@kosdev-code/kos-ui-cli 2.0.15 → 2.0.17
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ui-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.17",
|
|
4
4
|
"bin": {
|
|
5
5
|
"kosui": "./src/lib/cli.mjs"
|
|
6
6
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"main": "./src/index.js",
|
|
21
21
|
"kos": {
|
|
22
22
|
"build": {
|
|
23
|
-
"gitHash": "
|
|
23
|
+
"gitHash": "1d984c4a524b31269ebfcde808c11512c09d0886"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"category": "cache",
|
|
4
|
+
"file": "index.mjs",
|
|
5
|
+
"metadata": {
|
|
6
|
+
"name": "cache:clear",
|
|
7
|
+
"description": "Clear the generator context cache",
|
|
8
|
+
"invalidateCache": false,
|
|
9
|
+
"requiresModels": false
|
|
10
|
+
}
|
|
11
|
+
},
|
|
2
12
|
{
|
|
3
13
|
"category": "component",
|
|
4
14
|
"file": "index.mjs",
|
|
@@ -91,6 +101,10 @@
|
|
|
91
101
|
{
|
|
92
102
|
"key": "plugin:nav",
|
|
93
103
|
"name": "KOS UI Plugin Navigation View"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"key": "plugin:cp",
|
|
107
|
+
"name": "KOS UI Plugin Control Pour"
|
|
94
108
|
}
|
|
95
109
|
]
|
|
96
110
|
},
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// generators/plugin/plugin.mjs
|
|
2
2
|
|
|
3
|
+
import { execute } from "../../utils/exec.mjs";
|
|
4
|
+
import { getAllProjects } from "../../utils/nx-context.mjs";
|
|
5
|
+
import { required } from "../../utils/validators.mjs";
|
|
3
6
|
export const metadata = [
|
|
4
7
|
{ key: "pluginComponent", name: "KOS UI Plugin Component" },
|
|
5
8
|
{ key: "plugin:cui", name: "KOS UI Plugin CUI Configuration" },
|
|
@@ -7,12 +10,25 @@ export const metadata = [
|
|
|
7
10
|
{ key: "plugin:utility", name: "KOS UI Plugin Utility" },
|
|
8
11
|
{ key: "plugin:setting", name: "KOS UI Plugin Setting" },
|
|
9
12
|
{ key: "plugin:nav", name: "KOS UI Plugin Navigation View" },
|
|
13
|
+
{ key: "plugin:cp", name: "KOS UI Plugin Control Pour" },
|
|
10
14
|
];
|
|
11
15
|
|
|
12
16
|
export default async function (plop) {
|
|
13
|
-
const
|
|
14
|
-
const { getPluginProjects } = await import("../../utils/nx-context.mjs");
|
|
17
|
+
const allProjects = await getAllProjects();
|
|
15
18
|
|
|
19
|
+
plop.setActionType("createPluginComponent", async function (answers) {
|
|
20
|
+
const pluginType = answers.extensionPoint;
|
|
21
|
+
|
|
22
|
+
const command = `npx nx generate @kosdev-code/kos-nx-plugin:kos-component --name=${answers.componentName} --group=${answers.group} --appProject=${answers.componentProject} --pluginType=${pluginType} --type=components --no-interactive`;
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
await execute(command);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
throw new Error(error);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return `Component ${answers.componentName} created in ${answers.componentProject}`;
|
|
31
|
+
});
|
|
16
32
|
const pluginPrompts = [
|
|
17
33
|
{
|
|
18
34
|
type: "input",
|
|
@@ -24,7 +40,7 @@ export default async function (plop) {
|
|
|
24
40
|
type: "list",
|
|
25
41
|
name: "componentProject",
|
|
26
42
|
message: "Which project should the component be created in?",
|
|
27
|
-
choices:
|
|
43
|
+
choices: allProjects,
|
|
28
44
|
},
|
|
29
45
|
];
|
|
30
46
|
|
|
@@ -34,6 +50,7 @@ export default async function (plop) {
|
|
|
34
50
|
{ key: "plugin:utility", name: "utility" },
|
|
35
51
|
{ key: "plugin:setting", name: "setting" },
|
|
36
52
|
{ key: "plugin:nav", name: "nav" },
|
|
53
|
+
{ key: "plugin:cp", name: "controlPour" },
|
|
37
54
|
];
|
|
38
55
|
|
|
39
56
|
// Generic plugin component
|
|
@@ -64,6 +81,13 @@ export default async function (plop) {
|
|
|
64
81
|
},
|
|
65
82
|
]
|
|
66
83
|
: []),
|
|
84
|
+
{
|
|
85
|
+
type: "input",
|
|
86
|
+
name: "extensionPoint",
|
|
87
|
+
message: "Hidden extensionPoint",
|
|
88
|
+
default: name,
|
|
89
|
+
when: false, // hide from CLI
|
|
90
|
+
},
|
|
67
91
|
];
|
|
68
92
|
|
|
69
93
|
plop.setGenerator(key, {
|
|
@@ -72,10 +96,7 @@ export default async function (plop) {
|
|
|
72
96
|
} Plugin Component`,
|
|
73
97
|
prompts,
|
|
74
98
|
actions: [
|
|
75
|
-
|
|
76
|
-
data.extensionPoint = name;
|
|
77
|
-
return { type: "createPluginComponent" };
|
|
78
|
-
},
|
|
99
|
+
{ type: "createPluginComponent", data: { extensionPoint: name } },
|
|
79
100
|
],
|
|
80
101
|
});
|
|
81
102
|
}
|
package/src/lib/plopfile.mjs
CHANGED
|
@@ -33,7 +33,9 @@ export default async function (plop) {
|
|
|
33
33
|
|
|
34
34
|
const isWorkspace = await detectWorkspace();
|
|
35
35
|
if (!isWorkspace) {
|
|
36
|
-
console.warn(
|
|
36
|
+
console.warn(
|
|
37
|
+
"[kos-cli] Not inside an Nx workspace. Only a subset of generators are available."
|
|
38
|
+
);
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
|