Skip to content

Commit 640be2f

Browse files
Merge pull request #2432 from contentstack/v2-beta-dev
DX | 02-03-2026 | Beta Release
2 parents d8ddff9 + 90cda88 commit 640be2f

62 files changed

Lines changed: 10147 additions & 5680 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.talismanrc

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
21
fileignoreconfig:
3-
- filename: packages/contentstack-import/src/import/modules/environments.ts
4-
checksum: f61c635eaec8026e0cfa80a5ab8272f7946531f6d89505dc0d247b4c7ab0eab7
5-
- filename: pnpm-lock.yaml
6-
checksum: c3020538089092e55f086c39cc4c027ef3d48f6c786a217db9c5e49f55ab8380
7-
- filename: package-lock.json
8-
checksum: 099edd9ec7ed92eb61ce916511ac87e2fc1ff985efe64a25749ac88ba0d3fa7d
9-
- filename: packages/contentstack-bootstrap/src/bootstrap/utils.ts
10-
checksum: 5ab20e057fa9c4c300f7a882d30e1c68bbc91ed19de520488107e8c37239682a
11-
- filename: packages/contentstack-migration/README.md
12-
checksum: 0deea9c8e43a89a4f20fb25ffe1a38cccd19020fe4fedae80f1ca24d34307f2b
13-
- filename: packages/contentstack-import/src/import/modules/taxonomies.ts
14-
checksum: f4f44b6031d2936ec2da98b39bb5f5c1bd0f3be34dbe498c75e64a35b7d25a33
15-
- filename: packages/contentstack/README.md
16-
checksum: 3a0fab964797476a71d2149ce261d265f410bd756eb9cde9400be9e5250fdc35
2+
- filename: package-lock.json
3+
checksum: 45100667793fc7dfaae3e24787871257e7f29e06df69ba10ec05b358d59ff15d
4+
- filename: pnpm-lock.yaml
5+
checksum: 87d001c32b1d7f9df30a289c277e0ea13cfd8a0e2e5fa5118956ff4183683e5c
176
version: '1.0'

package-lock.json

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

packages/contentstack-audit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
1919
$ csdx COMMAND
2020
running command...
2121
$ csdx (--version|-v)
22-
@contentstack/cli-audit/2.0.0-beta.3 darwin-arm64 node-v24.12.0
22+
@contentstack/cli-audit/2.0.0-beta.3 darwin-arm64 node-v22.13.1
2323
$ csdx --help [COMMAND]
2424
USAGE
2525
$ csdx COMMAND

packages/contentstack-audit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/cli-audit",
3-
"version": "2.0.0-beta.4",
3+
"version": "2.0.0-beta.5",
44
"description": "Contentstack audit plugin",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/cli",
@@ -19,7 +19,7 @@
1919
],
2020
"dependencies": {
2121
"@contentstack/cli-command": "~2.0.0-beta",
22-
"@contentstack/cli-utilities": "~2.0.0-beta",
22+
"@contentstack/cli-utilities": "~2.0.0-beta.1",
2323
"@oclif/core": "^4.3.0",
2424
"@oclif/plugin-help": "^6.2.28",
2525
"chalk": "^4.1.2",

packages/contentstack-audit/src/audit-base-command.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ import { v4 as uuid } from 'uuid';
55
import isEmpty from 'lodash/isEmpty';
66
import { join, resolve } from 'path';
77
import cloneDeep from 'lodash/cloneDeep';
8-
import { cliux, sanitizePath, TableFlags, TableHeader, log, configHandler, CLIProgressManager, clearProgressModuleSetting } from '@contentstack/cli-utilities';
8+
import {
9+
cliux,
10+
sanitizePath,
11+
TableFlags,
12+
TableHeader,
13+
log,
14+
configHandler,
15+
CLIProgressManager,
16+
clearProgressModuleSetting,
17+
readContentTypeSchemas,
18+
} from '@contentstack/cli-utilities';
919
import { createWriteStream, existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'fs';
1020
import config from './config';
1121
import { print } from './util/log';
@@ -59,7 +69,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
5969
*/
6070
async start(command: CommandNames): Promise<boolean> {
6171
this.currentCommand = command;
62-
72+
6373
// Set progress supported module and console logs setting BEFORE any log calls
6474
// This ensures the logger respects the setting when it's initialized
6575
const logConfig = configHandler.get('log') || {};
@@ -68,10 +78,10 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
6878
configHandler.set('log.showConsoleLogs', false);
6979
}
7080
configHandler.set('log.progressSupportedModule', 'audit');
71-
81+
7282
// Initialize global summary for progress tracking
7383
CLIProgressManager.initializeGlobalSummary('AUDIT', '', 'Auditing content...');
74-
84+
7585
await this.promptQueue();
7686
await this.createBackUp();
7787
this.sharedConfig.reportPath = resolve(this.flags['report-path'] || process.cwd(), 'audit-report');
@@ -166,7 +176,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
166176

167177
// Print comprehensive summary at the end
168178
CLIProgressManager.printGlobalSummary();
169-
179+
170180
// Clear progress module setting now that audit is complete
171181
clearProgressModuleSetting();
172182

@@ -234,11 +244,11 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
234244

235245
let dataModuleWise: Record<string, any> = await new ModuleDataReader(cloneDeep(constructorParam)).run();
236246
log.debug(`Data module wise: ${JSON.stringify(dataModuleWise)}`, this.auditContext);
237-
247+
238248
// Extract logConfig and showConsoleLogs once before the loop to reuse throughout
239249
const logConfig = configHandler.get('log') || {};
240250
const showConsoleLogs = logConfig.showConsoleLogs ?? false;
241-
251+
242252
for (const module of this.sharedConfig.flags.modules || this.sharedConfig.modules) {
243253
// Update audit context with current module
244254
this.auditContext = { module: module };
@@ -480,19 +490,15 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
480490
* `gfSchema`. The values of these properties are the parsed JSON data from two different files.
481491
*/
482492
getCtAndGfSchema() {
483-
const ctPath = join(
484-
this.sharedConfig.basePath,
485-
this.sharedConfig.moduleConfig['content-types'].dirName,
486-
this.sharedConfig.moduleConfig['content-types'].fileName,
487-
);
493+
const ctDirPath = join(this.sharedConfig.basePath, this.sharedConfig.moduleConfig['content-types'].dirName);
488494
const gfPath = join(
489495
this.sharedConfig.basePath,
490496
this.sharedConfig.moduleConfig['global-fields'].dirName,
491497
this.sharedConfig.moduleConfig['global-fields'].fileName,
492498
);
493499

494500
const gfSchema = existsSync(gfPath) ? (JSON.parse(readFileSync(gfPath, 'utf8')) as ContentTypeStruct[]) : [];
495-
const ctSchema = existsSync(ctPath) ? (JSON.parse(readFileSync(ctPath, 'utf8')) as ContentTypeStruct[]) : [];
501+
const ctSchema = (readContentTypeSchemas(ctDirPath) || []) as ContentTypeStruct[];
496502

497503
return { ctSchema, gfSchema };
498504
}

packages/contentstack-audit/src/config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const config = {
1818
moduleConfig: {
1919
'content-types': {
2020
name: 'content type',
21-
fileName: 'schema.json',
21+
fileName: 'schema.json', // Not used - reads from individual files
2222
dirName: 'content_types',
2323
},
2424
'global-fields': {

0 commit comments

Comments
 (0)