Skip to content

Commit 7da16da

Browse files
committed
reverted import-setup changes
1 parent 22616dc commit 7da16da

8 files changed

Lines changed: 17 additions & 10 deletions

File tree

package-lock.json

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

packages/contentstack-import-setup/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-setup
4747
$ csdx COMMAND
4848
running command...
4949
$ csdx (--version)
50-
@contentstack/cli-cm-import-setup/2.0.0-beta darwin-arm64 node-v22.14.0
50+
@contentstack/cli-cm-import-setup/1.6.0 darwin-arm64 node-v22.14.0
5151
$ csdx --help [COMMAND]
5252
USAGE
5353
$ csdx COMMAND

packages/contentstack-import-setup/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@contentstack/cli-cm-import-setup",
33
"description": "Contentstack CLI plugin to setup the mappers and configurations for the import command",
4-
"version": "2.0.0-beta",
4+
"version": "1.6.0",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {
88
"@contentstack/cli-command": "~1.6.1",
9-
"@contentstack/cli-utilities": "~1.14.3",
9+
"@contentstack/cli-utilities": "~1.14.1",
1010
"@oclif/core": "^4.3.0",
1111
"big-json": "^3.2.0",
1212
"chalk": "^4.1.2",

packages/contentstack-import-setup/src/types/import-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default interface ImportConfig extends DefaultConfig, ExternalConfig {
3939
authtoken?: string;
4040
destinationStackName?: string;
4141
org_uid?: string;
42+
contentVersion: number;
4243
stackName?: string;
4344
branchName: string;
4445
selectedModules: Modules[];

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
3232
config.contentDir = path.resolve(config.contentDir);
3333
//Note to support the old key
3434
config.data = config.contentDir;
35+
if (fileExistsSync(path.join(config.contentDir, 'export-info.json'))) {
36+
config.contentVersion =
37+
((await readFile(path.join(config.contentDir, 'export-info.json'))) || {}).contentVersion || 2;
38+
} else {
39+
config.contentVersion = 1;
40+
}
3541

3642
const managementTokenAlias = importCmdFlags['management-token-alias'] || importCmdFlags['alias'];
3743

packages/contentstack-import-setup/src/utils/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ImportConfig } from '../types';
88
let logger: Logger;
99

1010
export function isImportConfig(config: ImportConfig | MessageType): config is ImportConfig {
11-
return (config as ImportConfig).data !== undefined ;
11+
return (config as ImportConfig).data !== undefined && (config as ImportConfig)?.contentVersion !== undefined;
1212
}
1313

1414
export function log(entry: LogEntry): void;

packages/contentstack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@contentstack/cli-cm-export": "~2.0.1-beta",
3232
"@contentstack/cli-cm-export-to-csv": "~1.9.1",
3333
"@contentstack/cli-cm-import": "~2.0.1-beta",
34-
"@contentstack/cli-cm-import-setup": "2.0.0-beta",
34+
"@contentstack/cli-cm-import-setup": "1.6.0",
3535
"@contentstack/cli-cm-migrate-rte": "~1.6.1",
3636
"@contentstack/cli-cm-seed": "~2.0.1-beta",
3737
"@contentstack/cli-command": "~1.6.1",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)