@common-stack/rollup-vite-utils 5.0.5-alpha.0 → 6.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.
- package/lib/constants/constants.cjs +4 -0
- package/lib/constants/constants.cjs.map +1 -0
- package/lib/constants/constants.d.ts +1 -0
- package/lib/constants/constants.js +2 -1
- package/lib/constants/constants.js.map +1 -1
- package/lib/default-config.json.cjs +31 -0
- package/lib/default-config.json.cjs.map +1 -0
- package/lib/index.cjs +1 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.js +1 -1
- package/lib/preStartup/configLoader/configLoader.cjs +27 -0
- package/lib/preStartup/configLoader/configLoader.cjs.map +1 -0
- package/lib/preStartup/configLoader/envLoader.cjs +10 -0
- package/lib/preStartup/configLoader/envLoader.cjs.map +1 -0
- package/lib/preStartup/configLoader/index.cjs +1 -0
- package/lib/preStartup/configLoader/index.cjs.map +1 -0
- package/lib/preStartup/copyIfVersionChanged.cjs +110 -0
- package/lib/preStartup/copyIfVersionChanged.cjs.map +1 -0
- package/lib/rollup/modifyLibFiles/extractGraphQLQueries.cjs +59 -0
- package/lib/rollup/modifyLibFiles/extractGraphQLQueries.cjs.map +1 -0
- package/lib/rollup/modifyLibFiles/handleComponentOrDialog.cjs +236 -0
- package/lib/rollup/modifyLibFiles/handleComponentOrDialog.cjs.map +1 -0
- package/lib/rollup/modifyLibFiles/handleIconSVGFiles.cjs +25 -0
- package/lib/rollup/modifyLibFiles/handleIconSVGFiles.cjs.map +1 -0
- package/lib/rollup/modifyLibFiles/handleWrappers.cjs +34 -0
- package/lib/rollup/modifyLibFiles/handleWrappers.cjs.map +1 -0
- package/lib/rollup/modifyLibFiles/utils.cjs +19 -0
- package/lib/rollup/modifyLibFiles/utils.cjs.map +1 -0
- package/lib/rollup/pluginIgnore.cjs +17 -0
- package/lib/rollup/pluginIgnore.cjs.map +1 -0
- package/lib/rollup/rollupPluginAddJsExtension.cjs +68 -0
- package/lib/rollup/rollupPluginAddJsExtension.cjs.map +1 -0
- package/lib/rollup/rollupPluginGenerateJson.cjs +39 -0
- package/lib/rollup/rollupPluginGenerateJson.cjs.map +1 -0
- package/lib/rollup/rollupPluginModifyLibFiles.cjs +50 -0
- package/lib/rollup/rollupPluginModifyLibFiles.cjs.map +1 -0
- package/lib/utils/setupConfig.cjs +65 -0
- package/lib/utils/setupConfig.cjs.map +1 -0
- package/lib/utils/utils.cjs +188 -0
- package/lib/utils/utils.cjs.map +1 -0
- package/lib/utils/utils.d.ts +12 -0
- package/lib/utils/utils.js +98 -2
- package/lib/utils/utils.js.map +1 -1
- package/lib/utils/withErrorHandleUtil.cjs +92 -0
- package/lib/utils/withErrorHandleUtil.cjs.map +1 -0
- package/lib/vite-plugins/i18n-internationalization-plugin.cjs +93 -0
- package/lib/vite-plugins/i18n-internationalization-plugin.cjs.map +1 -0
- package/lib/vite-plugins/vite-plugin-virutal-imports.cjs +27 -0
- package/lib/vite-plugins/vite-plugin-virutal-imports.cjs.map +1 -0
- package/lib/vite-wrappers/dialog-wrapper.cjs +53 -0
- package/lib/vite-wrappers/dialog-wrapper.cjs.map +1 -0
- package/lib/vite-wrappers/icon-switch.cjs +89 -0
- package/lib/vite-wrappers/icon-switch.cjs.map +1 -0
- package/lib/vite-wrappers/json-wrappers.cjs +132 -0
- package/lib/vite-wrappers/json-wrappers.cjs.map +1 -0
- package/lib/vite-wrappers/loaderGenerator.cjs +245 -0
- package/lib/vite-wrappers/loaderGenerator.cjs.map +1 -0
- package/lib/vite-wrappers/wrapperComponent.cjs +336 -0
- package/lib/vite-wrappers/wrapperComponent.cjs.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';var t=require('@babel/types'),utils=require('./utils.cjs');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var t__namespace=/*#__PURE__*/_interopNamespaceDefault(t);function handleWrappers(astroPath, filePath, dist) {
|
|
2
|
+
const parentObjectExpression = astroPath.findParent((p) => p.isObjectExpression());
|
|
3
|
+
const wrapperPaths = [];
|
|
4
|
+
astroPath.node.value.elements.forEach((element) => {
|
|
5
|
+
if (t__namespace.isArrowFunctionExpression(element) &&
|
|
6
|
+
t__namespace.isCallExpression(element.body) &&
|
|
7
|
+
t__namespace.isImport(element.body.callee)) {
|
|
8
|
+
const importArg = element.body.arguments[0];
|
|
9
|
+
if (t__namespace.isStringLiteral(importArg)) {
|
|
10
|
+
const importPath = importArg.value;
|
|
11
|
+
const normalizedImportPath = utils.processImportPaths(importPath, filePath, dist);
|
|
12
|
+
wrapperPaths.push(normalizedImportPath);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
if (wrapperPaths.length > 0) {
|
|
17
|
+
if (parentObjectExpression && t__namespace.isObjectExpression(parentObjectExpression.node)) {
|
|
18
|
+
const existingWrapperPaths = parentObjectExpression.node.properties.find((prop) => t__namespace.isObjectProperty(prop) &&
|
|
19
|
+
t__namespace.isIdentifier(prop.key) &&
|
|
20
|
+
prop.key.name === 'wrapperPaths');
|
|
21
|
+
if (existingWrapperPaths &&
|
|
22
|
+
t__namespace.isArrayExpression(existingWrapperPaths.value)) {
|
|
23
|
+
existingWrapperPaths.value.elements.push(...wrapperPaths.map((path) => t__namespace.stringLiteral(path)));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const wrapperPathsProperty = t__namespace.objectProperty(t__namespace.identifier('wrapperPaths'), t__namespace.arrayExpression(wrapperPaths.map((path) => t__namespace.stringLiteral(path))));
|
|
27
|
+
parentObjectExpression.node.properties.push(wrapperPathsProperty);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
astroPath.remove(); // Remove the wrappers property
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}exports.handleWrappers=handleWrappers;//# sourceMappingURL=handleWrappers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleWrappers.cjs","sources":["../../../src/rollup/modifyLibFiles/handleWrappers.ts"],"sourcesContent":[null],"names":["t","processImportPaths"],"mappings":"yaAIgB,cAAc,CAC1B,SAAqC,EACrC,QAAgB,EAChB,IAAY,EAAA;AAEZ,IAAA,MAAM,sBAAsB,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,KAClD,CAAC,CAAC,kBAAkB,EAAE,CACc,CAAC;IACzC,MAAM,YAAY,GAAa,EAAE,CAAC;AAEjC,IAAA,SAAS,CAAC,IAAI,CAAC,KAA2B,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;AACrE,QAAA,IACIA,YAAC,CAAC,yBAAyB,CAAC,OAAO,CAAC;AACpC,YAAAA,YAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC;YAChCA,YAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EACjC;YACE,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC5C,YAAA,IAAIA,YAAC,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE;AAC9B,gBAAA,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC;gBACnC,MAAM,oBAAoB,GAAGC,wBAAkB,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC5E,gBAAA,YAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;aAC3C;SACJ;AACL,KAAC,CAAC,CAAC;AAEH,IAAA,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;QACzB,IAAI,sBAAsB,IAAID,YAAC,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;YAC7E,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CACpE,CAAC,IAAI,KACDA,YAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC;AACxB,gBAAAA,YAAC,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB,gBAAA,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,cAAc,CACP,CAAC;AAElC,YAAA,IACI,oBAAoB;gBACpBA,YAAC,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,KAAK,CAAC,EACjD;gBACE,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CACpC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,KAAKA,YAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CACvD,CAAC;aACL;iBAAM;AACH,gBAAA,MAAM,oBAAoB,GAAGA,YAAC,CAAC,cAAc,CACzCA,YAAC,CAAC,UAAU,CAAC,cAAc,CAAC,EAC5BA,YAAC,CAAC,eAAe,CACb,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,KAAKA,YAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CACpD,CACJ,CAAC;gBACF,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;aACrE;SACJ;AACD,QAAA,SAAS,CAAC,MAAM,EAAE,CAAC;AACnB,QAAA,OAAO,IAAI,CAAC;KACf;AACD,IAAA,OAAO,KAAK,CAAC;AACjB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';var fs=require('fs'),path=require('path');/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
function processImportPaths(importPath, filePath, dist) {
|
|
3
|
+
const fullPath = path.resolve(path.dirname(filePath), importPath);
|
|
4
|
+
const packageJsonPath = findPackageJson(path.dirname(path.resolve(process.cwd(), dist)));
|
|
5
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
6
|
+
const relativePath = path.relative(path.dirname(packageJsonPath), fullPath);
|
|
7
|
+
return `${packageJson.name}/${relativePath.replace(/\\/g, '/')}`;
|
|
8
|
+
}
|
|
9
|
+
function findPackageJson(directory) {
|
|
10
|
+
let currentDir = directory;
|
|
11
|
+
while (currentDir && currentDir !== path.parse(currentDir).root) {
|
|
12
|
+
const packageJsonPath = path.join(currentDir, 'package.json');
|
|
13
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
14
|
+
return packageJsonPath;
|
|
15
|
+
}
|
|
16
|
+
currentDir = path.dirname(currentDir);
|
|
17
|
+
}
|
|
18
|
+
throw new Error(`No package.json found in path ${directory}`);
|
|
19
|
+
}exports.findPackageJson=findPackageJson;exports.processImportPaths=processImportPaths;//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../src/rollup/modifyLibFiles/utils.ts"],"sourcesContent":[null],"names":[],"mappings":"uDAAA;SAKgB,kBAAkB,CAAC,UAAkB,EAAE,QAAgB,EAAE,IAAY,EAAA;AACjF,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACzF,IAAA,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AACzE,IAAA,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5E,IAAA,OAAO,CAAG,EAAA,WAAW,CAAC,IAAI,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;AACrE,CAAC;AAEK,SAAU,eAAe,CAAC,SAAiB,EAAA;IAC7C,IAAI,UAAU,GAAG,SAAS,CAAC;AAC3B,IAAA,OAAO,UAAU,IAAI,UAAU,KAAK,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE;QAC7D,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AAC9D,QAAA,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE;AAChC,YAAA,OAAO,eAAe,CAAC;SAC1B;AACD,QAAA,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACzC;AACD,IAAA,MAAM,IAAI,KAAK,CAAC,iCAAiC,SAAS,CAAA,CAAE,CAAC,CAAC;AAClE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';function ignoreCssUrlPlugin() {
|
|
2
|
+
return {
|
|
3
|
+
name: 'ignore-css-url',
|
|
4
|
+
resolveId(source) {
|
|
5
|
+
if (source.match(/\.css\?url$/) && (source.startsWith('../') || source.startsWith('./'))) {
|
|
6
|
+
return { id: source, external: true }; // Mark as external
|
|
7
|
+
}
|
|
8
|
+
return null;
|
|
9
|
+
},
|
|
10
|
+
load(id) {
|
|
11
|
+
if (id.match(/\.css\?url$/) && (id.startsWith('../') || id.startsWith('./'))) {
|
|
12
|
+
return ''; // Ignore the file by returning an empty string
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}exports.ignoreCssUrlPlugin=ignoreCssUrlPlugin;//# sourceMappingURL=pluginIgnore.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginIgnore.cjs","sources":["../../src/rollup/pluginIgnore.ts"],"sourcesContent":[null],"names":[],"mappings":"sBAAgB,kBAAkB,GAAA;IAChC,OAAO;AACL,QAAA,IAAI,EAAE,gBAAgB;AACtB,QAAA,SAAS,CAAC,MAAM,EAAA;YACd,IAAI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE;gBACxF,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;aACvC;AACD,YAAA,OAAO,IAAI,CAAC;SACb;AACD,QAAA,IAAI,CAAC,EAAE,EAAA;YACL,IAAI,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE;gBAC5E,OAAO,EAAE,CAAC;aACX;AACD,YAAA,OAAO,IAAI,CAAC;SACb;KACF,CAAC;AACJ"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var parser=require('@babel/parser'),generateSource=require('@babel/generator'),traverseSource=require('@babel/traverse');// to support esm default
|
|
2
|
+
const traverse = traverseSource.default ?? traverseSource;
|
|
3
|
+
const generate = generateSource.default ?? generateSource;
|
|
4
|
+
const addJsExtensionToImportsPlugin = (options) => {
|
|
5
|
+
const knownNeedToAddIndexJs = ['@apollo/client'];
|
|
6
|
+
const needToAddIndexJs = Array.from(new Set([...options.needToAddIndexJs, ...knownNeedToAddIndexJs]));
|
|
7
|
+
const createRegexFromPackagePattern = (pattern) => {
|
|
8
|
+
const escapedPattern = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // Escape special characters
|
|
9
|
+
return new RegExp(`^${escapedPattern.replace(/\\\*/g, '.*')}`);
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
name: 'add-js-extension-to-imports',
|
|
13
|
+
transform(code, id) {
|
|
14
|
+
if (!/\.(tsx?|jsx?)$/.test(id))
|
|
15
|
+
return null;
|
|
16
|
+
const ast = parser.parse(code, {
|
|
17
|
+
sourceType: 'module',
|
|
18
|
+
plugins: ['typescript', 'jsx'],
|
|
19
|
+
});
|
|
20
|
+
traverse(ast, {
|
|
21
|
+
ImportDeclaration(path) {
|
|
22
|
+
const source = path.node.source.value;
|
|
23
|
+
if (/\.[a-z]+(\?.*)?$/.test(source) || (options.excludeImports && options.excludeImports.includes(source))) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (source.startsWith('./') || source.startsWith('../'))
|
|
27
|
+
return;
|
|
28
|
+
const getPackageName = (importPath) => {
|
|
29
|
+
if (importPath.startsWith('@')) {
|
|
30
|
+
const match = importPath.match(/^(@[^/]+\/[^/]+)/);
|
|
31
|
+
return match ? match[1] : null;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const match = importPath.match(/^([^/]+)/);
|
|
35
|
+
return match ? match[1] : null;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const packageName = getPackageName(source);
|
|
39
|
+
const shouldTransform = options.packages === '*' || options.packages.some(pkgPattern => {
|
|
40
|
+
const regex = createRegexFromPackagePattern(pkgPattern);
|
|
41
|
+
return regex.test(source);
|
|
42
|
+
});
|
|
43
|
+
if (!shouldTransform && !needToAddIndexJs.includes(packageName)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const isInExceptionList = packageName && needToAddIndexJs.includes(packageName);
|
|
47
|
+
const slashCount = (source.match(/\//g) || []).length;
|
|
48
|
+
if (shouldTransform || isInExceptionList) {
|
|
49
|
+
if (isInExceptionList) {
|
|
50
|
+
path.node.source.value = `${source}/index.js`;
|
|
51
|
+
}
|
|
52
|
+
else if (source.startsWith('@') && slashCount >= 2) {
|
|
53
|
+
path.node.source.value = `${source}.js`;
|
|
54
|
+
}
|
|
55
|
+
else if (!source.startsWith('@') && slashCount >= 1) {
|
|
56
|
+
path.node.source.value = `${source}.js`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
const output = generate(ast, {}, code);
|
|
62
|
+
return {
|
|
63
|
+
code: output.code,
|
|
64
|
+
map: output.map,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
};exports.default=addJsExtensionToImportsPlugin;//# sourceMappingURL=rollupPluginAddJsExtension.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollupPluginAddJsExtension.cjs","sources":["../../src/rollup/rollupPluginAddJsExtension.ts"],"sourcesContent":[null],"names":["parse"],"mappings":"+LAKA;AACA,MAAM,QAAQ,GAAI,cAAsB,CAAC,OAAO,IAAI,cAAc,CAAC;AACnE,MAAM,QAAQ,GAAI,cAAsB,CAAC,OAAO,IAAI,cAAc,CAAC;AAQnE,MAAM,6BAA6B,GAAG,CAAC,OAA8B,KAAI;AACrE,IAAA,MAAM,qBAAqB,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjD,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAEtG,IAAA,MAAM,6BAA6B,GAAG,CAAC,OAAe,KAAI;AACtD,QAAA,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACtE,QAAA,OAAO,IAAI,MAAM,CAAC,CAAA,CAAA,EAAI,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA,CAAE,CAAC,CAAC;AACnE,KAAC,CAAC;IAEF,OAAO;AACH,QAAA,IAAI,EAAE,6BAA6B;QACnC,SAAS,CAAC,IAAY,EAAE,EAAU,EAAA;AAC9B,YAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAA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SACL;KACJ,CAAC;AACN"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var util=require('util'),glob=require('glob'),fs=require('fs'),path=require('path');const globPromise = util.promisify(glob.glob); // Make sure to call .glob here
|
|
2
|
+
function generateJsonFromSpecificFiles(options = {}) {
|
|
3
|
+
const { pattern = '**/**/compute.js', // Pattern to match files
|
|
4
|
+
dist = 'lib', // Default output directory
|
|
5
|
+
outputFile = 'routes.json', // Output filename
|
|
6
|
+
} = options;
|
|
7
|
+
return {
|
|
8
|
+
name: 'aggregate-compute-routes',
|
|
9
|
+
async writeBundle() {
|
|
10
|
+
// Changed from generateBundle to writeBundle
|
|
11
|
+
const files = await globPromise(path.join(dist, pattern), { absolute: true }); // Ensure paths are absolute
|
|
12
|
+
const allFilteredRoutes = [];
|
|
13
|
+
for (const file of files) {
|
|
14
|
+
try {
|
|
15
|
+
// Dynamically import the JS file assuming it exports filteredRoutes
|
|
16
|
+
const module = await import(file); // file is already absolute
|
|
17
|
+
if (module.filteredRoutes) {
|
|
18
|
+
const newRoutes = module.filteredRoutes.map((filteredRoute) => {
|
|
19
|
+
const routConfig = Object.values(filteredRoute)[0];
|
|
20
|
+
return { [routConfig.path]: routConfig };
|
|
21
|
+
});
|
|
22
|
+
allFilteredRoutes.push(...newRoutes);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.warn(`Error importing ${file}: ${error}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Ensure the dist directory exists
|
|
30
|
+
if (!fs.existsSync(dist)) {
|
|
31
|
+
fs.mkdirSync(dist, { recursive: true });
|
|
32
|
+
}
|
|
33
|
+
// Specify the output file path and write the aggregated filteredRoutes to a JSON file
|
|
34
|
+
const outputPath = path.join(dist, outputFile);
|
|
35
|
+
fs.writeFileSync(outputPath, JSON.stringify(allFilteredRoutes, null, 2), 'utf8');
|
|
36
|
+
console.log(`Aggregated filtered routes have been written to ${outputPath}`);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}exports.default=generateJsonFromSpecificFiles;//# sourceMappingURL=rollupPluginGenerateJson.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollupPluginGenerateJson.cjs","sources":["../../src/rollup/rollupPluginGenerateJson.ts"],"sourcesContent":[null],"names":["promisify"],"mappings":"0JAMA,MAAM,WAAW,GAAGA,cAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAO3B,SAAU,6BAA6B,CAAC,UAA+B,EAAE,EAAA;AACnF,IAAA,MAAM,EACF,OAAO,GAAG,kBAAkB;IAC5B,IAAI,GAAG,KAAK;IACZ,UAAU,GAAG,aAAa;AAC7B,MAAA,GAAG,OAAO,CAAC;IAEZ,OAAO;AACH,QAAA,IAAI,EAAE,0BAA0B;AAChC,QAAA,MAAM,WAAW,GAAA;;YAEb,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9E,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,YAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACtB,gBAAA,IAAI;;oBAEA,MAAM,MAAM,GAAG,MAAM,OAAO,IAAI,CAAC,CAAC;AAClC,oBAAA,IAAI,MAAM,CAAC,cAAc,EAAE;wBACvB,MAAM,SAAS,GAAI,MAAM,CAAC,cAAgC,CAAC,GAAG,CAAC,CAAC,aAAa,KAAI;4BAC7E,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;4BACnD,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,GAAG,UAAU,EAAE,CAAC;AAC7C,yBAAC,CAAC,CAAC;AACH,wBAAA,iBAAiB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;qBACxC;iBACJ;gBAAC,OAAO,KAAK,EAAE;oBACZ,IAAI,CAAC,IAAI,CAAC,CAAA,gBAAA,EAAmB,IAAI,CAAK,EAAA,EAAA,KAAK,CAAE,CAAA,CAAC,CAAC;iBAClD;aACJ;;YAED,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACtB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;aAC3C;;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC/C,YAAA,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjF,YAAA,OAAO,CAAC,GAAG,CAAC,mDAAmD,UAAU,CAAA,CAAE,CAAC,CAAC;SAChF;KACJ,CAAC;AACN"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var fs=require('fs'),path=require('path'),parser=require('@babel/parser'),traverseSource=require('@babel/traverse'),generateSource=require('@babel/generator'),t=require('@babel/types'),util=require('util'),glob=require('glob'),pluginutils=require('@rollup/pluginutils'),handleWrappers=require('./modifyLibFiles/handleWrappers.cjs'),handleComponentOrDialog=require('./modifyLibFiles/handleComponentOrDialog.cjs'),handleIconSVGFiles=require('./modifyLibFiles/handleIconSVGFiles.cjs');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var t__namespace=/*#__PURE__*/_interopNamespaceDefault(t);/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
// to support esm default
|
|
3
|
+
// https://github.com/babel/babel/issues/15269#issuecomment-1505804243
|
|
4
|
+
const traverse = traverseSource.default ?? traverseSource;
|
|
5
|
+
const generate = generateSource.default ?? generateSource;
|
|
6
|
+
const globPromise = util.promisify(glob);
|
|
7
|
+
function writeModifiedASTToFile(filePath, ast, originalCode) {
|
|
8
|
+
const output = generate(ast, {}, originalCode);
|
|
9
|
+
fs.writeFileSync(filePath, output.code);
|
|
10
|
+
}
|
|
11
|
+
function modifyLibFilesPlugin(options = {}) {
|
|
12
|
+
const filter = pluginutils.createFilter(options.include, options.exclude);
|
|
13
|
+
const dist = options.outputDir || './lib';
|
|
14
|
+
const pattern = '**/**/compute.js';
|
|
15
|
+
return {
|
|
16
|
+
name: 'modify-lib-files',
|
|
17
|
+
async writeBundle(outputOptions) {
|
|
18
|
+
const filesToModify = await globPromise(path.join(dist, pattern), { absolute: true });
|
|
19
|
+
filesToModify.forEach((filePath) => {
|
|
20
|
+
if (!filter(filePath))
|
|
21
|
+
return;
|
|
22
|
+
const code = fs.readFileSync(filePath, 'utf8');
|
|
23
|
+
const ast = parser.parse(code, {
|
|
24
|
+
sourceType: 'module',
|
|
25
|
+
plugins: ['js', 'dynamicImport'],
|
|
26
|
+
});
|
|
27
|
+
let modified = false;
|
|
28
|
+
traverse(ast, {
|
|
29
|
+
enter(astroPath) {
|
|
30
|
+
if (t__namespace.isObjectProperty(astroPath.node) && t__namespace.isIdentifier(astroPath.node.key)) {
|
|
31
|
+
if (astroPath.node.key.name === 'component' || astroPath.node.key.name === 'dialog') {
|
|
32
|
+
modified = handleComponentOrDialog.handleComponentOrDialog(astroPath, filePath, dist) || modified;
|
|
33
|
+
}
|
|
34
|
+
else if (astroPath.node.key.name === 'wrappers' && t__namespace.isArrayExpression(astroPath.node.value)) {
|
|
35
|
+
modified = handleWrappers.handleWrappers(astroPath, filePath, dist) || modified;
|
|
36
|
+
}
|
|
37
|
+
else if (astroPath.node.key.name === 'icon' && t__namespace.isObjectExpression(astroPath.node.value)) {
|
|
38
|
+
modified = handleIconSVGFiles.handleIconSVGFiles(astroPath, filePath, dist) || modified;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
if (modified) {
|
|
44
|
+
writeModifiedASTToFile(filePath, ast, code);
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}exports.default=modifyLibFilesPlugin;//# sourceMappingURL=rollupPluginModifyLibFiles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollupPluginModifyLibFiles.cjs","sources":["../../src/rollup/rollupPluginModifyLibFiles.ts"],"sourcesContent":[null],"names":["promisify","createFilter","parse","t","handleComponentOrDialog","handleWrappers","handleIconSVGFiles"],"mappings":"g4BAAA;AAeA;AACA;AACA,MAAM,QAAQ,GAAI,cAAsB,CAAC,OAAO,IAAI,cAAc,CAAC;AACnE,MAAM,QAAQ,GAAI,cAAsB,CAAC,OAAO,IAAI,cAAc,CAAC;AACnE,MAAM,WAAW,GAAGA,cAAS,CAAC,IAAI,CAAC,CAAC;AAGpC,SAAS,sBAAsB,CAAC,QAAgB,EAAE,GAAW,EAAE,YAAoB,EAAA;IAC/E,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;IAC/C,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAEa,SAAU,oBAAoB,CAAC,UAAyB,EAAE,EAAA;AACpE,IAAA,MAAM,MAAM,GAAGC,wBAAY,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAC9D,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC;IAC1C,MAAM,OAAO,GAAG,kBAAkB,CAAC;IAEnC,OAAO;AACH,QAAA,IAAI,E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wC,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC;6BACnG;iCAAM,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,IAAIF,YAAC,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gCACzF,QAAQ,GAAGG,qCAAkB,CAAC,SAAgB,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC;6BAC/E;yBACJ;qBACJ;AACJ,iBAAA,CAAC,CAAC;gBAEH,IAAI,QAAQ,EAAE;AACV,oBAAA,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;iBAC/C;AACD,gBAAA,OAAO,IAAI,CAAC;AAChB,aAAC,CAAC,CAAC;SACN;KACJ,CAAC;AACN"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';var defaultConfig=require('../default-config.json.cjs');function isObject(item) {
|
|
2
|
+
return item && typeof item === 'object' && !Array.isArray(item);
|
|
3
|
+
}
|
|
4
|
+
function deepEqual(obj1, obj2) {
|
|
5
|
+
if (obj1 === obj2)
|
|
6
|
+
return true;
|
|
7
|
+
if (isObject(obj1) && isObject(obj2)) {
|
|
8
|
+
const keys1 = Object.keys(obj1);
|
|
9
|
+
const keys2 = Object.keys(obj2);
|
|
10
|
+
if (keys1.length !== keys2.length)
|
|
11
|
+
return false;
|
|
12
|
+
for (const key of keys1) {
|
|
13
|
+
if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key]))
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
else if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
19
|
+
if (obj1.length !== obj2.length)
|
|
20
|
+
return false;
|
|
21
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
22
|
+
if (!deepEqual(obj1[i], obj2[i]))
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
function removeDeepDuplicates(array) {
|
|
30
|
+
return array.reduce((acc, item) => {
|
|
31
|
+
if (!acc.some(existingItem => deepEqual(existingItem, item))) {
|
|
32
|
+
acc.push(item);
|
|
33
|
+
}
|
|
34
|
+
return acc;
|
|
35
|
+
}, []);
|
|
36
|
+
}
|
|
37
|
+
function deepMerge(target, source) {
|
|
38
|
+
if (Array.isArray(target) && Array.isArray(source)) {
|
|
39
|
+
let output = target.concat(source);
|
|
40
|
+
return removeDeepDuplicates(output);
|
|
41
|
+
}
|
|
42
|
+
else if (isObject(target) && isObject(source)) {
|
|
43
|
+
let output = Object.assign({}, target);
|
|
44
|
+
Object.keys(source).forEach(key => {
|
|
45
|
+
if (isObject(source[key]) || Array.isArray(source[key])) {
|
|
46
|
+
if (!(key in target)) {
|
|
47
|
+
Object.assign(output, { [key]: source[key] });
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
output[key] = deepMerge(target[key], source[key]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
Object.assign(output, { [key]: source[key] });
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return output;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return source;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const setupConfig = (config) => {
|
|
64
|
+
return deepMerge(defaultConfig.default, config);
|
|
65
|
+
};exports.setupConfig=setupConfig;//# sourceMappingURL=setupConfig.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupConfig.cjs","sources":["../../src/utils/setupConfig.ts"],"sourcesContent":[null],"names":["defaultConfig"],"mappings":"qEAEA,SAAS,QAAQ,CAAC,IAAI,EAAA;AACpB,IAAA,OAAO,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO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AG,CAAC,CAAC,CAAC;iBACnD;aACF;iBAAM;AACL,gBAAA,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aAC/C;AACH,SAAC,CAAC,CAAC;AACH,QAAA,OAAO,MAAM,CAAC;KACf;SAAM;AACL,QAAA,OAAO,MAAM,CAAC;KACf;AACH,CAAC;AAEY,MAAA,WAAW,GAAG,CAAC,MAAM,KAAI;AACpC,IAAA,OAAO,SAAS,CAACA,qBAAa,EAAE,MAAM,CAAC,CAAC;AAC1C"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
'use strict';var fs=require('fs-extra'),path=require('path'),constants=require('../constants/constants.cjs');/**
|
|
2
|
+
* Get the version from the package.json file in the specified directory.
|
|
3
|
+
* @param packagePath - The path to the directory containing the package.json file.
|
|
4
|
+
* @returns The version string or null if an error occurs.
|
|
5
|
+
*/
|
|
6
|
+
async function getPackageVersion(packagePath) {
|
|
7
|
+
try {
|
|
8
|
+
const packageJson = await fs.readJson(path.join(packagePath, 'package.json'));
|
|
9
|
+
return packageJson.version;
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
console.error(`Error reading package.json from ${packagePath}:`, err);
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get metadata from the metadata file.
|
|
18
|
+
* @param appDir - The application directory containing the metadata file.
|
|
19
|
+
* @returns The metadata object.
|
|
20
|
+
*/
|
|
21
|
+
async function getMetadata(appDir) {
|
|
22
|
+
try {
|
|
23
|
+
const metaPath = path.join(appDir, constants.SYNC_META_JSON);
|
|
24
|
+
if (await fs.pathExists(metaPath)) {
|
|
25
|
+
return await fs.readJson(metaPath);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
console.error(`Error reading metadata from ${appDir}:`, err);
|
|
30
|
+
}
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Update the metadata file with new data.
|
|
35
|
+
* @param appDir - The application directory containing the metadata file.
|
|
36
|
+
* @param newMeta - The new metadata to save.
|
|
37
|
+
*/
|
|
38
|
+
async function updateMetadata(appDir, newMeta) {
|
|
39
|
+
const metaPath = path.join(appDir, constants.SYNC_META_JSON);
|
|
40
|
+
try {
|
|
41
|
+
await fs.writeJson(metaPath, newMeta, { spaces: 2 });
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
console.error(`Error writing metadata to ${appDir}:`, err);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generate the content for the modules.js file.
|
|
49
|
+
* @param packages - The list of packages to include.
|
|
50
|
+
* @returns The generated content for modules.js.
|
|
51
|
+
*/
|
|
52
|
+
function generateModulesFile(packages) {
|
|
53
|
+
let imports = `import { Feature } from '@common-stack/client-react';\n`;
|
|
54
|
+
let modules = ``;
|
|
55
|
+
packages.forEach((pkg, index) => {
|
|
56
|
+
const moduleName = `Module${index + 1}`;
|
|
57
|
+
imports += `import ${moduleName} from '${pkg}';\n`;
|
|
58
|
+
modules += `${moduleName}, `;
|
|
59
|
+
});
|
|
60
|
+
const featureSetup = `
|
|
61
|
+
const features = new Feature(
|
|
62
|
+
${modules.trim().slice(0, -1)}
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
export const plugins = features.getComponentFillPlugins();
|
|
66
|
+
|
|
67
|
+
export default features;
|
|
68
|
+
`;
|
|
69
|
+
return `${imports}\n${featureSetup}`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Write the generated content to the modules.js file.
|
|
73
|
+
* @param destDir - The destination directory.
|
|
74
|
+
* @param packages - The list of packages to include.
|
|
75
|
+
*/
|
|
76
|
+
function writeModuleFile(destDir, packages) {
|
|
77
|
+
const modulesFileContent = generateModulesFile(packages);
|
|
78
|
+
const newFilePath = path.join(destDir, constants.MODULES_JS);
|
|
79
|
+
fs.writeFileSync(newFilePath, modulesFileContent);
|
|
80
|
+
}
|
|
81
|
+
function findPackageDir(initialDir, packageName) {
|
|
82
|
+
let currentDir = initialDir;
|
|
83
|
+
while (currentDir !== path.parse(currentDir).root) {
|
|
84
|
+
const packagePath = path.join(currentDir, 'node_modules', packageName);
|
|
85
|
+
if (fs.existsSync(packagePath)) {
|
|
86
|
+
return packagePath;
|
|
87
|
+
}
|
|
88
|
+
currentDir = path.dirname(currentDir);
|
|
89
|
+
}
|
|
90
|
+
console.error(`Package ${packageName} not found from ${initialDir} up to root.`);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Generate the content for the modules.js file.
|
|
95
|
+
* @param config - The list of packages to include.
|
|
96
|
+
* @returns The generated content for modules.js.
|
|
97
|
+
*/
|
|
98
|
+
function generateBackendModulesFile(config) {
|
|
99
|
+
const packages = config.modules || [];
|
|
100
|
+
const devPackages = config.devModules || [];
|
|
101
|
+
const exPackages = config.externalModules || [];
|
|
102
|
+
let imports = `import { ContainerModule, interfaces } from 'inversify';
|
|
103
|
+
import { TaggedType } from '@common-stack/core';
|
|
104
|
+
import { Feature } from '@common-stack/server-core';
|
|
105
|
+
`;
|
|
106
|
+
let modules = ``;
|
|
107
|
+
let exModules = ``;
|
|
108
|
+
let devModules = ``;
|
|
109
|
+
packages.forEach((pkg, index) => {
|
|
110
|
+
const moduleName = `Module${index + 1}`;
|
|
111
|
+
imports += `import ${moduleName} from '${pkg}';\n`;
|
|
112
|
+
modules += `${moduleName}, `;
|
|
113
|
+
});
|
|
114
|
+
exPackages.forEach((pkg, index) => {
|
|
115
|
+
const moduleName = `ExModule${index + 1}`;
|
|
116
|
+
imports += `import ${moduleName} from '${pkg}';\n`;
|
|
117
|
+
exModules += `${moduleName}, `;
|
|
118
|
+
});
|
|
119
|
+
let featureSetup = `import { EnvironmentService } from '@adminide-stack/platform-server';
|
|
120
|
+
import { IAdminIdeSettings } from '@adminide-stack/core';
|
|
121
|
+
import { config } from '../config';
|
|
122
|
+
const environmentService = new EnvironmentService(null, null);
|
|
123
|
+
|
|
124
|
+
export const settings: IAdminIdeSettings & any = {
|
|
125
|
+
subTopic: config.CONNECTION_ID,
|
|
126
|
+
brigadeNamespace: 'brigade',
|
|
127
|
+
brigadeVersion: 'v1',
|
|
128
|
+
environmentService,
|
|
129
|
+
environment: {
|
|
130
|
+
args: ['--builtin-extensions-dir', '', '--disable-extensions', ''],
|
|
131
|
+
},
|
|
132
|
+
adminApiNamespace: config.ADMIN_API_NAMESPACE,
|
|
133
|
+
apiNamespace: config.API_NAMESPACE,
|
|
134
|
+
sshNamespace: config.API_NAMESPACE,
|
|
135
|
+
apiVersion: 'v1',
|
|
136
|
+
activityNamespace: config.ACTIVITY_NAMESPACE,
|
|
137
|
+
activityVersion: '',
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const defaultModule = () =>
|
|
141
|
+
new ContainerModule((bind: interfaces.Bind) => {
|
|
142
|
+
bind('Settings').toConstantValue(settings).whenTargetTagged('default', true);
|
|
143
|
+
bind('Settings').toConstantValue(settings).whenTargetTagged('microservice', true);
|
|
144
|
+
bind('Settings').toConstantValue(settings).whenTargetTagged(TaggedType.MICROSERVICE, true);
|
|
145
|
+
bind('IMongoDBSettings').toConstantValue(settings);
|
|
146
|
+
bind('IMongoDBSettings').toConstantValue(settings);
|
|
147
|
+
bind('MongoOptions').toConstantValue({});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const DefaultFeature = new Feature({
|
|
151
|
+
createContainerFunc: [defaultModule],
|
|
152
|
+
createHemeraContainerFunc: [defaultModule],
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
export const ExternalModules = new Feature(${exModules.trim().slice(0, -1)});
|
|
156
|
+
|
|
157
|
+
let DevModules = new Feature({});
|
|
158
|
+
|
|
159
|
+
if (config.isDev) {
|
|
160
|
+
`;
|
|
161
|
+
devPackages.forEach((pkg, index) => {
|
|
162
|
+
const moduleName = `DevModule${index + 1}`;
|
|
163
|
+
featureSetup += `const ${moduleName} = require('${pkg}');\n`;
|
|
164
|
+
devModules += `${moduleName}.default, `;
|
|
165
|
+
});
|
|
166
|
+
featureSetup += `DevModules = new Feature(${devModules.trim().slice(0, -1)});
|
|
167
|
+
}\n
|
|
168
|
+
const features = new Feature(
|
|
169
|
+
DefaultFeature,
|
|
170
|
+
${modules.trim()}
|
|
171
|
+
ExternalModules, DevModules
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
export default features;
|
|
175
|
+
`;
|
|
176
|
+
return `${imports}\n${featureSetup}`;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Write the generated content to the modules.js file.
|
|
180
|
+
* @param destDir - The destination directory.
|
|
181
|
+
* @param packages - The list of packages to include.
|
|
182
|
+
*/
|
|
183
|
+
function writeBackendModuleFile(destDir, config) {
|
|
184
|
+
const modulesFileContent = generateBackendModulesFile(config);
|
|
185
|
+
const newFilePath = path.join(destDir, constants.MODULES_TS);
|
|
186
|
+
fs.writeFileSync(newFilePath, modulesFileContent, { encoding: 'utf8', flag: 'w' });
|
|
187
|
+
console.log(`Updated ${newFilePath} based on config.json.`);
|
|
188
|
+
}exports.findPackageDir=findPackageDir;exports.generateBackendModulesFile=generateBackendModulesFile;exports.generateModulesFile=generateModulesFile;exports.getMetadata=getMetadata;exports.getPackageVersion=getPackageVersion;exports.updateMetadata=updateMetadata;exports.writeBackendModuleFile=writeBackendModuleFile;exports.writeModuleFile=writeModuleFile;//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../src/utils/utils.ts"],"sourcesContent":[null],"names":["SYNC_META_JSON","MODULES_JS","MODULES_TS"],"mappings":"6GAeA;;;;AAIG;AACI,eAAe,iBAAiB,CAAC,WAAmB,EAAA;AACvD,IAAA,IAAI;AACA,QAAA,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,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WAAW,WAAW,CAAA,sBAAA,CAAwB,CAAC,CAAC;AAChE"}
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -38,4 +38,16 @@ export declare function generateModulesFile(packages: string[]): string;
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function writeModuleFile(destDir: string, packages: string[]): void;
|
|
40
40
|
export declare function findPackageDir(initialDir: string, packageName: string): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Generate the content for the modules.js file.
|
|
43
|
+
* @param config - The list of packages to include.
|
|
44
|
+
* @returns The generated content for modules.js.
|
|
45
|
+
*/
|
|
46
|
+
export declare function generateBackendModulesFile(config: any): string;
|
|
47
|
+
/**
|
|
48
|
+
* Write the generated content to the modules.js file.
|
|
49
|
+
* @param destDir - The destination directory.
|
|
50
|
+
* @param packages - The list of packages to include.
|
|
51
|
+
*/
|
|
52
|
+
export declare function writeBackendModuleFile(destDir: string, config: any): void;
|
|
41
53
|
export {};
|