Skip to content

Commit d991456

Browse files
authored
Merge pull request #2463 from contentstack/fix/dx_5441
Fixed test and lint workflow
2 parents bff380f + 28a6cf9 commit d991456

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+443
-1113
lines changed

.github/workflows/lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v4
13+
with:
14+
version: 10.28.0
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '22.x'
18+
cache: 'pnpm'
19+
- run: pnpm install --no-frozen-lockfile
20+
- run: pnpm -r --sort --workspace-concurrency=1 run build
21+
- run: pnpm run lint

.github/workflows/unit-test.yml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,35 @@
1-
name: Run Unit Tests
1+
name: Unit Tests
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

77
jobs:
8-
run-tests:
8+
test:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v4
13-
14-
- name: Setup pnpm
15-
uses: pnpm/action-setup@v4
11+
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v4
1613
with:
17-
version: 10.28.0 # or your local pnpm version
18-
19-
- name: Set up Node.js
20-
uses: actions/setup-node@v4
14+
version: 10.28.0
15+
- uses: actions/setup-node@v4
2116
with:
2217
node-version: '22.x'
23-
cache: 'pnpm' # optional but recommended
24-
25-
# - name: Temporarily disable contentstack package
26-
# run: mv packages/contentstack/package.json packages/contentstack/package.json.disabled || true
27-
28-
- name: Install Dependencies (Excluding Contentstack)
29-
run: pnpm install --no-frozen-lockfile
30-
31-
- name: Build all plugins (Excluding Contentstack)
32-
run: |
33-
NODE_ENV=PREPACK_MODE pnpm -r --sort run build
34-
35-
# - name: Restore contentstack package
36-
# run: mv packages/contentstack/package.json.disabled packages/contentstack/package.json || true
37-
38-
- name: Run tests for Contentstack Command
18+
cache: 'pnpm'
19+
- run: pnpm install --no-frozen-lockfile
20+
- run: pnpm -r --sort --workspace-concurrency=1 run build
21+
- name: Test contentstack
22+
working-directory: ./packages/contentstack
23+
run: pnpm test
24+
- name: Test contentstack-command
3925
working-directory: ./packages/contentstack-command
40-
run: npm run test:unit
41-
42-
- name: Run tests for Contentstack Config
26+
run: pnpm test
27+
- name: Test contentstack-config
4328
working-directory: ./packages/contentstack-config
44-
run: npm run test:unit
45-
46-
- name: Run tests for Contentstack Auth
29+
run: pnpm test
30+
- name: Test contentstack-auth
4731
working-directory: ./packages/contentstack-auth
48-
run: NODE_ENV=PREPACK_MODE npm run test:unit
32+
run: pnpm test
33+
- name: Test contentstack-utilities
34+
working-directory: ./packages/contentstack-utilities
35+
run: pnpm test

.talismanrc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
fileignoreconfig:
2-
- filename: packages/contentstack-bootstrap/src/bootstrap/utils.ts
3-
checksum: 6e6fb00bb11b03141e5ad27eeaa4af9718dc30520c3e73970bc208cc0ba2a7d2
4-
- filename: .github/workflows/release.yml
5-
checksum: 73807361b1a862dc882846ac75fefca49e3c734db032e9aa80158f2a686bea13
6-
- filename: pnpm-lock.yaml
7-
checksum: 45b77e385a0b13c82ba125dcdc82d27a360132ff6edda801cd8b75943996c310
8-
- filename: packages/contentstack-auth/src/commands/auth/logout.ts
9-
checksum: 20ff708d5a0ee56eb8786b19df07b49dacaddfa1deafe99c0397716c7865726d
10-
version: '1.0'

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"clean:packages": "pnpm -r --filter './packages/*' run clean",
1414
"build": "pnpm -r --filter './packages/*' run build",
1515
"test": "pnpm -r --filter './packages/*' run test",
16+
"lint": "pnpm -r --filter './packages/*' run lint",
1617
"prepack": "pnpm -r --filter './packages/*' run prepack",
1718
"bootstrap": "pnpm install",
1819
"clean:modules": "rm -rf node_modules packages/**/node_modules",
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"require": [
33
"test/helpers/init.js",
4-
"ts-node/register",
4+
"ts-node/register/transpile-only",
55
"source-map-support/register"
66
],
7-
"watch-extensions": [
8-
"ts"
9-
],
7+
"watch-extensions": ["ts"],
108
"recursive": true,
11-
"timeout": 5000
12-
}
9+
"reporter": "spec",
10+
"timeout": 10000,
11+
"exit": true
12+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"inlcude": [
2+
"include": [
33
"lib/**/*.js"
44
]
55
}

packages/contentstack-auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
1818
$ csdx COMMAND
1919
running command...
2020
$ csdx (--version)
21-
@contentstack/cli-auth/1.8.0-beta.0 darwin-arm64 node-v22.13.1
21+
@contentstack/cli-auth/1.8.0-beta.0 darwin-arm64 node-v24.13.0
2222
$ csdx --help [COMMAND]
2323
USAGE
2424
$ csdx COMMAND

packages/contentstack-auth/package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,8 @@
1111
"postpack": "rm -f oclif.manifest.json",
1212
"prepack": "pnpm compile && oclif manifest && oclif readme",
1313
"version": "oclif readme && git add README.md",
14-
"test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
15-
"pretest": "tsc -p test",
16-
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
17-
"posttest": "npm run lint",
18-
"lint": "eslint src/**/*.ts",
19-
"format": "eslint src/**/*.ts --fix",
20-
"test:integration": "mocha --forbid-only \"test/integration/*.test.ts\"",
21-
"test:unit": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
22-
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
14+
"test": "mocha \"test/unit/**/*.test.ts\"",
15+
"lint": "eslint src/**/*.ts"
2316
},
2417
"dependencies": {
2518
"@contentstack/cli-command": "~1.8.0-beta.1",

packages/contentstack-auth/src/base-command.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import {
33
configHandler,
44
createLogContext,
55
Flags,
6-
getAuthenticationMethod,
76
Interfaces,
8-
log,
97
} from '@contentstack/cli-utilities';
108
import { Context } from './interfaces';
119

packages/contentstack-auth/src/commands/auth/login.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
cliux,
32
CLIError,
43
authHandler as oauthHandler,
54
flags,

0 commit comments

Comments
 (0)