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.
@@ -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. When only one exists the template prompt auto-selects it.
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 if (TEMPLATES.length === 1) template = TEMPLATES[0];
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
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.8.0";
2
+ var version = "0.8.1";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kizlo",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "description": "A headless WordPress framework for TypeScript.",
6
6
  "keywords": [