@betterstart/cli 0.1.10 → 0.1.12
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/cli.js +18 -15
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2676,11 +2676,11 @@ function runFormPipeline(schema, cwd, config, options = {}) {
|
|
|
2676
2676
|
try {
|
|
2677
2677
|
const result = step.run();
|
|
2678
2678
|
files.push(...result);
|
|
2679
|
-
console.log(` ${stepNum}. ${step.name} \u2713`);
|
|
2679
|
+
if (!options.silent) console.log(` ${stepNum}. ${step.name} \u2713`);
|
|
2680
2680
|
} catch (err) {
|
|
2681
2681
|
const msg = err instanceof Error ? err.message : String(err);
|
|
2682
2682
|
errors.push(`${step.name}: ${msg}`);
|
|
2683
|
-
console.error(` ${stepNum}. ${step.name} \u2717 \u2014 ${msg}`);
|
|
2683
|
+
if (!options.silent) console.error(` ${stepNum}. ${step.name} \u2717 \u2014 ${msg}`);
|
|
2684
2684
|
}
|
|
2685
2685
|
}
|
|
2686
2686
|
return { success: errors.length === 0, files, errors };
|
|
@@ -7514,11 +7514,11 @@ function runEntityPipeline(schema, cwd, config, options = {}) {
|
|
|
7514
7514
|
try {
|
|
7515
7515
|
const result = step.run();
|
|
7516
7516
|
files.push(...result);
|
|
7517
|
-
console.log(` ${stepNum}. ${step.name} \u2713`);
|
|
7517
|
+
if (!options.silent) console.log(` ${stepNum}. ${step.name} \u2713`);
|
|
7518
7518
|
} catch (err) {
|
|
7519
7519
|
const msg = err instanceof Error ? err.message : String(err);
|
|
7520
7520
|
errors.push(`${step.name}: ${msg}`);
|
|
7521
|
-
console.error(` ${stepNum}. ${step.name} \u2717 \u2014 ${msg}`);
|
|
7521
|
+
if (!options.silent) console.error(` ${stepNum}. ${step.name} \u2717 \u2014 ${msg}`);
|
|
7522
7522
|
}
|
|
7523
7523
|
}
|
|
7524
7524
|
return {
|
|
@@ -7567,11 +7567,11 @@ function runSinglePipeline(schema, cwd, config, options = {}) {
|
|
|
7567
7567
|
try {
|
|
7568
7568
|
const result = step.run();
|
|
7569
7569
|
files.push(...result);
|
|
7570
|
-
console.log(` ${stepNum}. ${step.name} \u2713`);
|
|
7570
|
+
if (!options.silent) console.log(` ${stepNum}. ${step.name} \u2713`);
|
|
7571
7571
|
} catch (err) {
|
|
7572
7572
|
const msg = err instanceof Error ? err.message : String(err);
|
|
7573
7573
|
errors.push(`${step.name}: ${msg}`);
|
|
7574
|
-
console.error(` ${stepNum}. ${step.name} \u2717 \u2014 ${msg}`);
|
|
7574
|
+
if (!options.silent) console.error(` ${stepNum}. ${step.name} \u2717 \u2014 ${msg}`);
|
|
7575
7575
|
}
|
|
7576
7576
|
}
|
|
7577
7577
|
return {
|
|
@@ -13181,21 +13181,27 @@ function scaffoldPreset({
|
|
|
13181
13181
|
try {
|
|
13182
13182
|
if (ps.isForm) {
|
|
13183
13183
|
const schema = JSON.parse(ps.content);
|
|
13184
|
-
const pipelineResult = runFormPipeline(schema, cwd, config, { force: true });
|
|
13184
|
+
const pipelineResult = runFormPipeline(schema, cwd, config, { force: true, silent: true });
|
|
13185
13185
|
result.generatedFiles.push(...pipelineResult.files);
|
|
13186
13186
|
if (!pipelineResult.success) {
|
|
13187
13187
|
result.errors.push(...pipelineResult.errors.map((e) => `${ps.filename}: ${e}`));
|
|
13188
13188
|
}
|
|
13189
13189
|
} else if (ps.isSingle) {
|
|
13190
13190
|
const schema = JSON.parse(ps.content);
|
|
13191
|
-
const pipelineResult = runSinglePipeline(schema, cwd, config, {
|
|
13191
|
+
const pipelineResult = runSinglePipeline(schema, cwd, config, {
|
|
13192
|
+
force: true,
|
|
13193
|
+
silent: true
|
|
13194
|
+
});
|
|
13192
13195
|
result.generatedFiles.push(...pipelineResult.files);
|
|
13193
13196
|
if (!pipelineResult.success) {
|
|
13194
13197
|
result.errors.push(...pipelineResult.errors.map((e) => `${ps.filename}: ${e}`));
|
|
13195
13198
|
}
|
|
13196
13199
|
} else {
|
|
13197
13200
|
const schema = JSON.parse(ps.content);
|
|
13198
|
-
const pipelineResult = runEntityPipeline(schema, cwd, config, {
|
|
13201
|
+
const pipelineResult = runEntityPipeline(schema, cwd, config, {
|
|
13202
|
+
force: true,
|
|
13203
|
+
silent: true
|
|
13204
|
+
});
|
|
13199
13205
|
result.generatedFiles.push(...pipelineResult.files);
|
|
13200
13206
|
if (!pipelineResult.success) {
|
|
13201
13207
|
result.errors.push(...pipelineResult.errors.map((e) => `${ps.filename}: ${e}`));
|
|
@@ -13638,9 +13644,7 @@ var initCommand = new Command3("init").description("Scaffold CMS into a new or e
|
|
|
13638
13644
|
}
|
|
13639
13645
|
pm = pmChoice;
|
|
13640
13646
|
}
|
|
13641
|
-
const cnaSpinner = p4.spinner();
|
|
13642
13647
|
const displayName = projectPrompt.projectName === "." ? path37.basename(cwd) : projectPrompt.projectName;
|
|
13643
|
-
cnaSpinner.start(`Creating Next.js app: ${displayName}...`);
|
|
13644
13648
|
const { bin, prefix } = createNextAppCommand(pm);
|
|
13645
13649
|
const cnaArgs = [
|
|
13646
13650
|
...prefix,
|
|
@@ -13656,14 +13660,14 @@ var initCommand = new Command3("init").description("Scaffold CMS into a new or e
|
|
|
13656
13660
|
];
|
|
13657
13661
|
if (srcDir) cnaArgs.push("--src-dir");
|
|
13658
13662
|
else cnaArgs.push("--no-src-dir");
|
|
13663
|
+
p4.log.step(`Creating Next.js app: ${pc2.cyan(displayName)}`);
|
|
13659
13664
|
try {
|
|
13660
13665
|
execFileSync4(bin, cnaArgs, {
|
|
13661
13666
|
cwd,
|
|
13662
|
-
stdio: "
|
|
13667
|
+
stdio: "inherit",
|
|
13663
13668
|
timeout: 12e4
|
|
13664
13669
|
});
|
|
13665
13670
|
} catch (err) {
|
|
13666
|
-
cnaSpinner.stop("Failed to create Next.js app");
|
|
13667
13671
|
p4.log.error(err instanceof Error ? err.message : "create-next-app failed");
|
|
13668
13672
|
p4.log.info(
|
|
13669
13673
|
`You can create the project manually:
|
|
@@ -13678,7 +13682,6 @@ var initCommand = new Command3("init").description("Scaffold CMS into a new or e
|
|
|
13678
13682
|
(f) => fs32.existsSync(path37.join(cwd, f))
|
|
13679
13683
|
);
|
|
13680
13684
|
if (!hasPackageJson || !hasNextConfig) {
|
|
13681
|
-
cnaSpinner.stop("Failed to create Next.js app");
|
|
13682
13685
|
p4.log.error(
|
|
13683
13686
|
"create-next-app completed but the project was not created. This can happen with nested npx calls."
|
|
13684
13687
|
);
|
|
@@ -13690,7 +13693,7 @@ var initCommand = new Command3("init").description("Scaffold CMS into a new or e
|
|
|
13690
13693
|
);
|
|
13691
13694
|
process.exit(1);
|
|
13692
13695
|
}
|
|
13693
|
-
|
|
13696
|
+
p4.log.success(`Created ${displayName} Next.js project`);
|
|
13694
13697
|
project = detectProject(cwd);
|
|
13695
13698
|
}
|
|
13696
13699
|
const features = options.yes ? { includeEmail: true, preset: options.preset } : await promptFeatures(options.preset);
|