Skip to content

Commit c656e95

Browse files
Merge pull request #265 from rsodre/generator-namespace-fix
fix: separate model name and namespace on components generator
2 parents 60d08ef + cc672c5 commit c656e95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/bin/generateComponents.cjs

+3-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ manifest.models.forEach((model) => {
8282
const customTypes = [];
8383

8484
let modelName = model.tag;
85-
let modelNameNoNamespace = model.tag.split("-")[1];
85+
let [modelNamespace, modelNameNoNamespace] = model.tag.split("-");
8686

8787
try {
8888
const output = execSync(
@@ -102,7 +102,8 @@ manifest.models.forEach((model) => {
102102
fileContent += ` ${recsTypeObject},\n`;
103103
fileContent += ` {\n`;
104104
fileContent += ` metadata: {\n`;
105-
fileContent += ` name: "${modelName}",\n`;
105+
fileContent += ` namespace: "${modelNamespace}",\n`;
106+
fileContent += ` name: "${modelNameNoNamespace}",\n`;
106107
fileContent += ` types: ${JSON.stringify(types)},\n`;
107108
fileContent += ` customTypes: ${JSON.stringify(
108109
customTypes

0 commit comments

Comments
 (0)