@kosdev-code/kos-ui-cli 2.0.45 → 2.0.46

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.
@@ -23,31 +23,12 @@
23
23
  }
24
24
  }
25
25
  },
26
- {
27
- "category": "dev",
28
- "file": "index.mjs",
29
- "metadata": {
30
- "key": "dev",
31
- "name": "Development Server",
32
- "description": "Start development servers for host applications and plugins",
33
- "namedArguments": {
34
- "host": "host",
35
- "plugins": "plugins",
36
- "disable": "disable",
37
- "pluginsOnly": "pluginsOnly",
38
- "interactive": "interactive"
39
- }
40
- }
41
- },
42
26
  {
43
27
  "category": "env",
44
28
  "file": "index.mjs",
45
29
  "metadata": {
46
30
  "key": "env",
47
- "name": "Discover and Set Studio Environment Variables",
48
- "namedArguments": {
49
- "interactive": "interactive"
50
- }
31
+ "name": "Discover and Set Studio Environment Variables"
51
32
  }
52
33
  },
53
34
  {
@@ -63,18 +44,6 @@
63
44
  }
64
45
  }
65
46
  },
66
- {
67
- "category": "kab",
68
- "file": "index.mjs",
69
- "metadata": {
70
- "key": "kab",
71
- "name": "Run Kab Target",
72
- "namedArguments": {
73
- "project": "project",
74
- "interactive": "interactive"
75
- }
76
- }
77
- },
78
47
  {
79
48
  "category": "model",
80
49
  "file": "add-future.mjs",
@@ -110,7 +79,6 @@
110
79
  "parentAware": "parentAware",
111
80
  "singleton": "singleton",
112
81
  "dataServices": "dataServices",
113
- "autoRegister": "autoRegister",
114
82
  "dryRun": "dryRun",
115
83
  "interactive": "interactive"
116
84
  }
@@ -129,7 +97,6 @@
129
97
  "parentAware": "parentAware",
130
98
  "singleton": "singleton",
131
99
  "dataServices": "dataServices",
132
- "autoRegister": "autoRegister",
133
100
  "dryRun": "dryRun",
134
101
  "interactive": "interactive"
135
102
  }
@@ -178,7 +145,6 @@
178
145
  "singleton": "singleton",
179
146
  "dataServices": "dataServices",
180
147
  "futureAware": "futureAware",
181
- "autoRegister": "autoRegister",
182
148
  "dryRun": "dryRun",
183
149
  "interactive": "interactive"
184
150
  }
@@ -259,17 +225,6 @@
259
225
  "project": "componentProject",
260
226
  "componentProject": "componentProject"
261
227
  }
262
- },
263
- {
264
- "key": "plugin:custom",
265
- "name": "KOS UI Plugin Custom (User-Specified Contribution)",
266
- "namedArguments": {
267
- "name": "componentName",
268
- "componentName": "componentName",
269
- "project": "componentProject",
270
- "componentProject": "componentProject",
271
- "contributionKey": "contributionKey"
272
- }
273
228
  }
274
229
  ]
275
230
  },
@@ -345,29 +300,6 @@
345
300
  }
346
301
  }
347
302
  },
348
- {
349
- "category": "serve",
350
- "file": "index.mjs",
351
- "metadata": {
352
- "key": "serve",
353
- "name": "Run Serve Target",
354
- "namedArguments": {
355
- "project": "project",
356
- "interactive": "interactive"
357
- }
358
- }
359
- },
360
- {
361
- "category": "version",
362
- "file": "index.mjs",
363
- "metadata": {
364
- "key": "version",
365
- "name": "Display CLI and SDK Version Information",
366
- "namedArguments": {
367
- "interactive": "interactive"
368
- }
369
- }
370
- },
371
303
  {
372
304
  "category": "workspace",
373
305
  "file": "index.mjs",
@@ -376,8 +308,7 @@
376
308
  "name": "Create a new KOS UI Workspace",
377
309
  "namedArguments": {
378
310
  "name": "workspaceName",
379
- "workspaceName": "workspaceName",
380
- "enablePlugins": "enablePlugins"
311
+ "workspaceName": "workspaceName"
381
312
  }
382
313
  }
383
314
  },
@@ -20,29 +20,13 @@ export const metadata = {
20
20
  };
21
21
 
22
22
  export default async function (plop) {
23
- // Check if we're in interactive mode by looking at process args
24
- const isInteractive = process.argv.includes('-i') || process.argv.includes('--interactive');
25
-
26
- // For interactive mode, use lazy loading. For non-interactive, load immediately.
27
- let modelChoices;
28
- if (isInteractive) {
29
- modelChoices = async () => {
30
- const allModels = await getAllModels();
31
- return allModels.map((m) => ({
32
- name: `${m.model} (${m.project})`,
33
- value: m.model,
34
- }));
35
- };
36
- } else {
37
- const allModels = await getAllModels();
38
- modelChoices = allModels.map((m) => ({
39
- name: `${m.model} (${m.project})`,
40
- value: m.model,
41
- }));
42
- }
23
+ const allModels = await getAllModels();
24
+ const modelChoices = allModels.map((m) => ({
25
+ name: `${m.model} (${m.project})`,
26
+ value: m.model,
27
+ }));
43
28
 
44
29
  plop.setActionType("addFutureToModel", async function (answers) {
45
- const allModels = await getAllModels();
46
30
  const modelProject = allModels.find(
47
31
  (m) => m.model === answers.modelName
48
32
  )?.project;
@@ -27,39 +27,21 @@ export const metadata = {
27
27
  parentAware: "parentAware",
28
28
  singleton: "singleton",
29
29
  dataServices: "dataServices",
30
- autoRegister: "autoRegister",
31
30
  dryRun: "dryRun",
32
31
  interactive: "interactive",
33
32
  },
34
33
  };
35
34
 
36
35
  export default async function (plop) {
36
+ const allModels = await getAllModels();
37
37
  const libraryProjects = await getModelProjectsWithFallback();
38
-
39
- // Check if we're in interactive mode by looking at process args
40
- const isInteractive = process.argv.includes('-i') || process.argv.includes('--interactive');
41
-
42
- // For interactive mode, use lazy loading. For non-interactive, load immediately.
43
- let modelChoices;
44
- if (isInteractive) {
45
- modelChoices = async () => {
46
- const allModels = await getAllModels();
47
- return allModels.map((m) => ({
48
- name: `${m.model} (${m.project})`,
49
- value: m.model,
50
- }));
51
- };
52
- } else {
53
- const allModels = await getAllModels();
54
- modelChoices = allModels.map((m) => ({
55
- name: `${m.model} (${m.project})`,
56
- value: m.model,
57
- }));
58
- }
38
+ const modelChoices = allModels.map((m) => ({
39
+ name: `${m.model} (${m.project})`,
40
+ value: m.model,
41
+ }));
59
42
 
60
43
  plop.setActionType("createCompanionModel", async function (answers) {
61
44
  const modelProject = await getProjectDetails(answers.modelProject);
62
- const allModels = await getAllModels();
63
45
  const companionProject = allModels.find(
64
46
  (m) => m.model === answers.companionParent
65
47
  )?.project;
@@ -72,7 +54,6 @@ export default async function (plop) {
72
54
  --dataServices=${!!answers.dataServices} \
73
55
  --singleton=${!!answers.singleton} \
74
56
  --parentAware=${!!answers.parentAware} \
75
- --autoRegister=${!!answers.autoRegister} \
76
57
  --companion=true \
77
58
  --companionModel=${answers.companionParent} \
78
59
  --companionModelProject=${companionProject} \
@@ -18,38 +18,20 @@ export const metadata = {
18
18
  parentAware: "parentAware",
19
19
  singleton: "singleton",
20
20
  dataServices: "dataServices",
21
- autoRegister: "autoRegister",
22
21
  dryRun: "dryRun",
23
22
  interactive: "interactive",
24
23
  },
25
24
  };
26
25
 
27
26
  export default async function (plop) {
27
+ const allModels = await getAllModels();
28
28
  const allProjects = await getAllProjects();
29
-
30
- // Check if we're in interactive mode by looking at process args
31
- const isInteractive = process.argv.includes('-i') || process.argv.includes('--interactive');
32
-
33
- // For interactive mode, use lazy loading. For non-interactive, load immediately.
34
- let modelChoices;
35
- if (isInteractive) {
36
- modelChoices = async () => {
37
- const allModels = await getAllModels();
38
- return allModels.map((m) => ({
39
- name: `${m.model} (${m.project})`,
40
- value: m.model,
41
- }));
42
- };
43
- } else {
44
- const allModels = await getAllModels();
45
- modelChoices = allModels.map((m) => ({
46
- name: `${m.model} (${m.project})`,
47
- value: m.model,
48
- }));
49
- }
29
+ const modelChoices = allModels.map((m) => ({
30
+ name: `${m.model} (${m.project})`,
31
+ value: m.model,
32
+ }));
50
33
 
51
34
  plop.setActionType("createContainer", async function (answers) {
52
- const allModels = await getAllModels();
53
35
  const modelProject = allModels.find(
54
36
  (m) => m.model === answers.modelName
55
37
  )?.project;
@@ -61,7 +43,6 @@ export default async function (plop) {
61
43
  --skipRegistration=true \
62
44
  --dataServices=${!!answers.dataServices} \
63
45
  --singleton=${!!answers.singleton} \
64
- --autoRegister=${!!answers.autoRegister} \
65
46
  --no-interactive ${answers.dryRun ? "--dryRun" : ""} --verbose`;
66
47
 
67
48
  try {
@@ -14,30 +14,13 @@ export const metadata = {
14
14
 
15
15
  export default async function (plop) {
16
16
  const allProjects = await getAllProjects();
17
-
18
- // Check if we're in interactive mode by looking at process args
19
- const isInteractive = process.argv.includes('-i') || process.argv.includes('--interactive');
20
-
21
- // For interactive mode, use lazy loading. For non-interactive, load immediately.
22
- let modelChoices;
23
- if (isInteractive) {
24
- modelChoices = async () => {
25
- const allModels = await getAllModels();
26
- return allModels.map((m) => ({
27
- name: `${m.model} (${m.project})`,
28
- value: m.model,
29
- }));
30
- };
31
- } else {
32
- const allModels = await getAllModels();
33
- modelChoices = allModels.map((m) => ({
34
- name: `${m.model} (${m.project})`,
35
- value: m.model,
36
- }));
37
- }
17
+ const allModels = await getAllModels();
18
+ const modelChoices = allModels.map((m) => ({
19
+ name: `${m.model} (${m.project})`,
20
+ value: m.model,
21
+ }));
38
22
 
39
23
  plop.setActionType("createContext", async function (answers) {
40
- const allModels = await getAllModels();
41
24
  const modelProject = allModels.find(
42
25
  (m) => m.model === answers.modelName
43
26
  )?.project;
@@ -14,30 +14,13 @@ export const metadata = {
14
14
 
15
15
  export default async function (plop) {
16
16
  const allProjects = await getAllProjects();
17
-
18
- // Check if we're in interactive mode by looking at process args
19
- const isInteractive = process.argv.includes('-i') || process.argv.includes('--interactive');
20
-
21
- // For interactive mode, use lazy loading. For non-interactive, load immediately.
22
- let modelChoices;
23
- if (isInteractive) {
24
- modelChoices = async () => {
25
- const allModels = await getAllModels();
26
- return allModels.map((m) => ({
27
- name: `${m.model} (${m.project})`,
28
- value: m.model,
29
- }));
30
- };
31
- } else {
32
- const allModels = await getAllModels();
33
- modelChoices = allModels.map((m) => ({
34
- name: `${m.model} (${m.project})`,
35
- value: m.model,
36
- }));
37
- }
17
+ const allModels = await getAllModels();
18
+ const modelChoices = allModels.map((m) => ({
19
+ name: `${m.model} (${m.project})`,
20
+ value: m.model,
21
+ }));
38
22
 
39
23
  plop.setActionType("createHook", async function (answers) {
40
- const allModels = await getAllModels();
41
24
  const modelProject = allModels.find(
42
25
  (m) => m.model === answers.modelName
43
26
  )?.project;
@@ -15,14 +15,13 @@ export const metadata = {
15
15
  namedArguments: {
16
16
  name: "modelName",
17
17
  modelName: "modelName",
18
- project: "modelProject",
18
+ project: "modelProject",
19
19
  modelProject: "modelProject",
20
20
  container: "container",
21
21
  parentAware: "parentAware",
22
22
  singleton: "singleton",
23
23
  dataServices: "dataServices",
24
24
  futureAware: "futureAware",
25
- autoRegister: "autoRegister",
26
25
  dryRun: "dryRun",
27
26
  interactive: "interactive"
28
27
  }
@@ -42,7 +41,6 @@ export default async function (plop) {
42
41
  --singleton=${!!answers.singleton} \
43
42
  --parentAware=${!!answers.parentAware} \
44
43
  --futureAware=${answers.futureAware || 'none'} \
45
- --autoRegister=${!!answers.autoRegister} \
46
44
  --no-interactive ${answers.dryRun ? "--dryRun" : ""} --verbose`;
47
45
 
48
46
  try {
@@ -66,8 +66,8 @@ export const metadata = [
66
66
  componentProject: "componentProject"
67
67
  }
68
68
  },
69
- {
70
- key: "plugin:cp",
69
+ {
70
+ key: "plugin:cp",
71
71
  name: "KOS UI Plugin Control Pour",
72
72
  namedArguments: {
73
73
  name: "componentName",
@@ -76,17 +76,6 @@ export const metadata = [
76
76
  componentProject: "componentProject"
77
77
  }
78
78
  },
79
- {
80
- key: "plugin:custom",
81
- name: "KOS UI Plugin Custom (User-Specified Contribution)",
82
- namedArguments: {
83
- name: "componentName",
84
- componentName: "componentName",
85
- project: "componentProject",
86
- componentProject: "componentProject",
87
- contributionKey: "contributionKey"
88
- }
89
- },
90
79
  ];
91
80
 
92
81
  export default async function (plop) {
@@ -95,12 +84,7 @@ export default async function (plop) {
95
84
  plop.setActionType("createPluginComponent", async function (answers) {
96
85
  const pluginType = answers.extensionPoint;
97
86
 
98
- let 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`;
99
-
100
- // Add contributionKey for custom plugin types
101
- if (pluginType === 'custom' && answers.contributionKey) {
102
- command = `npx nx generate @kosdev-code/kos-nx-plugin:kos-component --name=${answers.componentName} --contributionKey=${answers.contributionKey} --appProject=${answers.componentProject} --pluginType=${pluginType} --type=components --no-interactive`;
103
- }
87
+ 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`;
104
88
 
105
89
  try {
106
90
  await execute(command);
@@ -132,7 +116,6 @@ export default async function (plop) {
132
116
  { key: "plugin:setting", name: "setting" },
133
117
  { key: "plugin:nav", name: "nav" },
134
118
  { key: "plugin:cp", name: "controlPour" },
135
- { key: "plugin:custom", name: "custom" },
136
119
  ];
137
120
 
138
121
  // Generic plugin component
@@ -163,16 +146,6 @@ export default async function (plop) {
163
146
  },
164
147
  ]
165
148
  : []),
166
- ...(name === "custom"
167
- ? [
168
- {
169
- type: "input",
170
- name: "contributionKey",
171
- message: "What contribution key should be used in .kos.json? (e.g., 'menus', 'panels', 'commands', etc.)",
172
- validate: required,
173
- },
174
- ]
175
- : []),
176
149
  {
177
150
  type: "input",
178
151
  name: "extensionPoint",
@@ -1,5 +1,5 @@
1
1
  // generators/workspace/index.mjs
2
- // Note: create-nx-workspace is imported lazily to avoid dependency errors
2
+ import { createWorkspace } from "create-nx-workspace";
3
3
  import { required } from "../../utils/validators.mjs";
4
4
  import registerListModels from "./list-models.mjs";
5
5
  import registerListProjects from "./list-projects.mjs";
@@ -9,18 +9,14 @@ export const metadata = {
9
9
  name: "Create a new KOS UI Workspace",
10
10
  namedArguments: {
11
11
  name: "workspaceName",
12
- workspaceName: "workspaceName",
13
- enablePlugins: "enablePlugins"
12
+ workspaceName: "workspaceName"
14
13
  }
15
14
  };
16
15
  export default async function (plop) {
17
16
  plop.setActionType("createWorkspace", async function (answers) {
18
- // Lazy import to avoid dependency errors when not using workspace generator
19
- const { createWorkspace } = await import("create-nx-workspace");
20
17
  await createWorkspace("@kosdev-code/kos-nx-plugin", {
21
18
  nxCloud: "skip",
22
19
  name: answers.workspaceName,
23
- enablePlugins: answers.enablePlugins,
24
20
  });
25
21
  return `Workspace ${answers.workspaceName} created.`;
26
22
  });
@@ -34,16 +30,10 @@ export default async function (plop) {
34
30
  message: "Enter the workspace name",
35
31
  validate: required,
36
32
  },
37
- {
38
- type: "confirm",
39
- name: "enablePlugins",
40
- message: "Do you want to enable plugin support?",
41
- default: true,
42
- },
43
33
  ],
44
34
  actions: () => [{ type: "createWorkspace" }],
45
35
  });
46
-
36
+
47
37
  // Register additional workspace generators
48
38
  await registerListModels(plop);
49
39
  await registerListProjects(plop);
@@ -12,14 +12,8 @@ import registerKosModel from "./generators/model/model.mjs";
12
12
  import registerComponent from "./generators/component/index.mjs";
13
13
  import registerPluginComponent from "./generators/plugin/index.mjs";
14
14
 
15
- import registerApiGenerate from "./generators/api/generate.mjs";
16
- import registerApiCompare from "./generators/api/compare.mjs";
17
15
  import registerCacheGenerators from "./generators/cache/index.mjs";
18
- import registerDev from "./generators/dev/index.mjs";
19
16
  import registerEnv from "./generators/env/index.mjs";
20
- import registerKab from "./generators/kab/index.mjs";
21
- import registerServe from "./generators/serve/index.mjs";
22
- import registerVersion from "./generators/version/index.mjs";
23
17
  import registerI18nNamespace from "./generators/i18n/namespace.mjs";
24
18
  import registerUiProject from "./generators/project/app.mjs";
25
19
  import registerContentProject from "./generators/project/content.mjs";
@@ -62,12 +56,6 @@ export default async function (plop) {
62
56
  await registerSplashProject(plop);
63
57
  await registerI18n(plop);
64
58
  await registerI18nNamespace(plop);
65
- await registerApiGenerate(plop);
66
- await registerApiCompare(plop);
67
- await registerDev(plop);
68
59
  await registerEnv(plop);
69
- await registerKab(plop);
70
- await registerServe(plop);
71
- await registerVersion(plop);
72
60
  await registerCacheGenerators(plop);
73
61
  }
@@ -1,139 +0,0 @@
1
- import { compareApiVersions } from "./lib/compare-api.mjs";
2
-
3
- /**
4
- * Registers the api:compare generator with Plop for comparing OpenAPI versions
5
- * and detecting breaking changes between API type definitions.
6
- *
7
- * This generator analyzes two generated API type definition files to identify
8
- * compatibility issues such as removed endpoints, changed parameters, and
9
- * breaking changes. Essential for safe API upgrades and release planning.
10
- *
11
- * @param {import('plop').NodePlopAPI} plop - The Plop API instance
12
- * @returns {Promise<void>} Resolves when generator is registered
13
- *
14
- * @example
15
- * ```javascript
16
- * // In plopfile.mjs
17
- * import registerApiCompare from './generators/api/compare.mjs';
18
- * await registerApiCompare(plop);
19
- * ```
20
- */
21
- export default async function register(plop) {
22
- plop.setGenerator("api:compare", {
23
- description: "Compare OpenAPI versions for compatibility analysis",
24
- prompts: [
25
- {
26
- type: "input",
27
- name: "project",
28
- message: "Project name containing generated API types",
29
- validate: (input) => {
30
- if (!input || input.trim() === "") {
31
- return "Project name is required";
32
- }
33
- return true;
34
- },
35
- },
36
- {
37
- type: "input",
38
- name: "app",
39
- message: "App namespace to compare (kos, dispense, freestyle, etc.)",
40
- validate: (input) => {
41
- if (!input || input.trim() === "") {
42
- return "App namespace is required";
43
- }
44
- return true;
45
- },
46
- },
47
- {
48
- type: "input",
49
- name: "baseVersion",
50
- message: "Base version to compare from",
51
- validate: (input) => {
52
- if (!input || input.trim() === "") {
53
- return "Base version is required";
54
- }
55
- return true;
56
- },
57
- },
58
- {
59
- type: "input",
60
- name: "targetVersion",
61
- message: "Target version to compare to",
62
- validate: (input) => {
63
- if (!input || input.trim() === "") {
64
- return "Target version is required";
65
- }
66
- return true;
67
- },
68
- },
69
- {
70
- type: "list",
71
- name: "format",
72
- message: "Output format",
73
- choices: ["console", "json", "markdown"],
74
- default: "console",
75
- },
76
- {
77
- type: "input",
78
- name: "outputFile",
79
- message: "Output file path (optional, leave empty for stdout)",
80
- default: "",
81
- },
82
- ],
83
- actions: function (answers) {
84
- return [
85
- async function compareApi() {
86
- try {
87
- const options = {
88
- project: answers.project,
89
- app: answers.app,
90
- apps: answers.apps, // Support multi-app comparison
91
- baseVersion: answers.baseVersion,
92
- targetVersion: answers.targetVersion,
93
- format: answers.format,
94
- outputFile: answers.outputFile || undefined,
95
- };
96
-
97
- const result = await compareApiVersions(options);
98
-
99
- if (answers.outputFile) {
100
- return `[ok] Comparison written to ${answers.outputFile}`;
101
- } else {
102
- return `[ok] Comparison complete`;
103
- }
104
- } catch (error) {
105
- console.error("Error comparing API versions:", error);
106
- throw new Error(`Failed to compare API versions: ${error.message}`);
107
- }
108
- },
109
- ];
110
- },
111
- });
112
- }
113
-
114
- /**
115
- * Metadata for CLI integration describing the api:compare command.
116
- *
117
- * Provides command key, description, and argument mappings for the CLI
118
- * help system and command-line argument parsing.
119
- *
120
- * @type {Object}
121
- * @property {string} key - Command identifier used in CLI
122
- * @property {string} name - Human-readable command name
123
- * @property {string} description - Command description for help text
124
- * @property {Object} namedArguments - Maps CLI argument names to prompt property names
125
- */
126
- export const metadata = {
127
- key: "api:compare",
128
- name: "Compare API Versions",
129
- description: "Analyze compatibility between OpenAPI versions and detect breaking changes",
130
- namedArguments: {
131
- project: "project",
132
- app: "app",
133
- apps: "apps", // For multi-app comparison
134
- base: "baseVersion",
135
- target: "targetVersion",
136
- format: "format",
137
- output: "outputFile",
138
- },
139
- };