@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.mjs
CHANGED
|
@@ -585,6 +585,13 @@ function updateModelIndex(codegenFs, indexPath, modelPath) {
|
|
|
585
585
|
ts.ScriptTarget.Latest,
|
|
586
586
|
true
|
|
587
587
|
);
|
|
588
|
+
const alreadyExported = sourceFile.statements.some(
|
|
589
|
+
(st) => ts.isExportDeclaration(st) && st.moduleSpecifier !== void 0 && ts.isStringLiteral(st.moduleSpecifier) && st.moduleSpecifier.text === `./${modelPath}`
|
|
590
|
+
);
|
|
591
|
+
if (alreadyExported) {
|
|
592
|
+
logger.info(`Export for ${modelPath} already present in ${indexPath}`);
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
588
595
|
const exportDeclaration = ts.factory.createExportDeclaration(
|
|
589
596
|
void 0,
|
|
590
597
|
false,
|