@vexblocks/cli 1.1.5 → 1.1.6
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/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -618,7 +618,7 @@ function getOptionalEnvVars(packages) {
|
|
|
618
618
|
}
|
|
619
619
|
async function mergeSchemaFile(schemaPath, spinner) {
|
|
620
620
|
const content = await fs4.readFile(schemaPath, "utf-8");
|
|
621
|
-
if (content.includes('from "./schema.cms"')) {
|
|
621
|
+
if (content.includes('from "./cms/schema.cms"') || content.includes('from "./schema.cms"')) {
|
|
622
622
|
spinner.text = "CMS schema already integrated";
|
|
623
623
|
return;
|
|
624
624
|
}
|
|
@@ -640,10 +640,10 @@ ${importStatement}` + newContent.slice(insertPosition);
|
|
|
640
640
|
${newContent}`;
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
const
|
|
643
|
+
const hasCmsSpread = /defineSchema\s*\(\s*\{[^}]*\.\.\.(cmsSchemaExports|cmsTablesWithoutUsers|cmsTables)/s.test(
|
|
644
644
|
newContent
|
|
645
645
|
);
|
|
646
|
-
if (!
|
|
646
|
+
if (!hasCmsSpread) {
|
|
647
647
|
const defineSchemaRegex = /defineSchema\s*\(\s*\{(\s*)/;
|
|
648
648
|
if (defineSchemaRegex.test(newContent)) {
|
|
649
649
|
newContent = newContent.replace(
|