Skip to content

Commit 56f19b1

Browse files
committed
Merge branch 'development' into feat/DX-2360
2 parents 04fc7e6 + 7ade683 commit 56f19b1

File tree

41 files changed

+882
-444
lines changed

Some content is hidden

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

41 files changed

+882
-444
lines changed

.github/workflows/unit-test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Run Unit Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
run-tests:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '22.x'
18+
19+
- name: Install dependencies for all plugins
20+
run: |
21+
npm run setup-repo-old
22+
23+
- name: Fetch latest references
24+
run: |
25+
git fetch --prune
26+
27+
- name: Identify Changed Plugins
28+
id: changes
29+
run: |
30+
echo "Finding changed files..."
31+
# Ensure both commit references are valid
32+
if [[ -z "${{ github.event.before }}" || -z "${{ github.sha }}" ]]; then
33+
echo "Error: Missing commit references"
34+
exit 1
35+
fi
36+
37+
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
38+
echo "Changed files:"
39+
echo "$CHANGED_FILES"
40+
41+
# Identify affected plugins
42+
AFFECTED_PLUGINS=$(echo "$CHANGED_FILES" | grep -oP '(?<=^packages/)([^/]+)' | sort -u | tr '\n' ' ')
43+
echo "Affected plugins: $AFFECTED_PLUGINS"
44+
45+
# Set output for the next step
46+
echo "::set-output name=affected_plugins::$AFFECTED_PLUGINS"
47+
48+
- name: Run Unit Tests for Affected Plugins
49+
run: |
50+
for plugin in ${{ steps.changes.outputs.affected_plugins }}; do
51+
echo "Running tests for $plugin..."
52+
npm run test:unit --prefix ./packages/$plugin
53+
done

package-lock.json

Lines changed: 483 additions & 180 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
1919
$ csdx COMMAND
2020
running command...
2121
$ csdx (--version|-v)
22-
@contentstack/cli-audit/1.9.0 darwin-arm64 node-v22.14.0
22+
@contentstack/cli-audit/1.9.1 darwin-arm64 node-v22.14.0
2323
$ csdx --help [COMMAND]
2424
USAGE
2525
$ csdx COMMAND

packages/contentstack-audit/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
"winston": "^3.17.0"
3131
},
3232
"devDependencies": {
33-
"@oclif/test": "^4.1.11",
33+
"@oclif/test": "^4.1.12",
3434
"@types/chai": "^4.3.20",
3535
"@types/fs-extra": "^11.0.4",
3636
"@types/mocha": "^10.0.10",
37-
"@types/node": "^20.17.19",
37+
"@types/node": "^20.17.28",
3838
"@types/uuid": "^9.0.8",
3939
"chai": "^4.5.0",
4040
"eslint": "^8.57.1",
@@ -44,7 +44,7 @@
4444
"nyc": "^15.1.0",
4545
"oclif": "^3.17.2",
4646
"shx": "^0.3.4",
47-
"sinon": "^19.0.2",
47+
"sinon": "^19.0.5",
4848
"ts-node": "^10.9.2",
4949
"typescript": "^5.7.3"
5050
},
@@ -74,7 +74,8 @@
7474
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
7575
"version": "oclif readme && git add README.md",
7676
"clean": "rm -rf ./lib ./node_modules tsconfig.tsbuildinfo oclif.manifest.json",
77-
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
77+
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"",
78+
"test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\""
7879
},
7980
"engines": {
8081
"node": ">=16"

packages/contentstack-audit/test/unit/commands/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Audit command', () => {
1010
filename!: string;
1111
} as FileTransportInstance;
1212

13-
describe('Audit run method', () => {
13+
describe('Audit run method:', () => {
1414
fancy
1515
.stdout({ print: process.env.PRINT === 'true' || false })
1616
.stub(winston.transports, 'File', () => fsTransport)

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.3.24 darwin-arm64 node-v22.14.0
21+
@contentstack/cli-auth/1.3.25 darwin-arm64 node-v22.14.0
2222
$ csdx --help [COMMAND]
2323
USAGE
2424
$ csdx COMMAND

packages/contentstack-auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-auth",
33
"description": "Contentstack CLI plugin for authentication activities",
4-
"version": "1.3.24",
4+
"version": "1.3.25",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {

packages/contentstack-bootstrap/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
1515
$ csdx COMMAND
1616
running command...
1717
$ csdx (--version)
18-
@contentstack/cli-cm-bootstrap/1.13.2 darwin-arm64 node-v22.14.0
18+
@contentstack/cli-cm-bootstrap/1.13.3 darwin-arm64 node-v22.14.0
1919
$ csdx --help [COMMAND]
2020
USAGE
2121
$ csdx COMMAND

packages/contentstack-bootstrap/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-bootstrap",
33
"description": "Bootstrap contentstack apps",
4-
"version": "1.13.2",
4+
"version": "1.13.3",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -17,7 +17,7 @@
1717
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
1818
},
1919
"dependencies": {
20-
"@contentstack/cli-cm-seed": "~1.10.2",
20+
"@contentstack/cli-cm-seed": "~1.10.3",
2121
"@contentstack/cli-command": "~1.3.3",
2222
"@contentstack/cli-utilities": "~1.9.0",
2323
"inquirer": "8.2.6",

packages/contentstack-branches/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
3737
$ csdx COMMAND
3838
running command...
3939
$ csdx (--version)
40-
@contentstack/cli-cm-branches/1.3.0 darwin-arm64 node-v22.14.0
40+
@contentstack/cli-cm-branches/1.3.1 darwin-arm64 node-v22.14.0
4141
$ csdx --help [COMMAND]
4242
USAGE
4343
$ csdx COMMAND

0 commit comments

Comments
 (0)