@erclx/canon 5.51.0 → 5.53.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.
Files changed (142) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +1 -4
  3. package/claude/.claude-plugin/plugin.json +1 -1
  4. package/claude/skills/canon-cli/SKILL.md +0 -3
  5. package/claude/skills/context-fold/REQUIREMENT.md +0 -1
  6. package/claude/skills/design-taste/references/kinds.md +0 -1
  7. package/claude/skills/draw-figure/REQUIREMENT.md +2 -3
  8. package/claude/skills/draw-figure/SKILL.md +4 -5
  9. package/claude/skills/draw-figure/references/figures.md +0 -1
  10. package/claude/skills/draw-figure/references/hand-drawn.md +1 -1
  11. package/claude/skills/git-pr/references/pr.md +1 -1
  12. package/claude/skills/pick-by-eye/REQUIREMENT.md +0 -1
  13. package/claude/skills/pick-by-eye/SKILL.md +1 -1
  14. package/claude/skills/review-address/SKILL.md +1 -1
  15. package/claude/skills/review-address/references/post-review-findings.md +1 -1
  16. package/claude/skills/review-pr/references/post.md +2 -2
  17. package/claude/skills/target-check/SKILL.md +2 -0
  18. package/claude/skills/target-setup/SKILL.md +1 -1
  19. package/claude/skills/target-update/REQUIREMENT.md +33 -0
  20. package/claude/skills/target-update/SKILL.md +136 -0
  21. package/claude/skills/teach-craft/REQUIREMENT.md +30 -0
  22. package/claude/skills/teach-craft/SKILL.md +39 -0
  23. package/claude/skills/teach-craft/references/lesson-craft.md +52 -0
  24. package/claude/skills/{teach-workspace → teach-craft}/references/pedagogy.md +12 -4
  25. package/docs/agents/audits.md +0 -1
  26. package/docs/agents/migrate.md +2 -1
  27. package/docs/target/migrations.md +12 -1
  28. package/docs/target/projects.md +1 -1
  29. package/docs/target/sync.md +1 -1
  30. package/docs/workflow/parallel-features.md +1 -1
  31. package/docs/workflow/skill-map-on-request.md +10 -22
  32. package/docs/workflow/skill-map.md +13 -14
  33. package/package.json +1 -4
  34. package/scripts/core/regen-web-previews.ts +2 -67
  35. package/src/audits/catalog.ts +0 -1
  36. package/src/browser/engine.ts +3 -6
  37. package/src/capture/render.ts +1 -1
  38. package/src/claude/cases/authoring.ts +0 -12
  39. package/src/claude/cases/misc.ts +0 -17
  40. package/src/claude/cases/setup.ts +7 -0
  41. package/src/claude/cases/workflow.ts +2 -38
  42. package/src/claude/skills-audit.ts +0 -1
  43. package/src/cli/help.ts +0 -7
  44. package/src/cli.ts +0 -6
  45. package/src/commands/labels.ts +9 -7
  46. package/src/commands/records.ts +0 -1
  47. package/src/commands/serve.ts +2 -2
  48. package/src/design/components.ts +8 -1514
  49. package/src/design/css.ts +5 -6
  50. package/src/design/fonts.ts +3 -5
  51. package/src/driver/drive.ts +3 -4
  52. package/src/driver/steps.ts +2 -5
  53. package/src/inventory/walk.ts +1 -1
  54. package/src/markdown/scope.ts +4 -31
  55. package/src/migrate/status.ts +5 -1
  56. package/src/records/validate.ts +4 -176
  57. package/src/sandbox/equivalence.ts +0 -5
  58. package/tooling/claude/seeds/.claude/hooks/review-post-scan.sh +1 -1
  59. package/claude/skills/draft-and-pick/REQUIREMENT.md +0 -26
  60. package/claude/skills/draft-and-pick/SKILL.md +0 -11
  61. package/claude/skills/draft-doc/REQUIREMENT.md +0 -26
  62. package/claude/skills/draft-doc/SKILL.md +0 -11
  63. package/claude/skills/draft-figure/REQUIREMENT.md +0 -26
  64. package/claude/skills/draft-figure/SKILL.md +0 -11
  65. package/claude/skills/draft-identity/REQUIREMENT.md +0 -26
  66. package/claude/skills/draft-identity/SKILL.md +0 -11
  67. package/claude/skills/draft-ready/REQUIREMENT.md +0 -26
  68. package/claude/skills/draft-ready/SKILL.md +0 -11
  69. package/claude/skills/draft-screencast/REQUIREMENT.md +0 -26
  70. package/claude/skills/draft-screencast/SKILL.md +0 -11
  71. package/claude/skills/draft-slides/REQUIREMENT.md +0 -26
  72. package/claude/skills/draft-slides/SKILL.md +0 -11
  73. package/claude/skills/make-deck/REQUIREMENT.md +0 -36
  74. package/claude/skills/make-deck/SKILL.md +0 -80
  75. package/claude/skills/make-deck/references/deck.md +0 -183
  76. package/claude/skills/read-frames/REQUIREMENT.md +0 -30
  77. package/claude/skills/read-frames/SKILL.md +0 -55
  78. package/claude/skills/record-screencast/REQUIREMENT.md +0 -35
  79. package/claude/skills/record-screencast/SKILL.md +0 -99
  80. package/claude/skills/script-screencast/REQUIREMENT.md +0 -34
  81. package/claude/skills/script-screencast/SKILL.md +0 -70
  82. package/claude/skills/script-screencast/references/beats-template.md +0 -119
  83. package/claude/skills/teach-workspace/REQUIREMENT.md +0 -34
  84. package/claude/skills/teach-workspace/SKILL.md +0 -196
  85. package/claude/skills/teach-workspace/references/glossary.md +0 -90
  86. package/claude/skills/teach-workspace/references/lesson-build.md +0 -106
  87. package/claude/skills/teach-workspace/references/lesson-craft.md +0 -135
  88. package/claude/skills/teach-workspace/references/promotion-fold.md +0 -35
  89. package/claude/skills/teach-workspace/references/promotion.md +0 -116
  90. package/claude/skills/teach-workspace/references/revisit.md +0 -28
  91. package/claude/skills/teach-workspace/references/teach.md +0 -211
  92. package/claude/skills/video-craft/REQUIREMENT.md +0 -35
  93. package/claude/skills/video-craft/SKILL.md +0 -96
  94. package/claude/skills/video-craft/references/adopted.md +0 -110
  95. package/src/commands/demo.ts +0 -542
  96. package/src/commands/slides.ts +0 -184
  97. package/src/commands/teach.ts +0 -1401
  98. package/src/demo/beats.ts +0 -135
  99. package/src/demo/compile.ts +0 -350
  100. package/src/demo/container.ts +0 -219
  101. package/src/demo/cursors.ts +0 -55
  102. package/src/demo/drive.ts +0 -442
  103. package/src/demo/pointer.ts +0 -178
  104. package/src/demo/theme.ts +0 -112
  105. package/src/demo/timeline.ts +0 -64
  106. package/src/slides/convert/chart.ts +0 -165
  107. package/src/slides/convert/deck.ts +0 -244
  108. package/src/slides/convert/export.ts +0 -567
  109. package/src/slides/convert/master.ts +0 -198
  110. package/src/slides/convert/shapes.ts +0 -804
  111. package/src/slides/convert/svg.ts +0 -38
  112. package/src/slides/convert/walk.ts +0 -671
  113. package/src/slides/decks.ts +0 -110
  114. package/src/slides/open.ts +0 -18
  115. package/src/slides/package/fonts.ts +0 -301
  116. package/src/slides/package/motion.ts +0 -316
  117. package/src/slides/package/test-face.ts +0 -113
  118. package/src/teach/browser/compile.ts +0 -44
  119. package/src/teach/browser/dismiss.ts +0 -76
  120. package/src/teach/browser/focus-line.ts +0 -19
  121. package/src/teach/browser/glossary-filter.ts +0 -44
  122. package/src/teach/browser/head.ts +0 -30
  123. package/src/teach/browser/quiz.ts +0 -19
  124. package/src/teach/browser/reload.ts +0 -9
  125. package/src/teach/browser/sidebar.ts +0 -233
  126. package/src/teach/browser/theme.ts +0 -18
  127. package/src/teach/components/code.tsx +0 -24
  128. package/src/teach/components/heading.tsx +0 -11
  129. package/src/teach/components/list.tsx +0 -17
  130. package/src/teach/components/paragraph.tsx +0 -29
  131. package/src/teach/components/refs.tsx +0 -28
  132. package/src/teach/cross-references.ts +0 -78
  133. package/src/teach/fonts.ts +0 -16
  134. package/src/teach/highlight.ts +0 -71
  135. package/src/teach/html/jsx-dev-runtime.ts +0 -13
  136. package/src/teach/html/jsx-runtime.ts +0 -113
  137. package/src/teach/html/raw.ts +0 -28
  138. package/src/teach/lesson.ts +0 -178
  139. package/src/teach/nav.ts +0 -1337
  140. package/src/teach/render.ts +0 -240
  141. package/src/teach/workspace.ts +0 -1164
  142. package/src/teach/write-if-changed.ts +0 -17
@@ -1,184 +0,0 @@
1
- import { resolve } from 'node:path'
2
- import type { Command } from 'commander'
3
- import { INSTALL_BROWSER } from '@/browser/engine'
4
- import { creationRel, SCRATCH } from '@/roots/record'
5
- import { listDecks, resolveDeck, SLIDES_FOLDER } from '@/slides/decks'
6
- import { openDeck } from '@/slides/open'
7
- import { intro, outro, palette } from '@/cli/ui'
8
-
9
- const SLIDES_AT = creationRel(process.cwd(), SLIDES_FOLDER)
10
-
11
- export function register(program: Command): void {
12
- const slides = program
13
- .command('slides')
14
- .helpOption('-h, --help', 'Show this help message')
15
- .description('Slide deck commands (render, list)')
16
-
17
- slides
18
- .command('render')
19
- .helpOption('-h, --help', 'Show this help message')
20
- .description(
21
- `Render a deck under ${SLIDES_AT}/, or a folder of HTML slides, into a PowerPoint deck`,
22
- )
23
- .argument(
24
- '[deck]',
25
- 'Deck name or folder, defaulting to the only deck when there is one',
26
- )
27
- .option(
28
- '-o, --out <path>',
29
- 'Output directory',
30
- creationRel(process.cwd(), SCRATCH, 'render', 'slides'),
31
- )
32
- .option(
33
- '-m, --mirror <path>',
34
- 'Copy the deck to this directory after writing',
35
- )
36
- .option('--open', 'Open the deck after writing')
37
- .action(
38
- async (
39
- deck: string | undefined,
40
- opts: { out: string; mirror?: string; open?: boolean },
41
- ) => {
42
- try {
43
- const root = process.cwd()
44
- const resolved = resolveDeck(root, deck)
45
- if (resolved.status === 'refused') fail(resolved.message)
46
- const outDir = resolve(root, opts.out)
47
- const mirror = resolveMirror(opts.mirror)
48
- await renderHtmlFolder(resolved.dir, outDir, mirror, opts.open)
49
- } catch (error) {
50
- reportFailure(error)
51
- }
52
- },
53
- )
54
-
55
- slides
56
- .command('list')
57
- .helpOption('-h, --help', 'Show this help message')
58
- .description(`List the decks under ${SLIDES_AT}/`)
59
- .option('--json', 'Output the decks as JSON')
60
- .action((opts: { json?: boolean }) => {
61
- const decks = listDecks(process.cwd())
62
- if (opts.json) {
63
- process.stdout.write(`${JSON.stringify(decks)}\n`)
64
- return
65
- }
66
- const { GREEN, GREY, NC } = palette(process.stderr)
67
- intro('Slide decks')
68
- if (decks.length === 0) {
69
- process.stderr.write(`${GREY}│${NC} No deck under ${SLIDES_AT}/\n`)
70
- }
71
- for (const { name, title, slides: count, path } of decks) {
72
- const noun = count === 1 ? 'slide' : 'slides'
73
- process.stderr.write(
74
- `${GREY}│${NC} ${GREEN}✓${NC} ${name} ${GREY}${title}, ${count} ${noun}, ${path}${NC}\n`,
75
- )
76
- }
77
- outro()
78
- })
79
- }
80
-
81
- /**
82
- * The converter loads on demand, so no other command resolves pptxgenjs,
83
- * jszip, or the token module at startup. A fallback, a refused link, chart, or
84
- * effect, or a token the master fell back on reports one line each and keeps
85
- * the exit at 0, since the deck is written either way. A malformed `deck.json` refuses before any slide is laid
86
- * out and exits 1.
87
- */
88
- async function renderHtmlFolder(
89
- sourceDir: string,
90
- outDir: string,
91
- mirror: string | undefined,
92
- shouldOpen: boolean | undefined,
93
- ): Promise<void> {
94
- const { exportHtmlDeck } = await import('@/slides/convert/export')
95
- const { GREEN, GREY, NC, RED } = palette(process.stderr)
96
- const result = await exportHtmlDeck(sourceDir, outDir, {
97
- root: process.cwd(),
98
- mirror,
99
- })
100
- if (result.status === 'refused') {
101
- fail(
102
- result.reason === 'browser-missing'
103
- ? `Chromium is not installed. Run ${INSTALL_BROWSER}`
104
- : result.message,
105
- )
106
- }
107
- intro('Render slides')
108
- process.stderr.write(
109
- `${GREY}│${NC} ${GREEN}✓${NC} ${result.slideCount} slides\n${GREY}│${NC} ${GREEN}✓${NC} ${result.pptxPath}\n`,
110
- )
111
- for (const { slide, selector, properties } of result.fallbacks) {
112
- process.stderr.write(
113
- `${GREY}│${NC} ${RED}✗${NC} slide ${slide} ${selector} drawn as a picture for ${properties.join(', ')}\n`,
114
- )
115
- }
116
- for (const { slide, selector, href, reason } of result.refusedLinks) {
117
- process.stderr.write(
118
- `${GREY}│${NC} ${RED}✗${NC} slide ${slide} ${selector} link "${href}" left out: ${reason}\n`,
119
- )
120
- }
121
- for (const { slide, selector, message } of result.refusedCharts) {
122
- process.stderr.write(
123
- `${GREY}│${NC} ${RED}✗${NC} slide ${slide} ${selector} chart left out: ${message}\n`,
124
- )
125
- }
126
- for (const { slide, message } of result.refusedMotion) {
127
- process.stderr.write(
128
- `${GREY}│${NC} ${RED}✗${NC} slide ${slide} motion left out: ${message}\n`,
129
- )
130
- }
131
- for (const { path, message } of result.refusedFonts) {
132
- process.stderr.write(
133
- `${GREY}│${NC} ${RED}✗${NC} font ${path} not embedded: ${message}\n`,
134
- )
135
- }
136
- for (const notice of result.notices) {
137
- process.stderr.write(`${GREY}│${NC} ${RED}✗${NC} ${notice}\n`)
138
- }
139
- if (result.mirrorPath) {
140
- process.stderr.write(
141
- `${GREY}│${NC} ${GREEN}✓${NC} mirrored to ${result.mirrorPath}\n`,
142
- )
143
- }
144
- if (shouldOpen) {
145
- const target = result.mirrorPath ?? result.pptxPath
146
- const opened = await openDeck(target)
147
- const mark = opened ? `${GREEN}✓${NC}` : `${RED}✗${NC}`
148
- process.stderr.write(
149
- `${GREY}│${NC} ${mark} ${opened ? 'opened' : 'could not open'} ${target}\n`,
150
- )
151
- }
152
- outro()
153
- }
154
-
155
- function resolveMirror(value: string | undefined): string | undefined {
156
- const mirror = value ?? process.env.CANON_SLIDES_MIRROR
157
- return mirror ? resolve(process.cwd(), mirror) : undefined
158
- }
159
-
160
- /**
161
- * Carries a fail-fast message from a validation helper to the action that
162
- * called it. `fail` keeps its `never` return so the compiler narrows past it,
163
- * and a helper deep in the call stack cannot set `process.exitCode` and unwind
164
- * on its own.
165
- */
166
- class SlidesError extends Error {}
167
-
168
- function fail(message: string): never {
169
- throw new SlidesError(message)
170
- }
171
-
172
- /**
173
- * `src/cli.ts` calls `program.parse()` without awaiting it, so a rejected
174
- * action promise reaches no handler and Bun prints a stack trace. Every action
175
- * that calls `fail` catches at its own boundary.
176
- */
177
- function reportFailure(error: unknown): void {
178
- if (!(error instanceof SlidesError)) throw error
179
- const { GREY, NC, RED } = palette(process.stderr)
180
- process.stderr.write(
181
- `${GREY}┌${NC}\n${GREY}│${NC} ${RED}✗${NC} ${error.message}\n${GREY}└${NC}\n`,
182
- )
183
- process.exitCode = 1
184
- }