@asyncapi/cli 2.16.10 → 3.0.0
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/assets/create-glee-app/templates/tutorial/package-lock.json +4 -3
- package/assets/create-template/templates/default/package-lock.json +4 -3
- package/lib/commands/new/template.d.ts +0 -1
- package/lib/commands/new/template.js +4 -7
- package/lib/core/flags/new/template.flags.d.ts +0 -1
- package/lib/core/flags/new/template.flags.js +0 -5
- package/oclif.manifest.json +1 -10
- package/package.json +5 -2
|
@@ -2148,9 +2148,10 @@
|
|
|
2148
2148
|
"integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA=="
|
|
2149
2149
|
},
|
|
2150
2150
|
"node_modules/@babel/runtime": {
|
|
2151
|
-
"version": "7.
|
|
2152
|
-
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.
|
|
2153
|
-
"integrity": "sha512-
|
|
2151
|
+
"version": "7.26.10",
|
|
2152
|
+
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.10.tgz",
|
|
2153
|
+
"integrity": "sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw==",
|
|
2154
|
+
"license": "MIT",
|
|
2154
2155
|
"dependencies": {
|
|
2155
2156
|
"regenerator-runtime": "^0.14.0"
|
|
2156
2157
|
},
|
|
@@ -1717,9 +1717,10 @@
|
|
|
1717
1717
|
"integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA=="
|
|
1718
1718
|
},
|
|
1719
1719
|
"node_modules/@babel/runtime": {
|
|
1720
|
-
"version": "7.
|
|
1721
|
-
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.
|
|
1722
|
-
"integrity": "sha512-
|
|
1720
|
+
"version": "7.26.10",
|
|
1721
|
+
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.10.tgz",
|
|
1722
|
+
"integrity": "sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw==",
|
|
1723
|
+
"license": "MIT",
|
|
1723
1724
|
"dependencies": {
|
|
1724
1725
|
"regenerator-runtime": "^0.14.0"
|
|
1725
1726
|
},
|
|
@@ -13,7 +13,6 @@ export default class template extends Command {
|
|
|
13
13
|
template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
14
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
15
|
'force-write': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
renderer: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
16
|
};
|
|
18
17
|
run(): Promise<void>;
|
|
19
18
|
}
|
|
@@ -35,11 +35,8 @@ class template extends base_1.default {
|
|
|
35
35
|
run() {
|
|
36
36
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
37
|
const { flags } = yield this.parse(template); // NOSONAR
|
|
38
|
-
const { name: projectName, template: templateName,
|
|
38
|
+
const { name: projectName, template: templateName, } = flags;
|
|
39
39
|
const PROJECT_DIRECTORY = (0, path_1.join)(process.cwd(), projectName);
|
|
40
|
-
if (rendererName !== 'nunjucks' && rendererName !== 'react') {
|
|
41
|
-
this.error('Invalid flag check the flag name of renderer');
|
|
42
|
-
}
|
|
43
40
|
const templateDirectory = (0, path_1.resolve)(__dirname, '../../../assets/create-template/templates/', templateName);
|
|
44
41
|
{
|
|
45
42
|
try {
|
|
@@ -61,7 +58,7 @@ class template extends base_1.default {
|
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
60
|
try {
|
|
64
|
-
yield copyAndModify(templateDirectory, PROJECT_DIRECTORY,
|
|
61
|
+
yield copyAndModify(templateDirectory, PROJECT_DIRECTORY, projectName);
|
|
65
62
|
this.log((0, exports.successMessage)(projectName));
|
|
66
63
|
}
|
|
67
64
|
catch (err) {
|
|
@@ -78,7 +75,7 @@ template.successMessage = exports.successMessage;
|
|
|
78
75
|
template.errorMessages = errorMessages;
|
|
79
76
|
template.flags = (0, template_flags_1.templateFlags)();
|
|
80
77
|
exports.default = template;
|
|
81
|
-
function copyAndModify(templateDirectory, PROJECT_DIRECTORY,
|
|
78
|
+
function copyAndModify(templateDirectory, PROJECT_DIRECTORY, projectName) {
|
|
82
79
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
83
80
|
const packageJsonPath = path_2.default.join(templateDirectory, 'package.json');
|
|
84
81
|
try {
|
|
@@ -89,7 +86,7 @@ function copyAndModify(templateDirectory, PROJECT_DIRECTORY, rendererName, proje
|
|
|
89
86
|
});
|
|
90
87
|
const packageData = yield jsonfile_1.default.readFile(packageJsonPath);
|
|
91
88
|
if ((packageData.generator && 'renderer' in packageData.generator)) {
|
|
92
|
-
packageData.generator.renderer =
|
|
89
|
+
packageData.generator.renderer = 'react';
|
|
93
90
|
}
|
|
94
91
|
if (packageData.name) {
|
|
95
92
|
packageData.name = projectName;
|
|
@@ -4,5 +4,4 @@ export declare const templateFlags: () => {
|
|
|
4
4
|
template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
5
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
6
|
'force-write': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
renderer: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
7
|
};
|
|
@@ -23,11 +23,6 @@ const templateFlags = () => {
|
|
|
23
23
|
default: false,
|
|
24
24
|
description: 'Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)',
|
|
25
25
|
}),
|
|
26
|
-
renderer: core_1.Flags.string({
|
|
27
|
-
char: 'r',
|
|
28
|
-
default: 'react',
|
|
29
|
-
description: 'Creating a template for particular engine, Its value can be either react or nunjucks.'
|
|
30
|
-
})
|
|
31
26
|
};
|
|
32
27
|
};
|
|
33
28
|
exports.templateFlags = templateFlags;
|
package/oclif.manifest.json
CHANGED
|
@@ -1413,15 +1413,6 @@
|
|
|
1413
1413
|
"name": "force-write",
|
|
1414
1414
|
"allowNo": false,
|
|
1415
1415
|
"type": "boolean"
|
|
1416
|
-
},
|
|
1417
|
-
"renderer": {
|
|
1418
|
-
"char": "r",
|
|
1419
|
-
"description": "Creating a template for particular engine, Its value can be either react or nunjucks.",
|
|
1420
|
-
"name": "renderer",
|
|
1421
|
-
"default": "react",
|
|
1422
|
-
"hasDynamicHelp": false,
|
|
1423
|
-
"multiple": false,
|
|
1424
|
-
"type": "option"
|
|
1425
1416
|
}
|
|
1426
1417
|
},
|
|
1427
1418
|
"hasDynamicHelp": false,
|
|
@@ -1785,5 +1776,5 @@
|
|
|
1785
1776
|
]
|
|
1786
1777
|
}
|
|
1787
1778
|
},
|
|
1788
|
-
"version": "
|
|
1779
|
+
"version": "3.0.0"
|
|
1789
1780
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asyncapi/cli",
|
|
3
3
|
"description": "All in one CLI for all AsyncAPI tools",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run_bin"
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"@changesets/changelog-git": "^0.2.0",
|
|
24
24
|
"@clack/prompts": "^0.7.0",
|
|
25
25
|
"@oclif/core": "^4.2.9",
|
|
26
|
+
"@oclif/plugin-autocomplete": "^3.2.26",
|
|
26
27
|
"@smoya/asyncapi-adoption-metrics": "^2.4.9",
|
|
27
28
|
"@stoplight/spectral-cli": "6.9.0",
|
|
28
29
|
"chalk": "^4.1.0",
|
|
@@ -127,7 +128,8 @@
|
|
|
127
128
|
}
|
|
128
129
|
},
|
|
129
130
|
"plugins": [
|
|
130
|
-
"@oclif/plugin-warn-if-update-available"
|
|
131
|
+
"@oclif/plugin-warn-if-update-available",
|
|
132
|
+
"@oclif/plugin-autocomplete"
|
|
131
133
|
],
|
|
132
134
|
"warn-if-update-available": {
|
|
133
135
|
"frequency": 24,
|
|
@@ -164,6 +166,7 @@
|
|
|
164
166
|
"pretest": "npm run build",
|
|
165
167
|
"pretest:coverage": "npm run build",
|
|
166
168
|
"posttest": "rimraf ./test.asyncapi-cli",
|
|
169
|
+
"postinstall": "node ./scripts/enableAutoComplete.js",
|
|
167
170
|
"test": "npm run test:unit && npm run action:test",
|
|
168
171
|
"test:unit": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" nyc --extension .ts mocha --require ts-node/register --require test/helpers/init.js --reporter spec --timeout 100000 \"test/**/*.test.ts\"",
|
|
169
172
|
"test:one": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" nyc --extension .ts mocha --require ts-node/register --require test/helpers/init.js --reporter spec --timeout 100000",
|