@common-stack/rollup-vite-utils 6.0.8-alpha.7 → 8.0.1-alpha.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.
Files changed (76) hide show
  1. package/lib/index.cjs +1 -1
  2. package/lib/index.d.ts +1 -0
  3. package/lib/index.js +1 -1
  4. package/lib/preStartup/configLoader/envLoader.cjs +1 -1
  5. package/lib/preStartup/configLoader/envLoader.cjs.map +1 -1
  6. package/lib/preStartup/configLoader/envLoader.js +1 -1
  7. package/lib/preStartup/configLoader/envLoader.js.map +1 -1
  8. package/lib/rollup/index.d.ts +1 -0
  9. package/lib/rollup/rollupPluginCamelcaseSvg.cjs +24 -0
  10. package/lib/rollup/rollupPluginCamelcaseSvg.cjs.map +1 -0
  11. package/lib/rollup/rollupPluginCamelcaseSvg.d.ts +8 -0
  12. package/lib/rollup/rollupPluginCamelcaseSvg.js +24 -0
  13. package/lib/rollup/rollupPluginCamelcaseSvg.js.map +1 -0
  14. package/lib/tools/codegen/commonPaths.cjs +20 -0
  15. package/lib/tools/codegen/commonPaths.cjs.map +1 -0
  16. package/lib/tools/codegen/commonPaths.d.ts +19 -0
  17. package/lib/tools/codegen/commonPaths.js +20 -0
  18. package/lib/tools/codegen/commonPaths.js.map +1 -0
  19. package/lib/tools/codegen/computeModules.cjs +47 -0
  20. package/lib/tools/codegen/computeModules.cjs.map +1 -0
  21. package/lib/tools/codegen/computeModules.d.ts +10 -0
  22. package/lib/tools/codegen/computeModules.js +47 -0
  23. package/lib/tools/codegen/computeModules.js.map +1 -0
  24. package/lib/tools/codegen/generateCodegenConfig.cjs +81 -0
  25. package/lib/tools/codegen/generateCodegenConfig.cjs.map +1 -0
  26. package/lib/tools/codegen/generateCodegenConfig.d.ts +6 -0
  27. package/lib/tools/codegen/generateCodegenConfig.js +81 -0
  28. package/lib/tools/codegen/generateCodegenConfig.js.map +1 -0
  29. package/lib/tools/codegen/index.cjs +14 -0
  30. package/lib/tools/codegen/index.cjs.map +1 -0
  31. package/lib/tools/codegen/index.d.ts +5 -0
  32. package/lib/tools/codegen/index.js +14 -0
  33. package/lib/tools/codegen/index.js.map +1 -0
  34. package/lib/tools/codegen/performCopyOperations.cjs +65 -0
  35. package/lib/tools/codegen/performCopyOperations.cjs.map +1 -0
  36. package/lib/tools/codegen/performCopyOperations.d.ts +8 -0
  37. package/lib/tools/codegen/performCopyOperations.js +65 -0
  38. package/lib/tools/codegen/performCopyOperations.js.map +1 -0
  39. package/lib/tools/codegen/readModule.test.d.ts +1 -0
  40. package/lib/tools/codegen/readModules.cjs +140 -0
  41. package/lib/tools/codegen/readModules.cjs.map +1 -0
  42. package/lib/tools/codegen/readModules.d.ts +11 -0
  43. package/lib/tools/codegen/readModules.js +140 -0
  44. package/lib/tools/codegen/readModules.js.map +1 -0
  45. package/lib/tools/codegen/setupCommonPackage.cjs +61 -0
  46. package/lib/tools/codegen/setupCommonPackage.cjs.map +1 -0
  47. package/lib/tools/codegen/setupCommonPackage.d.ts +12 -0
  48. package/lib/tools/codegen/setupCommonPackage.js +61 -0
  49. package/lib/tools/codegen/setupCommonPackage.js.map +1 -0
  50. package/lib/tools/codegen/templates/common/.npmignore.template +2 -0
  51. package/lib/tools/codegen/templates/common/package.json.template +25 -0
  52. package/lib/tools/codegen/templates/common/rollup.config.mjs.template +32 -0
  53. package/lib/tools/codegen/templates/common/src/apollo-context.ts.template +58 -0
  54. package/lib/tools/codegen/templates/common/src/configuration.ts.template +37 -0
  55. package/lib/tools/codegen/templates/common/src/generated/generated-models.ts.template +1 -0
  56. package/lib/tools/codegen/templates/common/src/index.ts.template +5 -0
  57. package/lib/tools/codegen/templates/common/src/permissions.ts.template +5 -0
  58. package/lib/tools/codegen/templates/common/src/types.ts.template +42 -0
  59. package/lib/tools/codegen/templates/common/tsconfig.json.template +18 -0
  60. package/lib/tools/index.d.ts +1 -0
  61. package/lib/utils/utils.cjs +21 -14
  62. package/lib/utils/utils.cjs.map +1 -1
  63. package/lib/utils/utils.d.ts +9 -3
  64. package/lib/utils/utils.js +21 -14
  65. package/lib/utils/utils.js.map +1 -1
  66. package/lib/vite-wrappers/generators/serverQueryLoaderGenerator.cjs +1 -1
  67. package/lib/vite-wrappers/generators/serverQueryLoaderGenerator.js +1 -1
  68. package/lib/vite-wrappers/json-wrappers.cjs +1 -0
  69. package/lib/vite-wrappers/json-wrappers.cjs.map +1 -1
  70. package/lib/vite-wrappers/json-wrappers.js +1 -0
  71. package/lib/vite-wrappers/json-wrappers.js.map +1 -1
  72. package/lib/vite-wrappers/wrapperComponent.cjs +9 -2
  73. package/lib/vite-wrappers/wrapperComponent.cjs.map +1 -1
  74. package/lib/vite-wrappers/wrapperComponent.js +9 -2
  75. package/lib/vite-wrappers/wrapperComponent.js.map +1 -1
  76. package/package.json +5 -5
@@ -0,0 +1,65 @@
1
+ 'use strict';var child_process=require('child_process'),fs=require('fs'),path=require('path'),commonPaths=require('./commonPaths.cjs');/**
2
+ * For each discovered module, if "cdecode.common" is found in
3
+ * the package.json, copy the specified files into the common package.
4
+ *
5
+ * Provide optional cdecodePaths = { repoRoot, commonPackagePath } to override
6
+ * the defaults in commonPaths.mjs.
7
+ */
8
+ function performCopyOperations(modules, cdecodePaths = {}) {
9
+ let { repoRoot, commonPackagePath } = cdecodePaths;
10
+ // Fallback to internal pathsConfig if not provided by user
11
+ if (!repoRoot) {
12
+ repoRoot = commonPaths.pathsConfig.repoRoot;
13
+ }
14
+ if (!commonPackagePath) {
15
+ // e.g. "packages/common"
16
+ commonPackagePath = path.join(commonPaths.pathsConfig.repoRoot, 'packages/common');
17
+ }
18
+ let shouldAddExport = false;
19
+ for (const modulesObj of modules) {
20
+ // modulesObj = { client, core, browser, server, independent }
21
+ for (const moduleName of Object.values(modulesObj)) {
22
+ try {
23
+ const modulePath = path.join(repoRoot, moduleName, '../');
24
+ const pkgJsonFilePath = path.join(modulePath, 'package.json');
25
+ if (!fs.existsSync(pkgJsonFilePath)) {
26
+ continue;
27
+ }
28
+ const pkgJsonBuffer = fs.readFileSync(pkgJsonFilePath, 'utf-8');
29
+ const pkgJson = JSON.parse(pkgJsonBuffer);
30
+ // If cdecode.common is present, copy the specified modules
31
+ if (pkgJson.cdecode?.common) {
32
+ const pkgName = (pkgJson.name || '').split('/')[1] || pkgJson.name;
33
+ const { modules: resourceList } = pkgJson.cdecode.common;
34
+ const directoryPath = path.join(commonPackagePath, `src/modules/${pkgName}`);
35
+ child_process.execSync(`mkdir -p ${directoryPath}`);
36
+ // Copy each file or folder
37
+ resourceList.forEach((moduleFile) => {
38
+ child_process.execSync(`cp -r ${path.join(modulePath, moduleFile)} ${directoryPath}`);
39
+ });
40
+ // Create an index.ts that re-exports each file
41
+ const getFileNameWithoutExt = (filePath) => {
42
+ const justFile = path.basename(filePath);
43
+ return path.basename(justFile, path.extname(justFile));
44
+ };
45
+ const exports = resourceList
46
+ .map((file) => `export * from './${getFileNameWithoutExt(file)}';`)
47
+ .join('\n');
48
+ // Write index.ts
49
+ child_process.execSync(`echo "${exports.replace(/"/g, '\\"')}" > ${path.join(directoryPath, 'index.ts')}`);
50
+ // Write an index.ts in the parent folder, referencing the new module folder
51
+ child_process.execSync(`echo "export * from './${pkgName}';" > ${path.join(directoryPath, '../', 'index.ts')}`);
52
+ shouldAddExport = true;
53
+ }
54
+ }
55
+ catch (e) {
56
+ console.error(`Error copying modules for: ${moduleName}`, e);
57
+ // you can decide to continue or break
58
+ }
59
+ }
60
+ }
61
+ // If we've added at least one module export, update the top-level index
62
+ if (shouldAddExport) {
63
+ child_process.execSync(`echo "export * from './modules';" >> ${path.join(commonPackagePath, 'src', 'index.ts')}`);
64
+ }
65
+ }exports.performCopyOperations=performCopyOperations;//# sourceMappingURL=performCopyOperations.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performCopyOperations.cjs","sources":["../../../src/tools/codegen/performCopyOperations.ts"],"sourcesContent":[null],"names":["pathsConfig","execSync"],"mappings":"uIAKA;;;;;;AAMG;SACa,qBAAqB,CAA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AAC,CAAA,2BAAA,EAA8B,UAAU,CAAE,CAAA,EAAE,CAAC,CAAC,CAAC;;aAEhE;SACJ;KACJ;;IAGD,IAAI,eAAe,EAAE;AACjB,QAAAA,sBAAQ,CAAC,CAAA,qCAAA,EAAwC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,UAAU,CAAC,CAAA,CAAE,CAAC,CAAC;KACvG;AACL"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * For each discovered module, if "cdecode.common" is found in
3
+ * the package.json, copy the specified files into the common package.
4
+ *
5
+ * Provide optional cdecodePaths = { repoRoot, commonPackagePath } to override
6
+ * the defaults in commonPaths.mjs.
7
+ */
8
+ export declare function performCopyOperations(modules: any, cdecodePaths?: any): void;
@@ -0,0 +1,65 @@
1
+ import {execSync}from'child_process';import fs__default from'fs';import path__default from'path';import {pathsConfig}from'./commonPaths.js';/**
2
+ * For each discovered module, if "cdecode.common" is found in
3
+ * the package.json, copy the specified files into the common package.
4
+ *
5
+ * Provide optional cdecodePaths = { repoRoot, commonPackagePath } to override
6
+ * the defaults in commonPaths.mjs.
7
+ */
8
+ function performCopyOperations(modules, cdecodePaths = {}) {
9
+ let { repoRoot, commonPackagePath } = cdecodePaths;
10
+ // Fallback to internal pathsConfig if not provided by user
11
+ if (!repoRoot) {
12
+ repoRoot = pathsConfig.repoRoot;
13
+ }
14
+ if (!commonPackagePath) {
15
+ // e.g. "packages/common"
16
+ commonPackagePath = path__default.join(pathsConfig.repoRoot, 'packages/common');
17
+ }
18
+ let shouldAddExport = false;
19
+ for (const modulesObj of modules) {
20
+ // modulesObj = { client, core, browser, server, independent }
21
+ for (const moduleName of Object.values(modulesObj)) {
22
+ try {
23
+ const modulePath = path__default.join(repoRoot, moduleName, '../');
24
+ const pkgJsonFilePath = path__default.join(modulePath, 'package.json');
25
+ if (!fs__default.existsSync(pkgJsonFilePath)) {
26
+ continue;
27
+ }
28
+ const pkgJsonBuffer = fs__default.readFileSync(pkgJsonFilePath, 'utf-8');
29
+ const pkgJson = JSON.parse(pkgJsonBuffer);
30
+ // If cdecode.common is present, copy the specified modules
31
+ if (pkgJson.cdecode?.common) {
32
+ const pkgName = (pkgJson.name || '').split('/')[1] || pkgJson.name;
33
+ const { modules: resourceList } = pkgJson.cdecode.common;
34
+ const directoryPath = path__default.join(commonPackagePath, `src/modules/${pkgName}`);
35
+ execSync(`mkdir -p ${directoryPath}`);
36
+ // Copy each file or folder
37
+ resourceList.forEach((moduleFile) => {
38
+ execSync(`cp -r ${path__default.join(modulePath, moduleFile)} ${directoryPath}`);
39
+ });
40
+ // Create an index.ts that re-exports each file
41
+ const getFileNameWithoutExt = (filePath) => {
42
+ const justFile = path__default.basename(filePath);
43
+ return path__default.basename(justFile, path__default.extname(justFile));
44
+ };
45
+ const exports = resourceList
46
+ .map((file) => `export * from './${getFileNameWithoutExt(file)}';`)
47
+ .join('\n');
48
+ // Write index.ts
49
+ execSync(`echo "${exports.replace(/"/g, '\\"')}" > ${path__default.join(directoryPath, 'index.ts')}`);
50
+ // Write an index.ts in the parent folder, referencing the new module folder
51
+ execSync(`echo "export * from './${pkgName}';" > ${path__default.join(directoryPath, '../', 'index.ts')}`);
52
+ shouldAddExport = true;
53
+ }
54
+ }
55
+ catch (e) {
56
+ console.error(`Error copying modules for: ${moduleName}`, e);
57
+ // you can decide to continue or break
58
+ }
59
+ }
60
+ }
61
+ // If we've added at least one module export, update the top-level index
62
+ if (shouldAddExport) {
63
+ execSync(`echo "export * from './modules';" >> ${path__default.join(commonPackagePath, 'src', 'index.ts')}`);
64
+ }
65
+ }export{performCopyOperations};//# sourceMappingURL=performCopyOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performCopyOperations.js","sources":["../../../src/tools/codegen/performCopyOperations.ts"],"sourcesContent":[null],"names":["path","fs"],"mappings":"4IAKA;;;;;;AAMG;SACa,qBAAqB,CAAC,OAAO,EAAE,eAAe,EAAS,EAAA;AACnE,IAAA,IAAI,EAAE,QAAQ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AC;;aAEhE;SACJ;KACJ;;IAGD,IAAI,eAAe,EAAE;AACjB,QAAA,QAAQ,CAAC,CAAA,qCAAA,EAAwCA,aAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,UAAU,CAAC,CAAA,CAAE,CAAC,CAAC;KACvG;AACL"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,140 @@
1
+ 'use strict';var fs=require('fs'),path=require('path'),module$1=require('module'),commonPaths=require('./commonPaths.cjs');var_documentCurrentScript=typeofdocument!=='undefined'?document.currentScript:null;// If you also need checkFileExists, import it from the same file:
2
+ // import { pathsConfig, checkFileExists } from './commonPaths.mjs';
3
+ // ESM-compatible require
4
+ const esmRequire = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('tools/codegen/readModules.cjs', document.baseURI).href)));
5
+ /**
6
+ * Reads modules from JSON config files and returns an array of module objects.
7
+ *
8
+ * The function separates modules into client and server arrays based on the suffix (“-server”),
9
+ * then it attempts to resolve each module’s location. If the resolution fails—often due to a missing
10
+ * "lib" folder on external packages—it falls back by removing any `/lib` reference from the module name.
11
+ *
12
+ * For local modules it always returns an object with { client, core, browser, server } keys.
13
+ * For modules from node_modules, it generates paths based on naming conventions.
14
+ */
15
+ function readModules(serverConfigPaths = []) {
16
+ // Separate client and server modules while loading the JSON config files.
17
+ const [clientModules, serverModules] = serverConfigPaths.reduce((acc, configFile) => {
18
+ if (!fs.existsSync(configFile)) {
19
+ console.error(`Config file not found: ${configFile}`);
20
+ process.exit(1);
21
+ }
22
+ const configData = JSON.parse(fs.readFileSync(configFile, 'utf-8'));
23
+ // Process regular modules.
24
+ configData.modules?.forEach((mod) => {
25
+ if (mod.endsWith('-server')) {
26
+ acc[1].push(mod);
27
+ }
28
+ else {
29
+ acc[0].push(mod);
30
+ }
31
+ });
32
+ // Process external modules.
33
+ configData.externalModules?.forEach((mod) => {
34
+ if (mod.endsWith('-server')) {
35
+ acc[1].push(mod);
36
+ }
37
+ else {
38
+ acc[0].push(mod);
39
+ }
40
+ });
41
+ // Process devModules.
42
+ configData.devModules?.forEach((mod) => {
43
+ if (mod.endsWith('-server')) {
44
+ acc[1].push(mod);
45
+ }
46
+ else {
47
+ acc[0].push(mod);
48
+ }
49
+ });
50
+ return acc;
51
+ }, [[], []]);
52
+ // Combine modules uniquely
53
+ const allModules = [...new Set([...clientModules, ...serverModules])];
54
+ const processedModules = new Set();
55
+ return allModules.reduce((acc, moduleName) => {
56
+ try {
57
+ let resolvedFile;
58
+ try {
59
+ // Attempt normal resolution.
60
+ resolvedFile = esmRequire.resolve(moduleName);
61
+ }
62
+ catch (err) {
63
+ // Fallback resolution: if the module name includes "/lib", remove it and try again.
64
+ const fallbackModule = moduleName.includes('/lib') ? moduleName.replace(/\/lib.*$/, '') : moduleName;
65
+ try {
66
+ resolvedFile = esmRequire.resolve(fallbackModule);
67
+ }
68
+ catch (err2) {
69
+ console.warn(`Could not resolve module ${moduleName} even with fallback ${fallbackModule}. Skipping.`);
70
+ return acc;
71
+ }
72
+ }
73
+ const dirName = path.dirname(resolvedFile);
74
+ const modulePath = path.relative(commonPaths.pathsConfig.repoRoot, dirName);
75
+ // Reverse the split parts to check if "node_modules" exists.
76
+ const [dir, pkg, ...rest] = modulePath.split('/').reverse();
77
+ const isLocal = !rest.includes('node_modules');
78
+ const baseModule = isLocal ? [...rest].reverse().join('/') : modulePath.replace('/lib', '');
79
+ if (processedModules.has(baseModule)) {
80
+ return acc;
81
+ }
82
+ processedModules.add(baseModule);
83
+ // For local modules, use "src" directory; for node_modules, use "lib"
84
+ const srcOrLib = isLocal ? 'src' : 'lib';
85
+ const generatePath = (type) => `${baseModule}${isLocal ? `/${type}` : ''}/${srcOrLib}`;
86
+ // For local modules, always return all module keys.
87
+ if (isLocal) {
88
+ return [
89
+ ...acc,
90
+ {
91
+ client: generatePath('client'),
92
+ core: generatePath('core'),
93
+ browser: generatePath('browser'),
94
+ server: generatePath('server'),
95
+ },
96
+ ];
97
+ }
98
+ // Otherwise, handle node_module naming conventions.
99
+ // If the baseModule ends with "-browser".
100
+ if (baseModule.endsWith('-browser')) {
101
+ return [
102
+ ...acc,
103
+ {
104
+ browser: `${baseModule}/${srcOrLib}`,
105
+ client: `${baseModule.replace(/-browser$/, '-client')}/${srcOrLib}`,
106
+ core: `${baseModule.replace(/-browser$/, '-core')}/${srcOrLib}`,
107
+ },
108
+ ];
109
+ }
110
+ if (baseModule.endsWith('-server')) {
111
+ return [
112
+ ...acc,
113
+ {
114
+ server: `${baseModule}/${srcOrLib}`,
115
+ },
116
+ ];
117
+ }
118
+ if (baseModule.includes('-browser')) {
119
+ return [
120
+ ...acc,
121
+ {
122
+ browser: `${baseModule}/${srcOrLib}`,
123
+ },
124
+ ];
125
+ }
126
+ // Default fallback.
127
+ return [
128
+ ...acc,
129
+ {
130
+ independent: `${baseModule}/${srcOrLib}`,
131
+ },
132
+ ];
133
+ }
134
+ catch (e) {
135
+ console.error(e);
136
+ console.log('Error while processing module:', moduleName);
137
+ return acc;
138
+ }
139
+ }, []);
140
+ }exports.readModules=readModules;//# sourceMappingURL=readModules.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readModules.cjs","sources":["../../../src/tools/codegen/readModules.ts"],"sourcesContent":[null],"names":["createRequire","pathsConfig"],"mappings":"8MAKA;AACA;AAEA;AACA,MAAM,UAAU,GAAGA,sBAAa,CAAC,+QAAe,CAAC,CAAC;AAElD;;;;;;;;;AASG;AACa,SAAA,WAAW,CAAC,iBAAA,GAA8B,EAAE,EAAA;;AAExD,IAAA,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAC3D,CAAC,GAAG,EAAE,UAAU,KAAI;QAChB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;AAC5B,YAAA,OAAO,CAAC,KAA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A,QAAQ,CAAE,CAAA;AAClE,qBAAA;iBACJ,CAAC;aACL;AACD,YAAA,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;gBAChC,OAAO;AACH,oBAAA,GAAG,GAAG;AACN,oBAAA;AACI,wBAAA,MAAM,EAAE,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA;AACtC,qBAAA;iBACJ,CAAC;aACL;AACD,YAAA,IAAI,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;gBACjC,OAAO;AACH,oBAAA,GAAG,GAAG;AACN,oBAAA;AACI,wBAAA,OAAO,EAAE,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA;AACvC,qBAAA;iBACJ,CAAC;aACL;;YAED,OAAO;AACH,gBAAA,GAAG,GAAG;AACN,gBAAA;AACI,oBAAA,WAAW,EAAE,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA;AAC3C,iBAAA;aACJ,CAAC;SACL;QAAC,OAAO,CAAC,EAAE;AACR,YAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACjB,YAAA,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;AAC1D,YAAA,OAAO,GAAG,CAAC;SACd;KACJ,EAAE,EAAW,CAAC,CAAC;AACpB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Reads modules from JSON config files and returns an array of module objects.
3
+ *
4
+ * The function separates modules into client and server arrays based on the suffix (“-server”),
5
+ * then it attempts to resolve each module’s location. If the resolution fails—often due to a missing
6
+ * "lib" folder on external packages—it falls back by removing any `/lib` reference from the module name.
7
+ *
8
+ * For local modules it always returns an object with { client, core, browser, server } keys.
9
+ * For modules from node_modules, it generates paths based on naming conventions.
10
+ */
11
+ export declare function readModules(serverConfigPaths?: string[]): any[];
@@ -0,0 +1,140 @@
1
+ import fs__default from'fs';import path__default from'path';import {createRequire}from'module';import {pathsConfig}from'./commonPaths.js';// If you also need checkFileExists, import it from the same file:
2
+ // import { pathsConfig, checkFileExists } from './commonPaths.mjs';
3
+ // ESM-compatible require
4
+ const esmRequire = createRequire(import.meta.url);
5
+ /**
6
+ * Reads modules from JSON config files and returns an array of module objects.
7
+ *
8
+ * The function separates modules into client and server arrays based on the suffix (“-server”),
9
+ * then it attempts to resolve each module’s location. If the resolution fails—often due to a missing
10
+ * "lib" folder on external packages—it falls back by removing any `/lib` reference from the module name.
11
+ *
12
+ * For local modules it always returns an object with { client, core, browser, server } keys.
13
+ * For modules from node_modules, it generates paths based on naming conventions.
14
+ */
15
+ function readModules(serverConfigPaths = []) {
16
+ // Separate client and server modules while loading the JSON config files.
17
+ const [clientModules, serverModules] = serverConfigPaths.reduce((acc, configFile) => {
18
+ if (!fs__default.existsSync(configFile)) {
19
+ console.error(`Config file not found: ${configFile}`);
20
+ process.exit(1);
21
+ }
22
+ const configData = JSON.parse(fs__default.readFileSync(configFile, 'utf-8'));
23
+ // Process regular modules.
24
+ configData.modules?.forEach((mod) => {
25
+ if (mod.endsWith('-server')) {
26
+ acc[1].push(mod);
27
+ }
28
+ else {
29
+ acc[0].push(mod);
30
+ }
31
+ });
32
+ // Process external modules.
33
+ configData.externalModules?.forEach((mod) => {
34
+ if (mod.endsWith('-server')) {
35
+ acc[1].push(mod);
36
+ }
37
+ else {
38
+ acc[0].push(mod);
39
+ }
40
+ });
41
+ // Process devModules.
42
+ configData.devModules?.forEach((mod) => {
43
+ if (mod.endsWith('-server')) {
44
+ acc[1].push(mod);
45
+ }
46
+ else {
47
+ acc[0].push(mod);
48
+ }
49
+ });
50
+ return acc;
51
+ }, [[], []]);
52
+ // Combine modules uniquely
53
+ const allModules = [...new Set([...clientModules, ...serverModules])];
54
+ const processedModules = new Set();
55
+ return allModules.reduce((acc, moduleName) => {
56
+ try {
57
+ let resolvedFile;
58
+ try {
59
+ // Attempt normal resolution.
60
+ resolvedFile = esmRequire.resolve(moduleName);
61
+ }
62
+ catch (err) {
63
+ // Fallback resolution: if the module name includes "/lib", remove it and try again.
64
+ const fallbackModule = moduleName.includes('/lib') ? moduleName.replace(/\/lib.*$/, '') : moduleName;
65
+ try {
66
+ resolvedFile = esmRequire.resolve(fallbackModule);
67
+ }
68
+ catch (err2) {
69
+ console.warn(`Could not resolve module ${moduleName} even with fallback ${fallbackModule}. Skipping.`);
70
+ return acc;
71
+ }
72
+ }
73
+ const dirName = path__default.dirname(resolvedFile);
74
+ const modulePath = path__default.relative(pathsConfig.repoRoot, dirName);
75
+ // Reverse the split parts to check if "node_modules" exists.
76
+ const [dir, pkg, ...rest] = modulePath.split('/').reverse();
77
+ const isLocal = !rest.includes('node_modules');
78
+ const baseModule = isLocal ? [...rest].reverse().join('/') : modulePath.replace('/lib', '');
79
+ if (processedModules.has(baseModule)) {
80
+ return acc;
81
+ }
82
+ processedModules.add(baseModule);
83
+ // For local modules, use "src" directory; for node_modules, use "lib"
84
+ const srcOrLib = isLocal ? 'src' : 'lib';
85
+ const generatePath = (type) => `${baseModule}${isLocal ? `/${type}` : ''}/${srcOrLib}`;
86
+ // For local modules, always return all module keys.
87
+ if (isLocal) {
88
+ return [
89
+ ...acc,
90
+ {
91
+ client: generatePath('client'),
92
+ core: generatePath('core'),
93
+ browser: generatePath('browser'),
94
+ server: generatePath('server'),
95
+ },
96
+ ];
97
+ }
98
+ // Otherwise, handle node_module naming conventions.
99
+ // If the baseModule ends with "-browser".
100
+ if (baseModule.endsWith('-browser')) {
101
+ return [
102
+ ...acc,
103
+ {
104
+ browser: `${baseModule}/${srcOrLib}`,
105
+ client: `${baseModule.replace(/-browser$/, '-client')}/${srcOrLib}`,
106
+ core: `${baseModule.replace(/-browser$/, '-core')}/${srcOrLib}`,
107
+ },
108
+ ];
109
+ }
110
+ if (baseModule.endsWith('-server')) {
111
+ return [
112
+ ...acc,
113
+ {
114
+ server: `${baseModule}/${srcOrLib}`,
115
+ },
116
+ ];
117
+ }
118
+ if (baseModule.includes('-browser')) {
119
+ return [
120
+ ...acc,
121
+ {
122
+ browser: `${baseModule}/${srcOrLib}`,
123
+ },
124
+ ];
125
+ }
126
+ // Default fallback.
127
+ return [
128
+ ...acc,
129
+ {
130
+ independent: `${baseModule}/${srcOrLib}`,
131
+ },
132
+ ];
133
+ }
134
+ catch (e) {
135
+ console.error(e);
136
+ console.log('Error while processing module:', moduleName);
137
+ return acc;
138
+ }
139
+ }, []);
140
+ }export{readModules};//# sourceMappingURL=readModules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readModules.js","sources":["../../../src/tools/codegen/readModules.ts"],"sourcesContent":[null],"names":["fs","path"],"mappings":"0IAKA;AACA;AAEA;AACA,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElD;;;;;;;;;AASG;AACa,SAAA,WAAW,CAAC,iBAAA,GAA8B,EAAE,EAAA;;AAExD,IAAA,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAC3D,CAAC,GAAG,EAAE,UAAU,KAAI;QAChB,IAAI,CAACA,WAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;AAC5B,YAAA,OAAO,CAAC,KAAK,CAAC,0BAA0B,UAAU,CAAA,CAAE,CAAC,CAAC;AACtD,YAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACnB;AACD,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAACA,WAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;;QAGpE,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GAAW,KAAI;AACxC,YAAA,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;gBACzB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACpB;iBAAM;gBACH,GAAG,CAAC,CAAC,CAA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AAE,CAAA;AACvC,qBAAA;iBACJ,CAAC;aACL;;YAED,OAAO;AACH,gBAAA,GAAG,GAAG;AACN,gBAAA;AACI,oBAAA,WAAW,EAAE,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA;AAC3C,iBAAA;aACJ,CAAC;SACL;QAAC,OAAO,CAAC,EAAE;AACR,YAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACjB,YAAA,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;AAC1D,YAAA,OAAO,GAAG,CAAC;SACd;KACJ,EAAE,EAAW,CAAC,CAAC;AACpB"}
@@ -0,0 +1,61 @@
1
+ 'use strict';var fs=require('fs-extra'),path=require('path'),url=require('url');var_documentCurrentScript=typeofdocument!=='undefined'?document.currentScript:null;const currentFilename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('tools/codegen/setupCommonPackage.cjs', document.baseURI).href)));
2
+ const currentDirname = path.dirname(currentFilename);
3
+ /**
4
+ * Strips template extension from filename
5
+ * @param filename Original filename like 'index.ts.template' or 'package.json.tpl'
6
+ * @returns Filename without template extension
7
+ */
8
+ function stripTemplateExtension(filename) {
9
+ return filename.replace(/\.(template|tpl)$/, '');
10
+ }
11
+ /**
12
+ * Recursively rename ".template" or ".tpl" files to their stripped names.
13
+ */
14
+ function renameTemplateFilesSync(dirPath) {
15
+ const entries = fs.readdirSync(dirPath, { withFileTypes: true });
16
+ for (const entry of entries) {
17
+ const entryPath = path.join(dirPath, entry.name);
18
+ if (entry.isDirectory()) {
19
+ renameTemplateFilesSync(entryPath);
20
+ }
21
+ else if (entry.name.endsWith('.template') || entry.name.endsWith('.tpl')) {
22
+ const newPath = path.join(dirPath, stripTemplateExtension(entry.name));
23
+ fs.moveSync(entryPath, newPath, { overwrite: true });
24
+ }
25
+ }
26
+ }
27
+ /**
28
+ * Clears and re-creates the "common" package directory,
29
+ * then copies the template content there.
30
+ *
31
+ * Provide optional projectPaths to override defaults.
32
+ */
33
+ function setupCommonPackage(projectPaths = {}) {
34
+ // Default template path, if none provided in projectPaths
35
+ const templatePath = projectPaths.templateCommonDir
36
+ ? path.resolve(projectPaths.templateCommonDir)
37
+ : path.join(currentDirname, 'templates/common');
38
+ // Default "common" package output, if none provided
39
+ const commonPackagePath = projectPaths.commonPackageDir
40
+ ? path.resolve(projectPaths.commonPackageDir)
41
+ : path.join(process.cwd(), 'packages/common');
42
+ console.log('--- Debug Info (setupCommonPackage) ---');
43
+ console.log('templatePath:', templatePath);
44
+ console.log('commonPackagePath:', commonPackagePath);
45
+ // 1) Remove existing directory
46
+ fs.removeSync(commonPackagePath);
47
+ // 2) Recreate it
48
+ fs.ensureDirSync(commonPackagePath);
49
+ // 3) Copy template into it
50
+ if (!fs.existsSync(templatePath)) {
51
+ console.error(`Template path not found: ${templatePath}`);
52
+ console.error('Check your config or directory layout.');
53
+ process.exit(1);
54
+ }
55
+ fs.copySync(templatePath, commonPackagePath, {
56
+ overwrite: true,
57
+ });
58
+ // 4) Recursively rename all ".template" or ".tpl" files
59
+ renameTemplateFilesSync(commonPackagePath);
60
+ console.log('Module generated from template!');
61
+ }exports.setupCommonPackage=setupCommonPackage;//# sourceMappingURL=setupCommonPackage.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupCommonPackage.cjs","sources":["../../../src/tools/codegen/setupCommonPackage.ts"],"sourcesContent":[null],"names":["fileURLToPath"],"mappings":"mKAUA,MAAM,eAAe,GAAGA,iBAAa,CAAC,sRAAe,CAAC,CAAC;AACvD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAErD;;;;AAIG;AACH,SAAS,sBAAsB,CAAC,QAAgB,EAAA;IAC5C,OAAO,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,E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AAC;AAElD,IAAA,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AACvD,IAAA,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AAC3C,IAAA,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;;AAGrD,IAAA,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;;AAGjC,IAAA,EAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;;IAGpC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;AAC9B,QAAA,OAAO,CAAC,KAAK,CAAC,4BAA4B,YAAY,CAAA,CAAE,CAAC,CAAC;AAC1D,QAAA,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;AACxD,QAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACnB;AAED,IAAA,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,EAAE;AACzC,QAAA,SAAS,EAAE,IAAI;AAClB,KAAA,CAAC,CAAC;;IAGH,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AAE3C,IAAA,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AACnD"}
@@ -0,0 +1,12 @@
1
+ interface ProjectPaths {
2
+ templateCommonDir?: string;
3
+ commonPackageDir?: string;
4
+ }
5
+ /**
6
+ * Clears and re-creates the "common" package directory,
7
+ * then copies the template content there.
8
+ *
9
+ * Provide optional projectPaths to override defaults.
10
+ */
11
+ export declare function setupCommonPackage(projectPaths?: ProjectPaths): void;
12
+ export {};
@@ -0,0 +1,61 @@
1
+ import fs from'fs-extra';import path__default from'path';import {fileURLToPath}from'url';const currentFilename = fileURLToPath(import.meta.url);
2
+ const currentDirname = path__default.dirname(currentFilename);
3
+ /**
4
+ * Strips template extension from filename
5
+ * @param filename Original filename like 'index.ts.template' or 'package.json.tpl'
6
+ * @returns Filename without template extension
7
+ */
8
+ function stripTemplateExtension(filename) {
9
+ return filename.replace(/\.(template|tpl)$/, '');
10
+ }
11
+ /**
12
+ * Recursively rename ".template" or ".tpl" files to their stripped names.
13
+ */
14
+ function renameTemplateFilesSync(dirPath) {
15
+ const entries = fs.readdirSync(dirPath, { withFileTypes: true });
16
+ for (const entry of entries) {
17
+ const entryPath = path__default.join(dirPath, entry.name);
18
+ if (entry.isDirectory()) {
19
+ renameTemplateFilesSync(entryPath);
20
+ }
21
+ else if (entry.name.endsWith('.template') || entry.name.endsWith('.tpl')) {
22
+ const newPath = path__default.join(dirPath, stripTemplateExtension(entry.name));
23
+ fs.moveSync(entryPath, newPath, { overwrite: true });
24
+ }
25
+ }
26
+ }
27
+ /**
28
+ * Clears and re-creates the "common" package directory,
29
+ * then copies the template content there.
30
+ *
31
+ * Provide optional projectPaths to override defaults.
32
+ */
33
+ function setupCommonPackage(projectPaths = {}) {
34
+ // Default template path, if none provided in projectPaths
35
+ const templatePath = projectPaths.templateCommonDir
36
+ ? path__default.resolve(projectPaths.templateCommonDir)
37
+ : path__default.join(currentDirname, 'templates/common');
38
+ // Default "common" package output, if none provided
39
+ const commonPackagePath = projectPaths.commonPackageDir
40
+ ? path__default.resolve(projectPaths.commonPackageDir)
41
+ : path__default.join(process.cwd(), 'packages/common');
42
+ console.log('--- Debug Info (setupCommonPackage) ---');
43
+ console.log('templatePath:', templatePath);
44
+ console.log('commonPackagePath:', commonPackagePath);
45
+ // 1) Remove existing directory
46
+ fs.removeSync(commonPackagePath);
47
+ // 2) Recreate it
48
+ fs.ensureDirSync(commonPackagePath);
49
+ // 3) Copy template into it
50
+ if (!fs.existsSync(templatePath)) {
51
+ console.error(`Template path not found: ${templatePath}`);
52
+ console.error('Check your config or directory layout.');
53
+ process.exit(1);
54
+ }
55
+ fs.copySync(templatePath, commonPackagePath, {
56
+ overwrite: true,
57
+ });
58
+ // 4) Recursively rename all ".template" or ".tpl" files
59
+ renameTemplateFilesSync(commonPackagePath);
60
+ console.log('Module generated from template!');
61
+ }export{setupCommonPackage};//# sourceMappingURL=setupCommonPackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupCommonPackage.js","sources":["../../../src/tools/codegen/setupCommonPackage.ts"],"sourcesContent":[null],"names":["path"],"mappings":"yFAUA,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvD,MAAM,cAAc,GAAGA,aAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAErD;;;;AAIG;AACH,SAAS,sBAAsB,CAAC,QAAgB,EAAA;IAC5C,OAAO,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;AACrD,CAAC;AAED;;AAEG;AACH,SAAS,uBAAuB,CAAC,OAAe,EAAA;AAC5C,IAAA,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,IAAA,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;AACzB,QAAA,MAAM,SAAS,GAAGA,aAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AACjD,QAAA,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE;YACrB,uBAAuB,CAAC,SAAS,CAAC,CAAC;SACtC;AAAM,aAAA,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACxE,YAAA,MAAM,OAAO,GAAGA,aAAI,CAAC,IAAI,CAAC,OAAO,EAAE,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACvE,YAAA,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SACxD;KACJ;AACL,CAAC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