Skip to content

Commit 66172a5

Browse files
Merge pull request #1869 from contentstack/feature/DX-2277
[DX-2277],Prevent marketplace apps recreation by default
2 parents ce75714 + d87f064 commit 66172a5

File tree

14 files changed

+6182
-5026
lines changed

14 files changed

+6182
-5026
lines changed

.talismanrc

Lines changed: 120 additions & 118 deletions
Large diffs are not rendered by default.

package-lock.json

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

packages/contentstack-bootstrap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
1818
},
1919
"dependencies": {
20-
"@contentstack/cli-cm-seed": "~1.11.0",
20+
"@contentstack/cli-cm-seed": "~1.11.1",
2121
"@contentstack/cli-command": "~1.5.0",
2222
"@contentstack/cli-utilities": "~1.11.1",
2323
"inquirer": "8.2.6",

packages/contentstack-clone/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
1616
$ csdx COMMAND
1717
running command...
1818
$ csdx (--version)
19-
@contentstack/cli-cm-clone/1.14.0 darwin-arm64 node-v22.14.0
19+
@contentstack/cli-cm-clone/1.14.1 darwin-arm64 node-v23.11.0
2020
$ csdx --help [COMMAND]
2121
USAGE
2222
$ csdx COMMAND

packages/contentstack-clone/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@contentstack/cli-cm-clone",
33
"description": "Contentstack stack clone plugin",
4-
"version": "1.14.0",
4+
"version": "1.14.1",
55
"author": "Contentstack",
66
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
77
"dependencies": {
88
"@colors/colors": "^1.6.0",
99
"@contentstack/cli-cm-export": "~1.16.1",
10-
"@contentstack/cli-cm-import": "~1.21.3",
10+
"@contentstack/cli-cm-import": "~1.22.0",
1111
"@contentstack/cli-command": "~1.5.0",
1212
"@contentstack/cli-utilities": "~1.11.1",
1313
"chalk": "^4.1.2",

packages/contentstack-import/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
4747
$ csdx COMMAND
4848
running command...
4949
$ csdx (--version)
50-
@contentstack/cli-cm-import/1.21.4 darwin-arm64 node-v22.14.0
50+
@contentstack/cli-cm-import/1.22.0 darwin-arm64 node-v22.11.0
5151
$ csdx --help [COMMAND]
5252
USAGE
5353
$ csdx COMMAND

packages/contentstack-import/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-cm-import",
33
"description": "Contentstack CLI plugin to import content into stack",
4-
"version": "1.21.4",
4+
"version": "1.22.0",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {

packages/contentstack-import/src/commands/cm/stacks/import.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export default class ImportCommand extends Command {
7070
module: flags.string({
7171
required: false,
7272
char: 'm',
73-
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.',
73+
description:
74+
'[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.',
7475
parse: printFlagDeprecation(['-m'], ['--module']),
7576
}),
7677
'backup-dir': flags.string({
@@ -80,11 +81,13 @@ export default class ImportCommand extends Command {
8081
}),
8182
branch: flags.string({
8283
char: 'B',
83-
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.',
84+
description:
85+
"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.",
8486
parse: printFlagDeprecation(['-B'], ['--branch']),
8587
}),
8688
'import-webhook-status': flags.string({
87-
description: '[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
89+
description:
90+
'[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
8891
options: ['disable', 'current'],
8992
required: false,
9093
default: 'disable',
@@ -96,6 +99,7 @@ export default class ImportCommand extends Command {
9699
}),
97100
'skip-app-recreation': flags.boolean({
98101
description: '(optional) Skips the recreation of private apps if they already exist.',
102+
parse: printFlagDeprecation(['--skip-app-recreation']),
99103
}),
100104
'replace-existing': flags.boolean({
101105
required: false,
@@ -156,7 +160,7 @@ export default class ImportCommand extends Command {
156160
.branch()
157161
.query()
158162
.find()
159-
.then(({ items }: any) => items)
163+
.then(({ items }: any) => items);
160164
if (branches.length) {
161165
flags.branch = 'main';
162166
}

packages/contentstack-import/src/import/modules/marketplace-apps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export default class ImportMarketplaceApps {
238238
if (canCreatePrivateApp) {
239239
log(this.importConfig, 'Starting developer hub private apps re-creation', 'success');
240240
for (let app of privateApps) {
241-
if (this.importConfig.skipPrivateAppRecreationIfExist && (await this.isPrivateAppExistInDeveloperHub(app))) {
241+
if (await this.isPrivateAppExistInDeveloperHub(app)) {
242242
// NOTE Found app already exist in the same org
243243
this.appUidMapping[app.uid] = app.uid;
244244
cliux.print(`App '${app.manifest.name}' already exist. skipping app recreation.!`, { color: 'yellow' });

packages/contentstack-import/src/utils/import-config-handler.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
2020
config = merge.recursive(config, externalConfig);
2121
}
2222

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

8082
if (importCmdFlags['branch']) {
8183
config.branchName = importCmdFlags['branch'];
@@ -89,7 +91,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
8991
if (importCmdFlags['backup-dir']) {
9092
config.useBackedupDir = importCmdFlags['backup-dir'];
9193
}
92-
94+
9395
if (importCmdFlags['skip-assets-publish']) {
9496
config.skipAssetsPublish = importCmdFlags['skip-assets-publish'];
9597
}

0 commit comments

Comments
 (0)