Skip to content

Commit b4e2f2b

Browse files
authored
Merge pull request #1290 from contentstack/staging
Sprint 51 Release
2 parents 9e4e28f + 75f3832 commit b4e2f2b

64 files changed

Lines changed: 553 additions & 722 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.

package-lock.json

Lines changed: 79 additions & 503 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/1.3.4 darwin-arm64 node-v18.12.1
22+
@contentstack/cli-audit/1.3.5 darwin-arm64 node-v20.8.0
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": "1.3.4",
3+
"version": "1.3.5",
44
"description": "Contentstack audit plugin",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/cli",
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@contentstack/cli-dev-dependencies": "^1.2.4",
34-
"@oclif/test": "^2.0.3",
34+
"@oclif/test": "^2.5.6",
3535
"@types/chai": "^4.3.5",
3636
"@types/fs-extra": "^11.0.2",
3737
"@types/mocha": "^10.0.6",

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
164164
* `gfSchema`. The values of these properties are the parsed JSON data from two different files.
165165
*/
166166
getCtAndGfSchema() {
167-
const modules = this.sharedConfig.flags.modules || this.sharedConfig.modules;
168167
const ctPath = join(
169168
this.sharedConfig.basePath,
170169
this.sharedConfig.moduleConfig['content-types'].dirName,
@@ -176,18 +175,6 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
176175
this.sharedConfig.moduleConfig['global-fields'].fileName,
177176
);
178177

179-
if (modules.includes('content-types')) {
180-
if (!existsSync(ctPath)) {
181-
this.log(this.$t(auditMsg.NOT_VALID_PATH, { path: ctPath }), 'error');
182-
}
183-
}
184-
185-
if (modules.includes('global-fields')) {
186-
if (!existsSync(gfPath)) {
187-
this.log(this.$t(auditMsg.NOT_VALID_PATH, { path: ctPath }), 'error');
188-
}
189-
}
190-
191178
const gfSchema = existsSync(gfPath) ? (JSON.parse(readFileSync(gfPath, 'utf8')) as ContentTypeStruct[]) : [];
192179
const ctSchema = existsSync(ctPath) ? (JSON.parse(readFileSync(ctPath, 'utf8')) as ContentTypeStruct[]) : [];
193180

packages/contentstack-audit/src/modules/content-types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export default class ContentType {
6060
this.inMemoryFix = returnFixSchema;
6161

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

6668
this.schema = this.moduleName === 'content-types' ? this.ctSchema : this.gfSchema;

packages/contentstack-audit/src/modules/entries.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export default class Entries {
6868
*/
6969
async run() {
7070
if (!existsSync(this.folderPath)) {
71-
throw new Error($t(auditMsg.NOT_VALID_PATH, { path: this.folderPath }));
71+
this.log(`Skipping ${this.moduleName} audit`, 'warn');
72+
this.log($t(auditMsg.NOT_VALID_PATH, { path: this.folderPath }), { color: 'yellow' });
73+
return {};
7274
}
7375

7476
await this.prepareEntryMetaData();
@@ -799,8 +801,11 @@ export default class Entries {
799801
const localesFolderPath = resolve(this.config.basePath, this.config.moduleConfig.locales.dirName);
800802
const localesPath = join(localesFolderPath, this.config.moduleConfig.locales.fileName);
801803
const masterLocalesPath = join(localesFolderPath, 'master-locale.json');
802-
this.locales = values(JSON.parse(readFileSync(masterLocalesPath, 'utf8')));
803-
this.locales.push(...values(JSON.parse(readFileSync(localesPath, 'utf8'))));
804+
this.locales = existsSync(masterLocalesPath) ? values(JSON.parse(readFileSync(masterLocalesPath, 'utf8'))) : [];
805+
806+
if (existsSync(localesPath)) {
807+
this.locales.push(...values(JSON.parse(readFileSync(localesPath, 'utf8'))));
808+
}
804809

805810
for (const { code } of this.locales) {
806811
for (const { uid } of this.ctSchema) {

packages/contentstack-auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"devDependencies": {
3333
"@fancy-test/nock": "^0.1.1",
3434
"@oclif/plugin-help": "^5.1.19",
35-
"@oclif/test": "^2.2.10",
35+
"@oclif/test": "^2.5.6",
3636
"@types/chai": "^4.2.18",
3737
"@types/inquirer": "^9.0.3",
3838
"@types/mkdirp": "^1.0.1",

packages/contentstack-auth/test/integration/auth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const messageFilePath = path.join(__dirname, '..', '..', '..', 'contentstack-uti
1010
const crypto = new NodeCrypto({
1111
typeIdentifier: '◈',
1212
algorithm: 'aes-192-cbc',
13-
encryptionKey: process.env.ENCRYPTION_KEY || '***REMOVED***'
13+
encryptionKey: process.env.ENCRYPTION_KEY || 'gjh67567mn'
1414
});
1515
const username = process.env.ENCRYPTION_KEY ? crypto.decrypt(process.env.USERNAME) : process.env.USERNAME
1616
const password = process.env.ENCRYPTION_KEY ? crypto.decrypt(process.env.PASSWORD) : process.env.PASSWORD

packages/contentstack-bootstrap/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-bootstrap",
33
"description": "Bootstrap contentstack apps",
4-
"version": "1.7.1",
4+
"version": "1.8.0",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -25,7 +25,7 @@
2525
"tar": "^6.1.13"
2626
},
2727
"devDependencies": {
28-
"@oclif/test": "^2.2.10",
28+
"@oclif/test": "^2.5.6",
2929
"@types/inquirer": "^9.0.3",
3030
"@types/mkdirp": "^1.0.1",
3131
"@types/node": "^14.14.32",

packages/contentstack-bootstrap/src/bootstrap/github/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Stream } from 'stream';
22
import * as zlib from 'zlib';
33
import * as tar from 'tar';
4-
import * as mkdirp from 'mkdirp';
4+
const mkdirp = require('mkdirp')
55
import { HttpRequestConfig, HttpClient } from '@contentstack/cli-utilities';
66

77
import GithubError from './github-error';

0 commit comments

Comments
 (0)