create-stacki 0.1.99 → 1.0.3
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.mjs +8 -30
- package/dist/stacki-studio.json +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -263,14 +263,7 @@ function parseRelease(input) {
|
|
|
263
263
|
}
|
|
264
264
|
return { path: name, content };
|
|
265
265
|
});
|
|
266
|
-
for (const required of [
|
|
267
|
-
"package.json",
|
|
268
|
-
"package-lock.json",
|
|
269
|
-
"Dockerfile",
|
|
270
|
-
"scripts/build.ts",
|
|
271
|
-
"src/shared/release.json",
|
|
272
|
-
"vendor/stacki/LICENSE"
|
|
273
|
-
]) {
|
|
266
|
+
for (const required of ["package.json", "package-lock.json", "Dockerfile", "scripts/build.ts", "src/shared/release.json", "vendor/stacki/LICENSE"]) {
|
|
274
267
|
if (!names.has(required.toLowerCase())) {
|
|
275
268
|
throw new Error("Incomplete Studio release");
|
|
276
269
|
}
|
|
@@ -528,9 +521,7 @@ function parseComponentDefaults(input) {
|
|
|
528
521
|
throw new Error("Component defaults exceed the stored node limit");
|
|
529
522
|
}
|
|
530
523
|
};
|
|
531
|
-
const components = Object.fromEntries(
|
|
532
|
-
entries.map(([file, recipe]) => [componentFile(file), parseRecipe(recipe, 0, takeNode)])
|
|
533
|
-
);
|
|
524
|
+
const components = Object.fromEntries(entries.map(([file, recipe]) => [componentFile(file), parseRecipe(recipe, 0, takeNode)]));
|
|
534
525
|
assert(Object.keys(components).length === entries.length, "Recipe parsing preserves every owner");
|
|
535
526
|
assert(nodes <= DEFAULT_LIMITS.storedNodesMax, "Parsed recipes fit the total node budget");
|
|
536
527
|
return { version: 1, components };
|
|
@@ -648,7 +639,7 @@ function metadataKind(input) {
|
|
|
648
639
|
if (input === "componentSources") {
|
|
649
640
|
return input;
|
|
650
641
|
}
|
|
651
|
-
if (input === "components" || input === "guide" || input === "publish" || input === "pages") {
|
|
642
|
+
if (input === "components" || input === "guide" || input === "publish" || input === "pages" || input === "styles") {
|
|
652
643
|
return input;
|
|
653
644
|
}
|
|
654
645
|
throw new Error("Unknown project metadata file");
|
|
@@ -786,15 +777,11 @@ Ask for approval before creating paid resources or deploying anything.
|
|
|
786
777
|
Report external setup that still needs my action. Updates are always opt-in.`;
|
|
787
778
|
async function confirm(project) {
|
|
788
779
|
if (!stdin.isTTY || !stdout.isTTY) {
|
|
789
|
-
throw new Error(
|
|
790
|
-
"Use --yes for a noninteractive installation, or --agent for setup instructions"
|
|
791
|
-
);
|
|
780
|
+
throw new Error("Use --yes for a noninteractive installation, or --agent for setup instructions");
|
|
792
781
|
}
|
|
793
782
|
const input = createInterface({ input: stdin, output: stdout });
|
|
794
783
|
try {
|
|
795
|
-
const answer = await input.question(
|
|
796
|
-
`Install Stacki Studio in ${path3.join(project, "studio")}? [y/N] `
|
|
797
|
-
);
|
|
784
|
+
const answer = await input.question(`Install Stacki Studio in ${path3.join(project, "studio")}? [y/N] `);
|
|
798
785
|
return /^(y|yes)$/i.test(answer.trim());
|
|
799
786
|
} finally {
|
|
800
787
|
input.close();
|
|
@@ -807,12 +794,7 @@ async function main() {
|
|
|
807
794
|
return;
|
|
808
795
|
}
|
|
809
796
|
requireSupportedNode(process.versions.node);
|
|
810
|
-
const release = parseRelease(
|
|
811
|
-
await readJson(
|
|
812
|
-
fileURLToPath(new URL("./stacki-studio.json", import.meta.url)),
|
|
813
|
-
RELEASE_BYTES_MAX
|
|
814
|
-
)
|
|
815
|
-
);
|
|
797
|
+
const release = parseRelease(await readJson(fileURLToPath(new URL("./stacki-studio.json", import.meta.url)), RELEASE_BYTES_MAX));
|
|
816
798
|
if (options.mode === "version") {
|
|
817
799
|
console.log(release.version);
|
|
818
800
|
return;
|
|
@@ -821,9 +803,7 @@ async function main() {
|
|
|
821
803
|
const installed = await installedVersion(project);
|
|
822
804
|
if (installed) {
|
|
823
805
|
console.log(`Stacki Studio ${installed} is already installed. No files were changed.`);
|
|
824
|
-
console.log(
|
|
825
|
-
"Open Studio to manage its version. Run npm --prefix studio run dev in this project."
|
|
826
|
-
);
|
|
806
|
+
console.log("Open Studio to manage its version. Run npm --prefix studio run dev in this project.");
|
|
827
807
|
return;
|
|
828
808
|
}
|
|
829
809
|
console.log(`Stacki Studio ${release.version} \u2014 1/3 Install`);
|
|
@@ -836,9 +816,7 @@ async function main() {
|
|
|
836
816
|
console.log(`
|
|
837
817
|
Installed Stacki Studio ${release.version} in ${path3.join(project, "studio")}`);
|
|
838
818
|
console.log("\n2/3 Local preview\nFrom your project root, run: npm --prefix studio run dev");
|
|
839
|
-
console.log(
|
|
840
|
-
"\n3/3 Go live\nFollow studio/docs/cloudflare.md to configure GitHub and Cloudflare."
|
|
841
|
-
);
|
|
819
|
+
console.log("\n3/3 Go live\nFollow studio/docs/cloudflare.md to configure GitHub and Cloudflare.");
|
|
842
820
|
console.log("For a prompt to give your agent: npm create stacki@latest -- --agent");
|
|
843
821
|
console.log("Commit /studio to keep this version with your project. Updates are opt-in.");
|
|
844
822
|
}
|