kizlo 0.8.0 → 0.8.1
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/commands/create.js +9 -3
- package/dist/package.js +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ import { downloadTemplate } from "giget";
|
|
|
15
15
|
const TEMPLATE_REPO = "github:kizlo-io/kizlo";
|
|
16
16
|
/**
|
|
17
17
|
* The templates `create` can scaffold from. Each id is both the `templates/<id>` folder and the
|
|
18
|
-
* preset that drives its WordPress setup.
|
|
18
|
+
* preset that drives its WordPress setup.
|
|
19
19
|
*/
|
|
20
20
|
const TEMPLATES = ["nextjs"];
|
|
21
21
|
function isTemplate(value) {
|
|
@@ -49,6 +49,13 @@ async function scaffoldTemplate(template, dir, name) {
|
|
|
49
49
|
});
|
|
50
50
|
fs.rmSync(path.join(dir, "kizlo.template.json"), { force: true });
|
|
51
51
|
const pkgPath = path.join(dir, "package.json");
|
|
52
|
+
if (!fs.existsSync(pkgPath)) {
|
|
53
|
+
fs.rmSync(dir, {
|
|
54
|
+
recursive: true,
|
|
55
|
+
force: true
|
|
56
|
+
});
|
|
57
|
+
throw new Error(`Template "${template}" wasn't found at ${source.remote ?? source.local}. This ref may predate the templates — retry with KIZLO_TEMPLATE_REF=main.`);
|
|
58
|
+
}
|
|
52
59
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
53
60
|
pkg.name = name;
|
|
54
61
|
if (pkg.dependencies?.kizlo === "workspace:*") pkg.dependencies.kizlo = `^${getVersion()}`;
|
|
@@ -83,8 +90,7 @@ const create = defineCommand({
|
|
|
83
90
|
process.exit(1);
|
|
84
91
|
}
|
|
85
92
|
template = requested;
|
|
86
|
-
} else
|
|
87
|
-
else template = orCancel(await p.select({
|
|
93
|
+
} else template = orCancel(await p.select({
|
|
88
94
|
message: "Template",
|
|
89
95
|
options: TEMPLATES.map((id) => ({
|
|
90
96
|
value: id,
|
package/dist/package.js
CHANGED