@oclif/plugin-command-snapshot 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/lib/commands/schema/compare.js +7 -7
- package/lib/commands/schema/generate.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +11 -11
- package/yarn.lock +1629 -2247
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.1.3](https://github.com/oclif/plugin-command-snapshot/compare/v3.1.2...v3.1.3) (2022-02-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* bump demps ([c2643c7](https://github.com/oclif/plugin-command-snapshot/commit/c2643c745aa121677be1bac60547180ba406b8e4))
|
|
11
|
+
|
|
5
12
|
### [3.1.2](https://github.com/oclif/plugin-command-snapshot/compare/v3.1.1...v3.1.2) (2021-11-10)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Generates and compares OCLIF plugins snapshot files
|
|
|
6
6
|
[](https://oclif.io)
|
|
7
7
|
[](https://npmjs.org/package/@oclif/plugin-command-snapshot)
|
|
8
8
|
[](https://npmjs.org/package/@oclif/plugin-command-snapshot)
|
|
9
|
-
[](https://github.com/nramyasri-sf/@oclif/plugin-command-snapshot/blob/
|
|
9
|
+
[](https://github.com/nramyasri-sf/@oclif/plugin-command-snapshot/blob/main/package.json)
|
|
10
10
|
|
|
11
11
|
<!-- toc -->
|
|
12
12
|
* [Usage](#usage)
|
|
@@ -23,7 +23,7 @@ class SchemaCompare extends snapshot_command_1.SnapshotCommand {
|
|
|
23
23
|
const latestSchema = (await this.generateLatestSchema());
|
|
24
24
|
this.debug('existingSchema', existingSchema);
|
|
25
25
|
this.debug('latestSchema', latestSchema);
|
|
26
|
-
const changes = just_diff_1.diff(latestSchema, existingSchema);
|
|
26
|
+
const changes = (0, just_diff_1.diff)(latestSchema, existingSchema);
|
|
27
27
|
if (changes.length === 0) {
|
|
28
28
|
this.log('No changes have been detected.');
|
|
29
29
|
return [];
|
|
@@ -40,23 +40,23 @@ class SchemaCompare extends snapshot_command_1.SnapshotCommand {
|
|
|
40
40
|
}
|
|
41
41
|
switch (change.op) {
|
|
42
42
|
case 'replace':
|
|
43
|
-
humandReadableChanges[commandId].push(`${chalk_1.underline(readablePath)} was changed from ${chalk_1.cyan(existing)} to ${chalk_1.cyan(latest)}`);
|
|
43
|
+
humandReadableChanges[commandId].push(`${(0, chalk_1.underline)(readablePath)} was changed from ${(0, chalk_1.cyan)(existing)} to ${(0, chalk_1.cyan)(latest)}`);
|
|
44
44
|
break;
|
|
45
45
|
case 'add':
|
|
46
|
-
humandReadableChanges[commandId].push(`${chalk_1.underline(readablePath)} was ${chalk_1.cyan('added')} to latest schema`);
|
|
46
|
+
humandReadableChanges[commandId].push(`${(0, chalk_1.underline)(readablePath)} was ${(0, chalk_1.cyan)('added')} to latest schema`);
|
|
47
47
|
break;
|
|
48
48
|
case 'remove':
|
|
49
|
-
humandReadableChanges[commandId].push(`${chalk_1.underline(readablePath)} was ${chalk_1.cyan('not found')} in latest schema`);
|
|
49
|
+
humandReadableChanges[commandId].push(`${(0, chalk_1.underline)(readablePath)} was ${(0, chalk_1.cyan)('not found')} in latest schema`);
|
|
50
50
|
break;
|
|
51
51
|
default:
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
this.log();
|
|
56
|
-
this.log(chalk_1.bold(chalk_1.red('Found the following schema changes:')));
|
|
56
|
+
this.log((0, chalk_1.bold)((0, chalk_1.red)('Found the following schema changes:')));
|
|
57
57
|
for (const [commandId, changes] of Object.entries(humandReadableChanges)) {
|
|
58
58
|
this.log();
|
|
59
|
-
this.log(chalk_1.bold(commandId));
|
|
59
|
+
this.log((0, chalk_1.bold)(commandId));
|
|
60
60
|
for (const change of changes) {
|
|
61
61
|
this.log(` - ${change}`);
|
|
62
62
|
}
|
|
@@ -70,7 +70,7 @@ class SchemaCompare extends snapshot_command_1.SnapshotCommand {
|
|
|
70
70
|
const contents = fs.readdirSync(filePath);
|
|
71
71
|
const folderIsVersioned = contents.every(c => semver.valid(c));
|
|
72
72
|
const schemasDir = folderIsVersioned ? path.join(filePath, semver.rsort(contents)[0] || '') : filePath;
|
|
73
|
-
const schemaFiles = generate_1.getAllFiles(schemasDir, '.json');
|
|
73
|
+
const schemaFiles = (0, generate_1.getAllFiles)(schemasDir, '.json');
|
|
74
74
|
let schemas = {
|
|
75
75
|
commands: {},
|
|
76
76
|
hooks: {},
|
|
@@ -60,11 +60,11 @@ class SchemaGenerator {
|
|
|
60
60
|
type: returnType,
|
|
61
61
|
skipTypeCheck: true,
|
|
62
62
|
};
|
|
63
|
-
return ts_json_schema_generator_1.createGenerator(config).createSchema(config.type);
|
|
63
|
+
return (0, ts_json_schema_generator_1.createGenerator)(config).createSchema(config.type);
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
66
66
|
if (error.message.toLowerCase().includes('no root type')) {
|
|
67
|
-
throw new Error(`Schema generator could not find the ${chalk_1.red(returnType)} type. Please make sure that ${chalk_1.red(returnType)} is exported.`);
|
|
67
|
+
throw new Error(`Schema generator could not find the ${(0, chalk_1.red)(returnType)} type. Please make sure that ${(0, chalk_1.red)(returnType)} is exported.`);
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
70
|
throw error;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"3.1.
|
|
1
|
+
{"version":"3.1.3","commands":{"schema:compare":{"id":"schema:compare","strict":true,"pluginName":"@oclif/plugin-command-snapshot","pluginAlias":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path of the generated snapshot file","multiple":false,"default":"./schemas"}},"args":[]},"schema:generate":{"id":"schema:generate","strict":true,"pluginName":"@oclif/plugin-command-snapshot","pluginAlias":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"directory to save the generated schema files; can use \"{version}\" to insert the current CLI/plugin version","multiple":false,"default":"./schemas"},"singlefile":{"name":"singlefile","type":"boolean","description":"put generated schema into a single file","allowNo":false},"ignorevoid":{"name":"ignorevoid","type":"boolean","description":"ignore commands that return void","allowNo":false}},"args":[]},"snapshot:compare":{"id":"snapshot:compare","strict":true,"pluginName":"@oclif/plugin-command-snapshot","pluginAlias":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path of the generated snapshot file","multiple":false,"default":"./command-snapshot.json"}},"args":[]},"snapshot:generate":{"id":"snapshot:generate","strict":true,"pluginName":"@oclif/plugin-command-snapshot","pluginAlias":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path to save the generated snapshot file; can use \"{version}\" to replace the current CLI/plugin version","multiple":false,"default":"./command-snapshot.json"}},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/plugin-command-snapshot",
|
|
3
3
|
"description": "generates and compares OCLIF plugins snapshot files",
|
|
4
|
-
"version": "3.1.
|
|
5
|
-
"author": "
|
|
4
|
+
"version": "3.1.3",
|
|
5
|
+
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/plugin-command-snapshot/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@oclif/core": "^1.
|
|
9
|
-
"chalk": "^4.1.
|
|
8
|
+
"@oclif/core": "^1.3.4",
|
|
9
|
+
"chalk": "^4.1.2",
|
|
10
10
|
"just-diff": "^3.1.1",
|
|
11
11
|
"semver": "^7.3.5",
|
|
12
|
-
"sinon": "^11.1.
|
|
13
|
-
"ts-json-schema-generator": "^0.
|
|
12
|
+
"sinon": "^11.1.2",
|
|
13
|
+
"ts-json-schema-generator": "^0.97.0",
|
|
14
14
|
"tslib": "^2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@commitlint/config-conventional": "^12.1.4",
|
|
18
|
-
"@oclif/plugin-help": "^5.1.
|
|
19
|
-
"@oclif/test": "^1.
|
|
18
|
+
"@oclif/plugin-help": "^5.1.11",
|
|
19
|
+
"@oclif/test": "^2.1.0",
|
|
20
20
|
"@types/chai": "^4",
|
|
21
21
|
"@types/mocha": "^8",
|
|
22
22
|
"@types/node": "^15",
|
|
23
|
-
"@types/semver": "^7.3.
|
|
23
|
+
"@types/semver": "^7.3.9",
|
|
24
24
|
"chai": "^4",
|
|
25
25
|
"commitlint": "^12.1.4",
|
|
26
26
|
"eslint": "^7",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"husky": "6",
|
|
31
31
|
"mocha": "^8",
|
|
32
32
|
"nyc": "^15",
|
|
33
|
-
"oclif": "^2.
|
|
33
|
+
"oclif": "^2.4.4",
|
|
34
34
|
"ts-node": "^9",
|
|
35
|
-
"typescript": "^4.
|
|
35
|
+
"typescript": "^4.5.5"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=12.0.0"
|