Skip to content

Commit

Permalink
Merge branch 'development' of github.com:contentstack/cli into tests/…
Browse files Browse the repository at this point in the history
…CS-43313
  • Loading branch information
shafeeqd959 committed Feb 1, 2024
2 parents 6d6ade5 + d8cb70c commit 5e9735f
Show file tree
Hide file tree
Showing 21 changed files with 114 additions and 546 deletions.
524 changes: 53 additions & 471 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions 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.3.4",
"version": "1.3.5",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@contentstack/cli-dev-dependencies": "^1.2.4",
"@oclif/test": "^2.0.3",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.3.5",
"@types/fs-extra": "^11.0.2",
"@types/mocha": "^10.0.6",
Expand Down
13 changes: 0 additions & 13 deletions packages/contentstack-audit/src/audit-base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
* `gfSchema`. The values of these properties are the parsed JSON data from two different files.
*/
getCtAndGfSchema() {
const modules = this.sharedConfig.flags.modules || this.sharedConfig.modules;
const ctPath = join(
this.sharedConfig.basePath,
this.sharedConfig.moduleConfig['content-types'].dirName,
Expand All @@ -176,18 +175,6 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
this.sharedConfig.moduleConfig['global-fields'].fileName,
);

if (modules.includes('content-types')) {
if (!existsSync(ctPath)) {
this.log(this.$t(auditMsg.NOT_VALID_PATH, { path: ctPath }), 'error');
}
}

if (modules.includes('global-fields')) {
if (!existsSync(gfPath)) {
this.log(this.$t(auditMsg.NOT_VALID_PATH, { path: ctPath }), 'error');
}
}

const gfSchema = existsSync(gfPath) ? (JSON.parse(readFileSync(gfPath, 'utf8')) as ContentTypeStruct[]) : [];
const ctSchema = existsSync(ctPath) ? (JSON.parse(readFileSync(ctPath, 'utf8')) as ContentTypeStruct[]) : [];

Expand Down
4 changes: 3 additions & 1 deletion packages/contentstack-audit/src/modules/content-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export default class ContentType {
this.inMemoryFix = returnFixSchema;

if (!existsSync(this.folderPath)) {
throw new Error($t(auditMsg.NOT_VALID_PATH, { path: this.folderPath }));
this.log(`Skipping ${this.moduleName} audit`, 'warn');
this.log($t(auditMsg.NOT_VALID_PATH, { path: this.folderPath }), { color: 'yellow' });
return returnFixSchema ? [] : {};
}

this.schema = this.moduleName === 'content-types' ? this.ctSchema : this.gfSchema;
Expand Down
11 changes: 8 additions & 3 deletions packages/contentstack-audit/src/modules/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export default class Entries {
*/
async run() {
if (!existsSync(this.folderPath)) {
throw new Error($t(auditMsg.NOT_VALID_PATH, { path: this.folderPath }));
this.log(`Skipping ${this.moduleName} audit`, 'warn');
this.log($t(auditMsg.NOT_VALID_PATH, { path: this.folderPath }), { color: 'yellow' });
return {};
}

await this.prepareEntryMetaData();
Expand Down Expand Up @@ -799,8 +801,11 @@ export default class Entries {
const localesFolderPath = resolve(this.config.basePath, this.config.moduleConfig.locales.dirName);
const localesPath = join(localesFolderPath, this.config.moduleConfig.locales.fileName);
const masterLocalesPath = join(localesFolderPath, 'master-locale.json');
this.locales = values(JSON.parse(readFileSync(masterLocalesPath, 'utf8')));
this.locales.push(...values(JSON.parse(readFileSync(localesPath, 'utf8'))));
this.locales = existsSync(masterLocalesPath) ? values(JSON.parse(readFileSync(masterLocalesPath, 'utf8'))) : [];

if (existsSync(localesPath)) {
this.locales.push(...values(JSON.parse(readFileSync(localesPath, 'utf8'))));
}

for (const { code } of this.locales) {
for (const { uid } of this.ctSchema) {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"devDependencies": {
"@fancy-test/nock": "^0.1.1",
"@oclif/plugin-help": "^5.1.19",
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.2.18",
"@types/inquirer": "^9.0.3",
"@types/mkdirp": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"tar": "^6.1.13"
},
"devDependencies": {
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"@types/inquirer": "^9.0.3",
"@types/mkdirp": "^1.0.1",
"@types/node": "^14.14.32",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@contentstack/cli-config": "~1.6.0",
"@contentstack/cli-dev-dependencies": "~1.2.4",
"@oclif/plugin-help": "^5.1.19",
"@oclif/test": "^1.2.6",
"@oclif/test": "^2.5.6",
"@types/flat": "^5.0.2",
"assert": "^2.0.0",
"chai": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"winston": "^3.7.2"
},
"devDependencies": {
"@oclif/test": "^1.2.6",
"@oclif/test": "^2.5.6",
"chai": "^4.2.0",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lodash": "^4.17.20"
},
"devDependencies": {
"@oclif/test": "^1.2.7",
"@oclif/test": "^2.5.6",
"chai": "^4.2.0",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"contentstack": "^3.10.1"
},
"devDependencies": {
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.2.18",
"@types/mkdirp": "^1.0.1",
"@types/mocha": "^8.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"winston": "^3.7.2"
},
"devDependencies": {
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.2.18",
"@types/inquirer": "^9.0.3",
"@types/mkdirp": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-dev-dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@oclif/core": "^2.9.3",
"lodash": "^4.17.21",
"fancy-test": "^2.0.0",
"@oclif/test":"^2.0.3"
"@oclif/test": "^2.5.6"
},
"devDependencies": {
"@types/node": "^14.14.32",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export-to-csv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"mkdirp": "^3.0.1"
},
"devDependencies": {
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.3.6",
"@types/mocha": "^10.0.1",
"chai": "^4.3.8",
Expand Down
4 changes: 2 additions & 2 deletions 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.3.3",
"@contentstack/cli-audit": "^1.3.5",
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.11",
"@contentstack/management": "~1.13.0",
Expand All @@ -25,7 +25,7 @@
"winston": "^3.7.2"
},
"devDependencies": {
"@oclif/test": "^1.2.6",
"@oclif/test": "^2.5.6",
"@types/big-json": "^3.2.0",
"@types/bluebird": "^3.5.38",
"@types/chai": "^4.2.18",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-launch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"winston": "^3.8.2"
},
"devDependencies": {
"@oclif/test": "^2.3.6",
"@oclif/test": "^2.5.6",
"@types/adm-zip": "^0.5.0",
"@types/chai": "^4",
"@types/esm": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"chai": "^4.3.4",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"winston": "^3.7.2"
},
"devDependencies": {
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"chai": "^4.3.4",
"eslint": "^8.18.0",
"globby": "^10.0.2",
"husky": "^8.0.3",
"jsdoc": "^4.0.0",
"jsdoc-to-markdown": "^7.0.1",
"jsdoc-to-markdown": "^8.0.0",
"mkdirp": "^1.0.4",
"nock": "^13.1.1",
"nyc": "^15.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"devDependencies": {
"@contentstack/cli-dev-dependencies": "^1.2.4",
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.2.18",
"@types/inquirer": "^9.0.3",
"@types/mkdirp": "^1.0.1",
Expand Down
4 changes: 2 additions & 2 deletions 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.3.4",
"@contentstack/cli-audit": "~1.3.5",
"@contentstack/cli-auth": "~1.3.17",
"@contentstack/cli-cm-bootstrap": "~1.7.1",
"@contentstack/cli-cm-branches": "~1.0.22",
Expand Down Expand Up @@ -54,7 +54,7 @@
"winston": "^3.7.2"
},
"devDependencies": {
"@oclif/test": "^2.2.10",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.2.18",
"@types/inquirer": "^9.0.3",
"@types/mkdirp": "^1.0.1",
Expand Down
Loading

0 comments on commit 5e9735f

Please sign in to comment.