create-zudo-doc 2.5.1 → 3.1.0

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/README.md CHANGED
@@ -31,7 +31,7 @@ pnpm create zudo-doc my-docs --yes
31
31
  # Fully specified, non-interactive
32
32
  pnpm create zudo-doc my-docs \
33
33
  --lang ja \
34
- --scheme Dracula \
34
+ --scheme "Default Dark" \
35
35
  --no-i18n \
36
36
  --search \
37
37
  --pm pnpm \
@@ -109,11 +109,11 @@ pnpm create zudo-doc my-docs \
109
109
  --install \
110
110
  --yes
111
111
 
112
- # Light/dark color scheme with Catppuccin pairings
112
+ # Light/dark color scheme with the Default pairing
113
113
  pnpm create zudo-doc my-docs \
114
114
  --color-scheme-mode light-dark \
115
- --light-scheme "Catppuccin Latte" \
116
- --dark-scheme "Catppuccin Mocha" \
115
+ --light-scheme "Default Light" \
116
+ --dark-scheme "Default Dark" \
117
117
  --default-mode dark \
118
118
  --yes
119
119
 
@@ -130,7 +130,7 @@ await createZudoDoc({
130
130
  projectName: "my-docs",
131
131
  defaultLang: "en",
132
132
  colorSchemeMode: "single",
133
- singleScheme: "Dracula",
133
+ singleScheme: "Default Dark",
134
134
  features: ["search", "sidebarFilter", "tagGovernance"],
135
135
  packageManager: "pnpm",
136
136
  install: true,
package/dist/api.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import path from "path";
2
+ import { SINGLE_SCHEMES } from "./constants.js";
2
3
  import { scaffold } from "./scaffold.js";
3
4
  import { initGitRepo, installDependencies, validateProjectName } from "./utils.js";
4
5
  export async function createZudoDoc(options) {
@@ -6,6 +7,21 @@ export async function createZudoDoc(options) {
6
7
  const nameError = validateProjectName(rest.projectName);
7
8
  if (nameError)
8
9
  throw new Error(`Invalid projectName: ${nameError}`);
10
+ // Validate scheme names like the CLI (cli.ts) and preset (preset.ts) paths do.
11
+ // Only `Default Light`/`Default Dark` exist post-catalog-drop (#2619); an
12
+ // unvalidated name here would be written verbatim into settings.ts and throw
13
+ // "Unknown color scheme" at the generated site's build — the exact failure
14
+ // this epic set out to eliminate. This is the last scaffolding entry point
15
+ // that lacked the guard.
16
+ for (const [label, value] of [
17
+ ["color scheme", rest.singleScheme],
18
+ ["light scheme", rest.lightScheme],
19
+ ["dark scheme", rest.darkScheme],
20
+ ]) {
21
+ if (value && !SINGLE_SCHEMES.includes(value)) {
22
+ throw new Error(`Unknown ${label} "${value}"`);
23
+ }
24
+ }
9
25
  const choices = { ...rest, defaultLang: rest.defaultLang ?? "en" };
10
26
  await scaffold(choices);
11
27
  const targetDir = path.resolve(process.cwd(), choices.projectName);
package/dist/cli.js CHANGED
@@ -110,12 +110,7 @@ ${pc.bold("Examples:")}
110
110
  create-zudo-doc my-docs --yes
111
111
 
112
112
  ${pc.dim("# Fully specified")}
113
- create-zudo-doc my-docs --lang ja --scheme Dracula --no-i18n --pm pnpm --install
114
-
115
- ${pc.dim("# Light/dark mode with custom schemes")}
116
- create-zudo-doc my-docs --color-scheme-mode light-dark \\
117
- --light-scheme "GitHub Light" --dark-scheme "GitHub Dark" \\
118
- --default-mode dark --yes
113
+ create-zudo-doc my-docs --lang ja --scheme "Default Dark" --no-i18n --pm pnpm --install
119
114
  `);
120
115
  }
121
116
  export function validateArgs(args) {
package/dist/constants.js CHANGED
@@ -1,73 +1,12 @@
1
1
  export const LIGHT_DARK_PAIRINGS = [
2
2
  { light: "Default Light", dark: "Default Dark", label: "Default" },
3
- { light: "GitHub Light", dark: "GitHub Dark", label: "GitHub" },
4
- { light: "Catppuccin Latte", dark: "Catppuccin Mocha", label: "Catppuccin" },
5
- { light: "Solarized Light", dark: "Solarized Dark", label: "Solarized" },
6
- { light: "Rose Pine Dawn", dark: "Rose Pine", label: "Rosé Pine" },
7
- { light: "Atom One Light", dark: "Atom One Dark", label: "Atom One" },
8
- { light: "Everforest Light", dark: "Everforest Dark", label: "Everforest" },
9
- { light: "Gruvbox Light", dark: "Gruvbox Dark", label: "Gruvbox" },
10
- { light: "Ayu Light", dark: "Ayu Dark", label: "Ayu" },
11
- ];
12
- // All available single schemes (dark ones most popular first)
13
- export const SINGLE_SCHEMES = [
14
- "Default Dark",
15
- "Dracula",
16
- "Catppuccin Mocha",
17
- "GitHub Dark",
18
- "Nord",
19
- "TokyoNight",
20
- "Gruvbox Dark",
21
- "Atom One Dark",
22
- "Rose Pine",
23
- "Solarized Dark",
24
- "Material Ocean",
25
- "Monokai Pro",
26
- "Everforest Dark",
27
- "Kanagawa Wave",
28
- "Night Owl",
29
- "Ayu Dark",
30
- "VS Code Dark+",
31
- "Doom One",
32
- "Challenger Deep",
33
- "Catppuccin Frappe",
34
- "Catppuccin Macchiato",
35
- "Gruvbox Dark Hard",
36
- "Rose Pine Moon",
37
- "GitHub Dark Dimmed",
38
- "Ayu Mirage",
39
- "Material Darker",
40
- "Material Dark",
41
- "Monokai Remastered",
42
- "Monokai Vivid",
43
- "Monokai Soda",
44
- "Solarized Dark Higher Contrast",
45
- "Gruvbox Material Dark",
46
- "Kanagawa Dragon",
47
- // Light schemes
48
- "Default Light",
49
- "GitHub Light",
50
- "Catppuccin Latte",
51
- "Solarized Light",
52
- "Rose Pine Dawn",
53
- "Atom One Light",
54
- "Everforest Light",
55
- "Gruvbox Light",
56
- "Ayu Light",
57
3
  ];
4
+ // All available single schemes (dark-first ordering — asserted by the host
5
+ // sync test).
6
+ export const SINGLE_SCHEMES = ["Default Dark", "Default Light"];
58
7
  // Light-only subset of SINGLE_SCHEMES. Used by the preset generator to populate
59
8
  // the "Light scheme" dropdown (dark schemes are derived as SINGLE_SCHEMES minus these).
60
- export const LIGHT_SCHEMES = [
61
- "Default Light",
62
- "GitHub Light",
63
- "Catppuccin Latte",
64
- "Solarized Light",
65
- "Rose Pine Dawn",
66
- "Atom One Light",
67
- "Everforest Light",
68
- "Gruvbox Light",
69
- "Ayu Light",
70
- ];
9
+ export const LIGHT_SCHEMES = ["Default Light"];
71
10
  export const SUPPORTED_LANGS = [
72
11
  { value: "en", label: "English" },
73
12
  { value: "ja", label: "Japanese" },
@@ -167,7 +106,7 @@ export const FEATURES = [
167
106
  {
168
107
  value: "skillSymlinker",
169
108
  label: "Skill symlinker",
170
- hint: "Symlink documentation skills",
109
+ hint: "Symlink documentation skills into Claude Code or Codex",
171
110
  default: false,
172
111
  cliFlag: "skill-symlinker",
173
112
  },
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ async function main() {
89
89
  prefilled.respectPrefersColorScheme ??= true;
90
90
  }
91
91
  else {
92
- prefilled.singleScheme ??= "Dracula";
92
+ prefilled.singleScheme ??= "Default Dark";
93
93
  }
94
94
  prefilled.packageManager ??= "pnpm";
95
95
  prefilled.githubUrl ??= "";
package/dist/prompts.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as p from "@clack/prompts";
2
- import { LIGHT_DARK_PAIRINGS, SINGLE_SCHEMES, FEATURES, SUPPORTED_LANGS } from "./constants.js";
2
+ import { SINGLE_SCHEMES, FEATURES, SUPPORTED_LANGS } from "./constants.js";
3
3
  import { validateProjectName } from "./utils.js";
4
4
  export async function runPrompts(prefilled = {}) {
5
5
  // 1. Project name
@@ -88,48 +88,9 @@ export async function runPrompts(prefilled = {}) {
88
88
  darkScheme = prefilled.darkScheme;
89
89
  }
90
90
  else {
91
- const pairingChoice = await p.select({
92
- message: "Choose a light/dark pairing:",
93
- options: [
94
- ...LIGHT_DARK_PAIRINGS.map((pair) => ({
95
- value: pair.label,
96
- label: `${pair.light} + ${pair.dark}`,
97
- hint: pair.label,
98
- })),
99
- {
100
- value: "custom",
101
- label: "Pick individually",
102
- hint: "Choose light and dark schemes separately",
103
- },
104
- ],
105
- });
106
- if (p.isCancel(pairingChoice))
107
- process.exit(0);
108
- if (pairingChoice === "custom") {
109
- const lightSchemes = SINGLE_SCHEMES.filter((s) => ["Light", "Latte", "Dawn"].some((k) => s.includes(k)));
110
- const darkSchemes = SINGLE_SCHEMES.filter((s) => !["Light", "Latte", "Dawn"].some((k) => s.includes(k)));
111
- const light = await p.select({
112
- message: "Choose light scheme:",
113
- options: lightSchemes.map((s) => ({ value: s, label: s })),
114
- });
115
- if (p.isCancel(light))
116
- process.exit(0);
117
- lightScheme = light;
118
- const dark = await p.select({
119
- message: "Choose dark scheme:",
120
- options: darkSchemes.map((s) => ({ value: s, label: s })),
121
- });
122
- if (p.isCancel(dark))
123
- process.exit(0);
124
- darkScheme = dark;
125
- }
126
- else {
127
- const pairing = LIGHT_DARK_PAIRINGS.find((pair) => pair.label === pairingChoice);
128
- if (pairing) {
129
- lightScheme = pairing.light;
130
- darkScheme = pairing.dark;
131
- }
132
- }
91
+ // Only the Default pairing exists — auto-assign, no prompt.
92
+ lightScheme = "Default Light";
93
+ darkScheme = "Default Dark";
133
94
  }
134
95
  // Default mode
135
96
  if (prefilled.defaultMode === undefined) {
@@ -11,5 +11,5 @@ export { getSecondaryLang };
11
11
  *
12
12
  * Bumped in lockstep by scripts/release-create-zudo-doc.sh.
13
13
  */
14
- export declare const ZUDO_DOC_PIN = "^2.5.1";
14
+ export declare const ZUDO_DOC_PIN = "^3.1.0";
15
15
  export declare function scaffold(choices: UserChoices): Promise<void>;
package/dist/scaffold.js CHANGED
@@ -18,7 +18,7 @@ export { getSecondaryLang };
18
18
  *
19
19
  * Bumped in lockstep by scripts/release-create-zudo-doc.sh.
20
20
  */
21
- export const ZUDO_DOC_PIN = "^2.5.1";
21
+ export const ZUDO_DOC_PIN = "^3.1.0";
22
22
  /**
23
23
  * Files in `templates/base/**` that must never be copied into a generated
24
24
  * project. Each entry is matched against the path relative to `templates/base/`
@@ -333,12 +333,14 @@ export async function scaffold(choices) {
333
333
  // skill a user later installs under a matching name. The skill name is
334
334
  // deterministic (always `<projectName>-wisdom`, matching DEFAULT_SKILL_NAME
335
335
  // in scripts/setup-doc-skill.sh and the package name), so these entries match
336
- // the directory the script creates. The docs-ja symlink only exists for i18n
337
- // projects (the script creates it conditionally), so gate that line on i18n.
336
+ // the directory the script creates. The setup script can target either
337
+ // .claude or .codex, so ignore both possible generated directories. The
338
+ // docs-ja symlink only exists for i18n projects (the script creates it
339
+ // conditionally), so gate those lines on i18n.
338
340
  if (choices.features.includes("skillSymlinker")) {
339
- gitignoreLines.push("# Generated doc-lookup skill", `.claude/skills/${choices.projectName}-wisdom/SKILL.md`, `.claude/skills/${choices.projectName}-wisdom/docs`);
341
+ gitignoreLines.push("# Generated doc-lookup skill", `.claude/skills/${choices.projectName}-wisdom/SKILL.md`, `.claude/skills/${choices.projectName}-wisdom/docs`, `.codex/skills/${choices.projectName}-wisdom/SKILL.md`, `.codex/skills/${choices.projectName}-wisdom/docs`);
340
342
  if (choices.features.includes("i18n")) {
341
- gitignoreLines.push(`.claude/skills/${choices.projectName}-wisdom/docs-ja`);
343
+ gitignoreLines.push(`.claude/skills/${choices.projectName}-wisdom/docs-ja`, `.codex/skills/${choices.projectName}-wisdom/docs-ja`);
342
344
  }
343
345
  gitignoreLines.push("");
344
346
  }
@@ -493,13 +495,16 @@ function generatePackageJson(choices) {
493
495
  // class-candidate scanning through symlinked project trees
494
496
  // (zudolab/zudo-doc#2511), adopted in lockstep with the root package.json
495
497
  // pins. No consumer-facing / CLI change.
496
- // next.76 (current pin): routine toolchain bump from next.75, adopted in
498
+ // next.76: routine toolchain bump from next.75, adopted in
497
499
  // lockstep with the root package.json pins. No consumer-facing / CLI change.
498
- "@takazudo/zfb": "0.1.0-next.76",
499
- "@takazudo/zfb-runtime": "0.1.0-next.76",
500
+ // next.77 (current pin): router persistence/history fixes and runtime
501
+ // island remount support, adopted in lockstep with the root package.json
502
+ // pins. No scaffold API change.
503
+ "@takazudo/zfb": "0.1.0-next.77",
504
+ "@takazudo/zfb-runtime": "0.1.0-next.77",
500
505
  // zfb-adapter-cloudflare — required for any route with `prerender = false`.
501
506
  // Pinned in lockstep with @takazudo/zfb.
502
- "@takazudo/zfb-adapter-cloudflare": "0.1.0-next.76",
507
+ "@takazudo/zfb-adapter-cloudflare": "0.1.0-next.77",
503
508
  // @takazudo/zudo-doc — published from this monorepo via
504
509
  // .github/workflows/publish-zudo-doc.yml. The pin here is bumped in
505
510
  // lockstep by scripts/release-create-zudo-doc.sh whenever zudo-doc's
@@ -582,7 +587,7 @@ function generatePackageJson(choices) {
582
587
  // @takazudo/zudo-doc/integrations/doc-history which in turn imports
583
588
  // @takazudo/zudo-doc-history-server/git-history. Without this dep the
584
589
  // plugin host fails at init with ERR_MODULE_NOT_FOUND — W8A (#1739).
585
- deps["@takazudo/zudo-doc-history-server"] = "^2.5.1";
590
+ deps["@takazudo/zudo-doc-history-server"] = "^3.1.0";
586
591
  // tsx is no longer needed here: the relocated package plugin imports the
587
592
  // runner directly (no `tsx -e` spawn) since the package ships compiled
588
593
  // dist/ — package-first migration #2321 (#2337).
@@ -593,7 +598,7 @@ function generatePackageJson(choices) {
593
598
  if (choices.features.includes("designTokenPanel")) {
594
599
  // @takazudo/zdtp requires preact >= 10.29.1 — see the preact floor comment
595
600
  // above (~line 382) for why the floor is set there and the coupling this creates.
596
- deps["@takazudo/zdtp"] = "0.4.2";
601
+ deps["@takazudo/zdtp"] = "0.4.5";
597
602
  }
598
603
  if (choices.features.includes("tagGovernance")) {
599
604
  // gray-matter is already in `deps` unconditionally (base template uses it),
@@ -635,6 +640,12 @@ function generatePackageJson(choices) {
635
640
  scripts["setup:doc-skill"] = "bash scripts/setup-doc-skill.sh";
636
641
  scripts["setup:doc-skill-silent"] =
637
642
  "bash scripts/setup-doc-skill.sh --silent";
643
+ scripts["setup:doc-skill:claude"] =
644
+ "bash scripts/setup-doc-skill.sh --target claude";
645
+ scripts["setup:doc-skill:codex"] =
646
+ "bash scripts/setup-doc-skill.sh --target codex";
647
+ scripts["setup:doc-skill:both"] =
648
+ "bash scripts/setup-doc-skill.sh --target both";
638
649
  }
639
650
  const runCmd = choices.packageManager === "npm" || choices.packageManager === "bun" ? `${choices.packageManager} run` : choices.packageManager;
640
651
  // claudeSkills ships the zudo-doc-version-bump skill, whose release workflow
@@ -35,15 +35,15 @@ export function generateSettingsFile(choices) {
35
35
  lines.push(``);
36
36
  lines.push(`export const settings = {`);
37
37
  if (choices.colorSchemeMode === "single") {
38
- lines.push(` colorScheme: ${JSON.stringify(choices.singleScheme ?? "Dracula")},`);
38
+ lines.push(` colorScheme: ${JSON.stringify(choices.singleScheme ?? "Default Dark")},`);
39
39
  lines.push(` colorMode: false as ColorModeConfig | false,`);
40
40
  }
41
41
  else {
42
- lines.push(` colorScheme: ${JSON.stringify(choices.darkScheme ?? "GitHub Dark")},`);
42
+ lines.push(` colorScheme: ${JSON.stringify(choices.darkScheme ?? "Default Dark")},`);
43
43
  lines.push(` colorMode: {`);
44
44
  lines.push(` defaultMode: ${JSON.stringify(choices.defaultMode ?? "dark")},`);
45
- lines.push(` lightScheme: ${JSON.stringify(choices.lightScheme ?? "GitHub Light")},`);
46
- lines.push(` darkScheme: ${JSON.stringify(choices.darkScheme ?? "GitHub Dark")},`);
45
+ lines.push(` lightScheme: ${JSON.stringify(choices.lightScheme ?? "Default Light")},`);
46
+ lines.push(` darkScheme: ${JSON.stringify(choices.darkScheme ?? "Default Dark")},`);
47
47
  lines.push(` respectPrefersColorScheme: ${choices.respectPrefersColorScheme ?? true},`);
48
48
  lines.push(` } satisfies ColorModeConfig as ColorModeConfig | false,`);
49
49
  }
@@ -130,6 +130,7 @@ export function generateSettingsFile(choices) {
130
130
  else {
131
131
  lines.push(` llmsTxt: false,`);
132
132
  }
133
+ lines.push(` changelogs: false,`);
133
134
  lines.push(` math: false,`);
134
135
  lines.push(` cjkFriendly: ${choices.cjkFriendly ?? false} as boolean,`);
135
136
  lines.push(` onBrokenMarkdownLinks: "warn" as "warn" | "error" | "ignore",`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zudo-doc",
3
- "version": "2.5.1",
3
+ "version": "3.1.0",
4
4
  "description": "Create a new zudo-doc documentation site",
5
5
  "license": "MIT",
6
6
  "author": "Takeshi Takatsudo",
@@ -1,21 +1,30 @@
1
1
  /**
2
2
  * Project-side color-scheme helpers.
3
3
  *
4
- * The MECHANISM (palette→CSS injection logic) now lives in the package:
4
+ * The MECHANISM (ramp→CSS injection logic) now lives in the package:
5
5
  * `@takazudo/zudo-doc/color-scheme-utils`. This file re-exports those
6
6
  * mechanism symbols and adds project-specific thin wrappers that read from
7
- * this project's `colorSchemes` map and `settings`. The DATA (palette values,
7
+ * this project's `colorSchemes` map and `settings`. The DATA (ramp values,
8
8
  * scheme names) stays in `./color-schemes` and `./settings`.
9
9
  *
10
10
  * S9a package-first migration — zudolab/zudo-doc#2333.
11
+ * Ramp-native rewrite — zudolab/zudo-doc#2585/#2586.
11
12
  */
12
13
 
13
14
  export {
14
- type ColorRef,
15
+ type OKLCH,
16
+ type StateRole,
17
+ type SemanticKey,
18
+ type RampRef,
19
+ type Ramps,
20
+ type ModeMap,
15
21
  type ColorScheme,
16
- SEMANTIC_DEFAULTS,
22
+ type CssEmitScope,
23
+ STATE_ROLES,
24
+ SEMANTIC_KEYS,
25
+ SEMANTIC_RAMP_DEFAULTS,
17
26
  SEMANTIC_CSS_NAMES,
18
- resolveColor,
27
+ resolveRampRef,
19
28
  resolveSemanticColors,
20
29
  schemeToCssPairs,
21
30
  generateCssCustomProperties as generateCssCustomPropertiesFromScheme,