Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm'
- run: pnpm install --no-frozen-lockfile
- run: pnpm -r --sort --workspace-concurrency=1 run build
- run: pnpm run lint
2 changes: 1 addition & 1 deletion .github/workflows/policy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
if [ "$license_file_found" = false ]; then
echo "No license file found. Please add a license file to the repository."
exit 1
fi
fi
2 changes: 1 addition & 1 deletion .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
args: --fail-on=all --all-projects
json: true
continue-on-error: true
- uses: contentstack/sca-policy@main
- uses: contentstack/sca-policy@main
56 changes: 22 additions & 34 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,36 @@
name: Run Unit Tests
name: Unit Tests

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
run-tests:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.0 # or your local pnpm version

- name: Set up Node.js
uses: actions/setup-node@v4
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm' # optional but recommended

# - name: Temporarily disable contentstack package
# run: mv packages/contentstack/package.json packages/contentstack/package.json.disabled || true

- name: Install Dependencies (Excluding Contentstack)
run: pnpm install --no-frozen-lockfile

- name: Build all plugins (Excluding Contentstack)
run: |
NODE_ENV=PREPACK_MODE pnpm -r --sort run build

# - name: Restore contentstack package
# run: mv packages/contentstack/package.json.disabled packages/contentstack/package.json || true

- name: Run tests for Contentstack Command
cache: 'pnpm'
- run: pnpm install --no-frozen-lockfile
- run: pnpm -r --sort --workspace-concurrency=1 run build
- name: Test contentstack
working-directory: ./packages/contentstack
run: pnpm test
- name: Test contentstack-command
working-directory: ./packages/contentstack-command
run: npm run test:unit

- name: Run tests for Contentstack Config
run: pnpm test
- name: Test contentstack-config
working-directory: ./packages/contentstack-config
run: npm run test:unit

- name: Run tests for Contentstack Auth
run: pnpm test
- name: Test contentstack-auth
working-directory: ./packages/contentstack-auth
run: NODE_ENV=PREPACK_MODE npm run test:unit
run: pnpm test
# Commented out in v2-beta production
# - name: Test contentstack-utilities
# working-directory: ./packages/contentstack-utilities
# run: pnpm test
12 changes: 11 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
fileignoreconfig:
- filename: .github/workflows/release-production-pipeline.yml
checksum: 4aef94feea3ea0538162a9454cfd30457ec85e3123672f0933713e3d113d4504
- filename: packages/contentstack-utilities/src/proxy-helper.ts
checksum: 2169f25563bca3a0fe54edd00c73646ed56d36aa7e8effe904de26b0c1633759
- filename: packages/contentstack-config/test/unit/commands/proxy.test.ts
checksum: b92210826693683300728e7e82e6789f0ad697b17e6b99a8a004c9a041bced00
- filename: packages/contentstack/test/unit/context-handler.test.ts
checksum: 6ef78899d3089685271bd16c156d057c807fd9b8560189387ae44e9576d23095
- filename: packages/contentstack/README.md
checksum: cdd03f1f11ef3ecf04f71ed0a468501633ce92f0d487ee097312644578cb3cdc
- filename: pnpm-lock.yaml
checksum: 840d10a9ef1d60aeb0edd46a5cf8ae8306c9eee321aff72a9bb0e1a7e5031159
checksum: 503b7df2c37c07135396c6013941e3a155c351e0cd14fe62ac65cedf6ff43bbd
version: '1.0'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"clean:packages": "pnpm -r --filter './packages/*' run clean",
"build": "pnpm -r --filter './packages/*' run build",
"test": "pnpm -r --filter './packages/*' run test",
"lint": "pnpm -r --filter './packages/*' run lint",
"prepack": "pnpm -r --filter './packages/*' run prepack",
"bootstrap": "pnpm install",
"clean:modules": "rm -rf node_modules packages/**/node_modules",
Expand Down
10 changes: 5 additions & 5 deletions packages/contentstack-auth/.mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"source-map-support/register",
"test/helpers/mocha-root-hooks.js"
],
"watch-extensions": [
"ts"
],
"watch-extensions": ["ts"],
"recursive": true,
"timeout": 5000
}
"reporter": "spec",
"timeout": 10000,
"exit": true
}
2 changes: 1 addition & 1 deletion packages/contentstack-auth/.nycrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"inlcude": [
"include": [
"lib/**/*.js"
]
}
20 changes: 9 additions & 11 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,21 @@
"postpack": "rm -f oclif.manifest.json",
"prepack": "pnpm compile && oclif manifest && oclif readme",
"version": "oclif readme && git add README.md",
"test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"pretest": "tsc -p test",
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"posttest": "npm run lint",
"lint": "eslint src/**/*.ts",
"format": "eslint src/**/*.ts --fix",
"test:integration": "mocha --forbid-only \"test/integration/*.test.ts\"",
"test:unit": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
"test": "mocha \"test/unit/**/*.test.ts\"",
"lint": "eslint src/**/*.ts"
},
"dependencies": {
"@contentstack/cli-command": "~2.0.0-beta.5",
"@contentstack/cli-utilities": "~2.0.0-beta.5",
"@oclif/core": "^4.3.0",
"@oclif/core": "^4.8.3",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
},
"overrides": {
"@oclif/core": {
"picomatch": "^4.0.4"
}
},
"devDependencies": {
"@fancy-test/nock": "^0.1.1",
"@oclif/plugin-help": "^6.2.28",
Expand Down Expand Up @@ -81,4 +79,4 @@
}
},
"repository": "contentstack/cli"
}
}
2 changes: 0 additions & 2 deletions packages/contentstack-auth/src/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import {
configHandler,
createLogContext,
Flags,
getAuthenticationMethod,
Interfaces,
log,
} from '@contentstack/cli-utilities';
import { Context } from './interfaces';

Expand Down
1 change: 0 additions & 1 deletion packages/contentstack-auth/src/commands/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
cliux,
CLIError,
authHandler as oauthHandler,
flags,
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface InquirePayload {
name: string;
message: string;
choices?: Array<any>;
transformer?: Function;
transformer?: (value: any) => any;
}

export interface User {
Expand Down
155 changes: 0 additions & 155 deletions packages/contentstack-auth/test/integration/auth.test.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/contentstack-auth/test/integration/config.json

This file was deleted.

Loading
Loading