@kosdev-code/kos-nx-plugin 2.0.40 → 2.1.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/generators.json +5 -0
- package/package.json +2 -2
- package/src/generators/kos-add-future-to-model/generator.d.ts.map +1 -1
- package/src/generators/kos-add-future-to-model/generator.js.map +1 -1
- package/src/generators/kos-add-future-to-model/lib/model-transformer.d.ts +8 -3
- package/src/generators/kos-add-future-to-model/lib/model-transformer.d.ts.map +1 -1
- package/src/generators/kos-add-future-to-model/lib/model-transformer.js +191 -155
- package/src/generators/kos-add-future-to-model/lib/model-transformer.js.map +1 -1
- package/src/generators/kos-container-model/files/model/__nameDashCase__-model.ts.template +25 -40
- package/src/generators/kos-container-model/files/model/index.ts.template +20 -5
- package/src/generators/kos-content-project/files/assets/.gitkeep +2 -0
- package/src/generators/kos-content-project/files/vite.config.ts.template +48 -0
- package/src/generators/kos-content-project/generator.d.ts +5 -0
- package/src/generators/kos-content-project/generator.d.ts.map +1 -0
- package/src/generators/kos-content-project/generator.js +55 -0
- package/src/generators/kos-content-project/generator.js.map +1 -0
- package/src/generators/kos-content-project/schema.d.ts +3 -0
- package/src/generators/kos-content-project/schema.json +18 -0
- package/src/generators/kos-model/files/model/__nameDashCase__-model.ts.template +35 -43
- package/src/generators/kos-model/files/model/index.ts__template__ +11 -3
- package/src/generators/kos-model/schema.d.ts +1 -0
- package/src/generators/kos-model/schema.json +5 -0
- package/src/generators/kos-plugin-project/generator.js +6 -6
- package/src/generators/kos-plugin-project/generator.js.map +1 -1
- package/src/generators/preset/generator.d.ts.map +1 -1
- package/src/generators/preset/generator.js +7 -5
- package/src/generators/preset/generator.js.map +1 -1
- package/src/generators/preset/tools/tools/scripts/update.mjs.template +29 -8
- package/src/generators/kos-container-model/files/model/__nameDashCase__-registration.ts.template +0 -113
- package/src/generators/kos-model/files/model/__nameDashCase__-registration.ts.template +0 -144
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
1
2
|
<% if (internal) {%>import {
|
|
2
3
|
kosDependency,
|
|
3
4
|
kosModel,
|
|
5
|
+
kosContainerAware,
|
|
4
6
|
kosTopicHandler,
|
|
7
|
+
type KosContainerAware,
|
|
8
|
+
kosLoggerAware,
|
|
9
|
+
type KosLoggerAware,
|
|
5
10
|
} from "../../../core/core/decorators";
|
|
6
|
-
import {
|
|
7
|
-
KosModelContainer,
|
|
8
|
-
type IKosModelContainer,
|
|
9
|
-
} from "../../../core/core/kos-container-model";
|
|
10
11
|
import type {
|
|
11
|
-
IKosDataModel
|
|
12
|
-
KosContextLogger,
|
|
13
|
-
KosCreationContext,
|
|
12
|
+
IKosDataModel
|
|
14
13
|
} from "../../../core/core/kosModel";
|
|
15
|
-
import type {
|
|
14
|
+
import type { KosModelRegistrationType } from "../../../core/core/registration/model-registration";
|
|
15
|
+
import type { IKosIdentifiable } from "../../../core/core/types";
|
|
16
16
|
import type { PublicModelInterface } from "../../../core/types";
|
|
17
|
-
<% } else { %>import { kosModel,
|
|
18
|
-
import
|
|
17
|
+
<% } else { %>import { kosModel, kosContainerAware, type KosContainerAware } from "@kosdev-code/kos-ui-sdk";
|
|
18
|
+
import { type KosModelRegistrationType, IKosDataModel, IKosIdentifiable, PublicModelInterface, kosLoggerAware, type KosLoggerAware } from "@kosdev-code/kos-ui-sdk";<% } %>
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
import type { <%= nameProperCase %>Options } from "./types";
|
|
@@ -26,42 +26,27 @@ export const MODEL_TYPE = "<%= nameDashCase %>-model";
|
|
|
26
26
|
|
|
27
27
|
export type <%= nameProperCase %>Model = PublicModelInterface<<%= nameProperCase %>ModelImpl>;
|
|
28
28
|
|
|
29
|
-
@
|
|
30
|
-
export
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
30
|
+
export interface <%= nameProperCase %>ModelImpl extends KosLoggerAware, KosContainerAware<<%= modelNameProperCase %>Model> {}
|
|
31
|
+
|
|
32
|
+
@kosModel({ modelTypeId: MODEL_TYPE, singleton: true<% if (autoRegister) { %>, autoRegister: true<% } %> })
|
|
33
|
+
@kosContainerAware<<%= modelNameProperCase %>Model>()
|
|
34
|
+
@kosLoggerAware()
|
|
35
|
+
export class <%= nameProperCase %>ModelImpl implements IKosIdentifiable, IKosDataModel {
|
|
36
|
+
|
|
37
|
+
// Registration property for type safety - actual value injected by @kosModel decorator
|
|
38
|
+
static Registration: KosModelRegistrationType<<%= nameProperCase %>Model, <%= nameProperCase %>Options>;
|
|
39
|
+
|
|
40
|
+
|
|
31
41
|
id: string;
|
|
32
|
-
|
|
33
|
-
@kosChild private _models: IKosModelContainer<<%= modelNameProperCase %>Model>;
|
|
34
|
-
constructor(modelId: string, options: <%= nameProperCase %>Options, context: KosCreationContext) {
|
|
42
|
+
constructor(modelId: string, _options: <%= nameProperCase %>Options) {
|
|
35
43
|
this.id = modelId;
|
|
36
|
-
|
|
37
|
-
this._models = new KosModelContainer<<%= modelNameProperCase %>Model>({parentId: modelId});
|
|
38
|
-
if (options) {
|
|
39
|
-
// Assign options properties here.
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getModel(id: string) {
|
|
44
|
-
return this._models.getModel(id);
|
|
45
|
-
}
|
|
46
|
-
get models () {
|
|
47
|
-
return this._models;
|
|
48
|
-
}
|
|
49
|
-
get data() {
|
|
50
|
-
return this._models.data;
|
|
44
|
+
// Container is automatically injected with parentId: modelId
|
|
51
45
|
}
|
|
52
46
|
|
|
53
|
-
updateModel(
|
|
47
|
+
updateModel(_options: <%= nameProperCase %>Options): void {
|
|
54
48
|
// Update model properties here.
|
|
55
49
|
}
|
|
56
|
-
|
|
57
|
-
addModel(model: <%= modelNameProperCase %>Model) {
|
|
58
|
-
this._models.addModel(model);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
removeModel(id: string){
|
|
63
|
-
this._models.removeModel(id);
|
|
64
|
-
};
|
|
65
50
|
// -------------------LIFECYCLE----------------------------
|
|
66
51
|
|
|
67
52
|
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// Import implementation class but don't export it directly
|
|
2
|
+
import { <%= nameProperCase %>ModelImpl } from "./<%= nameDashCase %>-model";
|
|
3
|
+
|
|
4
|
+
// Import container implementation class but don't export it directly
|
|
5
|
+
import { <%= modelNameProperCase %>ModelImpl } from "./<%= modelNameDashCase %>-model";
|
|
6
|
+
|
|
7
|
+
// Export types
|
|
5
8
|
export type { <%= nameProperCase %>Model } from "./<%= nameDashCase %>-model";
|
|
6
|
-
|
|
9
|
+
export type { <%= modelNameProperCase %>Model } from "./<%= modelNameDashCase %>-model";
|
|
10
|
+
export type * from "./types";
|
|
11
|
+
|
|
12
|
+
// Export Registration as the public API
|
|
13
|
+
export const <%= nameProperCase %> = <%= nameProperCase %>ModelImpl.Registration;
|
|
14
|
+
|
|
15
|
+
// Export Registration as the public API
|
|
16
|
+
export const <%= modelNameProperCase %> = <%= modelNameProperCase %>ModelImpl.Registration;
|
|
17
|
+
|
|
18
|
+
<% if (dataServices) { %>// Export services if configured
|
|
19
|
+
export * as <%= modelNameProperCase %>Services from "./services";<% } %>
|
|
20
|
+
|
|
21
|
+
<%= nameProperCase %>.addRelatedModel(<%= modelNameProperCase %>);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types='vitest' />
|
|
2
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
3
|
+
import react from '@vitejs/plugin-react';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { defineConfig } from 'vite';
|
|
6
|
+
import dts from 'vite-plugin-dts';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
root: __dirname,
|
|
10
|
+
cacheDir: '../../node_modules/.vite/<%= name %>',
|
|
11
|
+
publicDir: 'assets',
|
|
12
|
+
plugins: [
|
|
13
|
+
react(),
|
|
14
|
+
nxViteTsPaths(),
|
|
15
|
+
dts({
|
|
16
|
+
entryRoot: 'src',
|
|
17
|
+
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
// Uncomment this if you are using workers.
|
|
22
|
+
// worker: {
|
|
23
|
+
// plugins: [ nxViteTsPaths() ],
|
|
24
|
+
// },
|
|
25
|
+
|
|
26
|
+
// Configuration for building your library.
|
|
27
|
+
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
28
|
+
build: {
|
|
29
|
+
outDir: '../../dist/<%= name %>',
|
|
30
|
+
reportCompressedSize: true,
|
|
31
|
+
commonjsOptions: {
|
|
32
|
+
transformMixedEsModules: true,
|
|
33
|
+
},
|
|
34
|
+
lib: {
|
|
35
|
+
// Could also be a dictionary or array of multiple entry points.
|
|
36
|
+
entry: 'src/index.ts',
|
|
37
|
+
name: '<%= name %>',
|
|
38
|
+
fileName: '<%= name %>',
|
|
39
|
+
// Change this to the formats you want to support.
|
|
40
|
+
// Don't forget to update your package.json as well.
|
|
41
|
+
formats: ['es', 'cjs'],
|
|
42
|
+
},
|
|
43
|
+
rollupOptions: {
|
|
44
|
+
// External packages that should not be bundled into your library.
|
|
45
|
+
external: ['react', 'react-dom', 'react/jsx-runtime'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
|
+
import { KosContentProjectGeneratorSchema } from "./schema";
|
|
3
|
+
export declare function kosContentProjectGenerator(tree: Tree, options: KosContentProjectGeneratorSchema): Promise<void>;
|
|
4
|
+
export default kosContentProjectGenerator;
|
|
5
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/kos-content-project/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAEL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAE5D,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gCAAgC,iBAmD1C;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.kosContentProjectGenerator = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const eslint_1 = require("@nx/eslint");
|
|
6
|
+
const react_1 = require("@nx/react");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
async function kosContentProjectGenerator(tree, options) {
|
|
9
|
+
const config = (0, devkit_1.readNxJson)(tree);
|
|
10
|
+
const root = config?.workspaceLayout?.libsDir || "";
|
|
11
|
+
const projectRootDir = path.join(root, "content", options.name);
|
|
12
|
+
await (0, react_1.libraryGenerator)(tree, {
|
|
13
|
+
name: options.name,
|
|
14
|
+
bundler: "vite",
|
|
15
|
+
directory: projectRootDir,
|
|
16
|
+
component: false,
|
|
17
|
+
minimal: true,
|
|
18
|
+
projectNameAndRootFormat: "as-provided",
|
|
19
|
+
style: "css",
|
|
20
|
+
linter: eslint_1.Linter.EsLint,
|
|
21
|
+
});
|
|
22
|
+
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, options.name);
|
|
23
|
+
// Add KAB (Kos Asset Bundle) build targets similar to theme project
|
|
24
|
+
const externalJson = {
|
|
25
|
+
kab: {
|
|
26
|
+
command: `node tools/scripts/kabtool.mjs build ${options.name} && node tools/scripts/kabtool.mjs list ${options.name} `,
|
|
27
|
+
options: {
|
|
28
|
+
outputPath: `dist/archives/packages/${options.name}/`,
|
|
29
|
+
zipName: "ui.zip",
|
|
30
|
+
kabName: `${options.name}.kab`,
|
|
31
|
+
},
|
|
32
|
+
dependsOn: ["zip"],
|
|
33
|
+
},
|
|
34
|
+
zip: {
|
|
35
|
+
command: `node tools/scripts/archiver.js ${options.name}`,
|
|
36
|
+
options: {
|
|
37
|
+
outputPath: `dist/archives/packages/${options.name}/`,
|
|
38
|
+
zipName: "ui.zip",
|
|
39
|
+
},
|
|
40
|
+
dependsOn: ["build"],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.name, {
|
|
44
|
+
...projectConfiguration,
|
|
45
|
+
targets: {
|
|
46
|
+
...projectConfiguration.targets,
|
|
47
|
+
...externalJson,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, "files"), projectRootDir, options);
|
|
51
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
52
|
+
}
|
|
53
|
+
exports.kosContentProjectGenerator = kosContentProjectGenerator;
|
|
54
|
+
exports.default = kosContentProjectGenerator;
|
|
55
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/kos-content-project/generator.ts"],"names":[],"mappings":";;;AAAA,uCAOoB;AACpB,uCAAoC;AACpC,qCAA6C;AAC7C,6BAA6B;AAGtB,KAAK,UAAU,0BAA0B,CAC9C,IAAU,EACV,OAAyC;IAEzC,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,MAAM,EAAE,eAAe,EAAE,OAAO,IAAI,EAAE,CAAC;IACpD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE;QAC3B,IAAI,EAAE,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BAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "KosContentProject",
|
|
4
|
+
"title": "",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "What name would you like to use?"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["name"]
|
|
18
|
+
}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
2
|
+
<% if (futureAware && futureAware !== 'none') { %>/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
3
|
+
<% } %><% const hasFutureSupport = futureAware && futureAware !== 'none'; %>
|
|
2
4
|
<% const isCompleteFuture = futureAware === 'complete'; %>
|
|
3
5
|
<% const isCompositionCompanion = companion && companionPattern === 'composition'; %>
|
|
4
6
|
<% const isDecoratorCompanion = companion && companionPattern === 'decorator'; %>
|
|
5
|
-
<% if (internal) { %>import { kosModel<% if (parentAware) { %>, kosParentAware<% } %><% if (hasFutureSupport) { %>, kosFuture<% } %> } from "../../../core/core/decorators";
|
|
7
|
+
<% if (internal) { %>import { kosModel<% if (parentAware) { %>, kosParentAware<% } %><% if (hasFutureSupport) { %>, kosFuture, kosFutureAware, Kos<% if (isCompleteFuture) { %>FutureAwareFull<% } else { %>FutureAwareMinimal<% } %><% } %>, kosLoggerAware, KosLoggerAware } from "../../../core/core/decorators";
|
|
6
8
|
import type {
|
|
7
9
|
IKosDataModel,
|
|
8
|
-
KosContextLogger
|
|
9
|
-
KosCreationContext,
|
|
10
|
+
KosContextLogger
|
|
10
11
|
} from "../../../core/core/kosModel";
|
|
12
|
+
import type { KosModelRegistrationType } from "../../../core/core/registration/model-registration";
|
|
11
13
|
import type { IKosIdentifiable } from "../../../core/core/types";
|
|
12
14
|
import type { PublicModelInterface } from "../../../core/types";
|
|
13
15
|
<% if (hasFutureSupport) { %>import type {
|
|
14
16
|
ExternalFutureInterface,
|
|
15
|
-
FutureHandlerContainer<% if (isCompleteFuture) { %>,
|
|
16
|
-
FutureStateAccessor,
|
|
17
|
-
FutureUpdateHandler<% } %>,
|
|
18
|
-
FutureAwareContainer,
|
|
19
17
|
IFutureModel
|
|
20
|
-
} from "../../../models/types/future-interfaces"
|
|
21
|
-
|
|
22
|
-
<%
|
|
23
|
-
|
|
24
|
-
import { kosModel<% if (parentAware) { %>, kosParentAware<% } %><% if (hasFutureSupport) { %>, kosFuture, setup<% if (isCompleteFuture) { %>Complete<% } else { %>Minimal<% } %>FutureSupport<% } %><% if (isDecoratorCompanion) { %>, setupCompanionDecoratorMixin<% } %> } from "@kosdev-code/kos-ui-sdk";
|
|
18
|
+
} from "../../../models/types/future-interfaces";<% } %>
|
|
19
|
+
<% if (isDecoratorCompanion) { %>import { KosCompanionDecorator } from "../../../core/core/decorators";<% } %>
|
|
20
|
+
<% } else { %>import type { IKosDataModel, IKosIdentifiable, PublicModelInterface, KosModelRegistrationType<% if (hasFutureSupport) { %>, ExternalFutureInterface, IFutureModel<% } %><% if (isDecoratorCompanion) { %>, KosCompanionDecorator<% } %> } from "@kosdev-code/kos-ui-sdk";
|
|
21
|
+
import { kosModel<% if (parentAware) { %>, kosParentAware<% } %><% if (hasFutureSupport) { %>, kosFuture, kosFutureAware, Kos<% if (isCompleteFuture) { %>FutureAwareFull<% } else { %>FutureAwareMinimal<% } %><% } %><% if (isDecoratorCompanion) { %>, kosCompanion<% } %>, kosLoggerAware, KosLoggerAware } from "@kosdev-code/kos-ui-sdk";
|
|
25
22
|
<% } %>
|
|
26
23
|
import type { <%= nameProperCase %>Options} from "./types";
|
|
27
24
|
<% if (hasFutureSupport) { %>import type { <%= nameProperCase %>OperationProgress } from "./services";<% } %>
|
|
@@ -31,36 +28,41 @@ import type { <%= companionModelProperCase %>Model } from "<%= companionModelPro
|
|
|
31
28
|
<% } %>
|
|
32
29
|
export const MODEL_TYPE = "<%= nameDashCase %>-model";
|
|
33
30
|
|
|
34
|
-
export type <%= nameProperCase %>Model = PublicModelInterface<<%= nameProperCase %>ModelImpl><% if (hasFutureSupport) { %> & ExternalFutureInterface<<%= nameProperCase %>OperationProgress><% }
|
|
31
|
+
export type <%= nameProperCase %>Model = PublicModelInterface<<%= nameProperCase %>ModelImpl><% if (hasFutureSupport) { %> & ExternalFutureInterface<<%= nameProperCase %>OperationProgress><% } %>;
|
|
32
|
+
|
|
33
|
+
// Interface merging for decorator type safety
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
35
|
+
export interface <%= nameProperCase %>ModelImpl extends KosLoggerAware<% if (hasFutureSupport) { %>, Kos<% if (isCompleteFuture) { %>FutureAwareFull<% } else { %>FutureAwareMinimal<% } %><<%= nameProperCase %>OperationProgress><% } %><% if (isDecoratorCompanion) { %>, KosCompanionDecorator<<%= companionModelProperCase %>Model><% } %> {}
|
|
36
|
+
|
|
37
|
+
@kosModel({ modelTypeId: MODEL_TYPE<% if (singleton !== undefined) { %>, singleton: <%= singleton %><% } %><% if (autoRegister) { %>, autoRegister: true<% } %> })
|
|
38
|
+
<% if (parentAware && !isDecoratorCompanion) { %>@kosParentAware()<% } %>
|
|
39
|
+
<% if (hasFutureSupport) { %>@kosFutureAware(<% if (!isCompleteFuture) { %>{ mode: 'minimal' }<% } %>)<% } %>
|
|
40
|
+
<% if (isDecoratorCompanion) { %>@kosCompanion()<% } %>
|
|
41
|
+
@kosLoggerAware()
|
|
42
|
+
export class <%= nameProperCase %>ModelImpl implements IKosDataModel, IKosIdentifiable {
|
|
43
|
+
// Registration property for type safety - actual value injected by @kosModel decorator
|
|
44
|
+
static Registration: KosModelRegistrationType<<%= nameProperCase %>Model, <%= nameProperCase %>Options>;
|
|
35
45
|
|
|
36
|
-
<% if (parentAware) { %>@kosParentAware()<% } %>
|
|
37
|
-
@kosModel(MODEL_TYPE)
|
|
38
|
-
export class <%= nameProperCase %>ModelImpl implements IKosDataModel, IKosIdentifiable<% if (isCompleteFuture) { %>, FutureUpdateHandler<% } %> {
|
|
39
46
|
id: string;
|
|
40
|
-
|
|
47
|
+
// logger property is automatically provided by @kosLoggerAware decorator
|
|
41
48
|
<% if (isCompositionCompanion) { %>
|
|
42
49
|
// Composition pattern - explicit parent access
|
|
43
50
|
public readonly parent: <%= companionModelProperCase %>Model;
|
|
44
51
|
<% } %>
|
|
45
52
|
<% if (hasFutureSupport) { %>
|
|
46
|
-
// Future support properties -
|
|
47
|
-
public futureHandler!: FutureAwareContainer<<%= nameProperCase %>OperationProgress>;<% if (isCompleteFuture) { %>
|
|
48
|
-
public future?: IFutureModel<<%= nameProperCase %>OperationProgress>; // Used internally for progress checks and custom logic<% } %><% } %>
|
|
53
|
+
// Future support properties are provided via interface merging - no need to declare<% } %>
|
|
49
54
|
|
|
50
|
-
constructor(modelId: string, options: <%= nameProperCase %>Options
|
|
55
|
+
constructor(modelId: string, options: <%= nameProperCase %>Options) {
|
|
51
56
|
this.id = modelId;
|
|
52
|
-
|
|
57
|
+
// logger is automatically injected by @kosLoggerAware decorator
|
|
53
58
|
<% if (isCompositionCompanion) { %>
|
|
54
59
|
// Set parent from companionParent option for composition pattern
|
|
55
60
|
this.parent = options.companionParent;
|
|
56
|
-
<% } else if (isDecoratorCompanion) { %>
|
|
57
|
-
// Setup decorator mixin for transparent parent access
|
|
58
|
-
setupCompanionDecoratorMixin(this, options.companionParent);
|
|
59
61
|
<% } %>
|
|
60
|
-
<% if (
|
|
61
|
-
//
|
|
62
|
-
setup<% if (isCompleteFuture) { %>Complete<% } else { %>Minimal<% } %>FutureSupport(this);
|
|
62
|
+
<% if (isDecoratorCompanion) { %>
|
|
63
|
+
// Companion decorator automatically provides getCompanionParent() and parent property proxying
|
|
63
64
|
<% } %>
|
|
65
|
+
// Future support is automatically initialized by @kosFutureAware decorator
|
|
64
66
|
if (options) {
|
|
65
67
|
// Assign options properties here.
|
|
66
68
|
}
|
|
@@ -81,17 +83,7 @@ export class <%= nameProperCase %>ModelImpl implements IKosDataModel, IKosIdent
|
|
|
81
83
|
// This method should use a service that returns a Future for progress tracking
|
|
82
84
|
|
|
83
85
|
this.logger.debug(`Starting long-running operation for ${this.id}`);
|
|
84
|
-
|
|
85
|
-
// Example implementation pattern using services:
|
|
86
|
-
// import { perform<%= nameProperCase %>Operation } from './services';
|
|
87
|
-
//
|
|
88
|
-
// try {
|
|
89
|
-
// const future = await perform<%= nameProperCase %>Operation();
|
|
90
|
-
// return this.futureHandler.setFuture(future);
|
|
91
|
-
// } catch (error) {
|
|
92
|
-
// this.logger.error(`Failed to start operation for ${this.id}:`, error);
|
|
93
|
-
// throw error;
|
|
94
|
-
// }
|
|
86
|
+
|
|
95
87
|
|
|
96
88
|
// Placeholder that doesn't actually do anything
|
|
97
89
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
@@ -105,7 +97,7 @@ export class <%= nameProperCase %>ModelImpl implements IKosDataModel, IKosIdent
|
|
|
105
97
|
* Optional: Custom Future update handling
|
|
106
98
|
* Called whenever the Future state changes (progress, status, completion, etc.)
|
|
107
99
|
*/
|
|
108
|
-
onFutureUpdate(update: IFutureModel<<%= nameProperCase %>OperationProgress>): void {
|
|
100
|
+
onFutureUpdate?(update: IFutureModel<<%= nameProperCase %>OperationProgress>): void {
|
|
109
101
|
// Add custom Future update logic here
|
|
110
102
|
// Examples:
|
|
111
103
|
// - Log progress milestones
|
|
@@ -118,8 +110,8 @@ export class <%= nameProperCase %>ModelImpl implements IKosDataModel, IKosIdent
|
|
|
118
110
|
status: update.status,
|
|
119
111
|
endState: update.endState,
|
|
120
112
|
// Access typed progress data:
|
|
121
|
-
stage: update.
|
|
122
|
-
percentComplete: update.
|
|
113
|
+
stage: update.clientData?.stage,
|
|
114
|
+
percentComplete: update.clientData?.percentComplete
|
|
123
115
|
});
|
|
124
116
|
}
|
|
125
117
|
<% } %>
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Import implementation class but don't export it directly
|
|
2
|
+
import { <%= nameProperCase %>ModelImpl } from "./<%= nameDashCase %>-model";
|
|
3
|
+
|
|
4
|
+
// Export types
|
|
3
5
|
export type { <%= nameProperCase %>Model } from "./<%= nameDashCase %>-model";
|
|
4
|
-
|
|
6
|
+
export type * from "./types";
|
|
7
|
+
|
|
8
|
+
// Export Registration as the public API
|
|
9
|
+
export const <%= nameProperCase %> = <%= nameProperCase %>ModelImpl.Registration;
|
|
10
|
+
|
|
11
|
+
<% if (dataServices) { %>// Export services if configured
|
|
12
|
+
export * as <%= nameProperCase %>Services from "./services";<% } %>
|
|
@@ -18,6 +18,7 @@ export interface KosModelGeneratorSchema extends KosBaseGeneratorSchema {
|
|
|
18
18
|
container?: boolean;
|
|
19
19
|
parentAware?: boolean;
|
|
20
20
|
futureAware?: "none" | "minimal" | "complete";
|
|
21
|
+
autoRegister?: boolean;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export interface NormalizedKosBaseGeneratorSchema<
|
|
@@ -53,6 +53,11 @@
|
|
|
53
53
|
"default": false,
|
|
54
54
|
"description": "Is there a need for more than one instance of this model type"
|
|
55
55
|
},
|
|
56
|
+
"autoRegister": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": false,
|
|
59
|
+
"description": "Automatically register the model with the framework (escape hatch for plugins)"
|
|
60
|
+
},
|
|
56
61
|
"unitTests": {
|
|
57
62
|
"type": "boolean",
|
|
58
63
|
"default": false,
|
|
@@ -94,12 +94,12 @@ async function kosPluginProjectGenerator(tree, options) {
|
|
|
94
94
|
tree.delete(`${projectConfiguration.root}/src/app/app.spec.tsx`);
|
|
95
95
|
tree.delete(`${projectConfiguration.root}/.storybook/preview.ts`);
|
|
96
96
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
97
|
-
"@kosdev-code/kos-ddk": "
|
|
98
|
-
"@kosdev-code/kos-ddk-components": "
|
|
99
|
-
"@kosdev-code/kos-ddk-model-components": "
|
|
100
|
-
"@kosdev-code/kos-ddk-models": "
|
|
101
|
-
"@kosdev-code/kos-ddk-styles": "
|
|
102
|
-
"@kosdev-code/kos-ui-plugin": "
|
|
97
|
+
"@kosdev-code/kos-ddk": "~2.0.0",
|
|
98
|
+
"@kosdev-code/kos-ddk-components": "~2.0.0",
|
|
99
|
+
"@kosdev-code/kos-ddk-model-components": "~2.0.0",
|
|
100
|
+
"@kosdev-code/kos-ddk-models": "~2.0.0",
|
|
101
|
+
"@kosdev-code/kos-ddk-styles": "~2.0.0",
|
|
102
|
+
"@kosdev-code/kos-ui-plugin-dev": "~2.0.0",
|
|
103
103
|
}, {});
|
|
104
104
|
await (0, devkit_1.formatFiles)(tree);
|
|
105
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/kos-plugin-project/generator.ts"],"names":[],"mappings":";;;AAAA,uCAOoB;AACpB,uCAAoC;AACpC,qCAA6E;AAC7E,6BAA6B;AAC7B,sEAAsE;AAE/D,KAAK,UAAU,yBAAyB,CAC7C,IAAU,EACV,OAAwC;IAExC,MAAM,iBAAiB,GAAG,IAAA,oCAAkB,EAAC;QAC3C,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC,CAAC;IACH,MAAM,UAAU,GAAG;QACjB,GAAG,iBAAiB;QACpB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,WAAW,EAAE,OAAO,CAAC,IAAI;QACzB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,iBAAiB;KAC5C,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,IAA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IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAC7B,oBAAoB,CAAC,IAAI,EACzB,UAAU,CACX,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,yBAAyB,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,eAAe,CAAC,CAAC;IACzD,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,uBAAuB,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,wBAAwB,CAAC,CAAC;IAElE,IAAA,qCAA4B,EAC1B,IAAI,EACJ;QACE,sBAAsB,EAAE,QAAQ;QAChC,iCAAiC,EAAE,QAAQ;QAC3C,uCAAuC,EAAE,QAAQ;QACjD,6BAA6B,EAAE,QAAQ;QACvC,6BAA6B,EAAE,QAAQ;QACvC,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/kos-plugin-project/generator.ts"],"names":[],"mappings":";;;AAAA,uCAOoB;AACpB,uCAAoC;AACpC,qCAA6E;AAC7E,6BAA6B;AAC7B,sEAAsE;AAE/D,KAAK,UAAU,yBAAyB,CAC7C,IAAU,EACV,OAAwC;IAExC,MAAM,iBAAiB,GAAG,IAAA,oCAAkB,EAAC;QAC3C,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC,CAAC;IACH,MAAM,UAAU,GAAG;QACjB,GAAG,iBAAiB;QACpB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,WAAW,EAAE,OAAO,CAAC,IAAI;QACzB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,iBAAiB;KAC5C,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CA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,CAAC,SAAS,EAAE,OAAO,CAAC,EAC7B,oBAAoB,CAAC,IAAI,EACzB,UAAU,CACX,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,yBAAyB,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,eAAe,CAAC,CAAC;IACzD,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,uBAAuB,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,wBAAwB,CAAC,CAAC;IAElE,IAAA,qCAA4B,EAC1B,IAAI,EACJ;QACE,sBAAsB,EAAE,QAAQ;QAChC,iCAAiC,EAAE,QAAQ;QAC3C,uCAAuC,EAAE,QAAQ;QACjD,6BAA6B,EAAE,QAAQ;QACvC,6BAA6B,EAAE,QAAQ;QACvC,gCAAgC,EAAE,QAAQ;KAC3C,EACD,EAAE,CACH,CAAC;IACF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AA/HD,8DA+HC;AAED,kBAAe,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/preset/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAOL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAYjD,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/preset/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAOL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAYjD,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qBAAqB,iBA8S/B;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -58,10 +58,11 @@ async function presetGenerator(tree, options) {
|
|
|
58
58
|
});
|
|
59
59
|
// add the dependencies to the package.json
|
|
60
60
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
61
|
-
"@kosdev-code/kos-ui-sdk": "~2.
|
|
62
|
-
"@kosdev-code/kos-dispense-sdk": "~2.
|
|
63
|
-
"@kosdev-code/kos-freestyle-sdk": "~2.
|
|
64
|
-
"@kosdev-code/kos-cms-sdk": "~2.
|
|
61
|
+
"@kosdev-code/kos-ui-sdk": "~2.1.0",
|
|
62
|
+
"@kosdev-code/kos-dispense-sdk": "~2.1.0",
|
|
63
|
+
"@kosdev-code/kos-freestyle-sdk": "~2.1.0",
|
|
64
|
+
"@kosdev-code/kos-cms-sdk": "~2.1.0",
|
|
65
|
+
"@kosdev-code/kos-ui-plugin": "~2.1.0",
|
|
65
66
|
"@use-gesture/react": "^10.3.0",
|
|
66
67
|
"@react-spring/web": "^9.7.3",
|
|
67
68
|
"react-i18next": "^13.5.0",
|
|
@@ -70,8 +71,9 @@ async function presetGenerator(tree, options) {
|
|
|
70
71
|
"i18next-browser-languagedetector": "^7.2.0",
|
|
71
72
|
"i18next-http-backend": "^2.4.2",
|
|
72
73
|
"reflect-metadata": "^0.2.1",
|
|
74
|
+
zod: "^3.25.76",
|
|
73
75
|
}, {
|
|
74
|
-
"@kosdev-code/kos-nx-plugin": "~2.
|
|
76
|
+
"@kosdev-code/kos-nx-plugin": "~2.1.0",
|
|
75
77
|
"@types/node": "^18.16.9",
|
|
76
78
|
archiver: "^5.3.1",
|
|
77
79
|
"openapi-typescript": "^7.6.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/preset/generator.ts"],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AAO,EAAE,KAAK;QACd,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,eAAM,CAAC,MAAM;QACrB,SAAS,EAAE,kBAAkB;KAC9B,CAAC,CAAC;IACH,MAAM,qBAAqB,GAAG,IAAA,iCAAwB,EACpD,IAAI,EACJ,kBAAkB,CACnB,CAAC;IAEF,MAAM,SAAS,GAAG,GAAG,UAAU,CAAC,YAAY,KAAK,CAAC;IAClD,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IAE5C,8BAA8B;IAC9B,MAAM,IAAA,qBAAa,EAAC,IAAI,EAAE;QACxB,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,MAAM;QACjB,MAAM,EAAE,eAAM,CAAC,MAAM;QACrB,cAAc,EAAE,MAAM;QACtB,IAAI,EAAE,GAAG,SAAS,EAAE;QACpB,KAAK,EAAE,iBAAiB;QACxB,OAAO,EAAE,IAAI;QACb,wBAAwB,EAAE,aAAa;KACxC,CAAC,CAAC;IAEH,2CAA2C;IAC3C,IAAA,qCAA4B,EAC1B,IAAI,EACJ;QACE,yBAAyB,EAAE,QAAQ;QACnC,+BAA+B,EAAE,QAAQ;QACzC,gCAAgC,EAAE,QAAQ;QAC1C,0BAA0B,EAAE,QAAQ;QACpC,oBAAoB,EAAE,SAAS;QAC/B,mBAAmB,EAAE,QAAQ;QAC7B,eAAe,EAAE,SAAS;QAC1B,8BAA8B,EAAE,SAAS;QACzC,OAAO,EAAE,SAAS;QAClB,kCAAkC,EAAE,QAAQ;QAC5C,sBAAsB,EAAE,QAAQ;QAChC,kBAAkB,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/kos-nx-plugin/src/generators/preset/generator.ts"],"names":[],"mappings":";;;AAAA,uCAQoB;AAEpB,yBAA0B;AAE1B,+BAAmE;AACnE,qCAA4D;AAE5D,uCAAoC;AACpC,+BAA4B;AAC5B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,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,EAAE,0BAA0B;YAC/B,YAAY,EAAE,+CAA+C;YAC7D,YAAY,EAAE,wCAAwC;YACtD,WAAW,EAAE,uCAAuC;YACpD,GAAG,EAAE,0BAA0B;YAC/B,KAAK,EAAE,4BAA4B;YACnC,GAAG,IAAI,CAAC,OAAO;SAChB,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACxB,IAAA,4BAAmB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAhTD,0CAgTC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { execSync } from "child_process";
|
|
3
|
+
import { readFileSync, existsSync } from "fs";
|
|
3
4
|
const [, , sdk, ddk] = process.argv;
|
|
4
5
|
const kos = [
|
|
5
6
|
|
|
6
7
|
"@kosdev-code/kos-dispense-sdk",
|
|
7
|
-
|
|
8
|
+
"@kosdev-code/kos-ui-plugin",
|
|
8
9
|
"@kosdev-code/kos-ui-sdk",
|
|
9
10
|
|
|
10
11
|
]
|
|
@@ -23,22 +24,38 @@ const cms = [
|
|
|
23
24
|
.map((dep) => `${dep}@${sdk}`)
|
|
24
25
|
.join(" ");
|
|
25
26
|
|
|
26
|
-
const
|
|
27
|
+
const ddkPackages = [
|
|
27
28
|
"@kosdev-code/kos-ddk",
|
|
28
29
|
"@kosdev-code/kos-ddk-components",
|
|
29
30
|
"@kosdev-code/kos-ddk-models",
|
|
30
31
|
"@kosdev-code/kos-ddk-model-components",
|
|
31
32
|
"@kosdev-code/kos-ddk-styles",
|
|
32
|
-
"@kosdev-code/kos-ui-plugin"
|
|
33
|
-
]
|
|
33
|
+
"@kosdev-code/kos-ui-plugin-dev"
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const ddkDeps = ddkPackages
|
|
34
37
|
.map((dep) => `${dep}@${ddk}`)
|
|
35
38
|
.join(" ");
|
|
36
39
|
|
|
40
|
+
// Check if package.json exists and contains any DDK dependencies
|
|
41
|
+
let hasDdkDeps = false;
|
|
42
|
+
if (existsSync("package.json")) {
|
|
43
|
+
const packageJson = JSON.parse(readFileSync("package.json", "utf8"));
|
|
44
|
+
const allDeps = {
|
|
45
|
+
...packageJson.dependencies,
|
|
46
|
+
...packageJson.devDependencies,
|
|
47
|
+
...packageJson.peerDependencies
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
hasDdkDeps = ddkPackages.some(dep => allDeps[dep]);
|
|
51
|
+
}
|
|
52
|
+
|
|
37
53
|
const flags = [
|
|
38
54
|
"--loglevel error",
|
|
39
55
|
"--no-progress",
|
|
40
56
|
"--no-audit",
|
|
41
57
|
"--no-fund",
|
|
58
|
+
"--save-prefix='~'",
|
|
42
59
|
].join(" ");
|
|
43
60
|
console.log(chalk.green("Updating dependencies..."));
|
|
44
61
|
console.log(chalk.green("Updating kos dependencies..."));
|
|
@@ -56,10 +73,14 @@ execSync(`npm i ${cms} --save ${flags}`, {
|
|
|
56
73
|
stdio: "inherit",
|
|
57
74
|
});
|
|
58
75
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
if (hasDdkDeps) {
|
|
77
|
+
console.log(chalk.green("Updating ddk dependencies..."));
|
|
78
|
+
execSync(`npm i ${ddkDeps} --save ${flags}`, {
|
|
79
|
+
stdio: "inherit",
|
|
80
|
+
});
|
|
81
|
+
} else {
|
|
82
|
+
console.log(chalk.yellow("Skipping DDK dependencies - none found in package.json"));
|
|
83
|
+
}
|
|
63
84
|
|
|
64
85
|
console.log(chalk.green("Updating kos-ui-cli..."));
|
|
65
86
|
execSync(`npm i -g @kosdev-code/kos-ui-cli@${sdk} ${flags}`, {
|