Skip to content

[DX-2277],Prevent marketplace apps recreation by default #1869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: development
Choose a base branch
from
238 changes: 120 additions & 118 deletions .talismanrc

Large diffs are not rendered by default.

1,404 changes: 479 additions & 925 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.11.0",
"@contentstack/cli-cm-seed": "~1.11.1",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"inquirer": "8.2.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.14.0 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-clone/1.14.1 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.14.0",
"version": "1.14.1",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.16.1",
"@contentstack/cli-cm-import": "~1.21.3",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/1.21.1 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-import/1.22.0 darwin-arm64 node-v22.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.21.4",
"version": "1.22.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
12 changes: 8 additions & 4 deletions packages/contentstack-import/src/commands/cm/stacks/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default class ImportCommand extends Command {
module: flags.string({
required: false,
char: 'm',
description: '[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.',
description:
'[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.',
parse: printFlagDeprecation(['-m'], ['--module']),
}),
'backup-dir': flags.string({
Expand All @@ -80,11 +81,13 @@ export default class ImportCommand extends Command {
}),
branch: flags.string({
char: 'B',
description: 'The name of the branch where you want to import your content. If you don\'t mention the branch name, then by default the content will be imported to the main branch.',
description:
"The name of the branch where you want to import your content. If you don't mention the branch name, then by default the content will be imported to the main branch.",
parse: printFlagDeprecation(['-B'], ['--branch']),
}),
'import-webhook-status': flags.string({
description: '[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
description:
'[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
options: ['disable', 'current'],
required: false,
default: 'disable',
Expand All @@ -96,6 +99,7 @@ export default class ImportCommand extends Command {
}),
'skip-app-recreation': flags.boolean({
description: '(optional) Skips the recreation of private apps if they already exist.',
parse: printFlagDeprecation(['--skip-app-recreation']),
}),
'replace-existing': flags.boolean({
required: false,
Expand Down Expand Up @@ -156,7 +160,7 @@ export default class ImportCommand extends Command {
.branch()
.query()
.find()
.then(({ items }: any) => items)
.then(({ items }: any) => items);
if (branches.length) {
flags.branch = 'main';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default class ImportMarketplaceApps {
if (canCreatePrivateApp) {
log(this.importConfig, 'Starting developer hub private apps re-creation', 'success');
for (let app of privateApps) {
if (this.importConfig.skipPrivateAppRecreationIfExist && (await this.isPrivateAppExistInDeveloperHub(app))) {
if (await this.isPrivateAppExistInDeveloperHub(app)) {
// NOTE Found app already exist in the same org
this.appUidMapping[app.uid] = app.uid;
cliux.print(`App '${app.manifest.name}' already exist. skipping app recreation.!`, { color: 'yellow' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config = merge.recursive(config, externalConfig);
}

config.contentDir = sanitizePath(importCmdFlags['data'] || importCmdFlags['data-dir'] || config.data || (await askContentDir()));
config.contentDir = sanitizePath(
importCmdFlags['data'] || importCmdFlags['data-dir'] || config.data || (await askContentDir()),
);
const pattern = /[*$%#<>{}!&?]/g;
if (pattern.test(config.contentDir)) {
cliux.print(`\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
Expand Down Expand Up @@ -75,7 +77,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config.skipAudit = importCmdFlags['skip-audit'];
config.forceStopMarketplaceAppsPrompt = importCmdFlags.yes;
config.importWebhookStatus = importCmdFlags['import-webhook-status'];
config.skipPrivateAppRecreationIfExist = importCmdFlags['skip-app-recreation'];
config.skipPrivateAppRecreationIfExist = !importCmdFlags['skip-app-recreation'];

if (importCmdFlags['branch']) {
config.branchName = importCmdFlags['branch'];
Expand All @@ -89,7 +91,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
if (importCmdFlags['backup-dir']) {
config.useBackedupDir = importCmdFlags['backup-dir'];
}

if (importCmdFlags['skip-assets-publish']) {
config.skipAssetsPublish = importCmdFlags['skip-assets-publish'];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.11.0",
"version": "1.11.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "~1.21.3",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/management": "~1.20.2",
Expand Down
21 changes: 10 additions & 11 deletions packages/contentstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli/1.40.4 darwin-arm64 node-v22.14.0
@contentstack/cli/1.41.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -3635,7 +3635,7 @@ DESCRIPTION
Display help for csdx.
```

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

## `csdx launch`

Expand Down Expand Up @@ -3776,8 +3776,7 @@ USAGE
$ csdx launch:functions [-p <value>] [-d <value>]

FLAGS
-d, --data-dir=<value> [default: /Users/aman.kumar/Documents/cli-repos/cli/packages/contentstack] Current working
directory
-d, --data-dir=<value> [default: /Users/naman.dembla/Documents/cli/packages/contentstack] Current working directory
-p, --port=<value> [default: 3000] Port number

DESCRIPTION
Expand Down Expand Up @@ -3953,7 +3952,7 @@ EXAMPLES
$ csdx plugins
```

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

## `csdx plugins:add PLUGIN`

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

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

## `csdx plugins:install PLUGIN`

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

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

## `csdx plugins:link PATH`

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

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

## `csdx plugins:remove [PLUGIN]`

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

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

## `csdx plugins:uninstall [PLUGIN]`

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

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

## `csdx plugins:unlink [PLUGIN]`

Expand Down Expand Up @@ -4220,7 +4219,7 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.36/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.38/src/commands/plugins/update.ts)_

## `csdx tokens`

Expand Down
8 changes: 4 additions & 4 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.40.5",
"version": "1.41.0",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run.js"
Expand All @@ -27,13 +27,13 @@
"@contentstack/cli-cm-bootstrap": "~1.14.0",
"@contentstack/cli-cm-branches": "~1.4.2",
"@contentstack/cli-cm-bulk-publish": "~1.8.0",
"@contentstack/cli-cm-clone": "~1.14.0",
"@contentstack/cli-cm-clone": "~1.14.1",
"@contentstack/cli-cm-export": "~1.16.1",
"@contentstack/cli-cm-export-to-csv": "~1.8.1",
"@contentstack/cli-cm-import": "~1.21.3",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-cm-import-setup": "1.2.0",
"@contentstack/cli-cm-migrate-rte": "~1.5.1",
"@contentstack/cli-cm-seed": "~1.11.0",
"@contentstack/cli-cm-seed": "~1.11.1",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-config": "~1.12.0",
"@contentstack/cli-launch": "^1.8.0",
Expand Down
Loading
Loading