Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
a465a1a
added new projects to bootstrap
timbenniks Aug 12, 2025
623e73b
Removed duplicate short command names from auth plugin
ntrjpatel Aug 14, 2025
a23716b
Merge branch 'development' into fix/dx-3434
ntrjpatel Aug 19, 2025
44da35e
Talisman, readme and package-lock updates
ntrjpatel Aug 19, 2025
2afe9c2
Merge pull request #2079 from contentstack/fix/back-merge
harshithad0703 Aug 20, 2025
5e1aede
Added imageHost in env file
sunil-lakshman Aug 20, 2025
78cfbc3
Feat: Added Utility to fetch the branch using the branch alias and ad…
cs-raj Aug 21, 2025
45015ab
Feat: Added Utility to fetch the branch using the branch alias and ad…
cs-raj Aug 21, 2025
9a5b6e4
Merge pull request #2071 from contentstack/fix/dx-3434
harshithad0703 Aug 22, 2025
0538bda
Added bulk publish queue link
sunil-lakshman Aug 1, 2025
e2a6822
Fixed copilot PR comments
sunil-lakshman Aug 6, 2025
eefcb36
Fixed PR comments
sunil-lakshman Aug 6, 2025
e5609c2
Removed custom host logic
sunil-lakshman Aug 6, 2025
fbde3cd
update package-lock
sunil-lakshman Aug 19, 2025
856ae9f
update talismanrc
harshithad0703 Aug 22, 2025
a16b1b9
Merge branch 'development' into enh/dx-2196
sunil-lakshman Aug 6, 2025
42e6618
Merge branch 'development' into enh/dx-2196
sunil-lakshman Aug 6, 2025
ff0f3b8
Feat: Added branch-alias in import and version bump and updated Ui te…
cs-raj Aug 22, 2025
7659078
PR fixes
cs-raj Aug 22, 2025
316c0e4
Merge branch 'development' into feat/DX-3420
cs-raj Aug 22, 2025
d587061
Added try block before the start of export
cs-raj Aug 22, 2025
6b4e926
Merge pull request #2081 from contentstack/feat/DX-3420
cs-raj Aug 22, 2025
b8866d5
Merge branch 'development' into feat/DX-3421
cs-raj Aug 22, 2025
20810e1
Fixed the issue of branch undefined
cs-raj Aug 25, 2025
e3c54b1
Feat: Added branch alias support in clone command
cs-raj Aug 25, 2025
5a52635
Fix: Moved the branch check code to config and adding the default bra…
cs-raj Aug 25, 2025
9eb7241
Fixed the exit of import code
cs-raj Aug 25, 2025
6fce858
Merge branch development into fix/back-merge2
harshithad0703 Aug 26, 2025
3bf5662
Moved setup branch to seperate file
cs-raj Aug 26, 2025
f8f1326
Added await
cs-raj Aug 26, 2025
6ddefc3
update talismanrc
harshithad0703 Aug 26, 2025
5ca10ba
update package-lock
harshithad0703 Aug 26, 2025
7da5db3
update talismanrc
harshithad0703 Aug 26, 2025
292123c
Fix: Re-initialised the stack client after the branch selection
cs-raj Aug 26, 2025
ac661f6
Merge pull request #2092 from contentstack/fix/back-merge2
harshithad0703 Aug 26, 2025
4e423a5
Merge conflits resolved
sunil-lakshman Aug 28, 2025
235aab1
Merge branch 'development' into feat/DX-3471
cs-raj Aug 28, 2025
bac8bfc
Merge pull request #2090 from contentstack/feat/DX-3471
cs-raj Aug 28, 2025
2995be8
Removed Redundant Code
cs-raj Aug 28, 2025
badee6f
Talismand Update
cs-raj Aug 28, 2025
4994004
PR Fixes
cs-raj Aug 28, 2025
c78f309
Merge branch 'development' into fix/DX-3464
cs-raj Aug 28, 2025
c4008dc
Merge pull request #2085 from contentstack/feat/DX-3421
cs-raj Aug 28, 2025
79fb745
Merge branch 'development' into fix/DX-3464
cs-raj Aug 28, 2025
993783c
Removed console
cs-raj Aug 28, 2025
b3c158f
Merge pull request #2094 from contentstack/fix/DX-3464
cs-raj Aug 28, 2025
bad3be7
Fix: Fixed the import and clone bug for promping the user the message…
cs-raj Aug 28, 2025
54c3cbc
Fixed the issue of exporting multiple branches
cs-raj Aug 28, 2025
6504edf
Merge branch 'development' into fix/clone-bug
cs-raj Aug 28, 2025
03f59bb
sourcebranch and targetbranch alias resolution change
cs-raj Aug 28, 2025
70980e8
Merge branch 'development' into feat/bootstrap-kickstarts
sunil-lakshman Aug 29, 2025
b118794
Fixed Merge conflits and PR comments
sunil-lakshman Aug 29, 2025
e158633
Updated talisman file
sunil-lakshman Aug 29, 2025
98c5ec7
Added version bump
sunil-lakshman Aug 29, 2025
862b22c
Merge pull request #2063 from contentstack/feat/bootstrap-kickstarts
sunil-lakshman Aug 29, 2025
ca5c455
Fixed Merge conflits
sunil-lakshman Aug 29, 2025
cd35b95
Updated Readme files
sunil-lakshman Aug 29, 2025
fa33e52
Merge pull request #2084 from contentstack/fix/add-bulk-url
sunil-lakshman Aug 29, 2025
463678d
Merge branch 'development' into fix/clone-bug
cs-raj Aug 29, 2025
a30e00b
Merge pull request #2095 from contentstack/fix/clone-bug
cs-raj Aug 29, 2025
c44cc88
update talismanrc
harshithad0703 Aug 29, 2025
86b1c60
Merge pull request #2096 from contentstack/fix/talismanrc6
harshithad0703 Aug 29, 2025
154c510
Fix: Version Bump of Export-to-CSV
cs-raj Aug 29, 2025
e7197e6
Merge pull request #2098 from contentstack/fix/versionBump
cs-raj Aug 29, 2025
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
4 changes: 4 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
working-directory: ./packages/contentstack-command
run: npm run test:unit

- name: Run tests for Contentstack Command
working-directory: ./packages/contentstack-command
run: npm run test:unit

- name: Run tests for Audit plugin
working-directory: ./packages/contentstack-audit
run: npm run test:unit
Expand Down
30 changes: 25 additions & 5 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fileignoreconfig:
- filename: package-lock.json
checksum: b01e61e606c0f2fd26cee8c27e00f5910973020afa72ddfb9d995f09dff6229f
checksum: e18f2c44cd17fe67afa33290fc6e3ebd8e77be4cd85541b967792a03ea6b4279
- filename: pnpm-lock.yaml
checksum: e0310a5c5772a87bf606ee80722e29f9d0bc412ce10444f825a5c14dce4c1b88
checksum: 8ac9a74de5b8971d85a0471444233205d66fdc90ab8f68ab74053582bbb274f7
- filename: packages/contentstack-import-setup/test/unit/backup-handler.test.ts
checksum: 0582d62b88834554cf12951c8690a73ef3ddbb78b82d2804d994cf4148e1ef93
- filename: packages/contentstack-import-setup/test/config.json
Expand Down Expand Up @@ -57,8 +57,28 @@ fileignoreconfig:
checksum: f93aa9b0c964608b60c88d4c72ff33840b58ec900297c4bae1f4ea365aa51048
- filename: packages/contentstack-auth/test/utils/mfa-handler.test.ts
checksum: b067f93cf0185d794e8419cc41e8fac96ed790dea8fc48dc083ee242ccacbd4d
- filename: packages/contentstack-utilities/src/logger/logger.ts
checksum: 76429bc87e279624b386f00e7eb3f4ec25621ace7056289f812b9a076d6e184e
- filename: packages/contentstack-import/src/import/module-importer.ts
checksum: 93fac2407e20070aa393f783e5a21093e99424e5fd2873aabc2099ac3ea02b27
- filename: packages/contentstack-import/src/utils/import-config-handler.ts
checksum: bb8093633dc7de888541990623c3e02a482b7e6f5db0ba396bedc20c4c74b782
- filename: packages/contentstack-import/src/utils/setup-branch.ts
checksum: a4a968a20d5ab7cbc08c266819907541bbf793cc098521a5e810ada3cbacbee6
- filename: packages/contentstack-bulk-publish/src/producer/publish-unpublished-env.js
checksum: 96fd15e027f38b156c69f10943ea1d5a70e580fa8a5efeb3286cd7132145c72d
- filename: packages/contentstack-import/src/import/modules/entries.ts
checksum: 2fd4e8ecf75e077632a6408d09997f0921d2a3508f9f2cb8f47fe79a28592300
version: "1.0"
- filename: packages/contentstack-utilities/src/logger/logger.ts
checksum: 76429bc87e279624b386f00e7eb3f4ec25621ace7056289f812b9a076d6e184e
- filename: packages/contentstack-bootstrap/src/bootstrap/utils.ts
checksum: e66a08cb3cd444071688fbad1e14da309f8504f584cfaed85499d32b623e29e8
- filename: packages/contentstack-bootstrap/messages/index.json
checksum: c435ceaa709a7504da303a6ea674e07a89030d8ad4152e7917cd17e7f3e58052
- filename: packages/contentstack-bootstrap/src/config.ts
checksum: 65d300dc729fb84f5446c0b14921555db01fe5c90be3d297e3d0418a37b3696a
- filename: packages/contentstack-clone/src/commands/cm/stacks/clone.js
checksum: 433a84a882ea3f12b27127d47d289dfc64dda6b6fc956369f5851daaa57ae493
- filename: packages/contentstack-clone/src/lib/util/clone-handler.js
checksum: 7024f22a6ed3908d7cf074bbd8e7107e2d9f43bbcc42939b28d360c89d44cc29
- filename: packages/contentstack-bulk-publish/src/util/generate-bulk-publish-url.js
checksum: 5f7c1e2fac3e7fab21e861d609c54ca7191ee09fd076dd0adc66604043bf7a43
version: "1.0"
6,774 changes: 3,280 additions & 3,494 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/1.14.0 darwin-arm64 node-v23.11.0
@contentstack/cli-audit/1.14.1 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -282,7 +282,7 @@ DESCRIPTION
Display help for csdx.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.29/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.32/src/commands/help.ts)_

## `csdx plugins`

Expand All @@ -305,7 +305,7 @@ EXAMPLES
$ csdx plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.43/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.46/src/commands/plugins/index.ts)_

## `csdx plugins:add PLUGIN`

Expand Down Expand Up @@ -379,7 +379,7 @@ EXAMPLES
$ csdx plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.43/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.46/src/commands/plugins/inspect.ts)_

## `csdx plugins:install PLUGIN`

Expand Down Expand Up @@ -428,7 +428,7 @@ EXAMPLES
$ csdx plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.43/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.46/src/commands/plugins/install.ts)_

## `csdx plugins:link PATH`

Expand Down Expand Up @@ -459,7 +459,7 @@ EXAMPLES
$ csdx plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.43/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.46/src/commands/plugins/link.ts)_

## `csdx plugins:remove [PLUGIN]`

Expand Down Expand Up @@ -500,7 +500,7 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.43/src/commands/plugins/reset.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.46/src/commands/plugins/reset.ts)_

## `csdx plugins:uninstall [PLUGIN]`

Expand Down Expand Up @@ -528,7 +528,7 @@ EXAMPLES
$ csdx plugins:uninstall myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.43/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.46/src/commands/plugins/uninstall.ts)_

## `csdx plugins:unlink [PLUGIN]`

Expand Down Expand Up @@ -572,5 +572,5 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.43/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.46/src/commands/plugins/update.ts)_
<!-- commandsstop -->
6 changes: 3 additions & 3 deletions packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.14.0",
"version": "1.14.1",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand All @@ -18,8 +18,8 @@
"/oclif.manifest.json"
],
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.2",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@oclif/plugin-plugins": "^5.4.38",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/1.6.0 darwin-arm64 node-v22.14.0
@contentstack/cli-auth/1.5.1 darwin-arm64 node-v22.13.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
16 changes: 3 additions & 13 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-auth",
"description": "Contentstack CLI plugin for authentication activities",
"version": "1.6.0",
"version": "1.6.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -22,8 +22,8 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.2",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
Expand Down Expand Up @@ -70,16 +70,6 @@
"bin": "csdx",
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-auth/<%- commandPath %>"
},
"csdxConfig": {
"shortCommandName": {
"auth:login": "LIN",
"auth:logout": "LOT",
"auth:whoami": "WHO",
"auth:tokens": "LSTKN",
"auth:tokens:add": "ADTKN",
"auth:tokens:remove": "RMTKN"
}
},
"csdxConfig": {
"shortCommandName": {
"auth:login": "LOGIN",
Expand Down
17 changes: 10 additions & 7 deletions packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/1.15.0 darwin-arm64 node-v22.13.1
@contentstack/cli-cm-bootstrap/1.15.1 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -45,18 +45,19 @@ Bootstrap contentstack apps
```
USAGE
$ csdx cm:bootstrap [--app-name <value>] [--project-dir <value>] [-k <value> | --org <value> | -n <value>] [-y
<value>] [-a <value>]
<value>] [--run-dev-server] [-a <value>]

FLAGS
-a, --alias=<value> Alias of the management token
-k, --stack-api-key=<value> Provide stack API key to seed content
-n, --stack-name=<value> Name of the new stack that will be created.
-y, --yes=<value> [Optional] Skip stack confirmation
--app-name=<value> App name, reactjs-starter, nextjs-starter, gatsby-starter, angular-starter, nuxt-starter,
vue-starter, stencil-starter
--app-name=<value> App name, kickstart-next, kickstart-next-ssr, kickstart-next-ssg, kickstart-next-graphql,
kickstart-next-middleware, kickstart-nuxt, kickstart-nuxt-ssr
--org=<value> Provide organization UID to create a new stack
--project-dir=<value> Directory to setup the project. If directory name has a space then provide the path as a
string or escap the space using back slash eg: "../../test space" or ../../test\ space
--run-dev-server Automatically start the development server after setup

DESCRIPTION
Bootstrap contentstack apps
Expand All @@ -66,11 +67,13 @@ EXAMPLES

$ csdx cm:bootstrap --project-dir <path/to/setup/the/app>

$ csdx cm:bootstrap --app-name "reactjs-starter" --project-dir <path/to/setup/the/app>
$ csdx cm:bootstrap --app-name "kickstart-next" --project-dir <path/to/setup/the/app>

$ csdx cm:bootstrap --app-name "reactjs-starter" --project-dir <path/to/setup/the/app> --stack-api-key "stack-api-key"
$ csdx cm:bootstrap --app-name "kickstart-next" --project-dir <path/to/setup/the/app> --stack-api-key "stack-api-key"

$ csdx cm:bootstrap --app-name "reactjs-starter" --project-dir <path/to/setup/the/app> --org "your-org-uid" --stack-name "stack-name"
$ csdx cm:bootstrap --app-name "kickstart-next" --project-dir <path/to/setup/the/app> --org "your-org-uid" --stack-name "stack-name"

$ csdx cm:bootstrap --app-name "kickstart-next" --project-dir <path/to/setup/the/app> --run-dev-server
```

_See code: [src/commands/cm/bootstrap.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-bootstrap/src/commands/cm/bootstrap.ts)_
Expand Down
42 changes: 25 additions & 17 deletions packages/contentstack-bootstrap/messages/index.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
"CLI_BOOTSTRAP_INVALID_APP_NAME": "Invalid app name received, use cm:bootstrap see the list of apps supported",
"CLI_BOOTSTRAP_LOGIN_FAILED": "You need to login, first. See: auth:login --help",
"CLI_BOOTSTRAP_GITHUB_ACCESS_NOT_FOUND": "No Github access token found",
"CLI_BOOTSTRAP_START_CLONE_APP": "Cloning the selected app",
"CLI_BOOTSTRAP_REPO_NOT_FOUND": "Unable to find a repo for \"%s\"",
"CLI_BOOTSTRAP_NO_API_KEY_FOUND": "No API key generated for the stack",
"CLI_BOOTSTRAP_STACK_CREATION_FAILED": "Unable to create stack for content \"%s\"",
"CLI_BOOTSTRAP_APP_SELECTION_ENQUIRY": "Select an App",
"CLI_BOOTSTRAP_APP_COPY_SOURCE_CODE_DESTINATION_TYPE_ENQUIRY": "Choose the location where you want to copy the source code",
"CLI_BOOTSTRAP_APP_COPY_SOURCE_CODE_DESTINATION_ENQUIRY": "Enter destination path",
"CLI_BOOTSTRAP_NO_ACCESS_TOKEN_CREATED": "Note: Access token not created already, check out this link https://github.com/settings/tokens \n Provide github access token",
"CLI_BOOTSTRAP_TYPE_OF_APP_ENQUIRY": "Choose the type of app you want to clone",
"CLI_BOOTSTRAP_APP_FAILED_TO_CREATE_TOKEN_FOR_ENV": "Failed to create delivery token for env \"%s\"",
"CLI_BOOTSTRAP_APP_FAILED_TO_CREATE_ENV_FILE_FOR_ENV": "Failed to setup env file for \"%s\"",
"CLI_BOOTSTRAP_APP_ENV_NOT_FOUND_FOR_THE_STACK": "No environments found for the stack",
"CLI_BOOTSTRAP_SUCCESS": "Project setup is successful!"
}
"CLI_BOOTSTRAP_INVALID_APP_NAME": "Invalid app name received, use cm:bootstrap see the list of apps supported",
"CLI_BOOTSTRAP_LOGIN_FAILED": "You need to login, first. See: auth:login --help",
"CLI_BOOTSTRAP_GITHUB_ACCESS_NOT_FOUND": "No Github access token found",
"CLI_BOOTSTRAP_START_CLONE_APP": "Cloning the selected app",
"CLI_BOOTSTRAP_REPO_NOT_FOUND": "Unable to find a repo for \"%s\"",
"CLI_BOOTSTRAP_NO_API_KEY_FOUND": "No API key generated for the stack",
"CLI_BOOTSTRAP_STACK_CREATION_FAILED": "Unable to create stack for content \"%s\"",
"CLI_BOOTSTRAP_APP_SELECTION_ENQUIRY": "Select an App",
"CLI_BOOTSTRAP_APP_COPY_SOURCE_CODE_DESTINATION_TYPE_ENQUIRY": "Choose the location where you want to copy the source code",
"CLI_BOOTSTRAP_APP_COPY_SOURCE_CODE_DESTINATION_ENQUIRY": "Enter destination path",
"CLI_BOOTSTRAP_NO_ACCESS_TOKEN_CREATED": "Note: Access token not created already, check out this link https://github.com/settings/tokens \n Provide github access token",
"CLI_BOOTSTRAP_TYPE_OF_APP_ENQUIRY": "Choose the type of app you want to clone",
"CLI_BOOTSTRAP_APP_FAILED_TO_CREATE_TOKEN_FOR_ENV": "Failed to create delivery token for env \"%s\"",
"CLI_BOOTSTRAP_APP_FAILED_TO_CREATE_ENV_FILE_FOR_ENV": "Failed to setup env file for \"%s\"",
"CLI_BOOTSTRAP_APP_ENV_NOT_FOUND_FOR_THE_STACK": "No environments found for the stack",
"CLI_BOOTSTRAP_SUCCESS": "Project setup is successful!",
"CLI_BOOTSTRAP_SUCCESS_LIVE_PREVIEW_NOTE": "Note: Before running the app, please turn on Live Preview in the CMS: Stack Settings > Live Preview > Enable Live Preview",
"CLI_BOOTSTRAP_INSTALLING_DEPENDENCIES": "Installing local dependencies with NPM",
"CLI_BOOTSTRAP_DEPENDENCIES_INSTALLED": "NPM dependencies installed successfully!",
"CLI_BOOTSTRAP_DEPENDENCIES_INSTALL_FAILED": "Failed to install NPM dependencies.",
"CLI_BOOTSTRAP_RUN_DEV_SERVER_ENQUIRY": "Do you want to install dependencies and run the app locally (npm install && npm run dev)?",
"CLI_BOOTSTRAP_STARTING_DEV_SERVER": "Starting development server...",
"CLI_BOOTSTRAP_DEV_SERVER_STARTED": "Development server started successfully! Check your terminal for more details.",
"CLI_BOOTSTRAP_DEV_SERVER_FAILED": "Failed to start development server. You can start it manually with 'npm run dev' in the project directory."
}
8 changes: 4 additions & 4 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.15.0",
"version": "1.16.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -16,9 +16,9 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.12.0",
"@contentstack/cli-command": "~1.6.0",
"@contentstack/cli-utilities": "~1.13.2",
"@contentstack/cli-cm-seed": "~1.12.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"inquirer": "8.2.6",
Expand Down
52 changes: 51 additions & 1 deletion packages/contentstack-bootstrap/src/bootstrap/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as path from 'path';
import { execSync, spawn } from 'child_process';
import { cliux, sanitizePath } from '@contentstack/cli-utilities';
import { default as ContentStackSeed } from '@contentstack/cli-cm-seed/lib/commands/cm/stacks/seed';

Expand All @@ -19,6 +20,7 @@ export interface BootstrapOptions {
accessToken?: string;
appType: string;
livePreviewEnabled?: boolean;
runDevServer?: boolean;
master_locale: any;
}

Expand Down Expand Up @@ -113,20 +115,68 @@ export default class Bootstrap {
this.options.livePreviewEnabled as boolean,
this.options.seedParams.managementToken as string,
);

} else {
throw new Error(messageHandler.parse('CLI_BOOTSTRAP_NO_API_KEY_FOUND'));
}

if (this.options.livePreviewEnabled) {
cliux.print(
'Note: Before running the app, please configure a preview token, preview host, and app host in the environment file',
messageHandler.parse('CLI_BOOTSTRAP_SUCCESS_LIVE_PREVIEW_NOTE'),
{
color: 'yellow',
},
);
}

cliux.print(messageHandler.parse('CLI_BOOTSTRAP_SUCCESS'));

// Install dependencies and start development server if requested (after all other operations)
if (this.options.runDevServer) {
// Install project dependencies
cliux.loader(messageHandler.parse('CLI_BOOTSTRAP_INSTALLING_DEPENDENCIES'));
try {
execSync('npm install', {
cwd: this.cloneDirectory,
stdio: 'inherit'
});
cliux.loader();
cliux.print(messageHandler.parse('CLI_BOOTSTRAP_DEPENDENCIES_INSTALLED'));

// Start development server
cliux.print(messageHandler.parse('CLI_BOOTSTRAP_STARTING_DEV_SERVER'));
cliux.print(messageHandler.parse('CLI_BOOTSTRAP_DEV_SERVER_STARTED'));
cliux.print('You can now access your application. Check the output above for the local URL.');

// Run npm run dev using spawn for long-running process
const devProcess = spawn('npm', ['run', 'dev'], {
cwd: this.cloneDirectory,
stdio: 'inherit',
shell: true
});

devProcess.on('error', (error) => {
cliux.print(messageHandler.parse('CLI_BOOTSTRAP_DEV_SERVER_FAILED'), {
color: 'yellow',
});
console.error('Failed to start dev server:', error);
});

// Handle process exit
devProcess.on('exit', (code) => {
if (code !== 0 && code !== null) {
cliux.print(messageHandler.parse('CLI_BOOTSTRAP_DEV_SERVER_FAILED'), {
color: 'yellow',
});
}
});
} catch (installError: any) {
cliux.loader();
cliux.print(messageHandler.parse('CLI_BOOTSTRAP_DEPENDENCIES_INSTALL_FAILED'), {
color: 'yellow',
});
}
}
} catch (error) {
cliux.error(messageHandler.parse('CLI_BOOTSTRAP_STACK_CREATION_FAILED', this.appConfig.stack));
}
Expand Down
Loading
Loading