Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fileignoreconfig:
- filename: package-lock.json
checksum: d3b93fad9630655f037e36b78fea3354f1a038988562254afdad0f6e54ece12d
checksum: e79c27cf2fa46f146c1f94ea324fc4a2ebc31df8b2eb05720fcc64153e090a3f
- filename: pnpm-lock.yaml
checksum: aa6177859aaa87caf2892e8034657fd485c3abe7c13a833fd28449a1d33fa950
checksum: fe3e9d9f6eba0158d4985b8bdb8ec6e35419b3a9e9768e5610bf74f2f59454d1
- filename: packages/contentstack-import-setup/test/unit/backup-handler.test.ts
checksum: 0582d62b88834554cf12951c8690a73ef3ddbb78b82d2804d994cf4148e1ef93
- filename: packages/contentstack-import-setup/test/config.json
Expand Down Expand Up @@ -211,4 +211,14 @@ fileignoreconfig:
checksum: 49dd8e754a0d3635585a74e943ab097593f061089a7cddc22683ec6caddbb3c5
- filename: packages/contentstack-export/test/unit/export/modules/personalize.test.ts
checksum: 83cf034fabee00b42b4243a8c0b8ba280ab7c1e68ffd741c49c31aaee8ca0315
- filename: packages/contentstack-audit/test/unit/audit-base-command.test.ts
checksum: 17a16b4457c820494442f335d94d0949961e68e8ca72ca0f1fa9d4d0eeb0c17a
- filename: packages/contentstack-import/src/import/modules/taxonomies.ts
checksum: ed7037a220754ecfdf800f6b747059ad309e23e7bafa09f6938021246f67d998
- filename: packages/contentstack-export/test/unit/utils/logger.test.ts
checksum: ce8438d323fd0e42a88ece3dfd826313993c0198dbeffe01d046f835d6aad95f
- filename: packages/contentstack-export/test/unit/export/modules/taxonomies.test.ts
checksum: 57566af0bbd95a28b454e4436b0396dfec2fe05ddd5b448d46e3a8b68db8b9cb
- filename: packages/contentstack-export/test/unit/export/modules/entries.test.ts
checksum: 5950c6f697224e11bec32736e6a967b0ab7ac98e9c8f8bb8eaaf10af60913e40
version: "1.0"
2,081 changes: 1,039 additions & 1,042 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/1.15.0 darwin-arm64 node-v22.14.0
@contentstack/cli-audit/1.16.1 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -273,7 +273,7 @@ USAGE
$ csdx help [COMMAND...] [-n]

ARGUMENTS
COMMAND... Command to show help for.
[COMMAND...] Command to show help for.

FLAGS
-n, --nested-commands Include all nested commands in the output.
Expand All @@ -282,7 +282,7 @@ DESCRIPTION
Display help for csdx.
```

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

## `csdx plugins`

Expand All @@ -305,7 +305,7 @@ EXAMPLES
$ csdx plugins
```

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

## `csdx plugins:add PLUGIN`

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

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

## `csdx plugins:install PLUGIN`

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

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

## `csdx plugins:link PATH`

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

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

## `csdx plugins:remove [PLUGIN]`

Expand All @@ -470,7 +470,7 @@ USAGE
$ csdx plugins:remove [PLUGIN...] [-h] [-v]

ARGUMENTS
PLUGIN... plugin to uninstall
[PLUGIN...] plugin to uninstall

FLAGS
-h, --help Show CLI help.
Expand Down Expand Up @@ -500,7 +500,7 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

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

## `csdx plugins:uninstall [PLUGIN]`

Expand All @@ -511,7 +511,7 @@ USAGE
$ csdx plugins:uninstall [PLUGIN...] [-h] [-v]

ARGUMENTS
PLUGIN... plugin to uninstall
[PLUGIN...] plugin to uninstall

FLAGS
-h, --help Show CLI help.
Expand All @@ -528,7 +528,7 @@ EXAMPLES
$ csdx plugins:uninstall myplugin
```

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

## `csdx plugins:unlink [PLUGIN]`

Expand All @@ -539,7 +539,7 @@ USAGE
$ csdx plugins:unlink [PLUGIN...] [-h] [-v]

ARGUMENTS
PLUGIN... plugin to uninstall
[PLUGIN...] plugin to uninstall

FLAGS
-h, --help Show CLI help.
Expand Down Expand Up @@ -572,5 +572,5 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.48/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.52/src/commands/plugins/update.ts)_
<!-- commandsstop -->
2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.16.0",
"version": "1.16.1",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-audit/src/audit-base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
missingMultipleFields = missingEntry.missingMultipleFields ?? {};
await this.prepareReport(module, missingEntryRefs);

await this.prepareReport(`Entries_Select_feild`, missingSelectFeild);
await this.prepareReport(`Entries_Select_field`, missingSelectFeild);

await this.prepareReport('Entries_Mandatory_feild', missingMandatoryFields);
await this.prepareReport('Entries_Mandatory_field', missingMandatoryFields);

await this.prepareReport('Entries_Title_feild', missingTitleFields);
await this.prepareReport('Entries_Title_field', missingTitleFields);

await this.prepareReport('Entry_Missing_Locale_and_Env_in_Publish_Details', missingEnvLocalesInEntries);

Expand Down
12 changes: 6 additions & 6 deletions packages/contentstack-audit/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ const config = {
"Passed",
],
ReportTitleForEntries: {
Entries_Select_feild: 'Entries_Select_feild',
Entries_Mandatory_feild: 'Entries_Mandatory_feild',
Entries_Title_feild: 'Entries_Title_feild',
Entries_Select_field: 'Entries_Select_field',
Entries_Mandatory_field: 'Entries_Mandatory_field',
Entries_Title_field: 'Entries_Title_field',
Entry_Missing_Locale_and_Env: 'Entry_Missing_Locale_and_Env',
Entry_Missing_Locale_and_Env_in_Publish_Details: 'Entry_Missing_Locale_and_Env_in_Publish_Details',
Entry_Multiple_Fields:"Entry_Multiple_Fields"
},
feild_level_modules: [
'Entries_Title_feild',
'Entries_Mandatory_feild',
'Entries_Select_feild',
'Entries_Title_field',
'Entries_Mandatory_field',
'Entries_Select_field',
'Entry_Missing_Locale_and_Env_in_Publish_Details',
'field-rules',
'Entry_Multiple_Fields',
Expand Down
142 changes: 142 additions & 0 deletions packages/contentstack-audit/test/unit/audit-base-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,146 @@ describe('AuditBaseCommand class', () => {
});
});
});

describe('prepareReport method - Report file names', () => {
fancy
.stdout({ print: process.env.PRINT === 'true' || false })
.stub(winston.transports, 'File', () => fsTransport)
.stub(winston, 'createLogger', createMockWinstonLogger)
.stub(fs, 'createWriteStream', () => new PassThrough())
.stub(fs, 'mkdirSync', () => {})
.stub(fs, 'existsSync', () => true)
.it('should generate report file with correct spelling: Entries_Select_field (not feild)', async () => {
const writeFileSyncSpy = sinon.spy(fs, 'writeFileSync');
class CMD extends AuditBaseCommand {
async run() {
await this.init();
this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents');

await this.prepareReport('Entries_Select_field', {
entry1: {
name: 'Test Entry',
display_name: 'Select Field',
missingRefs: ['ref1'],
},
});

const jsonCall = writeFileSyncSpy.getCalls().find(call =>
typeof call.args[0] === 'string' && call.args[0].includes('.json')
);
return jsonCall ? (jsonCall.args[0] as string) : undefined;
}
}

const result = await CMD.run([]);
writeFileSyncSpy.restore();
expect(result).to.include('Entries_Select_field.json');
expect(result).to.not.include('Entries_Select_feild');
});

fancy
.stdout({ print: process.env.PRINT === 'true' || false })
.stub(winston.transports, 'File', () => fsTransport)
.stub(winston, 'createLogger', createMockWinstonLogger)
.stub(fs, 'createWriteStream', () => new PassThrough())
.stub(fs, 'mkdirSync', () => {})
.stub(fs, 'existsSync', () => true)
.it('should generate report file with correct spelling: Entries_Mandatory_field (not feild)', async () => {
const writeFileSyncSpy = sinon.spy(fs, 'writeFileSync');
class CMD extends AuditBaseCommand {
async run() {
await this.init();
this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents');

await this.prepareReport('Entries_Mandatory_field', {
entry1: {
name: 'Test Entry',
display_name: 'Mandatory Field',
missingRefs: ['ref1'],
},
});

const jsonCall = writeFileSyncSpy.getCalls().find(call =>
typeof call.args[0] === 'string' && call.args[0].includes('.json')
);
return jsonCall ? (jsonCall.args[0] as string) : undefined;
}
}

const result = await CMD.run([]);
writeFileSyncSpy.restore();
expect(result).to.include('Entries_Mandatory_field.json');
expect(result).to.not.include('Entries_Mandatory_feild');
});

fancy
.stdout({ print: process.env.PRINT === 'true' || false })
.stub(winston.transports, 'File', () => fsTransport)
.stub(winston, 'createLogger', createMockWinstonLogger)
.stub(fs, 'createWriteStream', () => new PassThrough())
.stub(fs, 'mkdirSync', () => {})
.stub(fs, 'existsSync', () => true)
.it('should generate report file with correct spelling: Entries_Title_field (not feild)', async () => {
const writeFileSyncSpy = sinon.spy(fs, 'writeFileSync');
class CMD extends AuditBaseCommand {
async run() {
await this.init();
this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents');

await this.prepareReport('Entries_Title_field', {
entry1: {
name: 'Test Entry',
display_name: 'Title Field',
missingRefs: ['ref1'],
},
});

const jsonCall = writeFileSyncSpy.getCalls().find(call =>
typeof call.args[0] === 'string' && call.args[0].includes('.json')
);
return jsonCall ? (jsonCall.args[0] as string) : undefined;
}
}

const result = await CMD.run([]);
writeFileSyncSpy.restore();
expect(result).to.include('Entries_Title_field.json');
expect(result).to.not.include('Entries_Title_feild');
});
});

describe('Config - ReportTitleForEntries keys', () => {
it('should have correct spelling in ReportTitleForEntries config', () => {
const config = require('../../src/config').default;

// Verify correct spelling (field, not feild)
expect(config.ReportTitleForEntries).to.have.property('Entries_Select_field');
expect(config.ReportTitleForEntries).to.have.property('Entries_Mandatory_field');
expect(config.ReportTitleForEntries).to.have.property('Entries_Title_field');

// Verify old typo is not present
expect(config.ReportTitleForEntries).to.not.have.property('Entries_Select_feild');
expect(config.ReportTitleForEntries).to.not.have.property('Entries_Mandatory_feild');
expect(config.ReportTitleForEntries).to.not.have.property('Entries_Title_feild');

// Verify values match keys
expect(config.ReportTitleForEntries.Entries_Select_field).to.equal('Entries_Select_field');
expect(config.ReportTitleForEntries.Entries_Mandatory_field).to.equal('Entries_Mandatory_field');
expect(config.ReportTitleForEntries.Entries_Title_field).to.equal('Entries_Title_field');
});

it('should have correct spelling in feild_level_modules array', () => {
const config = require('../../src/config').default;

// Verify correct spelling in the array
expect(config.feild_level_modules).to.include('Entries_Select_field');
expect(config.feild_level_modules).to.include('Entries_Mandatory_field');
expect(config.feild_level_modules).to.include('Entries_Title_field');

// Verify old typo is not present
expect(config.feild_level_modules).to.not.include('Entries_Select_feild');
expect(config.feild_level_modules).to.not.include('Entries_Mandatory_feild');
expect(config.feild_level_modules).to.not.include('Entries_Title_feild');
});
});
});
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.16.0",
"@contentstack/cli-audit": "~1.16.1",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.4",
"@contentstack/management": "~1.22.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"prepack": "pnpm compile && oclif manifest && oclif readme"
},
"dependencies": {
"@contentstack/cli-audit": "~1.16.0",
"@contentstack/cli-audit": "~1.16.1",
"@contentstack/cli-auth": "~1.6.1",
"@contentstack/cli-cm-bootstrap": "~1.17.0",
"@contentstack/cli-cm-branches": "~1.6.0",
Expand Down
Loading
Loading