@common-stack/rollup-vite-utils 8.2.4-alpha.0 → 8.2.4-alpha.11
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/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/lib/tools/codegen/generate-resolutions-cli.d.ts +23 -0
- package/lib/tools/codegen/generateResolutions.cjs +342 -0
- package/lib/tools/codegen/generateResolutions.cjs.map +1 -0
- package/lib/tools/codegen/generateResolutions.d.ts +92 -0
- package/lib/tools/codegen/generateResolutions.js +342 -0
- package/lib/tools/codegen/generateResolutions.js.map +1 -0
- package/lib/tools/codegen/generateResolutions.test.d.ts +1 -0
- package/lib/tools/codegen/index.cjs +2 -2
- package/lib/tools/codegen/index.cjs.map +1 -1
- package/lib/tools/codegen/index.d.ts +1 -0
- package/lib/tools/codegen/index.js +1 -1
- package/lib/tools/codegen/index.js.map +1 -1
- package/lib/utils/utils.cjs +102 -8
- package/lib/utils/utils.cjs.map +1 -1
- package/lib/utils/utils.d.ts +31 -0
- package/lib/utils/utils.js +102 -8
- package/lib/utils/utils.js.map +1 -1
- package/package.json +8 -4
- package/schemas/server-config.schema.json +64 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import fs__default from'fs';import path__default from'path';import {createRequire}from'module';import {getPackageName,resolvePackageJson}from'../../utils/packageUtils.js';/**
|
|
2
|
+
* Generate resolutions for server package.json based on config.json modules
|
|
3
|
+
*
|
|
4
|
+
* This utility reads the config.json file, analyzes dependencies from each module's
|
|
5
|
+
* package.json, and generates the required resolutions to avoid version conflicts
|
|
6
|
+
* in monorepo setups.
|
|
7
|
+
*
|
|
8
|
+
* Can also read from cdecode-config.json to process multiple servers at once.
|
|
9
|
+
*/
|
|
10
|
+
const esmRequire = createRequire(import.meta.url);
|
|
11
|
+
/**
|
|
12
|
+
* Packages that commonly cause version conflicts in monorepos
|
|
13
|
+
* and should be resolved to a single version.
|
|
14
|
+
*
|
|
15
|
+
* Note: react/react-dom are excluded as they are frontend concerns
|
|
16
|
+
* and should be managed at the app level, not in server resolutions.
|
|
17
|
+
*/
|
|
18
|
+
const CONFLICT_PRONE_PACKAGES = [
|
|
19
|
+
'@aws-sdk/client-s3',
|
|
20
|
+
'@aws-sdk/client-sts',
|
|
21
|
+
'@aws-sdk/client-cloudwatch',
|
|
22
|
+
'@aws-sdk/s3-request-presigner',
|
|
23
|
+
'@aws-sdk/client-iam',
|
|
24
|
+
'graphql',
|
|
25
|
+
'inversify',
|
|
26
|
+
'mongoose',
|
|
27
|
+
'moleculer',
|
|
28
|
+
'express',
|
|
29
|
+
'@apollo/server',
|
|
30
|
+
'@apollo/client',
|
|
31
|
+
// Note: react/react-dom intentionally excluded - managed at app level
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Extracts the package name from a module path in config.json
|
|
35
|
+
* E.g., "@adminide-stack/s3-admin-server" from "@adminide-stack/s3-admin-server/lib/module.js"
|
|
36
|
+
*/
|
|
37
|
+
function extractPackageFromConfigModule(modulePath) {
|
|
38
|
+
return getPackageName(modulePath);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Reads and parses the config.json file
|
|
42
|
+
*/
|
|
43
|
+
function readServerConfig(configPath) {
|
|
44
|
+
const configContent = fs__default.readFileSync(configPath, 'utf-8');
|
|
45
|
+
return JSON.parse(configContent);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Resolves a module from config.json to its package.json path
|
|
49
|
+
*/
|
|
50
|
+
function resolveModulePackageJson(moduleName, serverDir, repoRoot) {
|
|
51
|
+
const packageName = extractPackageFromConfigModule(moduleName);
|
|
52
|
+
if (!packageName)
|
|
53
|
+
return null;
|
|
54
|
+
// Try to resolve from the server's node_modules first
|
|
55
|
+
const serverNodeModules = path__default.join(serverDir, 'node_modules', packageName, 'package.json');
|
|
56
|
+
if (fs__default.existsSync(serverNodeModules)) {
|
|
57
|
+
return serverNodeModules;
|
|
58
|
+
}
|
|
59
|
+
// Try from repo root node_modules
|
|
60
|
+
const rootNodeModules = path__default.join(repoRoot, 'node_modules', packageName, 'package.json');
|
|
61
|
+
if (fs__default.existsSync(rootNodeModules)) {
|
|
62
|
+
return rootNodeModules;
|
|
63
|
+
}
|
|
64
|
+
// Try using resolvePackageJson utility
|
|
65
|
+
return resolvePackageJson(packageName, esmRequire, {
|
|
66
|
+
cwd: serverDir,
|
|
67
|
+
repoRoot,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Collects all dependencies from a package.json
|
|
72
|
+
*/
|
|
73
|
+
function collectDependencies(packageJsonPath) {
|
|
74
|
+
try {
|
|
75
|
+
const content = fs__default.readFileSync(packageJsonPath, 'utf-8');
|
|
76
|
+
const pkg = JSON.parse(content);
|
|
77
|
+
return {
|
|
78
|
+
dependencies: pkg.dependencies || {},
|
|
79
|
+
devDependencies: pkg.devDependencies || {},
|
|
80
|
+
peerDependencies: pkg.peerDependencies || {},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.warn(`Failed to read package.json at ${packageJsonPath}:`, error);
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Analyzes all modules from config.json and collects potential conflicts
|
|
90
|
+
*/
|
|
91
|
+
function analyzeModuleDependencies(configPath, serverDir, repoRoot, additionalConflictPackages = []) {
|
|
92
|
+
const config = readServerConfig(configPath);
|
|
93
|
+
const allModules = [...(config.modules || []), ...(config.devModules || []), ...(config.externalModules || [])];
|
|
94
|
+
const conflictPackages = new Set([...CONFLICT_PRONE_PACKAGES, ...additionalConflictPackages]);
|
|
95
|
+
const packageVersions = new Map(); // package -> (module -> version)
|
|
96
|
+
// Collect dependencies from each module
|
|
97
|
+
for (const modulePath of allModules) {
|
|
98
|
+
const packageJsonPath = resolveModulePackageJson(modulePath, serverDir, repoRoot);
|
|
99
|
+
if (!packageJsonPath) {
|
|
100
|
+
console.warn(`Could not resolve package.json for module: ${modulePath}`);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const moduleName = extractPackageFromConfigModule(modulePath) || modulePath;
|
|
104
|
+
const deps = collectDependencies(packageJsonPath);
|
|
105
|
+
const allDeps = {
|
|
106
|
+
...deps.dependencies,
|
|
107
|
+
...deps.peerDependencies,
|
|
108
|
+
};
|
|
109
|
+
// Check each dependency for potential conflicts
|
|
110
|
+
for (const [depName, version] of Object.entries(allDeps)) {
|
|
111
|
+
if (conflictPackages.has(depName) || depName.startsWith('@aws-sdk/')) {
|
|
112
|
+
if (!packageVersions.has(depName)) {
|
|
113
|
+
packageVersions.set(depName, new Map());
|
|
114
|
+
}
|
|
115
|
+
packageVersions.get(depName).set(moduleName, version);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Generate resolutions and identify conflicts
|
|
120
|
+
const resolutions = {};
|
|
121
|
+
const conflicts = [];
|
|
122
|
+
for (const [packageName, moduleVersions] of packageVersions) {
|
|
123
|
+
const versions = Array.from(moduleVersions.entries()).map(([module, version]) => ({
|
|
124
|
+
module,
|
|
125
|
+
version,
|
|
126
|
+
}));
|
|
127
|
+
// Check if there are version conflicts
|
|
128
|
+
const uniqueVersions = new Set(versions.map((v) => v.version));
|
|
129
|
+
if (uniqueVersions.size > 1) {
|
|
130
|
+
conflicts.push({ package: packageName, versions });
|
|
131
|
+
}
|
|
132
|
+
// Pick the highest version as the resolution
|
|
133
|
+
const highestVersion = pickHighestVersion(versions.map((v) => v.version));
|
|
134
|
+
resolutions[packageName] = highestVersion;
|
|
135
|
+
}
|
|
136
|
+
return { resolutions, conflicts };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Picks the highest semver version from an array of versions
|
|
140
|
+
*/
|
|
141
|
+
function pickHighestVersion(versions) {
|
|
142
|
+
// Clean version strings by removing range prefixes
|
|
143
|
+
const cleaned = versions.map((v) => v.replace(/^[\^~>=<]+/, '').replace(/\s.*$/, ''));
|
|
144
|
+
// Sort in descending order (highest first)
|
|
145
|
+
cleaned.sort((a, b) => {
|
|
146
|
+
const partsA = a.split('.').map((n) => parseInt(n, 10) || 0);
|
|
147
|
+
const partsB = b.split('.').map((n) => parseInt(n, 10) || 0);
|
|
148
|
+
// Compare major, minor, patch in order
|
|
149
|
+
for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
|
|
150
|
+
const numA = partsA[i] || 0;
|
|
151
|
+
const numB = partsB[i] || 0;
|
|
152
|
+
if (numB !== numA) {
|
|
153
|
+
return numB - numA; // Descending order (higher version first)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return 0;
|
|
157
|
+
});
|
|
158
|
+
// Return with caret prefix for flexibility
|
|
159
|
+
return `^${cleaned[0]}`;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Updates the server's package.json with the generated resolutions
|
|
163
|
+
*/
|
|
164
|
+
function updateServerPackageJson(serverPackageJsonPath, newResolutions, options = {}) {
|
|
165
|
+
const { dryRun = false, merge = true } = options;
|
|
166
|
+
const content = fs__default.readFileSync(serverPackageJsonPath, 'utf-8');
|
|
167
|
+
const pkg = JSON.parse(content);
|
|
168
|
+
if (merge) {
|
|
169
|
+
pkg.resolutions = {
|
|
170
|
+
...pkg.resolutions,
|
|
171
|
+
...newResolutions,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
pkg.resolutions = newResolutions;
|
|
176
|
+
}
|
|
177
|
+
// Sort resolutions alphabetically
|
|
178
|
+
pkg.resolutions = Object.fromEntries(Object.entries(pkg.resolutions).sort(([a], [b]) => a.localeCompare(b)));
|
|
179
|
+
if (dryRun) {
|
|
180
|
+
console.log('Dry run - would update resolutions to:');
|
|
181
|
+
console.log(JSON.stringify(pkg.resolutions, null, 2));
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
fs__default.writeFileSync(serverPackageJsonPath, JSON.stringify(pkg, null, 4) + '\n');
|
|
185
|
+
console.log(`Updated resolutions in ${serverPackageJsonPath}`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Main function to generate and apply resolutions for a server
|
|
190
|
+
*/
|
|
191
|
+
function generateServerResolutions(serverDir, repoRoot, options = {}) {
|
|
192
|
+
const { configFileName = 'config.json', dryRun = false, additionalConflictPackages = [] } = options;
|
|
193
|
+
const configPath = path__default.join(serverDir, configFileName);
|
|
194
|
+
const packageJsonPath = path__default.join(serverDir, 'package.json');
|
|
195
|
+
if (!fs__default.existsSync(configPath)) {
|
|
196
|
+
throw new Error(`Config file not found: ${configPath}`);
|
|
197
|
+
}
|
|
198
|
+
if (!fs__default.existsSync(packageJsonPath)) {
|
|
199
|
+
throw new Error(`Package.json not found: ${packageJsonPath}`);
|
|
200
|
+
}
|
|
201
|
+
const result = analyzeModuleDependencies(configPath, serverDir, repoRoot, additionalConflictPackages);
|
|
202
|
+
if (result.conflicts.length > 0) {
|
|
203
|
+
console.log('\n⚠️ Version conflicts detected:');
|
|
204
|
+
for (const conflict of result.conflicts) {
|
|
205
|
+
console.log(`\n ${conflict.package}:`);
|
|
206
|
+
for (const { module, version } of conflict.versions) {
|
|
207
|
+
console.log(` - ${module}: ${version}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
console.log('\n📦 Generated resolutions:');
|
|
212
|
+
console.log(JSON.stringify(result.resolutions, null, 2));
|
|
213
|
+
updateServerPackageJson(packageJsonPath, result.resolutions, { dryRun });
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Reads cdecode-config.json and returns the configuration
|
|
218
|
+
*/
|
|
219
|
+
function readCDecodeConfig(repoRoot) {
|
|
220
|
+
const configPath = path__default.join(repoRoot, 'cdecode-config.json');
|
|
221
|
+
if (!fs__default.existsSync(configPath)) {
|
|
222
|
+
throw new Error(`cdecode-config.json not found at ${configPath}`);
|
|
223
|
+
}
|
|
224
|
+
const content = fs__default.readFileSync(configPath, 'utf-8');
|
|
225
|
+
return JSON.parse(content);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Gets server directories from cdecode-config.json
|
|
229
|
+
* Returns both the config.json paths (from servers array) and package.json paths (from updateDependencies)
|
|
230
|
+
*/
|
|
231
|
+
function getServersFromCDecodeConfig(repoRoot, category = 'backend') {
|
|
232
|
+
const cdecodeConfig = readCDecodeConfig(repoRoot);
|
|
233
|
+
const servers = [];
|
|
234
|
+
// Get package paths from updateDependencies
|
|
235
|
+
const packagePaths = cdecodeConfig.updateDependencies?.packagePaths;
|
|
236
|
+
if (packagePaths) {
|
|
237
|
+
const categories = category === 'all' ? ['backend', 'frontend', 'mobile'] : [category];
|
|
238
|
+
for (const cat of categories) {
|
|
239
|
+
const paths = packagePaths[cat] || [];
|
|
240
|
+
for (const pkgPath of paths) {
|
|
241
|
+
const fullPkgPath = path__default.join(repoRoot, pkgPath);
|
|
242
|
+
const serverDir = path__default.dirname(fullPkgPath);
|
|
243
|
+
const configJsonPath = path__default.join(serverDir, 'config.json');
|
|
244
|
+
servers.push({
|
|
245
|
+
serverDir,
|
|
246
|
+
packageJsonPath: fullPkgPath,
|
|
247
|
+
configJsonPath: fs__default.existsSync(configJsonPath) ? configJsonPath : undefined,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return servers;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Generates resolutions for all servers listed in cdecode-config.json
|
|
256
|
+
* Collects dependencies from all modules across all servers and applies
|
|
257
|
+
* consistent resolutions to each server's package.json
|
|
258
|
+
*/
|
|
259
|
+
function generateResolutionsFromCDecodeConfig(repoRoot, options = {}) {
|
|
260
|
+
const { category = 'backend', dryRun = false, additionalConflictPackages = [] } = options;
|
|
261
|
+
const servers = getServersFromCDecodeConfig(repoRoot, category);
|
|
262
|
+
const results = new Map();
|
|
263
|
+
if (servers.length === 0) {
|
|
264
|
+
console.log(`No servers found for category: ${category}`);
|
|
265
|
+
return results;
|
|
266
|
+
}
|
|
267
|
+
console.log(`\n🔍 Found ${servers.length} server(s) to process:\n`);
|
|
268
|
+
servers.forEach((s) => console.log(` - ${path__default.relative(repoRoot, s.serverDir)}`));
|
|
269
|
+
// First pass: collect all dependencies from all servers' modules
|
|
270
|
+
const conflictPackages = new Set([...CONFLICT_PRONE_PACKAGES, ...additionalConflictPackages]);
|
|
271
|
+
const globalPackageVersions = new Map();
|
|
272
|
+
for (const server of servers) {
|
|
273
|
+
if (!server.configJsonPath) {
|
|
274
|
+
console.log(`\n⚠️ Skipping ${path__default.relative(repoRoot, server.serverDir)} - no config.json found`);
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
console.log(`\n📂 Analyzing ${path__default.relative(repoRoot, server.serverDir)}...`);
|
|
278
|
+
const config = readServerConfig(server.configJsonPath);
|
|
279
|
+
const allModules = [...(config.modules || []), ...(config.devModules || []), ...(config.externalModules || [])];
|
|
280
|
+
for (const modulePath of allModules) {
|
|
281
|
+
const packageJsonPath = resolveModulePackageJson(modulePath, server.serverDir, repoRoot);
|
|
282
|
+
if (!packageJsonPath)
|
|
283
|
+
continue;
|
|
284
|
+
const moduleName = extractPackageFromConfigModule(modulePath) || modulePath;
|
|
285
|
+
const deps = collectDependencies(packageJsonPath);
|
|
286
|
+
const allDeps = { ...deps.dependencies, ...deps.peerDependencies };
|
|
287
|
+
for (const [depName, version] of Object.entries(allDeps)) {
|
|
288
|
+
if (conflictPackages.has(depName) || depName.startsWith('@aws-sdk/')) {
|
|
289
|
+
if (!globalPackageVersions.has(depName)) {
|
|
290
|
+
globalPackageVersions.set(depName, new Map());
|
|
291
|
+
}
|
|
292
|
+
globalPackageVersions.get(depName).set(moduleName, version);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// Generate unified resolutions
|
|
298
|
+
const unifiedResolutions = {};
|
|
299
|
+
const allConflicts = [];
|
|
300
|
+
for (const [packageName, moduleVersions] of globalPackageVersions) {
|
|
301
|
+
const versions = Array.from(moduleVersions.entries()).map(([module, version]) => ({
|
|
302
|
+
module,
|
|
303
|
+
version,
|
|
304
|
+
}));
|
|
305
|
+
const uniqueVersions = new Set(versions.map((v) => v.version));
|
|
306
|
+
if (uniqueVersions.size > 1) {
|
|
307
|
+
allConflicts.push({ package: packageName, versions });
|
|
308
|
+
}
|
|
309
|
+
const highestVersion = pickHighestVersion(versions.map((v) => v.version));
|
|
310
|
+
unifiedResolutions[packageName] = highestVersion;
|
|
311
|
+
}
|
|
312
|
+
// Report conflicts
|
|
313
|
+
if (allConflicts.length > 0) {
|
|
314
|
+
console.log('\n⚠️ Version conflicts detected across all servers:');
|
|
315
|
+
for (const conflict of allConflicts) {
|
|
316
|
+
console.log(`\n ${conflict.package}:`);
|
|
317
|
+
for (const { module, version } of conflict.versions) {
|
|
318
|
+
console.log(` - ${module}: ${version}`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
console.log('\n📦 Unified resolutions to apply:');
|
|
323
|
+
console.log(JSON.stringify(unifiedResolutions, null, 2));
|
|
324
|
+
// Apply to all servers
|
|
325
|
+
for (const server of servers) {
|
|
326
|
+
if (!fs__default.existsSync(server.packageJsonPath)) {
|
|
327
|
+
console.log(`\n⚠️ Skipping ${server.packageJsonPath} - file not found`);
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
console.log(`\n✏️ Updating ${path__default.relative(repoRoot, server.packageJsonPath)}...`);
|
|
331
|
+
updateServerPackageJson(server.packageJsonPath, unifiedResolutions, { dryRun });
|
|
332
|
+
results.set(server.serverDir, {
|
|
333
|
+
resolutions: unifiedResolutions,
|
|
334
|
+
conflicts: allConflicts,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
if (!dryRun) {
|
|
338
|
+
console.log('\n✅ All servers updated successfully!');
|
|
339
|
+
console.log(' Run `yarn install` to apply the changes.\n');
|
|
340
|
+
}
|
|
341
|
+
return results;
|
|
342
|
+
}export{analyzeModuleDependencies,generateServerResolutions as default,generateResolutionsFromCDecodeConfig,generateServerResolutions,getServersFromCDecodeConfig,readCDecodeConfig,readServerConfig,updateServerPackageJson};//# sourceMappingURL=generateResolutions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateResolutions.js","sources":["../../../src/tools/codegen/generateResolutions.ts"],"sourcesContent":[null],"names":["fs","path"],"mappings":"2KAAA;;;;;;;;AAQG;AAOH,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElD;;;;;;AAMG;AACH,MAAM,uBAAuB,GAAG;IAC5B,oBAAoB;IACpB,qBAAqB;IACrB,4BAA4B;IAC5B,+BAA+B;IAC/B,qBAAqB;IACrB,SAAS;IACT,WAAW;IACX,UAAU;IACV,WAAW;IACX,SAAS;IACT,gBAAgB;IAChB,gBAAgB;;CAEnB,CAAC;AAuCF;;;AAGG;AACH,SAAS,8BAA8B,CAAC,UAAkB,EAAA;AACtD,IAAA,OAAO,cAAc,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAED;;AAEG;AACG,SAAU,gBAAgB,CAAC,UAAkB,EAAA;IAC/C,MAAM,aAAa,GAAGA,WAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3D,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;AACrC,CAAC;AAED;;AAEG;AACH,SAAS,wBAAwB,CAAC,UAAkB,EAAE,SAAiB,EAAE,QAAgB,EAAA;AACrF,IAAA,MAAM,WAAW,GAAG,8BAA8B,CAAC,UAAU,CAAC,CAAC;AAC/D,IAAA,IAAI,CAAC,WAAW;AAAE,QAAA,OAAO,IAAI,CAAC;;AAG9B,IAAA,MAAM,iBAAiB,GAAGC,aAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAA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CommonPackage=require('./setupCommonPackage.cjs'),readModules=require('./readModules.cjs'),performCopyOperations=require('./performCopyOperations.cjs'),generateCodegenConfig=require('./generateCodegenConfig.cjs');/**
|
|
1
|
+
'use strict';var setupCommonPackage=require('./setupCommonPackage.cjs'),readModules=require('./readModules.cjs'),performCopyOperations=require('./performCopyOperations.cjs'),generateCodegenConfig=require('./generateCodegenConfig.cjs'),generateResolutions=require('./generateResolutions.cjs');/**
|
|
2
2
|
* Orchestrates the codegen tasks, reading from your cdecodeConfig object.
|
|
3
3
|
* Example usage: runCodegenTasks(cdecodeConfig).
|
|
4
4
|
*/
|
|
@@ -11,4 +11,4 @@ async function runCodegenTasks(cdecodeConfig) {
|
|
|
11
11
|
performCopyOperations.performCopyOperations(allModules, cdecodeConfig.projectPaths);
|
|
12
12
|
// 4) Generate the codegen config
|
|
13
13
|
generateCodegenConfig.generateCodegenConfig(allModules, cdecodeConfig.codegen, cdecodeConfig.projectPaths);
|
|
14
|
-
}exports.runCodegenTasks=runCodegenTasks;//# sourceMappingURL=index.cjs.map
|
|
14
|
+
}exports.analyzeModuleDependencies=generateResolutions.analyzeModuleDependencies;exports.generateResolutionsFromCDecodeConfig=generateResolutions.generateResolutionsFromCDecodeConfig;exports.generateServerResolutions=generateResolutions.generateServerResolutions;exports.getServersFromCDecodeConfig=generateResolutions.getServersFromCDecodeConfig;exports.readCDecodeConfig=generateResolutions.readCDecodeConfig;exports.updateServerPackageJson=generateResolutions.updateServerPackageJson;exports.runCodegenTasks=runCodegenTasks;//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/tools/codegen/index.ts"],"sourcesContent":[null],"names":["setupCommonPackage","readModules","performCopyOperations","generateCodegenConfig"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/tools/codegen/index.ts"],"sourcesContent":[null],"names":["setupCommonPackage","readModules","performCopyOperations","generateCodegenConfig"],"mappings":"oSAgBA;;;AAGG;AACI,eAAe,eAAe,CAAC,aAAa,EAAA;;AAE/C,IAAAA,qCAAkB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;;IAG/C,MAAM,UAAU,GAAGC,uBAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;;AAGtD,IAAAC,2CAAqB,CAAC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;;IAG9DC,2CAAqB,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;AACzF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { generateServerResolutions, generateResolutionsFromCDecodeConfig, analyzeModuleDependencies, updateServerPackageJson, readCDecodeConfig, getServersFromCDecodeConfig, type ResolutionResult, type ServerConfig, type CDecodeConfig, } from './generateResolutions.js';
|
|
1
2
|
/**
|
|
2
3
|
* Orchestrates the codegen tasks, reading from your cdecodeConfig object.
|
|
3
4
|
* Example usage: runCodegenTasks(cdecodeConfig).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {setupCommonPackage}from'./setupCommonPackage.js';import {readModules}from'./readModules.js';import {performCopyOperations}from'./performCopyOperations.js';import {generateCodegenConfig}from'./generateCodegenConfig.js';/**
|
|
1
|
+
import {setupCommonPackage}from'./setupCommonPackage.js';import {readModules}from'./readModules.js';import {performCopyOperations}from'./performCopyOperations.js';import {generateCodegenConfig}from'./generateCodegenConfig.js';export{analyzeModuleDependencies,generateResolutionsFromCDecodeConfig,generateServerResolutions,getServersFromCDecodeConfig,readCDecodeConfig,updateServerPackageJson}from'./generateResolutions.js';/**
|
|
2
2
|
* Orchestrates the codegen tasks, reading from your cdecodeConfig object.
|
|
3
3
|
* Example usage: runCodegenTasks(cdecodeConfig).
|
|
4
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/tools/codegen/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/tools/codegen/index.ts"],"sourcesContent":[null],"names":[],"mappings":"uaAgBA;;;AAGG;AACI,eAAe,eAAe,CAAC,aAAa,EAAA;;AAE/C,IAAA,kBAAkB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;;IAG/C,MAAM,UAAU,GAAG,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;;AAGtD,IAAA,qBAAqB,CAAC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;;IAG9D,qBAAqB,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;AACzF"}
|
package/lib/utils/utils.cjs
CHANGED
|
@@ -99,10 +99,38 @@ function generateBackendModulesFile(config) {
|
|
|
99
99
|
const packages = config.modules || [];
|
|
100
100
|
const devPackages = config.devModules || [];
|
|
101
101
|
const exPackages = config.externalModules || [];
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
const enableServiceSchemas = config.enableServiceSchemas !== false; // default true
|
|
103
|
+
const serviceSchemasPath = config.serviceSchemasPath || 'common/server';
|
|
104
|
+
const additionalProxyServices = config.additionalProxyServices || [];
|
|
105
|
+
// Build consolidated imports
|
|
106
|
+
const inversifyImports = additionalProxyServices.length > 0
|
|
107
|
+
? 'ContainerModule, interfaces, injectable, inject'
|
|
108
|
+
: 'ContainerModule, interfaces';
|
|
109
|
+
const commonStackCoreImports = additionalProxyServices.length > 0 ? 'TaggedType, CommonType' : 'TaggedType';
|
|
110
|
+
const commonServerImports = [];
|
|
111
|
+
if (enableServiceSchemas) {
|
|
112
|
+
commonServerImports.push('AllServiceSchemas');
|
|
113
|
+
}
|
|
114
|
+
if (additionalProxyServices.length > 0) {
|
|
115
|
+
commonServerImports.push('SERVER_TYPES');
|
|
116
|
+
}
|
|
117
|
+
let imports = `import { ${inversifyImports} } from 'inversify';
|
|
118
|
+
import { ${commonStackCoreImports} } from '@common-stack/core';
|
|
104
119
|
import { Feature } from '@common-stack/server-core';
|
|
105
120
|
`;
|
|
121
|
+
// Add generateProxyMethods from codegen-zod if needed
|
|
122
|
+
if (additionalProxyServices.length > 0) {
|
|
123
|
+
imports += `import { generateProxyMethods } from '@common-stack/codegen-zod';\n`;
|
|
124
|
+
}
|
|
125
|
+
// Add common/server imports
|
|
126
|
+
if (commonServerImports.length > 0) {
|
|
127
|
+
imports += `import { ${commonServerImports.join(', ')} } from '${serviceSchemasPath}';\n`;
|
|
128
|
+
}
|
|
129
|
+
// Add type imports for additional proxy services
|
|
130
|
+
if (additionalProxyServices.length > 0) {
|
|
131
|
+
imports += `import type { ServiceBroker } from 'moleculer';\n`;
|
|
132
|
+
imports += `import type { CdmLogger } from '@cdm-logger/core';\n`;
|
|
133
|
+
}
|
|
106
134
|
let modules = ``;
|
|
107
135
|
let exModules = ``;
|
|
108
136
|
let devModules = ``;
|
|
@@ -116,6 +144,69 @@ import { Feature } from '@common-stack/server-core';
|
|
|
116
144
|
imports += `import ${moduleName} from '${pkg}';\n`;
|
|
117
145
|
exModules += `${moduleName}, `;
|
|
118
146
|
});
|
|
147
|
+
// Build DefaultFeature with optional serviceSchemas
|
|
148
|
+
const serviceSchemasLine = enableServiceSchemas ? '\n serviceSchemas: AllServiceSchemas,' : '';
|
|
149
|
+
// Generate proxy service classes and container module if configured
|
|
150
|
+
let proxyClassesCode = '';
|
|
151
|
+
let proxyServicesModule = '';
|
|
152
|
+
if (additionalProxyServices.length > 0) {
|
|
153
|
+
// Generate injectable proxy classes
|
|
154
|
+
const proxyClasses = additionalProxyServices
|
|
155
|
+
.map(({ type, schema }) => {
|
|
156
|
+
// Create class name from type (e.g., IAuthProviderService -> AuthProviderServiceProxy)
|
|
157
|
+
const className = type.replace(/^I/, '') + 'Proxy';
|
|
158
|
+
// Schema defaults to type (AllServiceSchemas is keyed by interface name)
|
|
159
|
+
const schemaKey = schema || type;
|
|
160
|
+
return `
|
|
161
|
+
// Auto-generated proxy class for ${type}
|
|
162
|
+
@injectable()
|
|
163
|
+
class ${className} {
|
|
164
|
+
constructor(
|
|
165
|
+
@inject(CommonType.MOLECULER_BROKER) broker: ServiceBroker,
|
|
166
|
+
@inject('Logger') logger: CdmLogger.ILogger,
|
|
167
|
+
) {
|
|
168
|
+
// Validate schema exists
|
|
169
|
+
const schema = AllServiceSchemas['${schemaKey}'];
|
|
170
|
+
if (!schema) {
|
|
171
|
+
throw new Error(
|
|
172
|
+
\`[additionalProxyServices] Schema '${schemaKey}' not found in AllServiceSchemas. \\n\` +
|
|
173
|
+
\`Available schemas: \${Object.keys(AllServiceSchemas).slice(0, 10).join(', ')}... \\n\` +
|
|
174
|
+
\`Please check your config.json additionalProxyServices configuration.\`
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
// Auto-generate proxy methods from schema
|
|
178
|
+
generateProxyMethods(this, schema, broker, logger);
|
|
179
|
+
}
|
|
180
|
+
}`;
|
|
181
|
+
})
|
|
182
|
+
.join('\n');
|
|
183
|
+
proxyClassesCode = proxyClasses;
|
|
184
|
+
// Generate container bindings with validation
|
|
185
|
+
const proxyBindings = additionalProxyServices
|
|
186
|
+
.map(({ type, schema }) => {
|
|
187
|
+
const className = type.replace(/^I/, '') + 'Proxy';
|
|
188
|
+
const schemaKey = schema || type;
|
|
189
|
+
return ` // Bind ${type} -> ${className} (schema: ${schemaKey})
|
|
190
|
+
if (!SERVER_TYPES.${type}) {
|
|
191
|
+
throw new Error(
|
|
192
|
+
\`[additionalProxyServices] SERVER_TYPES.${type} is not defined. \\n\` +
|
|
193
|
+
\`Please ensure '${type}' is exported from SERVER_TYPES in your common/server module.\`
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
bind(SERVER_TYPES.${type}).to(${className}).inSingletonScope();`;
|
|
197
|
+
})
|
|
198
|
+
.join('\n');
|
|
199
|
+
proxyServicesModule = `
|
|
200
|
+
// Container module for additional proxy services (from config.json additionalProxyServices)
|
|
201
|
+
const additionalProxyServicesModule = () =>
|
|
202
|
+
new ContainerModule((bind: interfaces.Bind) => {
|
|
203
|
+
if (process.env.NODE_ENV === 'development') {
|
|
204
|
+
console.log('[module.ts] Registering additional proxy services:', ${JSON.stringify(additionalProxyServices.map((p) => p.type))});
|
|
205
|
+
}
|
|
206
|
+
${proxyBindings}
|
|
207
|
+
});
|
|
208
|
+
`;
|
|
209
|
+
}
|
|
119
210
|
let featureSetup = `import { EnvironmentService } from '@adminide-stack/platform-server';
|
|
120
211
|
import { IAdminIdeSettings } from '@adminide-stack/core';
|
|
121
212
|
import { config } from '../config';
|
|
@@ -136,7 +227,8 @@ export const settings: IAdminIdeSettings & any = {
|
|
|
136
227
|
activityNamespace: config.ACTIVITY_NAMESPACE,
|
|
137
228
|
activityVersion: '',
|
|
138
229
|
};
|
|
139
|
-
|
|
230
|
+
${proxyClassesCode}
|
|
231
|
+
${proxyServicesModule}
|
|
140
232
|
const defaultModule = () =>
|
|
141
233
|
new ContainerModule((bind: interfaces.Bind) => {
|
|
142
234
|
bind('Settings').toConstantValue(settings).whenTargetTagged('default', true);
|
|
@@ -148,21 +240,23 @@ const defaultModule = () =>
|
|
|
148
240
|
});
|
|
149
241
|
|
|
150
242
|
const DefaultFeature = new Feature({
|
|
151
|
-
createContainerFunc: [defaultModule],
|
|
152
|
-
createMicroServiceContainerFunc: [defaultModule]
|
|
243
|
+
createContainerFunc: [defaultModule${additionalProxyServices.length > 0 ? ', additionalProxyServicesModule' : ''}],
|
|
244
|
+
createMicroServiceContainerFunc: [defaultModule${additionalProxyServices.length > 0 ? ', additionalProxyServicesModule' : ''}],${serviceSchemasLine}
|
|
153
245
|
});
|
|
154
246
|
|
|
155
247
|
export const ExternalModules = new Feature(${exModules ? exModules.trim().slice(0, -1) : '{}'});
|
|
156
248
|
|
|
157
249
|
`;
|
|
158
|
-
if (
|
|
250
|
+
if (devPackages.length > 0) {
|
|
251
|
+
featureSetup += `let DevModules: Feature;\n`;
|
|
252
|
+
featureSetup += `if(process.env.NODE_ENV === 'development') {\n`;
|
|
159
253
|
devPackages.forEach((pkg, index) => {
|
|
160
254
|
const moduleName = `DevModule${index + 1}`;
|
|
161
255
|
featureSetup += `const ${moduleName} = require('${pkg}');\n`;
|
|
162
256
|
devModules += `${moduleName}.default, `;
|
|
163
257
|
});
|
|
164
|
-
featureSetup += `
|
|
165
|
-
|
|
258
|
+
featureSetup += `DevModules = new Feature(${devModules.trim().slice(0, -1)});
|
|
259
|
+
}else{\n DevModules = new Feature();\n}\n
|
|
166
260
|
const features = new Feature(
|
|
167
261
|
DefaultFeature,
|
|
168
262
|
${modules.trim()}
|
package/lib/utils/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../src/utils/utils.ts"],"sourcesContent":[null],"names":["SYNC_META_JSON","MODULES_JS","MODULES_TS"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../src/utils/utils.ts"],"sourcesContent":[null],"names":["SYNC_META_JSON","MODULES_JS","MODULES_TS"],"mappings":"6GAkDA;;;;AAIG;AACI,eAAe,iBAAiB,CAAC,WAAmB,EAAA;AACvD,IAAA,IAAI;AACA,QAAA,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;QAC9E,OAAO,WAAW,CAAC,OAAO,CAAC;KAC9B;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,CAAA,gCAAA,EAAmC,WAAW,CAAG,CAAA,CAAA,EAAE,GAAG,CAAC,CAAC;AACtE,QAAA,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAED;;;;AAIG;AACI,eAAe,WAAW,CAAC,MAAc,EAAA;AAC5C,IAAA,IAAI;QACA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAEA,wBAAc,CAAC,CAAC;QACnD,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,Q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[];
|
|
14
|
+
/**
|
|
15
|
+
* Enable service schemas for self-healing container.
|
|
16
|
+
* When true, imports AllServiceSchemas from 'common/server' and adds to DefaultFeature.
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
enableServiceSchemas?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Custom path to import service schemas from.
|
|
22
|
+
* @default 'common/server'
|
|
23
|
+
*/
|
|
24
|
+
serviceSchemasPath?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Additional proxy services to auto-generate.
|
|
27
|
+
* Use this when you notice missing bindings in dev mode.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```json
|
|
31
|
+
* {
|
|
32
|
+
* "additionalProxyServices": [
|
|
33
|
+
* { "type": "IAuthProviderService" }
|
|
34
|
+
* ]
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* - `type`: The key in SERVER_TYPES and AllServiceSchemas (e.g., "IAuthProviderService")
|
|
39
|
+
* - `schema`: (Optional) Override key in AllServiceSchemas if different from type
|
|
40
|
+
*/
|
|
41
|
+
additionalProxyServices?: Array<{
|
|
42
|
+
type: string;
|
|
43
|
+
schema?: string;
|
|
44
|
+
}>;
|
|
14
45
|
[key: string]: any;
|
|
15
46
|
}
|
|
16
47
|
/**
|