@kosdev-code/kos-nx-plugin 2.1.26 → 2.1.28

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.
Files changed (39) hide show
  1. package/migrations.json +5 -0
  2. package/package.json +2 -2
  3. package/src/migrations/dev-server-support/coordinators/migration-analyzer.d.ts +13 -0
  4. package/src/migrations/dev-server-support/coordinators/migration-analyzer.d.ts.map +1 -0
  5. package/src/migrations/dev-server-support/coordinators/migration-analyzer.js +53 -0
  6. package/src/migrations/dev-server-support/coordinators/migration-analyzer.js.map +1 -0
  7. package/src/migrations/dev-server-support/coordinators/migration-executor.d.ts +13 -0
  8. package/src/migrations/dev-server-support/coordinators/migration-executor.d.ts.map +1 -0
  9. package/src/migrations/dev-server-support/coordinators/migration-executor.js +239 -0
  10. package/src/migrations/dev-server-support/coordinators/migration-executor.js.map +1 -0
  11. package/src/migrations/dev-server-support/coordinators/migration-reporter.d.ts +16 -0
  12. package/src/migrations/dev-server-support/coordinators/migration-reporter.d.ts.map +1 -0
  13. package/src/migrations/dev-server-support/coordinators/migration-reporter.js +49 -0
  14. package/src/migrations/dev-server-support/coordinators/migration-reporter.js.map +1 -0
  15. package/src/migrations/dev-server-support/helpers/config-updater.d.ts +24 -0
  16. package/src/migrations/dev-server-support/helpers/config-updater.d.ts.map +1 -0
  17. package/src/migrations/dev-server-support/helpers/config-updater.js +54 -0
  18. package/src/migrations/dev-server-support/helpers/config-updater.js.map +1 -0
  19. package/src/migrations/dev-server-support/helpers/port-allocator.d.ts +37 -0
  20. package/src/migrations/dev-server-support/helpers/port-allocator.d.ts.map +1 -0
  21. package/src/migrations/dev-server-support/helpers/port-allocator.js +49 -0
  22. package/src/migrations/dev-server-support/helpers/port-allocator.js.map +1 -0
  23. package/src/migrations/dev-server-support/helpers/project-analyzer.d.ts +74 -0
  24. package/src/migrations/dev-server-support/helpers/project-analyzer.d.ts.map +1 -0
  25. package/src/migrations/dev-server-support/helpers/project-analyzer.js +109 -0
  26. package/src/migrations/dev-server-support/helpers/project-analyzer.js.map +1 -0
  27. package/src/migrations/dev-server-support/helpers/webpack-updater.d.ts +48 -0
  28. package/src/migrations/dev-server-support/helpers/webpack-updater.d.ts.map +1 -0
  29. package/src/migrations/dev-server-support/helpers/webpack-updater.js +144 -0
  30. package/src/migrations/dev-server-support/helpers/webpack-updater.js.map +1 -0
  31. package/src/migrations/dev-server-support/migrate.d.ts +57 -0
  32. package/src/migrations/dev-server-support/migrate.d.ts.map +1 -0
  33. package/src/migrations/dev-server-support/migrate.js +68 -0
  34. package/src/migrations/dev-server-support/migrate.js.map +1 -0
  35. package/src/migrations/dev-server-support/types.d.ts +39 -0
  36. package/src/migrations/dev-server-support/types.d.ts.map +1 -0
  37. package/src/migrations/dev-server-support/types.js +6 -0
  38. package/src/migrations/dev-server-support/types.js.map +1 -0
  39. package/src/generators/preset/tools/tools/scripts/generate-api-types-split.mjs.template +0 -403
package/migrations.json CHANGED
@@ -75,6 +75,11 @@
75
75
  "version": "2.0.0",
76
76
  "description": "Migration for v2.0.0",
77
77
  "implementation": "./src/migrations/update-sdk-2.0/update"
78
+ },
79
+ "dev-server-support": {
80
+ "version": "2.1.28",
81
+ "description": "Adds kosui dev server support to .kos.json, webpack configs, and model projects",
82
+ "implementation": "./src/migrations/dev-server-support/migrate"
78
83
  }
79
84
  },
80
85
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-nx-plugin",
3
- "version": "2.1.26",
3
+ "version": "2.1.28",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "publishConfig": {
@@ -19,7 +19,7 @@
19
19
  "main": "./src/index.js",
20
20
  "kos": {
21
21
  "build": {
22
- "gitHash": "5af05d3d902c4ddbee74f34723b5acd86dfbdeb7"
22
+ "gitHash": "de3ec24ed2fd4a39115ae0c10eeb3876aedb2c22"
23
23
  }
24
24
  }
25
25
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * (C) Copyright 2025, TCCC, All rights reserved.
3
+ */
4
+ import { Tree } from "@nx/devkit";
5
+ import type { MigrationRequirements } from "../types";
6
+ /**
7
+ * Zone 2: Migration analysis coordinator
8
+ */
9
+ /**
10
+ * Analyzes the workspace to determine what migrations are needed.
11
+ */
12
+ export declare function analyzeMigrationRequirements(tree: Tree): MigrationRequirements;
13
+ //# sourceMappingURL=migration-analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-analyzer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/coordinators/migration-analyzer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAyB,IAAI,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,KAAK,EAAgB,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEpE;;GAEG;AAEH;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,GACT,qBAAqB,CAmBvB"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * (C) Copyright 2025, TCCC, All rights reserved.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.analyzeMigrationRequirements = void 0;
7
+ const devkit_1 = require("@nx/devkit");
8
+ const kos_config_helpers_1 = require("../../../utils/kos-config-helpers");
9
+ const project_analyzer_1 = require("../helpers/project-analyzer");
10
+ /**
11
+ * Zone 2: Migration analysis coordinator
12
+ */
13
+ /**
14
+ * Analyzes the workspace to determine what migrations are needed.
15
+ */
16
+ function analyzeMigrationRequirements(tree) {
17
+ const projects = (0, devkit_1.getProjects)(tree);
18
+ // Check if root config needs migration
19
+ const needsRootConfig = determineIfRootConfigNeedsMigration(tree);
20
+ // Categorize all projects
21
+ const categorized = (0, project_analyzer_1.categorizeProjects)(tree, projects);
22
+ // Get workspace name
23
+ const workspaceName = determineWorkspaceName(tree);
24
+ return {
25
+ needsRootConfig,
26
+ uiProjects: categorized.uiProjects,
27
+ pluginProjects: categorized.pluginProjects,
28
+ modelProjects: categorized.modelProjects,
29
+ workspaceName,
30
+ };
31
+ }
32
+ exports.analyzeMigrationRequirements = analyzeMigrationRequirements;
33
+ /**
34
+ * Determines if root .kos.json needs development configuration.
35
+ */
36
+ function determineIfRootConfigNeedsMigration(tree) {
37
+ if (!tree.exists(".kos.json")) {
38
+ return false;
39
+ }
40
+ const rootConfig = (0, devkit_1.readJson)(tree, ".kos.json");
41
+ return !(0, kos_config_helpers_1.hasDevelopmentConfig)(rootConfig);
42
+ }
43
+ /**
44
+ * Determines workspace name from package.json or uses default.
45
+ */
46
+ function determineWorkspaceName(tree) {
47
+ if (tree.exists("package.json")) {
48
+ const packageJson = (0, devkit_1.readJson)(tree, "package.json");
49
+ return packageJson.name || "kos-workspace";
50
+ }
51
+ return "kos-workspace";
52
+ }
53
+ //# sourceMappingURL=migration-analyzer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-analyzer.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/coordinators/migration-analyzer.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAAyD;AACzD,0EAAyE;AACzE,kEAAiE;AAGjE;;GAEG;AAEH;;GAEG;AACH,SAAgB,4BAA4B,CAC1C,IAAU;IAEV,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAEnC,uCAAuC;IACvC,MAAM,eAAe,GAAG,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAElE,0BAA0B;IAC1B,MAAM,WAAW,GAAG,IAAA,qCAAkB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEvD,qBAAqB;IACrB,MAAM,aAAa,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAEnD,OAAO;QACL,eAAe;QACf,UAAU,EAAE,WAAW,CAAC,UAAU;QAClC,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,aAAa,EAAE,WAAW,CAAC,aAAa;QACxC,aAAa;KACd,CAAC;AACJ,CAAC;AArBD,oEAqBC;AAED;;GAEG;AACH,SAAS,mCAAmC,CAAC,IAAU;IACrD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAiB,IAAA,iBAAQ,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAA,yCAAoB,EAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,IAAU;IACxC,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACnD,OAAO,WAAW,CAAC,IAAI,IAAI,eAAe,CAAC;IAC7C,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * (C) Copyright 2025, TCCC, All rights reserved.
3
+ */
4
+ import { Tree } from "@nx/devkit";
5
+ import type { MigrationRequirements, MigrationResults } from "../types";
6
+ /**
7
+ * Zone 2: Migration execution coordinator
8
+ */
9
+ /**
10
+ * Executes all migration updates based on requirements.
11
+ */
12
+ export declare function executeMigrationPlan(tree: Tree, requirements: MigrationRequirements): MigrationResults;
13
+ //# sourceMappingURL=migration-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-executor.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/coordinators/migration-executor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAY,IAAI,EAAc,MAAM,YAAY,CAAC;AAiBxD,OAAO,KAAK,EAGV,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB;;GAEG;AAEH;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,qBAAqB,GAClC,gBAAgB,CAkDlB"}
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+ /**
3
+ * (C) Copyright 2025, TCCC, All rights reserved.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.executeMigrationPlan = void 0;
7
+ const devkit_1 = require("@nx/devkit");
8
+ const config_updater_1 = require("../helpers/config-updater");
9
+ const port_allocator_1 = require("../helpers/port-allocator");
10
+ const project_analyzer_1 = require("../helpers/project-analyzer");
11
+ const webpack_updater_1 = require("../helpers/webpack-updater");
12
+ /**
13
+ * Zone 2: Migration execution coordinator
14
+ */
15
+ /**
16
+ * Executes all migration updates based on requirements.
17
+ */
18
+ function executeMigrationPlan(tree, requirements) {
19
+ const results = {
20
+ rootConfigUpdated: false,
21
+ pluginConfigsUpdated: 0,
22
+ uiConfigsUpdated: 0,
23
+ pluginWebpackUpdated: 0,
24
+ uiWebpackUpdated: 0,
25
+ modelProjectsUpdated: 0,
26
+ totalChanges: 0,
27
+ };
28
+ // Step 1: Migrate root configuration
29
+ if (requirements.needsRootConfig) {
30
+ results.rootConfigUpdated = migrateRootConfiguration(tree, requirements);
31
+ if (results.rootConfigUpdated)
32
+ results.totalChanges++;
33
+ }
34
+ // Step 2: Migrate plugin .kos.json files
35
+ results.pluginConfigsUpdated = migratePluginConfigurations(tree, requirements.pluginProjects);
36
+ results.totalChanges += results.pluginConfigsUpdated;
37
+ // Step 3: Migrate UI .kos.json files
38
+ results.uiConfigsUpdated = migrateUiConfigurations(tree, requirements.uiProjects);
39
+ results.totalChanges += results.uiConfigsUpdated;
40
+ // Step 4: Migrate plugin webpack configs
41
+ results.pluginWebpackUpdated = migratePluginWebpackConfigs(tree, requirements.pluginProjects);
42
+ results.totalChanges += results.pluginWebpackUpdated;
43
+ // Step 5: Migrate UI webpack configs
44
+ results.uiWebpackUpdated = migrateUiWebpackConfigs(tree, requirements);
45
+ results.totalChanges += results.uiWebpackUpdated;
46
+ // Step 6: Migrate model project.json files
47
+ results.modelProjectsUpdated = migrateModelProjects(tree, requirements.modelProjects);
48
+ results.totalChanges += results.modelProjectsUpdated;
49
+ return results;
50
+ }
51
+ exports.executeMigrationPlan = executeMigrationPlan;
52
+ /**
53
+ * Migrates root .kos.json to add development configuration.
54
+ */
55
+ function migrateRootConfiguration(tree, requirements) {
56
+ const rootConfig = (0, devkit_1.readJson)(tree, ".kos.json");
57
+ // Create host configurations
58
+ const hosts = createHostConfigurations(requirements.uiProjects, requirements.pluginProjects);
59
+ // Create port ranges
60
+ const portRanges = createPortRanges(hosts);
61
+ // Find default projects
62
+ const defaults = (0, project_analyzer_1.findDefaultProjects)(requirements);
63
+ // Update root config
64
+ const updatedConfig = {
65
+ ...rootConfig,
66
+ type: "root",
67
+ generator: {
68
+ defaults: {
69
+ model: defaults.defaultModel,
70
+ "model-component": defaults.defaultModelComponent,
71
+ ui: defaults.defaultUi,
72
+ },
73
+ },
74
+ development: {
75
+ hosts,
76
+ portRanges,
77
+ logDir: `/tmp/${requirements.workspaceName.replace(/^@[^/]+\//, "")}-logs`,
78
+ },
79
+ };
80
+ (0, config_updater_1.writeJsonConfig)(tree, ".kos.json", updatedConfig);
81
+ return true;
82
+ }
83
+ /**
84
+ * Creates host configurations from UI projects.
85
+ */
86
+ function createHostConfigurations(uiProjects, pluginProjects) {
87
+ const hosts = uiProjects.map((ui, index) => {
88
+ const port = (0, port_allocator_1.calculateHostPort)(index);
89
+ const pluginContext = (0, project_analyzer_1.derivePluginContext)(ui);
90
+ const type = (0, project_analyzer_1.deriveUiType)(ui.kosJson);
91
+ return {
92
+ name: ui.name,
93
+ project: ui.name,
94
+ port,
95
+ type,
96
+ pluginContext,
97
+ plugins: [],
98
+ };
99
+ });
100
+ // Assign plugins to first available host
101
+ if (hosts.length > 0 && pluginProjects.length > 0) {
102
+ const primaryHost = hosts[0];
103
+ const plugins = (0, port_allocator_1.allocatePluginPorts)(primaryHost.port + 1, pluginProjects);
104
+ primaryHost.plugins = plugins;
105
+ }
106
+ return hosts;
107
+ }
108
+ /**
109
+ * Creates port range configurations for all hosts.
110
+ */
111
+ function createPortRanges(hosts) {
112
+ const ranges = {};
113
+ hosts.forEach((host) => {
114
+ const maxPluginPort = (0, port_allocator_1.findMaxPluginPort)(host.port, host.plugins);
115
+ ranges[host.name] = (0, port_allocator_1.createPortRange)(host.port, host.plugins.length);
116
+ });
117
+ return ranges;
118
+ }
119
+ /**
120
+ * Migrates plugin .kos.json files.
121
+ */
122
+ function migratePluginConfigurations(tree, pluginProjects) {
123
+ let updated = 0;
124
+ pluginProjects.forEach((plugin) => {
125
+ const kosJsonPath = `${plugin.root}/.kos.json`;
126
+ if (!tree.exists(kosJsonPath))
127
+ return;
128
+ const kosJson = (0, devkit_1.readJson)(tree, kosJsonPath);
129
+ if (!kosJson.test?.plugin?.context) {
130
+ kosJson.test = kosJson.test || {};
131
+ kosJson.test.plugin = kosJson.test.plugin || {};
132
+ // Derive context from root config or project name
133
+ let pluginContext = plugin.name;
134
+ if (tree.exists(".kos.json")) {
135
+ const rootConfig = (0, devkit_1.readJson)(tree, ".kos.json");
136
+ if (rootConfig.development?.hosts) {
137
+ const host = rootConfig.development.hosts.find((h) => h.plugins?.some((p) => p.project === plugin.name));
138
+ if (host) {
139
+ pluginContext = host.pluginContext;
140
+ }
141
+ }
142
+ }
143
+ kosJson.test.plugin.context = pluginContext;
144
+ (0, config_updater_1.writeJsonConfig)(tree, kosJsonPath, kosJson);
145
+ updated++;
146
+ }
147
+ });
148
+ return updated;
149
+ }
150
+ /**
151
+ * Migrates UI .kos.json files.
152
+ */
153
+ function migrateUiConfigurations(tree, uiProjects) {
154
+ let updated = 0;
155
+ uiProjects.forEach((ui) => {
156
+ const kosJsonPath = `${ui.root}/.kos.json`;
157
+ if (!tree.exists(kosJsonPath))
158
+ return;
159
+ const kosJson = (0, devkit_1.readJson)(tree, kosJsonPath);
160
+ if (!kosJson.test?.plugin?.context) {
161
+ kosJson.test = kosJson.test || {};
162
+ kosJson.test.plugin = kosJson.test.plugin || {};
163
+ kosJson.test.plugin.context = ui.name;
164
+ (0, config_updater_1.writeJsonConfig)(tree, kosJsonPath, kosJson);
165
+ updated++;
166
+ }
167
+ });
168
+ return updated;
169
+ }
170
+ /**
171
+ * Migrates plugin webpack configs.
172
+ */
173
+ function migratePluginWebpackConfigs(tree, pluginProjects) {
174
+ let updated = 0;
175
+ pluginProjects.forEach((plugin) => {
176
+ const webpackPath = `${plugin.root}/webpack.config.ts`;
177
+ if (tree.exists(webpackPath)) {
178
+ if ((0, webpack_updater_1.updatePluginWebpackConfig)(tree, webpackPath)) {
179
+ updated++;
180
+ }
181
+ }
182
+ });
183
+ return updated;
184
+ }
185
+ /**
186
+ * Migrates UI webpack configs for plugin-enabled UIs.
187
+ */
188
+ function migrateUiWebpackConfigs(tree, requirements) {
189
+ let updated = 0;
190
+ requirements.uiProjects.forEach((ui) => {
191
+ // Check if this UI has plugins
192
+ let hasPlugins = false;
193
+ if (tree.exists(".kos.json")) {
194
+ const rootConfig = (0, devkit_1.readJson)(tree, ".kos.json");
195
+ if (rootConfig.development?.hosts) {
196
+ const host = rootConfig.development.hosts.find((h) => h.name === ui.name);
197
+ if (host && host.plugins?.length > 0) {
198
+ hasPlugins = true;
199
+ }
200
+ }
201
+ }
202
+ if (!hasPlugins)
203
+ return; // Skip UIs without plugins
204
+ const webpackPath = `${ui.root}/webpack.config.ts`;
205
+ if (tree.exists(webpackPath)) {
206
+ if ((0, webpack_updater_1.updateUiWebpackConfig)(tree, webpackPath)) {
207
+ updated++;
208
+ }
209
+ }
210
+ });
211
+ return updated;
212
+ }
213
+ /**
214
+ * Migrates model project.json files to add api target.
215
+ */
216
+ function migrateModelProjects(tree, modelProjects) {
217
+ let updated = 0;
218
+ modelProjects.forEach((model) => {
219
+ const projectJsonPath = `${model.root}/project.json`;
220
+ if (!tree.exists(projectJsonPath))
221
+ return;
222
+ (0, devkit_1.updateJson)(tree, projectJsonPath, (json) => {
223
+ if (!json.targets?.api) {
224
+ json.targets = json.targets || {};
225
+ json.targets.api = {
226
+ command: `kosui api:generate --project=${model.name}`,
227
+ options: {
228
+ host: "http://127.0.0.1:8081",
229
+ defaultVersion: "snapshot",
230
+ },
231
+ };
232
+ updated++;
233
+ }
234
+ return json;
235
+ });
236
+ });
237
+ return updated;
238
+ }
239
+ //# sourceMappingURL=migration-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-executor.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/coordinators/migration-executor.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAAwD;AACxD,8DAA4D;AAC5D,8DAKmC;AACnC,kEAIqC;AACrC,gEAGoC;AAQpC;;GAEG;AAEH;;GAEG;AACH,SAAgB,oBAAoB,CAClC,IAAU,EACV,YAAmC;IAEnC,MAAM,OAAO,GAAqB;QAChC,iBAAiB,EAAE,KAAK;QACxB,oBAAoB,EAAE,CAAC;QACvB,gBAAgB,EAAE,CAAC;QACnB,oBAAoB,EAAE,CAAC;QACvB,gBAAgB,EAAE,CAAC;QACnB,oBAAoB,EAAE,CAAC;QACvB,YAAY,EAAE,CAAC;KAChB,CAAC;IAEF,qCAAqC;IACrC,IAAI,YAAY,CAAC,eAAe,EAAE,CAAC;QACjC,OAAO,CAAC,iBAAiB,GAAG,wBAAwB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACzE,IAAI,OAAO,CAAC,iBAAiB;YAAE,OAAO,CAAC,YAAY,EAAE,CAAC;IACxD,CAAC;IAED,yCAAyC;IACzC,OAAO,CAAC,oBAAoB,GAAG,2BAA2B,CACxD,IAAI,EACJ,YAAY,CAAC,cAAc,CAC5B,CAAC;IACF,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAErD,qCAAqC;IACrC,OAAO,CAAC,gBAAgB,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1,16 @@
1
+ /**
2
+ * (C) Copyright 2025, TCCC, All rights reserved.
3
+ */
4
+ import type { MigrationRequirements, MigrationResults } from "../types";
5
+ /**
6
+ * Zone 2: Migration reporting coordinator
7
+ */
8
+ /**
9
+ * Announces the start of migration.
10
+ */
11
+ export declare function announceMigrationStart(): void;
12
+ /**
13
+ * Reports the completion of migration with detailed results.
14
+ */
15
+ export declare function reportMigrationCompletion(requirements: MigrationRequirements, results: MigrationResults): void;
16
+ //# sourceMappingURL=migration-reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-reporter.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/coordinators/migration-reporter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAExE;;GAEG;AAEH;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,qBAAqB,EACnC,OAAO,EAAE,gBAAgB,GACxB,IAAI,CA+CN"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /**
3
+ * (C) Copyright 2025, TCCC, All rights reserved.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.reportMigrationCompletion = exports.announceMigrationStart = void 0;
7
+ const devkit_1 = require("@nx/devkit");
8
+ /**
9
+ * Zone 2: Migration reporting coordinator
10
+ */
11
+ /**
12
+ * Announces the start of migration.
13
+ */
14
+ function announceMigrationStart() {
15
+ devkit_1.logger.info("Running dev-server-support migration...");
16
+ }
17
+ exports.announceMigrationStart = announceMigrationStart;
18
+ /**
19
+ * Reports the completion of migration with detailed results.
20
+ */
21
+ function reportMigrationCompletion(requirements, results) {
22
+ if (results.totalChanges === 0) {
23
+ devkit_1.logger.info("No migrations needed - workspace already up to date.");
24
+ return;
25
+ }
26
+ if (results.rootConfigUpdated) {
27
+ const hostCount = requirements.uiProjects.length;
28
+ const pluginCount = requirements.pluginProjects.length;
29
+ devkit_1.logger.info(`✓ Added development configuration with ${hostCount} host(s) and ${pluginCount} plugin(s)`);
30
+ }
31
+ if (results.pluginConfigsUpdated > 0) {
32
+ devkit_1.logger.info(`✓ Updated ${results.pluginConfigsUpdated} plugin .kos.json file(s) with test.plugin.context`);
33
+ }
34
+ if (results.uiConfigsUpdated > 0) {
35
+ devkit_1.logger.info(`✓ Updated ${results.uiConfigsUpdated} UI .kos.json file(s) with test.plugin.context`);
36
+ }
37
+ if (results.pluginWebpackUpdated > 0) {
38
+ devkit_1.logger.info(`✓ Updated ${results.pluginWebpackUpdated} plugin webpack.config.ts file(s) with dev server support`);
39
+ }
40
+ if (results.uiWebpackUpdated > 0) {
41
+ devkit_1.logger.info(`✓ Updated ${results.uiWebpackUpdated} UI webpack.config.ts file(s) with plugin dev aggregator`);
42
+ }
43
+ if (results.modelProjectsUpdated > 0) {
44
+ devkit_1.logger.info(`✓ Added api target to ${results.modelProjectsUpdated} model project.json file(s)`);
45
+ }
46
+ devkit_1.logger.info(`✅ Dev server support migration completed. Updated ${results.totalChanges} file(s).`);
47
+ }
48
+ exports.reportMigrationCompletion = reportMigrationCompletion;
49
+ //# sourceMappingURL=migration-reporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-reporter.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/coordinators/migration-reporter.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAAoC;AAGpC;;GAEG;AAEH;;GAEG;AACH,SAAgB,sBAAsB;IACpC,eAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;AACzD,CAAC;AAFD,wDAEC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CACvC,YAAmC,EACnC,OAAyB;IAEzB,IAAI,OAAO,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;QAC/B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/devkit";
5
+ /**
6
+ * Zone 3: Configuration file update utilities
7
+ */
8
+ /**
9
+ * Writes a JSON configuration file with consistent formatting.
10
+ */
11
+ export declare function writeJsonConfig(tree: Tree, path: string, content: object): void;
12
+ /**
13
+ * Reads and parses a JSON file, returning null if file doesn't exist.
14
+ */
15
+ export declare function readJsonConfigSafe<T>(tree: Tree, path: string): T | null;
16
+ /**
17
+ * Checks if a .kos.json file exists for a project.
18
+ */
19
+ export declare function hasKosConfig(tree: Tree, projectRoot: string): boolean;
20
+ /**
21
+ * Updates a text file with string replacement.
22
+ */
23
+ export declare function updateTextFile(tree: Tree, path: string, oldString: string, newString: string): boolean;
24
+ //# sourceMappingURL=config-updater.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-updater.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/helpers/config-updater.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;GAEG;AAEH;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAWxE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAErE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAaT"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * (C) Copyright 2025, TCCC, All rights reserved.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.updateTextFile = exports.hasKosConfig = exports.readJsonConfigSafe = exports.writeJsonConfig = void 0;
7
+ /**
8
+ * Zone 3: Configuration file update utilities
9
+ */
10
+ /**
11
+ * Writes a JSON configuration file with consistent formatting.
12
+ */
13
+ function writeJsonConfig(tree, path, content) {
14
+ tree.write(path, JSON.stringify(content, null, 2) + "\n");
15
+ }
16
+ exports.writeJsonConfig = writeJsonConfig;
17
+ /**
18
+ * Reads and parses a JSON file, returning null if file doesn't exist.
19
+ */
20
+ function readJsonConfigSafe(tree, path) {
21
+ if (!tree.exists(path)) {
22
+ return null;
23
+ }
24
+ const content = tree.read(path, "utf-8");
25
+ if (!content) {
26
+ return null;
27
+ }
28
+ return JSON.parse(content);
29
+ }
30
+ exports.readJsonConfigSafe = readJsonConfigSafe;
31
+ /**
32
+ * Checks if a .kos.json file exists for a project.
33
+ */
34
+ function hasKosConfig(tree, projectRoot) {
35
+ return tree.exists(`${projectRoot}/.kos.json`);
36
+ }
37
+ exports.hasKosConfig = hasKosConfig;
38
+ /**
39
+ * Updates a text file with string replacement.
40
+ */
41
+ function updateTextFile(tree, path, oldString, newString) {
42
+ const content = tree.read(path, "utf-8");
43
+ if (!content) {
44
+ return false;
45
+ }
46
+ if (!content.includes(oldString)) {
47
+ return false;
48
+ }
49
+ const updated = content.replace(oldString, newString);
50
+ tree.write(path, updated);
51
+ return true;
52
+ }
53
+ exports.updateTextFile = updateTextFile;
54
+ //# sourceMappingURL=config-updater.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-updater.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/helpers/config-updater.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH;;GAEG;AAEH;;GAEG;AACH,SAAgB,eAAe,CAC7B,IAAU,EACV,IAAY,EACZ,OAAe;IAEf,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CA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3: Port allocation utilities
6
+ */
7
+ export interface PortRange {
8
+ start: number;
9
+ next: number;
10
+ }
11
+ export interface PluginPortAssignment {
12
+ project: string;
13
+ port: number;
14
+ alias: string;
15
+ enabled: boolean;
16
+ }
17
+ /**
18
+ * Calculates the starting port for a host based on index.
19
+ */
20
+ export declare function calculateHostPort(hostIndex: number): number;
21
+ /**
22
+ * Allocates sequential ports for plugins.
23
+ */
24
+ export declare function allocatePluginPorts(startPort: number, pluginProjects: Array<{
25
+ name: string;
26
+ }>): PluginPortAssignment[];
27
+ /**
28
+ * Creates a port range configuration for a host.
29
+ */
30
+ export declare function createPortRange(startPort: number, pluginCount: number): PortRange;
31
+ /**
32
+ * Finds the maximum plugin port for a host configuration.
33
+ */
34
+ export declare function findMaxPluginPort(hostPort: number, plugins: Array<{
35
+ port: number;
36
+ }>): number;
37
+ //# sourceMappingURL=port-allocator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"port-allocator.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/helpers/port-allocator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AAEH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GACtC,oBAAoB,EAAE,CAcxB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,SAAS,CAKX;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAC/B,MAAM,CAER"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /**
3
+ * (C) Copyright 2025, TCCC, All rights reserved.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.findMaxPluginPort = exports.createPortRange = exports.allocatePluginPorts = exports.calculateHostPort = void 0;
7
+ /**
8
+ * Calculates the starting port for a host based on index.
9
+ */
10
+ function calculateHostPort(hostIndex) {
11
+ return 4200 + hostIndex * 100;
12
+ }
13
+ exports.calculateHostPort = calculateHostPort;
14
+ /**
15
+ * Allocates sequential ports for plugins.
16
+ */
17
+ function allocatePluginPorts(startPort, pluginProjects) {
18
+ let currentPort = startPort;
19
+ return pluginProjects.map((plugin) => {
20
+ const pluginAlias = plugin.name.replace(/-plugin$/, "");
21
+ const assignment = {
22
+ project: plugin.name,
23
+ port: currentPort,
24
+ alias: pluginAlias,
25
+ enabled: true,
26
+ };
27
+ currentPort++;
28
+ return assignment;
29
+ });
30
+ }
31
+ exports.allocatePluginPorts = allocatePluginPorts;
32
+ /**
33
+ * Creates a port range configuration for a host.
34
+ */
35
+ function createPortRange(startPort, pluginCount) {
36
+ return {
37
+ start: startPort,
38
+ next: startPort + pluginCount + 1,
39
+ };
40
+ }
41
+ exports.createPortRange = createPortRange;
42
+ /**
43
+ * Finds the maximum plugin port for a host configuration.
44
+ */
45
+ function findMaxPluginPort(hostPort, plugins) {
46
+ return plugins.reduce((max, plugin) => Math.max(max, plugin.port), hostPort);
47
+ }
48
+ exports.findMaxPluginPort = findMaxPluginPort;
49
+ //# sourceMappingURL=port-allocator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"port-allocator.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/kos-nx-plugin/src/migrations/dev-server-support/helpers/port-allocator.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAkBH;;GAEG;AACH,SAAgB,iBAAiB,CAAC,SAAiB;IACjD,OAAO,IAAI,GAAG,SAAS,GAAG,GAAG,CAAC;AAChC,CAAC;AAFD,8CAEC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,SAAiB,EACjB,cAAuC;IAEvC,IAAI,WAAW,GAAG,SAAS,CAAC;IAE5B,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACnC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACxD,MAAM,UAAU,GAAG;YACjB,OAAO,EAAE,MAAM,CAAC,IAAI;YACpB,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,IAAI;SACd,CAAC;QACF,WAAW,EAAE,CAAC;QACd,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,kDAiBC;AAED;;GAEG;AACH,SAAgB,eAAe,CAC7B,SAAiB,EACjB,WAAmB;IAEnB,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,CAAC;KAClC,CAAC;AACJ,CAAC;AARD,0CAQC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,OAAgC;IAEhC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC/E,CAAC;AALD,8CAKC"}