@common-stack/rollup-vite-utils 6.0.8-alpha.7 → 7.0.2-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/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/preStartup/configLoader/envLoader.cjs +1 -1
- package/lib/preStartup/configLoader/envLoader.cjs.map +1 -1
- package/lib/preStartup/configLoader/envLoader.js +1 -1
- package/lib/preStartup/configLoader/envLoader.js.map +1 -1
- package/lib/rollup/index.d.ts +1 -0
- package/lib/rollup/rollupPluginCamelcaseSvg.cjs +24 -0
- package/lib/rollup/rollupPluginCamelcaseSvg.cjs.map +1 -0
- package/lib/rollup/rollupPluginCamelcaseSvg.d.ts +8 -0
- package/lib/rollup/rollupPluginCamelcaseSvg.js +24 -0
- package/lib/rollup/rollupPluginCamelcaseSvg.js.map +1 -0
- package/lib/tools/codegen/commonPaths.cjs +20 -0
- package/lib/tools/codegen/commonPaths.cjs.map +1 -0
- package/lib/tools/codegen/commonPaths.d.ts +19 -0
- package/lib/tools/codegen/commonPaths.js +20 -0
- package/lib/tools/codegen/commonPaths.js.map +1 -0
- package/lib/tools/codegen/computeModules.cjs +47 -0
- package/lib/tools/codegen/computeModules.cjs.map +1 -0
- package/lib/tools/codegen/computeModules.d.ts +10 -0
- package/lib/tools/codegen/computeModules.js +47 -0
- package/lib/tools/codegen/computeModules.js.map +1 -0
- package/lib/tools/codegen/generateCodegenConfig.cjs +96 -0
- package/lib/tools/codegen/generateCodegenConfig.cjs.map +1 -0
- package/lib/tools/codegen/generateCodegenConfig.d.ts +16 -0
- package/lib/tools/codegen/generateCodegenConfig.js +96 -0
- package/lib/tools/codegen/generateCodegenConfig.js.map +1 -0
- package/lib/tools/codegen/generateCodegenConfig.test.d.ts +1 -0
- package/lib/tools/codegen/index.cjs +14 -0
- package/lib/tools/codegen/index.cjs.map +1 -0
- package/lib/tools/codegen/index.d.ts +5 -0
- package/lib/tools/codegen/index.js +14 -0
- package/lib/tools/codegen/index.js.map +1 -0
- package/lib/tools/codegen/modulePathParser.d.ts +56 -0
- package/lib/tools/codegen/performCopyOperations.cjs +236 -0
- package/lib/tools/codegen/performCopyOperations.cjs.map +1 -0
- package/lib/tools/codegen/performCopyOperations.d.ts +27 -0
- package/lib/tools/codegen/performCopyOperations.js +236 -0
- package/lib/tools/codegen/performCopyOperations.js.map +1 -0
- package/lib/tools/codegen/performCopyOperations.test.d.ts +1 -0
- package/lib/tools/codegen/readModules.cjs +249 -0
- package/lib/tools/codegen/readModules.cjs.map +1 -0
- package/lib/tools/codegen/readModules.d.ts +33 -0
- package/lib/tools/codegen/readModules.js +249 -0
- package/lib/tools/codegen/readModules.js.map +1 -0
- package/lib/tools/codegen/readModules.test.d.ts +1 -0
- package/lib/tools/codegen/setupCommonPackage.cjs +61 -0
- package/lib/tools/codegen/setupCommonPackage.cjs.map +1 -0
- package/lib/tools/codegen/setupCommonPackage.d.ts +12 -0
- package/lib/tools/codegen/setupCommonPackage.js +61 -0
- package/lib/tools/codegen/setupCommonPackage.js.map +1 -0
- package/lib/tools/codegen/templates/common/.npmignore.template +2 -0
- package/lib/tools/codegen/templates/common/package.json.template +25 -0
- package/lib/tools/codegen/templates/common/rollup.config.mjs.template +34 -0
- package/lib/tools/codegen/templates/common/src/apollo-context.ts.template +64 -0
- package/lib/tools/codegen/templates/common/src/configuration.ts.template +37 -0
- package/lib/tools/codegen/templates/common/src/generated/generated-models.ts.template +1 -0
- package/lib/tools/codegen/templates/common/src/index.ts.template +5 -0
- package/lib/tools/codegen/templates/common/src/permissions.ts.template +5 -0
- package/lib/tools/codegen/templates/common/src/types.ts.template +42 -0
- package/lib/tools/codegen/templates/common/tsconfig.json.template +16 -0
- package/lib/tools/index.d.ts +1 -0
- package/lib/utils/utils.cjs +21 -14
- package/lib/utils/utils.cjs.map +1 -1
- package/lib/utils/utils.d.ts +9 -3
- package/lib/utils/utils.js +21 -14
- package/lib/utils/utils.js.map +1 -1
- package/lib/vite-wrappers/generators/serverQueryLoaderGenerator.cjs +1 -1
- package/lib/vite-wrappers/generators/serverQueryLoaderGenerator.js +1 -1
- package/lib/vite-wrappers/json-wrappers.cjs +1 -0
- package/lib/vite-wrappers/json-wrappers.cjs.map +1 -1
- package/lib/vite-wrappers/json-wrappers.js +1 -0
- package/lib/vite-wrappers/json-wrappers.js.map +1 -1
- package/lib/vite-wrappers/wrapperComponent.cjs +9 -2
- package/lib/vite-wrappers/wrapperComponent.cjs.map +1 -1
- package/lib/vite-wrappers/wrapperComponent.js +9 -2
- package/lib/vite-wrappers/wrapperComponent.js.map +1 -1
- package/package.json +8 -6
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var wrapperComponent=require('./vite-wrappers/wrapperComponent.cjs'),jsonWrappers=require('./vite-wrappers/json-wrappers.cjs'),customRoutes=require('./vite-wrappers/custom-routes.cjs'),resourceParams=require('./vite-wrappers/generators/utils/resourceParams.cjs'),pickConfig=require('./vite-wrappers/generators/utils/pickConfig.cjs'),rollupPluginGenerateJson=require('./rollup/rollupPluginGenerateJson.cjs'),rollupPluginModifyLibFiles=require('./rollup/rollupPluginModifyLibFiles.cjs'),rollupPluginAddJsExtension=require('./rollup/rollupPluginAddJsExtension.cjs'),pluginIgnore=require('./rollup/pluginIgnore.cjs'),rollupPluginUpdateFromConfig=require('./rollup/rollupPluginUpdateFromConfig.cjs'),copyIfVersionChanged=require('./preStartup/copyIfVersionChanged.cjs');require('./preStartup/configLoader/index.cjs');var i18nInternationalizationPlugin=require('./vite-plugins/i18n-internationalization-plugin.cjs'),vitePluginVirutalImports=require('./vite-plugins/vite-plugin-virutal-imports.cjs'),utils=require('./utils/utils.cjs'),withErrorHandleUtil=require('./utils/withErrorHandleUtil.cjs'),setupConfig=require('./utils/setupConfig.cjs'),verifyConfig=require('./utils/verifyConfig.cjs'),configLoader=require('./preStartup/configLoader/configLoader.cjs'),envLoader=require('./preStartup/configLoader/envLoader.cjs');exports.getRootPath=wrapperComponent.getRootPath;exports.wrapRouteComponent=wrapperComponent.wrapRouteComponent;exports.defineRoutesConfig=jsonWrappers.defineRoutesConfig;exports.getHash=jsonWrappers.getHash;exports.loadRoutesConfig=jsonWrappers.loadRoutesConfig;exports.resolvePathsUsingPackages=jsonWrappers.resolvePathsUsingPackages;exports.createDummyFile=customRoutes.createDummyFile;exports.generateRoute=customRoutes.generateRoute;exports.resolveResourceParamsPlaceholders=resourceParams.resolveResourceParamsPlaceholders;exports.pickValues=pickConfig.pickValues;exports.d=rollupPluginGenerateJson;exports.k=rollupPluginModifyLibFiles;exports.l=rollupPluginAddJsExtension;exports.m=pluginIgnore;exports.updateFromConfig=rollupPluginUpdateFromConfig.updateFromConfig;exports.copyIfVersionChanged=copyIfVersionChanged.copyIfVersionChanged;exports.i18nInternationalizationPlugin=i18nInternationalizationPlugin.i18nInternationalizationPlugin;exports.virtualImportsPlugin=vitePluginVirutalImports.virtualImportsPlugin;exports.findPackageDir=utils.findPackageDir;exports.generateBackendModulesFile=utils.generateBackendModulesFile;exports.generateModulesFile=utils.generateModulesFile;exports.getMetadata=utils.getMetadata;exports.getPackageVersion=utils.getPackageVersion;exports.resolveModulesPath=utils.resolveModulesPath;exports.updateMetadata=utils.updateMetadata;exports.writeBackendModuleFile=utils.writeBackendModuleFile;exports.writeModuleFile=utils.writeModuleFile;exports.withErrorHandler=withErrorHandleUtil.withErrorHandler;exports.setupConfig=setupConfig.setupConfig;exports.verifyConfigSchema=verifyConfig.verifyConfigSchema;exports.performCopyOperations=configLoader.performCopyOperations;exports.resolveConfigPaths=configLoader.resolveConfigPaths;exports.loadEnvConfig=envLoader.loadEnvConfig;//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var wrapperComponent=require('./vite-wrappers/wrapperComponent.cjs'),jsonWrappers=require('./vite-wrappers/json-wrappers.cjs'),customRoutes=require('./vite-wrappers/custom-routes.cjs'),resourceParams=require('./vite-wrappers/generators/utils/resourceParams.cjs'),pickConfig=require('./vite-wrappers/generators/utils/pickConfig.cjs'),rollupPluginGenerateJson=require('./rollup/rollupPluginGenerateJson.cjs'),rollupPluginModifyLibFiles=require('./rollup/rollupPluginModifyLibFiles.cjs'),rollupPluginAddJsExtension=require('./rollup/rollupPluginAddJsExtension.cjs'),pluginIgnore=require('./rollup/pluginIgnore.cjs'),rollupPluginUpdateFromConfig=require('./rollup/rollupPluginUpdateFromConfig.cjs'),rollupPluginCamelcaseSvg=require('./rollup/rollupPluginCamelcaseSvg.cjs'),copyIfVersionChanged=require('./preStartup/copyIfVersionChanged.cjs');require('./preStartup/configLoader/index.cjs');var i18nInternationalizationPlugin=require('./vite-plugins/i18n-internationalization-plugin.cjs'),vitePluginVirutalImports=require('./vite-plugins/vite-plugin-virutal-imports.cjs'),utils=require('./utils/utils.cjs'),withErrorHandleUtil=require('./utils/withErrorHandleUtil.cjs'),setupConfig=require('./utils/setupConfig.cjs'),verifyConfig=require('./utils/verifyConfig.cjs'),index=require('./tools/codegen/index.cjs'),configLoader=require('./preStartup/configLoader/configLoader.cjs'),envLoader=require('./preStartup/configLoader/envLoader.cjs');exports.getRootPath=wrapperComponent.getRootPath;exports.wrapRouteComponent=wrapperComponent.wrapRouteComponent;exports.defineRoutesConfig=jsonWrappers.defineRoutesConfig;exports.getHash=jsonWrappers.getHash;exports.loadRoutesConfig=jsonWrappers.loadRoutesConfig;exports.resolvePathsUsingPackages=jsonWrappers.resolvePathsUsingPackages;exports.createDummyFile=customRoutes.createDummyFile;exports.generateRoute=customRoutes.generateRoute;exports.resolveResourceParamsPlaceholders=resourceParams.resolveResourceParamsPlaceholders;exports.pickValues=pickConfig.pickValues;exports.d=rollupPluginGenerateJson;exports.k=rollupPluginModifyLibFiles;exports.l=rollupPluginAddJsExtension;exports.m=pluginIgnore;exports.updateFromConfig=rollupPluginUpdateFromConfig.updateFromConfig;exports.c=rollupPluginCamelcaseSvg;exports.copyIfVersionChanged=copyIfVersionChanged.copyIfVersionChanged;exports.i18nInternationalizationPlugin=i18nInternationalizationPlugin.i18nInternationalizationPlugin;exports.virtualImportsPlugin=vitePluginVirutalImports.virtualImportsPlugin;exports.findPackageDir=utils.findPackageDir;exports.generateBackendModulesFile=utils.generateBackendModulesFile;exports.generateModulesFile=utils.generateModulesFile;exports.getMetadata=utils.getMetadata;exports.getPackageVersion=utils.getPackageVersion;exports.resolveModulesPath=utils.resolveModulesPath;exports.updateMetadata=utils.updateMetadata;exports.writeBackendModuleFile=utils.writeBackendModuleFile;exports.writeModuleFile=utils.writeModuleFile;exports.withErrorHandler=withErrorHandleUtil.withErrorHandler;exports.setupConfig=setupConfig.setupConfig;exports.verifyConfigSchema=verifyConfig.verifyConfigSchema;exports.runCodegenTasks=index.runCodegenTasks;exports.performCopyOperations=configLoader.performCopyOperations;exports.resolveConfigPaths=configLoader.resolveConfigPaths;exports.loadEnvConfig=envLoader.loadEnvConfig;//# sourceMappingURL=index.cjs.map
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getRootPath,wrapRouteComponent}from'./vite-wrappers/wrapperComponent.js';export{defineRoutesConfig,getHash,loadRoutesConfig,resolvePathsUsingPackages}from'./vite-wrappers/json-wrappers.js';export{createDummyFile,generateRoute}from'./vite-wrappers/custom-routes.js';export{resolveResourceParamsPlaceholders}from'./vite-wrappers/generators/utils/resourceParams.js';export{pickValues}from'./vite-wrappers/generators/utils/pickConfig.js';import*as rollupPluginGenerateJson from'./rollup/rollupPluginGenerateJson.js';export{rollupPluginGenerateJson as d };import*as rollupPluginModifyLibFiles from'./rollup/rollupPluginModifyLibFiles.js';export{rollupPluginModifyLibFiles as k };import*as rollupPluginAddJsExtension from'./rollup/rollupPluginAddJsExtension.js';export{rollupPluginAddJsExtension as l };import*as pluginIgnore from'./rollup/pluginIgnore.js';export{pluginIgnore as m };export{updateFromConfig}from'./rollup/rollupPluginUpdateFromConfig.js';export{copyIfVersionChanged}from'./preStartup/copyIfVersionChanged.js';import'./preStartup/configLoader/index.js';export{i18nInternationalizationPlugin}from'./vite-plugins/i18n-internationalization-plugin.js';export{virtualImportsPlugin}from'./vite-plugins/vite-plugin-virutal-imports.js';export{findPackageDir,generateBackendModulesFile,generateModulesFile,getMetadata,getPackageVersion,resolveModulesPath,updateMetadata,writeBackendModuleFile,writeModuleFile}from'./utils/utils.js';export{withErrorHandler}from'./utils/withErrorHandleUtil.js';export{setupConfig}from'./utils/setupConfig.js';export{verifyConfigSchema}from'./utils/verifyConfig.js';export{performCopyOperations,resolveConfigPaths}from'./preStartup/configLoader/configLoader.js';export{loadEnvConfig}from'./preStartup/configLoader/envLoader.js';//# sourceMappingURL=index.js.map
|
|
1
|
+
export{getRootPath,wrapRouteComponent}from'./vite-wrappers/wrapperComponent.js';export{defineRoutesConfig,getHash,loadRoutesConfig,resolvePathsUsingPackages}from'./vite-wrappers/json-wrappers.js';export{createDummyFile,generateRoute}from'./vite-wrappers/custom-routes.js';export{resolveResourceParamsPlaceholders}from'./vite-wrappers/generators/utils/resourceParams.js';export{pickValues}from'./vite-wrappers/generators/utils/pickConfig.js';import*as rollupPluginGenerateJson from'./rollup/rollupPluginGenerateJson.js';export{rollupPluginGenerateJson as d };import*as rollupPluginModifyLibFiles from'./rollup/rollupPluginModifyLibFiles.js';export{rollupPluginModifyLibFiles as k };import*as rollupPluginAddJsExtension from'./rollup/rollupPluginAddJsExtension.js';export{rollupPluginAddJsExtension as l };import*as pluginIgnore from'./rollup/pluginIgnore.js';export{pluginIgnore as m };export{updateFromConfig}from'./rollup/rollupPluginUpdateFromConfig.js';import*as rollupPluginCamelcaseSvg from'./rollup/rollupPluginCamelcaseSvg.js';export{rollupPluginCamelcaseSvg as c };export{copyIfVersionChanged}from'./preStartup/copyIfVersionChanged.js';import'./preStartup/configLoader/index.js';export{i18nInternationalizationPlugin}from'./vite-plugins/i18n-internationalization-plugin.js';export{virtualImportsPlugin}from'./vite-plugins/vite-plugin-virutal-imports.js';export{findPackageDir,generateBackendModulesFile,generateModulesFile,getMetadata,getPackageVersion,resolveModulesPath,updateMetadata,writeBackendModuleFile,writeModuleFile}from'./utils/utils.js';export{withErrorHandler}from'./utils/withErrorHandleUtil.js';export{setupConfig}from'./utils/setupConfig.js';export{verifyConfigSchema}from'./utils/verifyConfig.js';export{runCodegenTasks}from'./tools/codegen/index.js';export{performCopyOperations,resolveConfigPaths}from'./preStartup/configLoader/configLoader.js';export{loadEnvConfig}from'./preStartup/configLoader/envLoader.js';//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';var path=require('path'),dotenv=require('dotenv-esm');function loadEnvConfig(directoryName) {
|
|
2
2
|
let dotEnvResult;
|
|
3
|
-
if (process.env.
|
|
3
|
+
if (process.env.ENV_FILE) {
|
|
4
4
|
dotEnvResult = dotenv.config({ path: path.resolve(directoryName, process.env.ENV_FILE) });
|
|
5
5
|
if (dotEnvResult.error) {
|
|
6
6
|
throw dotEnvResult.error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envLoader.cjs","sources":["../../../src/preStartup/configLoader/envLoader.ts"],"sourcesContent":[null],"names":["resolve"],"mappings":"mEAGM,SAAU,aAAa,CAAC,aAAa,EAAA;AACvC,IAAA,IAAI,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"envLoader.cjs","sources":["../../../src/preStartup/configLoader/envLoader.ts"],"sourcesContent":[null],"names":["resolve"],"mappings":"mEAGM,SAAU,aAAa,CAAC,aAAa,EAAA;AACvC,IAAA,IAAI,YAAY,CAAC;AACjB,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;QACtB,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAEA,YAAO,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACrF,QAAA,IAAI,YAAY,CAAC,KAAK,EAAE;YACpB,MAAM,YAAY,CAAC,KAAK,CAAC;SAC5B;KACJ;AACD,IAAA,OAAO,YAAY,CAAC;AACxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {resolve}from'path';import dotenv from'dotenv-esm';function loadEnvConfig(directoryName) {
|
|
2
2
|
let dotEnvResult;
|
|
3
|
-
if (process.env.
|
|
3
|
+
if (process.env.ENV_FILE) {
|
|
4
4
|
dotEnvResult = dotenv.config({ path: resolve(directoryName, process.env.ENV_FILE) });
|
|
5
5
|
if (dotEnvResult.error) {
|
|
6
6
|
throw dotEnvResult.error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envLoader.js","sources":["../../../src/preStartup/configLoader/envLoader.ts"],"sourcesContent":[null],"names":[],"mappings":"0DAGM,SAAU,aAAa,CAAC,aAAa,EAAA;AACvC,IAAA,IAAI,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"envLoader.js","sources":["../../../src/preStartup/configLoader/envLoader.ts"],"sourcesContent":[null],"names":[],"mappings":"0DAGM,SAAU,aAAa,CAAC,aAAa,EAAA;AACvC,IAAA,IAAI,YAAY,CAAC;AACjB,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;QACtB,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACrF,QAAA,IAAI,YAAY,CAAC,KAAK,EAAE;YACpB,MAAM,YAAY,CAAC,KAAK,CAAC;SAC5B;KACJ;AACD,IAAA,OAAO,YAAY,CAAC;AACxB"}
|
package/lib/rollup/index.d.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var camelCase=require('lodash.camelcase');function camelCaseSVG() {
|
|
2
|
+
return {
|
|
3
|
+
name: 'camelCaseSVG',
|
|
4
|
+
transform(code, id) {
|
|
5
|
+
if (id.endsWith('Icon.tsx')) {
|
|
6
|
+
const svgPropsRegex = /"[-a-zA-Z]+[-][a-zA-Z]+"/g;
|
|
7
|
+
let transformedCode = code;
|
|
8
|
+
const matches = code.match(svgPropsRegex);
|
|
9
|
+
if (!matches || matches.length === 0) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
matches.forEach((match) => {
|
|
13
|
+
const camelCasePropName = camelCase(match);
|
|
14
|
+
transformedCode = transformedCode.replace(match, `"${camelCasePropName}"`);
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
code: transformedCode,
|
|
18
|
+
map: null,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}exports.default=camelCaseSVG;//# sourceMappingURL=rollupPluginCamelcaseSvg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollupPluginCamelcaseSvg.cjs","sources":["../../src/rollup/rollupPluginCamelcaseSvg.ts"],"sourcesContent":[null],"names":[],"mappings":"gHAEA,SAAS,YAAY,GAAA;IACnB,OAAO;AACL,QAAA,IAAI,EAAE,cAAc;QACpB,SAAS,CAAC,IAAI,EAAE,EAAE,EAAA;AAChB,YAAA,IAAI,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;gBAC3B,MAAM,aAAa,GAAG,2BAA2B,CAAC;gBAClD,IAAI,eAAe,GAAG,IAAI,CAAC;gBAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBAE1C,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AACpC,oBAAA,OAAO,IAAI,CAAC;iBACb;AAED,gBAAA,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACxB,oBAAA,MAAM,iBAAiB,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;oBAC3C,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAI,CAAA,EAAA,iBAAiB,CAAG,CAAA,CAAA,CAAC,CAAC;AAC7E,iBAAC,CAAC,CAAC;gBAEH,OAAO;AACL,oBAAA,IAAI,EAAE,eAAe;AACrB,oBAAA,GAAG,EAAE,IAAI;iBACV,CAAC;aACH;AACD,YAAA,OAAO,IAAI,CAAC;SACb;KACF,CAAC;AACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import camelCase from'lodash.camelcase';function camelCaseSVG() {
|
|
2
|
+
return {
|
|
3
|
+
name: 'camelCaseSVG',
|
|
4
|
+
transform(code, id) {
|
|
5
|
+
if (id.endsWith('Icon.tsx')) {
|
|
6
|
+
const svgPropsRegex = /"[-a-zA-Z]+[-][a-zA-Z]+"/g;
|
|
7
|
+
let transformedCode = code;
|
|
8
|
+
const matches = code.match(svgPropsRegex);
|
|
9
|
+
if (!matches || matches.length === 0) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
matches.forEach((match) => {
|
|
13
|
+
const camelCasePropName = camelCase(match);
|
|
14
|
+
transformedCode = transformedCode.replace(match, `"${camelCasePropName}"`);
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
code: transformedCode,
|
|
18
|
+
map: null,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}export{camelCaseSVG as default};//# sourceMappingURL=rollupPluginCamelcaseSvg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollupPluginCamelcaseSvg.js","sources":["../../src/rollup/rollupPluginCamelcaseSvg.ts"],"sourcesContent":[null],"names":[],"mappings":"wCAEA,SAAS,YAAY,GAAA;IACnB,OAAO;AACL,QAAA,IAAI,EAAE,cAAc;QACpB,SAAS,CAAC,IAAI,EAAE,EAAE,EAAA;AAChB,YAAA,IAAI,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;gBAC3B,MAAM,aAAa,GAAG,2BAA2B,CAAC;gBAClD,IAAI,eAAe,GAAG,IAAI,CAAC;gBAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBAE1C,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AACpC,oBAAA,OAAO,IAAI,CAAC;iBACb;AAED,gBAAA,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACxB,oBAAA,MAAM,iBAAiB,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;oBAC3C,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAI,CAAA,EAAA,iBAAiB,CAAG,CAAA,CAAA,CAAC,CAAC;AAC7E,iBAAC,CAAC,CAAC;gBAEH,OAAO;AACL,oBAAA,IAAI,EAAE,eAAe;AACrB,oBAAA,GAAG,EAAE,IAAI;iBACV,CAAC;aACH;AACD,YAAA,OAAO,IAAI,CAAC;SACb;KACF,CAAC;AACJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';var path=require('path');require('fs');var url=require('url');var_documentCurrentScript=typeofdocument!=='undefined'?document.currentScript:null;const __filename_ = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('tools/codegen/commonPaths.cjs', document.baseURI).href)));
|
|
2
|
+
const __dirname_ = path.dirname(__filename_);
|
|
3
|
+
/**
|
|
4
|
+
* If your folder structure is:
|
|
5
|
+
* adminIde-stack/
|
|
6
|
+
* └── tools/
|
|
7
|
+
* └── codegen/
|
|
8
|
+
* └── commonPaths.mjs
|
|
9
|
+
*
|
|
10
|
+
* Going two levels up from codegen => adminIde-stack/
|
|
11
|
+
*/
|
|
12
|
+
const pathsConfig = {
|
|
13
|
+
// The location of this file
|
|
14
|
+
__filename: __filename_,
|
|
15
|
+
__dirname: __dirname_,
|
|
16
|
+
// Points to adminIde-stack. Adjust if needed (e.g., ../.. vs ../../..)
|
|
17
|
+
repoRoot: process.cwd(),
|
|
18
|
+
// Typically adminIde-stack/packages/common
|
|
19
|
+
commonPackagePath: path.join(process.cwd(), 'packages/common'),
|
|
20
|
+
};exports.pathsConfig=pathsConfig;//# sourceMappingURL=commonPaths.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonPaths.cjs","sources":["../../../src/tools/codegen/commonPaths.ts"],"sourcesContent":[null],"names":["fileURLToPath"],"mappings":"8JAIA,MAAM,WAAW,GAAGA,iBAAa,CAAC,+QAAe,CAAC,CAAC;AACnD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AAE7C;;;;;;;;AAQG;AACU,MAAA,WAAW,GAAG;;AAEvB,IAAA,UAAU,EAAE,WAAW;AACvB,IAAA,SAAS,EAAE,UAAU;;AAGrB,IAAA,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE;;IAGvB,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,iBAAiB,CAAC;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If your folder structure is:
|
|
3
|
+
* adminIde-stack/
|
|
4
|
+
* └── tools/
|
|
5
|
+
* └── codegen/
|
|
6
|
+
* └── commonPaths.mjs
|
|
7
|
+
*
|
|
8
|
+
* Going two levels up from codegen => adminIde-stack/
|
|
9
|
+
*/
|
|
10
|
+
export declare const pathsConfig: {
|
|
11
|
+
__filename: string;
|
|
12
|
+
__dirname: string;
|
|
13
|
+
repoRoot: string;
|
|
14
|
+
commonPackagePath: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Check if a file exists, otherwise exit
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkFileExists(filePath: any): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import path__default from'path';import'fs';import {fileURLToPath}from'url';const __filename_ = fileURLToPath(import.meta.url);
|
|
2
|
+
const __dirname_ = path__default.dirname(__filename_);
|
|
3
|
+
/**
|
|
4
|
+
* If your folder structure is:
|
|
5
|
+
* adminIde-stack/
|
|
6
|
+
* └── tools/
|
|
7
|
+
* └── codegen/
|
|
8
|
+
* └── commonPaths.mjs
|
|
9
|
+
*
|
|
10
|
+
* Going two levels up from codegen => adminIde-stack/
|
|
11
|
+
*/
|
|
12
|
+
const pathsConfig = {
|
|
13
|
+
// The location of this file
|
|
14
|
+
__filename: __filename_,
|
|
15
|
+
__dirname: __dirname_,
|
|
16
|
+
// Points to adminIde-stack. Adjust if needed (e.g., ../.. vs ../../..)
|
|
17
|
+
repoRoot: process.cwd(),
|
|
18
|
+
// Typically adminIde-stack/packages/common
|
|
19
|
+
commonPackagePath: path__default.join(process.cwd(), 'packages/common'),
|
|
20
|
+
};export{pathsConfig};//# sourceMappingURL=commonPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonPaths.js","sources":["../../../src/tools/codegen/commonPaths.ts"],"sourcesContent":[null],"names":["path"],"mappings":"2EAIA,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,MAAM,UAAU,GAAGA,aAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AAE7C;;;;;;;;AAQG;AACU,MAAA,WAAW,GAAG;;AAEvB,IAAA,UAAU,EAAE,WAAW;AACvB,IAAA,SAAS,EAAE,UAAU;;AAGrB,IAAA,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE;;IAGvB,iBAAiB,EAAEA,aAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,iBAAiB,CAAC;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';var path=require('path'),commonPaths=require('./commonPaths.cjs');/**
|
|
2
|
+
* Given a list of modules objects (e.g. {client, core, browser, server, independent}),
|
|
3
|
+
* build a list of GraphQL schemas and documents for codegen.
|
|
4
|
+
*
|
|
5
|
+
* Provide optional cdecodePaths = { repoRoot } if you want to override defaults.
|
|
6
|
+
*/
|
|
7
|
+
function computeModules(modules, cdecodePaths = {}) {
|
|
8
|
+
let { repoRoot } = cdecodePaths;
|
|
9
|
+
if (!repoRoot) {
|
|
10
|
+
repoRoot = commonPaths.pathsConfig.repoRoot;
|
|
11
|
+
}
|
|
12
|
+
const result = { schemas: [], documents: [] };
|
|
13
|
+
for (const modObj of modules) {
|
|
14
|
+
try {
|
|
15
|
+
const { core, client, browser, server, independent } = modObj;
|
|
16
|
+
const corePath = core ? path.join(repoRoot, core) : null;
|
|
17
|
+
const clientPath = client ? path.join(repoRoot, client) : null;
|
|
18
|
+
const browserPath = browser ? path.join(repoRoot, browser) : null;
|
|
19
|
+
const serverPath = server ? path.join(repoRoot, server) : null;
|
|
20
|
+
const independentPath = independent ? path.join(repoRoot, independent) : null;
|
|
21
|
+
// .gql documents
|
|
22
|
+
if (clientPath)
|
|
23
|
+
result.documents.push(`${clientPath}/**/*.gql`);
|
|
24
|
+
if (corePath)
|
|
25
|
+
result.documents.push(`${corePath}/**/*.gql`);
|
|
26
|
+
if (browserPath)
|
|
27
|
+
result.documents.push(`${browserPath}/**/*.gql`);
|
|
28
|
+
if (serverPath)
|
|
29
|
+
result.documents.push(`${serverPath}/**/*.gql`);
|
|
30
|
+
if (independentPath)
|
|
31
|
+
result.documents.push(`${independentPath}/**/*.gql`);
|
|
32
|
+
// .graphql schemas
|
|
33
|
+
if (serverPath)
|
|
34
|
+
result.schemas.push(`${serverPath}/**/*.graphql`);
|
|
35
|
+
if (clientPath)
|
|
36
|
+
result.schemas.push(`${clientPath}/**/*.graphql`);
|
|
37
|
+
if (browserPath)
|
|
38
|
+
result.schemas.push(`${browserPath}/**/*.graphql`);
|
|
39
|
+
if (independentPath)
|
|
40
|
+
result.schemas.push(`${independentPath}/**/*.graphql`);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
console.error(`Could not compute paths for module: ${JSON.stringify(modObj)}`, err);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}exports.computeModules=computeModules;//# sourceMappingURL=computeModules.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeModules.cjs","sources":["../../../src/tools/codegen/computeModules.ts"],"sourcesContent":[null],"names":["pathsConfig"],"mappings":"+EAGA;;;;;AAKG;SACa,cAAc,CAAC,OAAO,EAAE,eAAe,EAAS,EAAA;AAC5D,IAAA,IAAI,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC;IAChC,IAAI,CAAC,QAAQ,EAAE;AACX,QAAA,QAAQ,GAAGA,uBAAW,CAAC,QAAQ,CAAC;KACnC;IAED,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAE9C,IAAA,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AAC1B,QAAA,IAAI;AACA,YAAA,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;AAE9D,YAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;AACzD,YAAA,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;AAC/D,YAAA,MAAM,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;AAClE,YAAA,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAA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,OAAO,CAAC,KAAK,CAAC,CAAA,oCAAA,EAAuC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA,CAAE,EAAE,GAAG,CAAC,CAAC;SACvF;KACJ;AAED,IAAA,OAAO,MAAM,CAAC;AAClB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a list of modules objects (e.g. {client, core, browser, server, independent}),
|
|
3
|
+
* build a list of GraphQL schemas and documents for codegen.
|
|
4
|
+
*
|
|
5
|
+
* Provide optional cdecodePaths = { repoRoot } if you want to override defaults.
|
|
6
|
+
*/
|
|
7
|
+
export declare function computeModules(modules: any, cdecodePaths?: any): {
|
|
8
|
+
schemas: any[];
|
|
9
|
+
documents: any[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import path__default from'path';import {pathsConfig}from'./commonPaths.js';/**
|
|
2
|
+
* Given a list of modules objects (e.g. {client, core, browser, server, independent}),
|
|
3
|
+
* build a list of GraphQL schemas and documents for codegen.
|
|
4
|
+
*
|
|
5
|
+
* Provide optional cdecodePaths = { repoRoot } if you want to override defaults.
|
|
6
|
+
*/
|
|
7
|
+
function computeModules(modules, cdecodePaths = {}) {
|
|
8
|
+
let { repoRoot } = cdecodePaths;
|
|
9
|
+
if (!repoRoot) {
|
|
10
|
+
repoRoot = pathsConfig.repoRoot;
|
|
11
|
+
}
|
|
12
|
+
const result = { schemas: [], documents: [] };
|
|
13
|
+
for (const modObj of modules) {
|
|
14
|
+
try {
|
|
15
|
+
const { core, client, browser, server, independent } = modObj;
|
|
16
|
+
const corePath = core ? path__default.join(repoRoot, core) : null;
|
|
17
|
+
const clientPath = client ? path__default.join(repoRoot, client) : null;
|
|
18
|
+
const browserPath = browser ? path__default.join(repoRoot, browser) : null;
|
|
19
|
+
const serverPath = server ? path__default.join(repoRoot, server) : null;
|
|
20
|
+
const independentPath = independent ? path__default.join(repoRoot, independent) : null;
|
|
21
|
+
// .gql documents
|
|
22
|
+
if (clientPath)
|
|
23
|
+
result.documents.push(`${clientPath}/**/*.gql`);
|
|
24
|
+
if (corePath)
|
|
25
|
+
result.documents.push(`${corePath}/**/*.gql`);
|
|
26
|
+
if (browserPath)
|
|
27
|
+
result.documents.push(`${browserPath}/**/*.gql`);
|
|
28
|
+
if (serverPath)
|
|
29
|
+
result.documents.push(`${serverPath}/**/*.gql`);
|
|
30
|
+
if (independentPath)
|
|
31
|
+
result.documents.push(`${independentPath}/**/*.gql`);
|
|
32
|
+
// .graphql schemas
|
|
33
|
+
if (serverPath)
|
|
34
|
+
result.schemas.push(`${serverPath}/**/*.graphql`);
|
|
35
|
+
if (clientPath)
|
|
36
|
+
result.schemas.push(`${clientPath}/**/*.graphql`);
|
|
37
|
+
if (browserPath)
|
|
38
|
+
result.schemas.push(`${browserPath}/**/*.graphql`);
|
|
39
|
+
if (independentPath)
|
|
40
|
+
result.schemas.push(`${independentPath}/**/*.graphql`);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
console.error(`Could not compute paths for module: ${JSON.stringify(modObj)}`, err);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}export{computeModules};//# sourceMappingURL=computeModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeModules.js","sources":["../../../src/tools/codegen/computeModules.ts"],"sourcesContent":[null],"names":["path"],"mappings":"2EAGA;;;;;AAKG;SACa,cAAc,CAAC,OAAO,EAAE,eAAe,EAAS,EAAA;AAC5D,IAAA,IAAI,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC;IAChC,IAAI,CAAC,QAAQ,EAAE;AACX,QAAA,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;KACnC;IAED,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAE9C,IAAA,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AAC1B,QAA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,CAAA,CAAC,CAAC;;AAG1E,YAAA,IAAI,UAAU;gBAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAG,EAAA,UAAU,CAAe,aAAA,CAAA,CAAC,CAAC;AAClE,YAAA,IAAI,UAAU;gBAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAG,EAAA,UAAU,CAAe,aAAA,CAAA,CAAC,CAAC;AAClE,YAAA,IAAI,WAAW;gBAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAG,EAAA,WAAW,CAAe,aAAA,CAAA,CAAC,CAAC;AACpE,YAAA,IAAI,eAAe;gBAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAG,EAAA,eAAe,CAAe,aAAA,CAAA,CAAC,CAAC;SAC/E;QAAC,OAAO,GAAG,EAAE;AACV,YAAA,OAAO,CAAC,KAAK,CAAC,CAAA,oCAAA,EAAuC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA,CAAE,EAAE,GAAG,CAAC,CAAC;SACvF;KACJ;AAED,IAAA,OAAO,MAAM,CAAC;AAClB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict';var fs=require('fs'),path=require('path'),commonPaths=require('./commonPaths.cjs'),computeModules=require('./computeModules.cjs');/**
|
|
2
|
+
* Recursively traverse an object (or array), replacing string placeholders
|
|
3
|
+
* based on the replacements map. Returns a new object/array with substitutions.
|
|
4
|
+
* Modified here to "spread" discovered schemas / documents if they occur in an array.
|
|
5
|
+
*/
|
|
6
|
+
function fillPlaceholders(input, placeholders) {
|
|
7
|
+
if (Array.isArray(input)) {
|
|
8
|
+
const result = [];
|
|
9
|
+
for (const el of input) {
|
|
10
|
+
const filled = fillPlaceholders(el, placeholders);
|
|
11
|
+
// If the original element is the placeholder and its substitution is an array,
|
|
12
|
+
// spread the array's contents instead of inserting it as a nested array.
|
|
13
|
+
if (typeof el === 'string' &&
|
|
14
|
+
(el === '%discoveredSchemas%' || el === '%discoveredDocuments%') &&
|
|
15
|
+
Array.isArray(filled)) {
|
|
16
|
+
result.push(...filled);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
result.push(filled);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
if (input && typeof input === 'object') {
|
|
25
|
+
const resultObj = {};
|
|
26
|
+
for (const [key, val] of Object.entries(input)) {
|
|
27
|
+
resultObj[key] = fillPlaceholders(val, placeholders);
|
|
28
|
+
}
|
|
29
|
+
return resultObj;
|
|
30
|
+
}
|
|
31
|
+
if (typeof input === 'string') {
|
|
32
|
+
// If input is %discoveredSchemas%, replace with an actual array
|
|
33
|
+
if (input === '%discoveredSchemas%') {
|
|
34
|
+
return placeholders.discoveredSchemas;
|
|
35
|
+
}
|
|
36
|
+
// If input is %discoveredDocuments%, replace with an actual array
|
|
37
|
+
if (input === '%discoveredDocuments%') {
|
|
38
|
+
return placeholders.discoveredDocuments;
|
|
39
|
+
}
|
|
40
|
+
// If input is $PRIMARY_SCHEMA_PLACEHOLDER$, replace with a string
|
|
41
|
+
if (input === '$PRIMARY_SCHEMA_PLACEHOLDER$') {
|
|
42
|
+
return placeholders.primarySchema;
|
|
43
|
+
}
|
|
44
|
+
// Otherwise return the same string
|
|
45
|
+
return input;
|
|
46
|
+
}
|
|
47
|
+
return input; // For numbers, booleans, etc.
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generates the "codegen.ts" file based on discovered modules.
|
|
51
|
+
* We read placeholders (%discoveredSchemas%, %discoveredDocuments%, etc.)
|
|
52
|
+
* from cdecodeConfig.codegen.fullConfig and substitute them with real paths.
|
|
53
|
+
*/
|
|
54
|
+
function generateCodegenConfig(allModules, codegenOptions = {}, cdecodePaths = {}) {
|
|
55
|
+
const { schemas: schemaPaths, documents: documentPaths } = computeModules.computeModules(allModules, cdecodePaths);
|
|
56
|
+
let { repoRoot } = cdecodePaths;
|
|
57
|
+
if (!repoRoot) {
|
|
58
|
+
repoRoot = commonPaths.pathsConfig.repoRoot;
|
|
59
|
+
}
|
|
60
|
+
// Where will we write the file?
|
|
61
|
+
const OUTPUT_FILE = codegenOptions.outputFile
|
|
62
|
+
? path.join(repoRoot, codegenOptions.outputFile)
|
|
63
|
+
: path.join(repoRoot, 'codegen.ts');
|
|
64
|
+
// Resolve all discovered paths relative to the folder of OUTPUT_FILE
|
|
65
|
+
const outputDir = path.dirname(OUTPUT_FILE);
|
|
66
|
+
const relativeSchemas = schemaPaths.map((absPath) => path.relative(outputDir, absPath).replace(/\\/g, '/'));
|
|
67
|
+
const relativeDocs = documentPaths.map((absPath) => path.relative(outputDir, absPath).replace(/\\/g, '/'));
|
|
68
|
+
// Warn if empty
|
|
69
|
+
if (!relativeSchemas.length || !relativeDocs.length) {
|
|
70
|
+
console.warn('No schemas or documents found. Please verify your modules configuration.');
|
|
71
|
+
}
|
|
72
|
+
// We'll read the entire codegen config from cdecodeConfig (the user JSON)
|
|
73
|
+
// Then we'll fill placeholders like %discoveredSchemas% with the actual arrays
|
|
74
|
+
const userConfig = codegenOptions.fullConfig || {};
|
|
75
|
+
// Prepare the placeholders
|
|
76
|
+
const placeholdersObj = {
|
|
77
|
+
discoveredSchemas: relativeSchemas,
|
|
78
|
+
discoveredDocuments: relativeDocs,
|
|
79
|
+
primarySchema: codegenOptions.rootSchema || 'servers/backend-server/src/api/root-schema.graphqls',
|
|
80
|
+
};
|
|
81
|
+
// Recursively fill placeholders
|
|
82
|
+
const finalConfig = fillPlaceholders(userConfig, placeholdersObj);
|
|
83
|
+
// finalConfig now has the replaced arrays (though they are strings if we used JSON.stringify).
|
|
84
|
+
// For many codegen configs, having an array in the JSON is correct.
|
|
85
|
+
// If your placeholders are inserted as raw text, you may need to parse them back to arrays.
|
|
86
|
+
// But if your codegen CLI can handle JSON arrays directly, this works fine.
|
|
87
|
+
// Convert finalConfig to actual JSON text
|
|
88
|
+
const codegenFileContents = `
|
|
89
|
+
// This file is auto-generated. Do not edit manually.
|
|
90
|
+
const config = ${JSON.stringify(finalConfig, null, 2)};
|
|
91
|
+
|
|
92
|
+
export default config;
|
|
93
|
+
`.trimStart();
|
|
94
|
+
fs.writeFileSync(OUTPUT_FILE, codegenFileContents);
|
|
95
|
+
console.log(`Generated codegen config at: ${OUTPUT_FILE}`);
|
|
96
|
+
}exports.fillPlaceholders=fillPlaceholders;exports.generateCodegenConfig=generateCodegenConfig;//# sourceMappingURL=generateCodegenConfig.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateCodegenConfig.cjs","sources":["../../../src/tools/codegen/generateCodegenConfig.ts"],"sourcesContent":[null],"names":["computeModules","pathsConfig"],"mappings":"+IAMA;;;;AAIG;AACa,SAAA,gBAAgB,CAC5B,KAAU,EACV,YAIC,EAAA;AAED,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,MAAM,GAAU,EAAE,CAAC;AACzB,QAAA,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE;YACpB,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;;;YAGlD,IACI,OAAO,EAAE,KAAK,QAAQ;AACtB,iBAAC,EAAE,KAAK,qBAAqB,IAAI,EAAE,KAAK,uBAAuB,CAAC;AAChE,gBAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EACvB;AACE,gBAAA,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;aAC1B;iBAAM;AACH,gBAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACvB;SACJ;AACD,QAAA,OAAO,MAAM,CAAC;KACjB;AACD,IAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACpC,MAAM,SAAS,GAAwB,EAAE,CAAC;AAC1C,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,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QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5G,MAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;;IAG3G,IAAI,CAAC,eAAe,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;AACjD,QAAA,OAAO,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;KAC5F;;;AAID,IAAA,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,IAAI,EAAE,CAAC;;AAGnD,IAAA,MAAM,eAAe,GAAG;AACpB,QAAA,iBAAiB,EAAE,eAAe;AAClC,QAAA,mBAAmB,EAAE,YAAY;AACjC,QAAA,aAAa,EAAE,cAAc,CAAC,UAAU,IAAI,qDAAqD;KACpG,CAAC;;IAGF,MAAM,WAAW,GAAG,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;;;;;;AAQlE,IAAA,MAAM,mBAAmB,GAAG,CAAA;;iBAEf,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;;;CAGpD,CAAC,SAAS,EAAE,CAAC;AAEV,IAAA,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;AACnD,IAAA,OAAO,CAAC,GAAG,CAAC,gCAAgC,WAAW,CAAA,CAAE,CAAC,CAAC;AAC/D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively traverse an object (or array), replacing string placeholders
|
|
3
|
+
* based on the replacements map. Returns a new object/array with substitutions.
|
|
4
|
+
* Modified here to "spread" discovered schemas / documents if they occur in an array.
|
|
5
|
+
*/
|
|
6
|
+
export declare function fillPlaceholders(input: any, placeholders: {
|
|
7
|
+
discoveredSchemas: string[];
|
|
8
|
+
discoveredDocuments: string[];
|
|
9
|
+
primarySchema: string;
|
|
10
|
+
}): any;
|
|
11
|
+
/**
|
|
12
|
+
* Generates the "codegen.ts" file based on discovered modules.
|
|
13
|
+
* We read placeholders (%discoveredSchemas%, %discoveredDocuments%, etc.)
|
|
14
|
+
* from cdecodeConfig.codegen.fullConfig and substitute them with real paths.
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateCodegenConfig(allModules: any, codegenOptions?: any, cdecodePaths?: any): void;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import fs__default from'fs';import path__default from'path';import {pathsConfig}from'./commonPaths.js';import {computeModules}from'./computeModules.js';/**
|
|
2
|
+
* Recursively traverse an object (or array), replacing string placeholders
|
|
3
|
+
* based on the replacements map. Returns a new object/array with substitutions.
|
|
4
|
+
* Modified here to "spread" discovered schemas / documents if they occur in an array.
|
|
5
|
+
*/
|
|
6
|
+
function fillPlaceholders(input, placeholders) {
|
|
7
|
+
if (Array.isArray(input)) {
|
|
8
|
+
const result = [];
|
|
9
|
+
for (const el of input) {
|
|
10
|
+
const filled = fillPlaceholders(el, placeholders);
|
|
11
|
+
// If the original element is the placeholder and its substitution is an array,
|
|
12
|
+
// spread the array's contents instead of inserting it as a nested array.
|
|
13
|
+
if (typeof el === 'string' &&
|
|
14
|
+
(el === '%discoveredSchemas%' || el === '%discoveredDocuments%') &&
|
|
15
|
+
Array.isArray(filled)) {
|
|
16
|
+
result.push(...filled);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
result.push(filled);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
if (input && typeof input === 'object') {
|
|
25
|
+
const resultObj = {};
|
|
26
|
+
for (const [key, val] of Object.entries(input)) {
|
|
27
|
+
resultObj[key] = fillPlaceholders(val, placeholders);
|
|
28
|
+
}
|
|
29
|
+
return resultObj;
|
|
30
|
+
}
|
|
31
|
+
if (typeof input === 'string') {
|
|
32
|
+
// If input is %discoveredSchemas%, replace with an actual array
|
|
33
|
+
if (input === '%discoveredSchemas%') {
|
|
34
|
+
return placeholders.discoveredSchemas;
|
|
35
|
+
}
|
|
36
|
+
// If input is %discoveredDocuments%, replace with an actual array
|
|
37
|
+
if (input === '%discoveredDocuments%') {
|
|
38
|
+
return placeholders.discoveredDocuments;
|
|
39
|
+
}
|
|
40
|
+
// If input is $PRIMARY_SCHEMA_PLACEHOLDER$, replace with a string
|
|
41
|
+
if (input === '$PRIMARY_SCHEMA_PLACEHOLDER$') {
|
|
42
|
+
return placeholders.primarySchema;
|
|
43
|
+
}
|
|
44
|
+
// Otherwise return the same string
|
|
45
|
+
return input;
|
|
46
|
+
}
|
|
47
|
+
return input; // For numbers, booleans, etc.
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generates the "codegen.ts" file based on discovered modules.
|
|
51
|
+
* We read placeholders (%discoveredSchemas%, %discoveredDocuments%, etc.)
|
|
52
|
+
* from cdecodeConfig.codegen.fullConfig and substitute them with real paths.
|
|
53
|
+
*/
|
|
54
|
+
function generateCodegenConfig(allModules, codegenOptions = {}, cdecodePaths = {}) {
|
|
55
|
+
const { schemas: schemaPaths, documents: documentPaths } = computeModules(allModules, cdecodePaths);
|
|
56
|
+
let { repoRoot } = cdecodePaths;
|
|
57
|
+
if (!repoRoot) {
|
|
58
|
+
repoRoot = pathsConfig.repoRoot;
|
|
59
|
+
}
|
|
60
|
+
// Where will we write the file?
|
|
61
|
+
const OUTPUT_FILE = codegenOptions.outputFile
|
|
62
|
+
? path__default.join(repoRoot, codegenOptions.outputFile)
|
|
63
|
+
: path__default.join(repoRoot, 'codegen.ts');
|
|
64
|
+
// Resolve all discovered paths relative to the folder of OUTPUT_FILE
|
|
65
|
+
const outputDir = path__default.dirname(OUTPUT_FILE);
|
|
66
|
+
const relativeSchemas = schemaPaths.map((absPath) => path__default.relative(outputDir, absPath).replace(/\\/g, '/'));
|
|
67
|
+
const relativeDocs = documentPaths.map((absPath) => path__default.relative(outputDir, absPath).replace(/\\/g, '/'));
|
|
68
|
+
// Warn if empty
|
|
69
|
+
if (!relativeSchemas.length || !relativeDocs.length) {
|
|
70
|
+
console.warn('No schemas or documents found. Please verify your modules configuration.');
|
|
71
|
+
}
|
|
72
|
+
// We'll read the entire codegen config from cdecodeConfig (the user JSON)
|
|
73
|
+
// Then we'll fill placeholders like %discoveredSchemas% with the actual arrays
|
|
74
|
+
const userConfig = codegenOptions.fullConfig || {};
|
|
75
|
+
// Prepare the placeholders
|
|
76
|
+
const placeholdersObj = {
|
|
77
|
+
discoveredSchemas: relativeSchemas,
|
|
78
|
+
discoveredDocuments: relativeDocs,
|
|
79
|
+
primarySchema: codegenOptions.rootSchema || 'servers/backend-server/src/api/root-schema.graphqls',
|
|
80
|
+
};
|
|
81
|
+
// Recursively fill placeholders
|
|
82
|
+
const finalConfig = fillPlaceholders(userConfig, placeholdersObj);
|
|
83
|
+
// finalConfig now has the replaced arrays (though they are strings if we used JSON.stringify).
|
|
84
|
+
// For many codegen configs, having an array in the JSON is correct.
|
|
85
|
+
// If your placeholders are inserted as raw text, you may need to parse them back to arrays.
|
|
86
|
+
// But if your codegen CLI can handle JSON arrays directly, this works fine.
|
|
87
|
+
// Convert finalConfig to actual JSON text
|
|
88
|
+
const codegenFileContents = `
|
|
89
|
+
// This file is auto-generated. Do not edit manually.
|
|
90
|
+
const config = ${JSON.stringify(finalConfig, null, 2)};
|
|
91
|
+
|
|
92
|
+
export default config;
|
|
93
|
+
`.trimStart();
|
|
94
|
+
fs__default.writeFileSync(OUTPUT_FILE, codegenFileContents);
|
|
95
|
+
console.log(`Generated codegen config at: ${OUTPUT_FILE}`);
|
|
96
|
+
}export{fillPlaceholders,generateCodegenConfig};//# sourceMappingURL=generateCodegenConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateCodegenConfig.js","sources":["../../../src/tools/codegen/generateCodeg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C5F;;;AAID,IAAA,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,IAAI,EAAE,CAAC;;AAGnD,IAAA,MAAM,eAAe,GAAG;AACpB,QAAA,iBAAiB,EAAE,eAAe;AAClC,QAAA,mBAAmB,EAAE,YAAY;AACjC,QAAA,aAAa,EAAE,cAAc,CAAC,UAAU,IAAI,qDAAqD;KACpG,CAAC;;IAGF,MAAM,WAAW,GAAG,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;;;;;;AAQlE,IAAA,MAAM,mBAAmB,GAAG,CAAA;;iBAEf,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;;;CAGpD,CAAC,SAAS,EAAE,CAAC;AAEV,IAAAC,WAAE,CAAC,aAAa,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;AACnD,IAAA,OAAO,CAAC,GAAG,CAAC,gCAAgC,WAAW,CAAA,CAAE,CAAC,CAAC;AAC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';var setupCommonPackage=require('./setupCommonPackage.cjs'),readModules=require('./readModules.cjs'),performCopyOperations=require('./performCopyOperations.cjs'),generateCodegenConfig=require('./generateCodegenConfig.cjs');/**
|
|
2
|
+
* Orchestrates the codegen tasks, reading from your cdecodeConfig object.
|
|
3
|
+
* Example usage: runCodegenTasks(cdecodeConfig).
|
|
4
|
+
*/
|
|
5
|
+
async function runCodegenTasks(cdecodeConfig) {
|
|
6
|
+
// 1) Setup "common" package from template
|
|
7
|
+
setupCommonPackage.setupCommonPackage(cdecodeConfig.projectPaths);
|
|
8
|
+
// 2) Read modules from server config files
|
|
9
|
+
const allModules = readModules.readModules(cdecodeConfig.servers);
|
|
10
|
+
// 3) Perform file-copy operations for modules that define cdecode.common
|
|
11
|
+
performCopyOperations.performCopyOperations(allModules, cdecodeConfig.projectPaths);
|
|
12
|
+
// 4) Generate the codegen config
|
|
13
|
+
generateCodegenConfig.generateCodegenConfig(allModules, cdecodeConfig.codegen, cdecodeConfig.projectPaths);
|
|
14
|
+
}exports.runCodegenTasks=runCodegenTasks;//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/tools/codegen/index.ts"],"sourcesContent":[null],"names":["setupCommonPackage","readModules","performCopyOperations","generateCodegenConfig"],"mappings":"2OAKA;;;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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {setupCommonPackage}from'./setupCommonPackage.js';import {readModules}from'./readModules.js';import {performCopyOperations}from'./performCopyOperations.js';import {generateCodegenConfig}from'./generateCodegenConfig.js';/**
|
|
2
|
+
* Orchestrates the codegen tasks, reading from your cdecodeConfig object.
|
|
3
|
+
* Example usage: runCodegenTasks(cdecodeConfig).
|
|
4
|
+
*/
|
|
5
|
+
async function runCodegenTasks(cdecodeConfig) {
|
|
6
|
+
// 1) Setup "common" package from template
|
|
7
|
+
setupCommonPackage(cdecodeConfig.projectPaths);
|
|
8
|
+
// 2) Read modules from server config files
|
|
9
|
+
const allModules = readModules(cdecodeConfig.servers);
|
|
10
|
+
// 3) Perform file-copy operations for modules that define cdecode.common
|
|
11
|
+
performCopyOperations(allModules, cdecodeConfig.projectPaths);
|
|
12
|
+
// 4) Generate the codegen config
|
|
13
|
+
generateCodegenConfig(allModules, cdecodeConfig.codegen, cdecodeConfig.projectPaths);
|
|
14
|
+
}export{runCodegenTasks};//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/tools/codegen/index.ts"],"sourcesContent":[null],"names":[],"mappings":"kOAKA;;;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"}
|