Revert "fix: Have modules extend Module and we use a union of Module and CustomModule for module-v1"
This reverts commit 98d48fe2e1.
This commit is contained in:
parent
f6ec61d31e
commit
47e3fc81ff
2 changed files with 94 additions and 96 deletions
|
|
@ -21,16 +21,15 @@ for (const module of modules) {
|
|||
text = text // add `...ModuleDefaults;` after the model type
|
||||
.split("\n")
|
||||
.flatMap(line => {
|
||||
return line.replace(/model ([A-Za-z]+) {/, "model $1 extends Module {");
|
||||
// if (line.trimStart().startsWith(`type: "${module.name}"`)) {
|
||||
// return [
|
||||
// line,
|
||||
// '',
|
||||
// ' ...ModuleDefaults; // added by fetchModuleSchemas.js',
|
||||
// ]
|
||||
// } else {
|
||||
// return line;
|
||||
// }
|
||||
if (line.trimStart().startsWith(`type: "${module.name}"`)) {
|
||||
return [
|
||||
line,
|
||||
'',
|
||||
' ...ModuleDefaults; // added by fetchModuleSchemas.js',
|
||||
]
|
||||
} else {
|
||||
return line;
|
||||
}
|
||||
})
|
||||
.join('\n')
|
||||
|
||||
|
|
@ -43,4 +42,4 @@ for (const module of modules) {
|
|||
fs.writeFileSync(`${modulesDir}/index.tsp`,
|
||||
moduleImports.map(m => `import "./${m}";`).join("\n") + `
|
||||
alias RepoModule = ${moduleModels.map(m => `${m}Module`).join(" | ")};`
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue