Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8e5dcd6
add stack settings import functionality and update config
harshithad0703 Jul 2, 2025
0b07126
refactor: rename ImportStackSettings to ImportStack and update log me…
harshithad0703 Jul 3, 2025
8184ce8
Merge branch 'development' into fix/dx-3097-import-stack-settings
harshithad0703 Jul 4, 2025
00b64f8
version bump
harshithad0703 Jul 4, 2025
7a09d8c
Merge pull request #1987 from contentstack/main
harshithad0703 Jul 7, 2025
6695de3
Merge pull request #1988 from contentstack/staging
harshithad0703 Jul 8, 2025
ce11342
Merge branch 'development' into fix/dx-3097-import-stack-settings
harshithad0703 Jul 11, 2025
15b64da
chore: bump version to 1.43.0 and update @contentstack/management to …
harshithad0703 Jul 11, 2025
af43060
Merge pull request #1979 from contentstack/fix/dx-3097-import-stack-s…
harshithad0703 Jul 11, 2025
d5760b6
chore: update @contentstack/management to version 1.22.0
harshithad0703 Jul 11, 2025
f32d19c
Merge branch 'development' into fix/dx-3097-import-stack-settings
harshithad0703 Jul 11, 2025
b693eaa
chore: update @contentstack/management to version 1.22.0 and bump ver…
harshithad0703 Jul 11, 2025
7b250f0
Merge pull request #1991 from contentstack/fix/dx-3097-import-stack-s…
harshithad0703 Jul 11, 2025
9986c4e
chore: update @contentstack/management to version 1.22.0 and bump ver…
harshithad0703 Jul 11, 2025
c3e1026
update package lock
harshithad0703 Jul 11, 2025
6c71480
Merge pull request #1992 from contentstack/fix/dx-3097-version-and-op…
harshithad0703 Jul 11, 2025
b795539
Merge pull request #1990 from contentstack/development
harshithad0703 Jul 11, 2025
12b7b2b
update talismanrc
harshithad0703 Jul 11, 2025
12dc5a6
Merge pull request #1994 from contentstack/fix/talismanrc-update
harshithad0703 Jul 11, 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: 2 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
fileignoreconfig:
- filename: pnpm-lock.yaml
checksum: 97a6a5b7d3ddb046ccd03d135c0421e674a4dbbc3f9466380481c5e3dac1ebd3
checksum: 612695c9e9d0a57c0996600c22ed44dc7929e926a619d30e753ab06310b22548
- filename: packages/contentstack-import/test/integration/auth-token-modules/environments.test.js
checksum: bc6f06b75d082aaf99e2f2f4b932b143765e2f14086967fb8973fe1b2ca6c03e
- filename: packages/contentstack-import/test/integration/environments.test.js
checksum: e71f033dad8944ffeafdf22d0514bda1d20c43e8fea0d62c96e774f3414beb31
- filename: package-lock.json
checksum: 8699ac1d7b2d3af92b6a95cbb9898ad5bb4e7eb17527824cd6ecdd14e6cfde5a
checksum: e72c7f98e233e37f4c6b1afa4fd7cd42225e8eb3bb29c130a4e4f8a91be18cc7
- filename: packages/contentstack-auth/test/unit/tokens-validation.test.ts
checksum: 676052e30d31a771ce68302d89b050d176bbef50f3abc7e9cdd4384f0e274e10
- filename: packages/contentstack-import/test/integration/auth-token.test.js
Expand Down
1,362 changes: 621 additions & 741 deletions package-lock.json

Large diffs are not rendered by default.

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.2",
"version": "1.14.3",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.17.0",
"@contentstack/cli-cm-import": "~1.24.0",
"@contentstack/cli-cm-import": "~1.25.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.12.0",
"@oclif/core": "^4.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.24.0",
"version": "1.25.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.13.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.12.0",
"@contentstack/management": "~1.21.4",
"@contentstack/management": "~1.22.0",
"@contentstack/cli-variants": "~1.2.1",
"@oclif/core": "^4.3.0",
"big-json": "^3.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-import/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const config: DefaultConfig = {
types: [
'locales',
'environments',
'stack',
'assets',
'taxonomies',
'extensions',
Expand Down
47 changes: 47 additions & 0 deletions packages/contentstack-import/src/import/modules/stack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { join } from 'node:path';
import { log, formatError, fileHelper, fsUtil } from '../../utils';
import BaseClass from './base-class';
import { ModuleClassParams } from '../../types';

export default class ImportStack extends BaseClass { // classname
private stackSettingsPath: string;
private envUidMapperPath: string;
private stackSettings: Record<string, any> | null = null;
private envUidMapper: Record<string, string> = {};

constructor({ importConfig, stackAPIClient }: ModuleClassParams) {
super({ importConfig, stackAPIClient });
this.stackSettingsPath = join(this.importConfig.backupDir, 'stack', 'settings.json');
this.envUidMapperPath = join(this.importConfig.backupDir, 'mapper', 'environments', 'uid-mapping.json');
}

async start(): Promise<void> {
log(this.importConfig, 'Migrating stack...', 'info');

if (fileHelper.fileExistsSync(this.envUidMapperPath)) {
this.envUidMapper = fsUtil.readFile(this.envUidMapperPath, true) as Record<string, string>;
} else {
throw new Error('Please run the environments migration first.');
}

if (fileHelper.fileExistsSync(this.stackSettingsPath)) {
this.stackSettings = fsUtil.readFile(this.stackSettingsPath, true) as Record<string, any>;
} else {
log(this.importConfig, 'No stack Found!', 'info');
return;
}

if (this.stackSettings?.live_preview && this.stackSettings?.live_preview['default-env']) {
const oldEnvUid = this.stackSettings.live_preview['default-env'];
const mappedEnvUid = this.envUidMapper[oldEnvUid];
this.stackSettings.live_preview['default-env'] = mappedEnvUid;
}

try {
await this.stack.addSettings(this.stackSettings);
log(this.importConfig, 'Successfully imported stack', 'success');
} catch (error) {
log(this.importConfig, `Stack failed to be imported! ${formatError(error)}`, 'error');
}
}
}
6 changes: 3 additions & 3 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.11.2",
"version": "1.11.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "~1.24.0",
"@contentstack/cli-cm-import": "~1.25.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.12.0",
"@contentstack/management": "~1.21.4",
"@contentstack/management": "~1.22.0",
"inquirer": "8.2.6",
"mkdirp": "^1.0.4",
"tar": "^6.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-utilities",
"version": "1.12.0",
"version": "1.12.1",
"description": "Utilities for contentstack projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -32,7 +32,7 @@
"author": "contentstack",
"license": "MIT",
"dependencies": {
"@contentstack/management": "~1.21.4",
"@contentstack/management": "~1.22.0",
"@contentstack/marketplace-sdk": "^1.2.8",
"@oclif/core": "^4.3.0",
"axios": "^1.9.0",
Expand Down
12 changes: 6 additions & 6 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.42.0",
"version": "1.43.0",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run.js"
Expand All @@ -27,20 +27,20 @@
"@contentstack/cli-cm-bootstrap": "~1.14.1",
"@contentstack/cli-cm-branches": "~1.4.3",
"@contentstack/cli-cm-bulk-publish": "~1.8.2",
"@contentstack/cli-cm-clone": "~1.14.2",
"@contentstack/cli-cm-clone": "~1.14.3",
"@contentstack/cli-cm-export": "~1.17.0",
"@contentstack/cli-cm-export-to-csv": "~1.8.2",
"@contentstack/cli-cm-import": "~1.24.0",
"@contentstack/cli-cm-import": "~1.25.0",
"@contentstack/cli-cm-import-setup": "1.3.0",
"@contentstack/cli-cm-migrate-rte": "~1.5.2",
"@contentstack/cli-cm-seed": "~1.11.2",
"@contentstack/cli-cm-seed": "~1.11.3",
"@contentstack/cli-command": "~1.5.1",
"@contentstack/cli-config": "~1.13.0",
"@contentstack/cli-launch": "^1.9.2",
"@contentstack/cli-migration": "~1.7.3",
"@contentstack/cli-utilities": "~1.12.0",
"@contentstack/cli-utilities": "~1.12.1",
"@contentstack/cli-variants": "~1.2.2",
"@contentstack/management": "~1.21.4",
"@contentstack/management": "~1.22.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@oclif/plugin-not-found": "^3.2.53",
Expand Down
61 changes: 47 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading