@kosdev-code/kos-codegen-core 0.1.0-next.781 → 0.1.0-next.782
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/index.js +7 -0
- package/index.js.map +1 -1
- package/index.mjs +7 -0
- package/index.mjs.map +1 -1
- package/lib/generators/generate-container-model.d.ts +1 -0
- package/lib/generators/generate-container-model.d.ts.map +1 -1
- package/lib/generators/update-model-index.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/kos-container-model/model/__nameDashCase__-model.ts.template +14 -7
package/index.js
CHANGED
|
@@ -607,6 +607,13 @@ function updateModelIndex(codegenFs, indexPath, modelPath) {
|
|
|
607
607
|
ts__namespace.ScriptTarget.Latest,
|
|
608
608
|
true
|
|
609
609
|
);
|
|
610
|
+
const alreadyExported = sourceFile.statements.some(
|
|
611
|
+
(st) => ts__namespace.isExportDeclaration(st) && st.moduleSpecifier !== void 0 && ts__namespace.isStringLiteral(st.moduleSpecifier) && st.moduleSpecifier.text === `./${modelPath}`
|
|
612
|
+
);
|
|
613
|
+
if (alreadyExported) {
|
|
614
|
+
logger.info(`Export for ${modelPath} already present in ${indexPath}`);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
610
617
|
const exportDeclaration = ts__namespace.factory.createExportDeclaration(
|
|
611
618
|
void 0,
|
|
612
619
|
false,
|