@kidd-cli/cli 0.1.3 → 0.1.4

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.
@@ -1,10 +1,9 @@
1
- import { n as isKebabCase, r as renderTemplate, t as writeFiles } from "../../write-dfZMTbtn.mjs";
2
- import { t as detectProject } from "../../detect-t9mL3oTg.mjs";
1
+ import { n as isKebabCase, r as renderTemplate, t as writeFiles } from "../../write-CdoqLFeH.mjs";
2
+ import { t as detectProject } from "../../detect-DcO0_CWy.mjs";
3
3
  import { command } from "@kidd-cli/core";
4
4
  import { join } from "node:path";
5
5
  import { loadConfig } from "@kidd-cli/config/loader";
6
6
  import { z } from "zod";
7
-
8
7
  //#region src/commands/add/command.ts
9
8
  const addCommandCommand = command({
10
9
  args: z.object({
@@ -117,6 +116,5 @@ function resolveCommandsDir(configResult, rootDir) {
117
116
  if (configResult) return join(rootDir, configResult.config.commands ?? DEFAULT_COMMANDS);
118
117
  return join(rootDir, DEFAULT_COMMANDS);
119
118
  }
120
-
121
119
  //#endregion
122
- export { addCommandCommand as default };
120
+ export { addCommandCommand as default };
@@ -1,7 +1,5 @@
1
1
  import { command } from "@kidd-cli/core";
2
-
3
2
  //#region src/commands/add/index.ts
4
3
  const addCommand = command({ description: "Add a command or middleware to your project" });
5
-
6
4
  //#endregion
7
- export { addCommand as default };
5
+ export { addCommand as default };
@@ -1,9 +1,8 @@
1
- import { n as isKebabCase, r as renderTemplate, t as writeFiles } from "../../write-dfZMTbtn.mjs";
2
- import { t as detectProject } from "../../detect-t9mL3oTg.mjs";
1
+ import { n as isKebabCase, r as renderTemplate, t as writeFiles } from "../../write-CdoqLFeH.mjs";
2
+ import { t as detectProject } from "../../detect-DcO0_CWy.mjs";
3
3
  import { command } from "@kidd-cli/core";
4
4
  import { join } from "node:path";
5
5
  import { z } from "zod";
6
-
7
6
  //#region src/commands/add/middleware.ts
8
7
  const addMiddlewareCommand = command({
9
8
  args: z.object({
@@ -82,6 +81,5 @@ async function resolveDescription(ctx) {
82
81
  placeholder: "What does this middleware do?"
83
82
  });
84
83
  }
85
-
86
84
  //#endregion
87
- export { addMiddlewareCommand as default };
85
+ export { addMiddlewareCommand as default };
@@ -1,10 +1,9 @@
1
- import { t as extractConfig } from "../config-helpers-QvhfBI9b.mjs";
1
+ import { t as extractConfig } from "../config-helpers-wZhBJJXJ.mjs";
2
2
  import { command } from "@kidd-cli/core";
3
3
  import { relative } from "node:path";
4
4
  import { build, compile, resolveTargetLabel } from "@kidd-cli/bundler";
5
5
  import { loadConfig } from "@kidd-cli/config/loader";
6
6
  import { z } from "zod";
7
-
8
7
  //#region src/commands/build.ts
9
8
  /**
10
9
  * Build a kidd CLI project for production using tsdown.
@@ -147,6 +146,5 @@ function formatBinariesNote(params) {
147
146
  const maxLen = Math.max(...params.binaries.map((b) => b.label.length));
148
147
  return params.binaries.map((binary) => `${binary.label.padEnd(maxLen)} ${relative(params.cwd, binary.path)}`).join("\n");
149
148
  }
150
-
151
149
  //#endregion
152
- export { buildCommand as default };
150
+ export { buildCommand as default };
@@ -1,9 +1,8 @@
1
- import { t as extractConfig } from "../config-helpers-QvhfBI9b.mjs";
1
+ import { t as extractConfig } from "../config-helpers-wZhBJJXJ.mjs";
2
2
  import { autoload, command } from "@kidd-cli/core";
3
3
  import { join } from "node:path";
4
4
  import { loadConfig } from "@kidd-cli/config/loader";
5
5
  import { existsSync } from "node:fs";
6
-
7
6
  //#region src/commands/commands.ts
8
7
  /**
9
8
  * Display the command tree for a kidd CLI project.
@@ -118,6 +117,5 @@ function formatLabel(name, description) {
118
117
  if (description) return `${name} — ${description}`;
119
118
  return name;
120
119
  }
121
-
122
120
  //#endregion
123
- export { commandsCommand as default };
121
+ export { commandsCommand as default };
@@ -1,8 +1,7 @@
1
- import { t as extractConfig } from "../config-helpers-QvhfBI9b.mjs";
1
+ import { t as extractConfig } from "../config-helpers-wZhBJJXJ.mjs";
2
2
  import { command } from "@kidd-cli/core";
3
3
  import { watch } from "@kidd-cli/bundler";
4
4
  import { loadConfig } from "@kidd-cli/config/loader";
5
-
6
5
  //#region src/commands/dev.ts
7
6
  /**
8
7
  * Start a kidd CLI project in development mode with file watching.
@@ -52,6 +51,5 @@ function createOnSuccess(ctx) {
52
51
  ctx.logger.success("Rebuilt successfully");
53
52
  };
54
53
  }
55
-
56
54
  //#endregion
57
- export { devCommand as default };
55
+ export { devCommand as default };
@@ -3,12 +3,11 @@ import { dirname, join, relative } from "node:path";
3
3
  import { readManifest } from "@kidd-cli/utils/manifest";
4
4
  import { loadConfig } from "@kidd-cli/config/loader";
5
5
  import { z } from "zod";
6
+ import { attemptAsync, err, match, ok } from "@kidd-cli/utils/fp";
6
7
  import pc from "picocolors";
7
8
  import { mkdir, readFile, writeFile } from "node:fs/promises";
8
- import { attemptAsync, err, ok } from "@kidd-cli/utils/fp";
9
9
  import { fileExists } from "@kidd-cli/utils/fs";
10
10
  import { jsonParse, jsonStringify } from "@kidd-cli/utils/json";
11
-
12
11
  //#region src/lib/checks.ts
13
12
  /**
14
13
  * Default entry point for the CLI source.
@@ -493,7 +492,6 @@ async function updatePackageJson(cwd, transform) {
493
492
  if (writeError) return err(`Failed to write package.json: ${writeError.message}`);
494
493
  return ok();
495
494
  }
496
-
497
495
  //#endregion
498
496
  //#region src/commands/doctor.ts
499
497
  /**
@@ -636,10 +634,7 @@ function formatResultLine(result, fixResults) {
636
634
  * @returns A colored string representation of the status.
637
635
  */
638
636
  function formatDisplayStatus(status) {
639
- if (status === "pass") return pc.green("pass");
640
- if (status === "warn") return pc.yellow("warn");
641
- if (status === "fix") return pc.blue("fix ");
642
- return pc.red("fail");
637
+ return match(status).with("pass", () => pc.green("pass")).with("warn", () => pc.yellow("warn")).with("fix", () => pc.blue("fix ")).with("fail", () => pc.red("fail")).exhaustive();
643
638
  }
644
639
  /**
645
640
  * Format the summary line with counts.
@@ -664,6 +659,5 @@ function pluralizeCheck(count) {
664
659
  if (count === 1) return "check";
665
660
  return "checks";
666
661
  }
667
-
668
662
  //#endregion
669
- export { doctorCommand as default };
663
+ export { doctorCommand as default };
@@ -1,11 +1,28 @@
1
- import { n as isKebabCase, r as renderTemplate, t as writeFiles } from "../write-dfZMTbtn.mjs";
1
+ import { n as isKebabCase, r as renderTemplate, t as writeFiles } from "../write-CdoqLFeH.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { command } from "@kidd-cli/core";
4
4
  import { dirname, join } from "node:path";
5
5
  import { readManifest } from "@kidd-cli/utils/manifest";
6
6
  import { z } from "zod";
7
7
  import { attempt } from "@kidd-cli/utils/fp";
8
-
8
+ //#region src/generated/template-versions.ts
9
+ /**
10
+ * Zod version from the workspace catalog.
11
+ */
12
+ const ZOD_VERSION = "^4.3.6";
13
+ /**
14
+ * TypeScript version from the workspace catalog.
15
+ */
16
+ const TYPESCRIPT_VERSION = "^5.9.3";
17
+ /**
18
+ * Vitest version from the workspace catalog.
19
+ */
20
+ const VITEST_VERSION = "^4.0.18";
21
+ /**
22
+ * Tsdown version from the workspace catalog.
23
+ */
24
+ const TSDOWN_VERSION = "^0.21.1";
25
+ //#endregion
9
26
  //#region src/commands/init.ts
10
27
  const initCommand = command({
11
28
  args: z.object({
@@ -34,7 +51,11 @@ const initCommand = command({
34
51
  coreVersion,
35
52
  description: projectDescription,
36
53
  name: projectName,
37
- packageManager
54
+ packageManager,
55
+ tsdownVersion: TSDOWN_VERSION,
56
+ typescriptVersion: TYPESCRIPT_VERSION,
57
+ vitestVersion: VITEST_VERSION,
58
+ zodVersion: ZOD_VERSION
38
59
  }
39
60
  });
40
61
  if (renderError) {
@@ -190,6 +211,5 @@ async function resolveDependencyVersion(packageName) {
190
211
  if (manifestError || !manifest.version) return DEFAULT_VERSION;
191
212
  return manifest.version;
192
213
  }
193
-
194
214
  //#endregion
195
- export { initCommand as default };
215
+ export { initCommand as default };
@@ -9,6 +9,5 @@ function extractConfig(result) {
9
9
  if (result) return result.config;
10
10
  return {};
11
11
  }
12
-
13
12
  //#endregion
14
- export { extractConfig as t };
13
+ export { extractConfig as t };
@@ -1,8 +1,7 @@
1
1
  import { join } from "node:path";
2
- import { readFile } from "node:fs/promises";
3
2
  import { attemptAsync, ok, toErrorMessage } from "@kidd-cli/utils/fp";
3
+ import { readFile } from "node:fs/promises";
4
4
  import { fileExists } from "@kidd-cli/utils/fs";
5
-
6
5
  //#region src/lib/detect.ts
7
6
  /**
8
7
  * Detect whether the given directory contains a kidd-based CLI project.
@@ -58,6 +57,5 @@ async function readPackageJson(filePath) {
58
57
  }, null];
59
58
  }
60
59
  }
61
-
62
60
  //#endregion
63
- export { detectProject as t };
61
+ export { detectProject as t };
package/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { cli } from "@kidd-cli/core";
2
2
  import { join } from "node:path";
3
3
  import { readManifest } from "@kidd-cli/utils/manifest";
4
-
5
4
  //#region src/manifest.ts
6
5
  /**
7
6
  * Read and validate the CLI package manifest.
@@ -26,7 +25,6 @@ async function loadCLIManifest(baseDir) {
26
25
  version: manifest.version
27
26
  };
28
27
  }
29
-
30
28
  //#endregion
31
29
  //#region src/index.ts
32
30
  const manifest = await loadCLIManifest(import.meta.dirname);
@@ -36,6 +34,5 @@ await cli({
36
34
  name: manifest.name,
37
35
  version: manifest.version
38
36
  });
39
-
40
37
  //#endregion
41
- export { };
38
+ export {};
@@ -5,7 +5,7 @@
5
5
  "keywords": [],
6
6
  "license": "MIT",
7
7
  "bin": {
8
- "{{ name }}": "./dist/index.js"
8
+ "{{ name }}": "./dist/index.mjs"
9
9
  },
10
10
  "files": [
11
11
  "dist"
@@ -19,11 +19,12 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@kidd-cli/core": "^{{ coreVersion }}",
22
- "zod": "^3.24.0"
22
+ "zod": "{{ zodVersion }}"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@kidd-cli/cli": "^{{ cliVersion }}",
26
- "typescript": "^5.7.0",
27
- "vitest": "^4.0.0"
26
+ "tsdown": "{{ tsdownVersion }}",
27
+ "typescript": "{{ typescriptVersion }}",
28
+ "vitest": "{{ vitestVersion }}"
28
29
  }
29
30
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES2022",
3
+ "target": "ES2024",
4
4
  "module": "ESNext",
5
5
  "moduleResolution": "bundler",
6
6
  "strict": true,
@@ -1,9 +1,8 @@
1
1
  import { dirname, join, relative } from "node:path";
2
- import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
3
2
  import { ok, toErrorMessage } from "@kidd-cli/utils/fp";
3
+ import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
4
4
  import { fileExists } from "@kidd-cli/utils/fs";
5
5
  import { Liquid } from "liquidjs";
6
-
7
6
  //#region src/lib/render.ts
8
7
  /**
9
8
  * Render all `.liquid` templates in a directory using LiquidJS.
@@ -92,7 +91,6 @@ function isGenerateError(value) {
92
91
  if (typeof value !== "object" || value === null) return false;
93
92
  return "type" in value && "message" in value;
94
93
  }
95
-
96
94
  //#endregion
97
95
  //#region src/lib/validate.ts
98
96
  const KEBAB_CASE_CHARS_RE = /^[a-z][\da-z-]*$/;
@@ -108,7 +106,6 @@ function isKebabCase(value) {
108
106
  if (value.includes("--")) return false;
109
107
  return true;
110
108
  }
111
-
112
109
  //#endregion
113
110
  //#region src/lib/write.ts
114
111
  /**
@@ -162,6 +159,5 @@ async function writeSingleFile(file, outputDir, overwrite) {
162
159
  }, null];
163
160
  }
164
161
  }
165
-
166
162
  //#endregion
167
- export { isKebabCase as n, renderTemplate as r, writeFiles as t };
163
+ export { isKebabCase as n, renderTemplate as r, writeFiles as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kidd-cli/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "DX companion CLI for the kidd framework",
5
5
  "keywords": [
6
6
  "cli",
@@ -22,20 +22,21 @@
22
22
  ],
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "fs-extra": "^11.3.3",
25
+ "fs-extra": "^11.3.4",
26
26
  "liquidjs": "^10.25.0",
27
27
  "picocolors": "^1.1.1",
28
28
  "zod": "^4.3.6",
29
- "@kidd-cli/bundler": "0.1.2",
30
- "@kidd-cli/config": "0.1.2",
31
- "@kidd-cli/core": "0.2.0",
32
- "@kidd-cli/utils": "0.1.2"
29
+ "@kidd-cli/bundler": "0.1.3",
30
+ "@kidd-cli/config": "0.1.3",
31
+ "@kidd-cli/core": "0.3.0",
32
+ "@kidd-cli/utils": "0.1.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/fs-extra": "^11.0.4",
36
- "tsdown": "0.21.0-beta.2",
36
+ "tsdown": "0.21.1",
37
37
  "typescript": "^5.9.3",
38
- "vitest": "^4.0.18"
38
+ "vitest": "^4.0.18",
39
+ "yaml": "^2.8.0"
39
40
  },
40
41
  "scripts": {
41
42
  "build": "tsdown && mkdir -p dist/lib && cp -r src/lib/templates dist/lib/templates",