@pecot/visual-mcp 1.2.0 → 1.3.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.
Files changed (131) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +35 -5
  3. package/assets/slidev/deck-lint.config.js +2 -2
  4. package/assets/slidev/deck-lint.env.config.js +2 -2
  5. package/assets/slidev/package.json +3 -3
  6. package/assets/slidev/runtime/package.json +1 -1
  7. package/assets/slidev/scripts/eslint/_shared/dist/lib/drawio-geometry.js +10 -10
  8. package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.d.ts +2 -2
  9. package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.js +4 -4
  10. package/assets/slidev/scripts/eslint/_shared/dist/tsconfig.tsbuildinfo +1 -1
  11. package/assets/slidev/scripts/eslint/_shared/lib/drawio-geometry.ts +10 -10
  12. package/assets/slidev/scripts/eslint/_shared/lib/text-measurer.ts +4 -4
  13. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-content-before-frontmatter.js +1 -1
  14. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-marker-cell.js +4 -4
  15. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-page.js +1 -1
  16. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-asset-prefix.js +1 -1
  17. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-filename-prefix.js +1 -1
  18. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-scaled-drawio.js +3 -3
  19. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-triple-hyphen-in-frontmatter.js +3 -3
  20. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-unknown-props.js +3 -3
  21. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/one-slide-per-file.js +1 -1
  22. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-matching-length.js +1 -1
  23. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-slides-entry.js +1 -1
  24. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/validate-clicks.js +7 -7
  25. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/tsconfig.tsbuildinfo +1 -1
  26. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-content-before-frontmatter.ts +1 -1
  27. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-marker-cell.ts +4 -4
  28. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-page.ts +1 -1
  29. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-asset-prefix.ts +1 -1
  30. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-filename-prefix.ts +1 -1
  31. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-scaled-drawio.ts +3 -3
  32. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-triple-hyphen-in-frontmatter.ts +3 -3
  33. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-unknown-props.ts +3 -3
  34. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/one-slide-per-file.ts +1 -1
  35. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-matching-length.ts +1 -1
  36. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-slides-entry.ts +1 -1
  37. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/validate-clicks.ts +7 -7
  38. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/max-chars.js +6 -6
  39. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint-body.js +3 -3
  40. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint.js +2 -2
  41. package/assets/slidev/scripts/eslint/text-constraints/dist/tsconfig.tsbuildinfo +1 -1
  42. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/max-chars.ts +6 -6
  43. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint-body.ts +3 -3
  44. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint.ts +2 -2
  45. package/assets/slidev/scripts/eslint/validate-references/dist/index.js +1 -1
  46. package/assets/slidev/scripts/eslint/validate-references/dist/lib/semantic-validator.js +12 -12
  47. package/assets/slidev/scripts/eslint/validate-references/dist/tsconfig.tsbuildinfo +1 -1
  48. package/assets/slidev/scripts/eslint/validate-references/index.ts +1 -1
  49. package/assets/slidev/scripts/eslint/validate-references/lib/semantic-validator.ts +12 -12
  50. package/cli/dist/cli.js +8 -8
  51. package/cli/dist/commands/chromium/host-dependencies.js +3 -3
  52. package/cli/dist/commands/drawio/export.js +15 -15
  53. package/cli/dist/commands/drawio/theme.js +7 -7
  54. package/cli/dist/commands/drawio/url.js +14 -14
  55. package/cli/dist/commands/evidence-xlsx/create.js +11 -11
  56. package/cli/dist/commands/pptx-ooxml/preview.js +13 -13
  57. package/cli/dist/commands/slidev-project/create.js +12 -12
  58. package/cli/dist/commands/slidev-project/linked-theme.js +5 -5
  59. package/cli/dist/commands/slidev-project/lint.js +13 -13
  60. package/cli/dist/commands/slidev-project/sync.js +19 -19
  61. package/cli/dist/commands/slidev-project/theme.js +9 -9
  62. package/cli/dist/commands/slidev-to-pptx/convert.js +47 -47
  63. package/cli/dist/domain/_shared/text-check.js +2 -2
  64. package/cli/dist/domain/drawio/export.js +4 -4
  65. package/cli/dist/domain/drawio/label-text.js +1 -1
  66. package/cli/dist/domain/drawio/url.js +27 -27
  67. package/cli/dist/domain/evidence-xlsx/image-dimensions.js +14 -14
  68. package/cli/dist/domain/evidence-xlsx/layout.d.ts +2 -3
  69. package/cli/dist/domain/evidence-xlsx/ooxml.d.ts +1 -8
  70. package/cli/dist/domain/evidence-xlsx/ooxml.js +35 -24
  71. package/cli/dist/domain/evidence-xlsx/spec-schema.js +26 -26
  72. package/cli/dist/domain/pptx-ooxml/merge.js +3 -3
  73. package/cli/dist/domain/slidev-project/generated-files.d.ts +1 -1
  74. package/cli/dist/domain/slidev-project/generated-files.js +34 -34
  75. package/cli/dist/domain/slidev-project/initial-pages.js +4 -4
  76. package/cli/dist/domain/slidev-project/lint.js +11 -11
  77. package/cli/dist/domain/slidev-project/sync.js +13 -13
  78. package/cli/dist/domain/slidev-project/warnings.js +4 -4
  79. package/cli/dist/domain/slidev-theme/declaration.js +9 -9
  80. package/cli/dist/domain/slidev-theme/references.js +10 -10
  81. package/cli/dist/domain/slidev-theme/store-layout.js +6 -6
  82. package/cli/dist/domain/slidev-theme/talk-theme.js +13 -13
  83. package/cli/dist/domain/slidev-theme/theme-spec.js +5 -5
  84. package/cli/dist/domain/slidev-to-pptx/errors.js +3 -3
  85. package/cli/dist/infra/_shared/dependency-root.js +4 -4
  86. package/cli/dist/infra/_shared/patch-apply.js +6 -5
  87. package/cli/dist/infra/_shared/runtime-install.js +4 -3
  88. package/cli/dist/infra/_shared/slidev-bin.js +1 -1
  89. package/cli/dist/infra/drawio/icons.js +3 -3
  90. package/cli/dist/infra/drawio/pdf.js +1 -1
  91. package/cli/dist/infra/drawio/screenshot.js +10 -9
  92. package/cli/dist/infra/evidence-xlsx/workbook-writer.js +2 -2
  93. package/cli/dist/infra/playwright/chromium.js +4 -3
  94. package/cli/dist/infra/playwright/host-dependencies.js +8 -8
  95. package/cli/dist/infra/playwright/launch.js +5 -5
  96. package/cli/dist/infra/pptx-ooxml/soffice.js +2 -2
  97. package/cli/dist/infra/slidev-project/eslint-runner.js +10 -9
  98. package/cli/dist/infra/slidev-project/fs.js +6 -6
  99. package/cli/dist/infra/slidev-theme/store.js +18 -15
  100. package/cli/dist/infra/slidev-to-pptx/cache-store.js +6 -6
  101. package/cli/dist/infra/slidev-to-pptx/dom-converter.js +12 -12
  102. package/cli/dist/infra/slidev-to-pptx/pipeline.d.ts +1 -1
  103. package/cli/dist/infra/slidev-to-pptx/pipeline.js +54 -54
  104. package/cli/dist/infra/slidev-to-pptx/prerender-capture.js +14 -14
  105. package/cli/dist/infra/slidev-to-pptx/prerender.js +10 -10
  106. package/cli/dist/infra/slidev-to-pptx/runner.js +1 -0
  107. package/cli/dist/infra/slidev-to-pptx/scanner.js +10 -10
  108. package/cli/dist/infra/slidev-to-pptx/server.js +2 -2
  109. package/cli/dist/infra/slidev-to-pptx/single-pass-worker.js +39 -39
  110. package/cli/dist/infra/slidev-to-pptx/slide-worker.js +3 -3
  111. package/cli/dist/infra/slidev-to-pptx/visibility-helpers.js +8 -8
  112. package/cli/dist/mcp/dev-server-registry.js +10 -9
  113. package/cli/dist/mcp/queue.js +1 -1
  114. package/cli/dist/mcp/result.js +4 -4
  115. package/cli/dist/mcp/serve.js +1 -1
  116. package/cli/dist/mcp/server.js +2 -2
  117. package/cli/dist/mcp/tools/_shared.d.ts +1 -1
  118. package/cli/dist/mcp/tools/_shared.js +36 -37
  119. package/cli/dist/mcp/tools/drawio.js +22 -22
  120. package/cli/dist/mcp/tools/evidence.js +8 -8
  121. package/cli/dist/mcp/tools/setup.js +26 -26
  122. package/cli/dist/mcp/tools/slide-dev.js +20 -20
  123. package/cli/dist/mcp/tools/slide-page.js +36 -36
  124. package/cli/dist/mcp/tools/slide-theme.js +6 -6
  125. package/cli/dist/mcp/tools/slide.js +49 -49
  126. package/cli/dist/mcp/windows-path.js +8 -7
  127. package/cli/dist/node-runtime.d.ts +6 -1
  128. package/cli/dist/node-runtime.js +16 -8
  129. package/npm-shrinkwrap.json +25 -31
  130. package/package.json +2 -2
  131. package/vendor/text-rules/dist/source-hash +1 -1
@@ -23,10 +23,10 @@ vite-plugin-static-copy は、talk-dir からの相対パスの先頭の `../`
23
23
  function themePublicLines(themeName) {
24
24
  return [
25
25
  '',
26
- '// talk-dir の位置。設定ファイルの隣にある。',
26
+ '// location of the talk-dir, next to this config file.',
27
27
  'const talkDirectory = path.dirname(fileURLToPath(import.meta.url))',
28
28
  '',
29
- '// 実体のパスを求める。無ければ undefined にして、Slidev の既定に任せる。',
29
+ '// resolve the real path; return undefined when it is missing and leave it to the Slidev default.',
30
30
  'function resolveRealPath(...segments: string[]): string | undefined {',
31
31
  ' try {',
32
32
  ' return realpathSync(path.join(...segments))',
@@ -36,20 +36,20 @@ function themePublicLines(themeName) {
36
36
  ' }',
37
37
  '}',
38
38
  '',
39
- '// glob の特殊文字を、文字そのものとして扱わせる。Windows の区切りは / にそろえる。',
39
+ '// make glob special characters match literally; normalize the Windows separator to /.',
40
40
  'function escapeGlob(value: string): string {',
41
41
  ' const posixPath = path.sep === \'\\\\\' ? value.replaceAll(\'\\\\\', \'/\') : value',
42
42
  ' const specials = path.sep === \'\\\\\' ? /[()[\\]{}!+@]/gu : /[\\\\()[\\]{}!*?|+@]/gu',
43
43
  ' return posixPath.replaceAll(specials, \'\\\\$&\')',
44
44
  '}',
45
45
  '',
46
- '// テーマの実体と、その public/。',
46
+ '// real path of the theme and its public/.',
47
47
  `const themeRoot = resolveRealPath(talkDirectory, 'node_modules', ${quoted(themeName)})`,
48
48
  'const themePublic = themeRoot === undefined ? undefined : resolveRealPath(themeRoot, \'public\')',
49
49
  '',
50
- '// テーマの peerDependencies のうち、talk-dir の node_modules から解決できる名前。',
51
- '// optional の名前は除く。Vite は dedupe の名前を root からだけ解決し、見つからないと起動が失敗する。',
52
- '// 読めない・JSON でないときは空にして、設定の読み込みを止めない。',
50
+ '// names in the theme peerDependencies that resolve from node_modules of the talk-dir.',
51
+ '// optional ones are excluded; Vite resolves dedupe names from the root only and fails to start when one is not found.',
52
+ '// return an empty list when the file is unreadable or not JSON, so loading the config does not stop.',
53
53
  'function readThemePeers(): string[] {',
54
54
  ' if (themeRoot === undefined) return []',
55
55
  ' try {',
@@ -68,7 +68,7 @@ function themePublicLines(themeName) {
68
68
  '',
69
69
  'const themePeers = readThemePeers()',
70
70
  '',
71
- '// talk-dir からテーマの public/ までの区間の数(先頭の ../ は数えない)。',
71
+ '// number of segments from the talk-dir to the theme public/ (leading ../ are not counted).',
72
72
  'const themePublicDepth = themePublic === undefined',
73
73
  ' ? 0',
74
74
  ' : path.relative(talkDirectory, themePublic).split(/[\\\\/]/u).filter(segment => segment !== \'..\').length',
@@ -87,9 +87,9 @@ function themePublicLines(themeName) {
87
87
  ' },',
88
88
  ' }',
89
89
  '',
90
- '// テーマの layouts・components・styles は、dev の起動時の warmup で変換しておく。',
91
- '// node_modules の下の glob は、Vite が無視する。そのためテーマの実体のパスで書く。',
92
- '// talk-dir の側の同名のファイルは、テーマを上書きする利用者のものなので、相対の glob で並べる。',
90
+ '// transform theme layouts, components and styles in the warmup at dev start.',
91
+ '// Vite ignores globs under node_modules, so write them with the real path of the theme.',
92
+ '// files of the same name on the talk-dir side override the theme and belong to the user, so list them with relative globs.',
93
93
  'const themeServer = themeRoot === undefined',
94
94
  ' ? {}',
95
95
  ' : {',
@@ -108,7 +108,7 @@ function themePublicLines(themeName) {
108
108
  }
109
109
  /**
110
110
  `vite.config.ts` の中身。
111
- 日本語を含む行は、文章 lint が 1 行ずつ読む。そのため、中身は 1 行 1 要素の配列で組み立てる。
111
+ 中身は 1 行 1 要素の配列で組み立てる。
112
112
  */
113
113
  export function viteConfigSource(options) {
114
114
  const themeName = options.themeName;
@@ -124,41 +124,41 @@ export function viteConfigSource(options) {
124
124
  const slidevLines = themeName === undefined
125
125
  ? []
126
126
  : [
127
- ' // テーマの public/ を /theme/ で配る。',
127
+ ' // serve the theme public/ at /theme/.',
128
128
  ' slidev: themeStaticCopy,',
129
129
  ];
130
130
  const serverSpread = themeName === undefined ? [] : [' ...themeServer,'];
131
131
  return [
132
- '// 本体が生成するファイル。本体の更新で書き直す。',
133
- '// Vite の追加設定は setup/vite-plugins.ts に置く。',
132
+ '// generated by pecotv; rewritten when pecotv is updated.',
133
+ '// put extra Vite settings in setup/vite-plugins.ts.',
134
134
  '/// <reference types="@slidev/types" />',
135
135
  ...importLines,
136
136
  'import { defineConfig } from \'vite\'',
137
137
  ...themeLines,
138
138
  '',
139
139
  'export default defineConfig({',
140
- ' // キャッシュを talk-dir に閉じる。',
141
- ' // node_modules/.vite を共有すると衝突する。',
140
+ ' // keep the cache inside the talk-dir.',
141
+ ' // sharing node_modules/.vite causes conflicts.',
142
142
  ' cacheDir: \'./.vite\',',
143
143
  ' resolve: {',
144
- ' // node_modules とテーマは symlink で張る。',
145
- ' // Vite の既定(false)では、symlink 先の Vue ファイルの scoped CSS が build に入らない。',
144
+ ' // node_modules and the theme are linked with symlinks.',
145
+ ' // with the Vite default (false), scoped CSS of Vue files behind a symlink is left out of the build.',
146
146
  ' preserveSymlinks: true,',
147
- ' // テーマの peerDependencies は、本体の 1 つに寄せる。',
147
+ ' // dedupe the theme peerDependencies to the single copy of the main package.',
148
148
  dedupeLine,
149
149
  ' },',
150
150
  ...slidevLines,
151
151
  ' server: {',
152
152
  ...serverSpread,
153
- ' // dev サーバを起動し直した後も、ブラウザに古い変換結果を使わせない。',
154
- ' // 古い結果を使うと、許可リストの外の CSS が 403 で拒まれ、プレビューが白紙のままになる。',
153
+ ' // keep the browser from using stale transform results after the dev server restarts.',
154
+ ' // with stale results, CSS outside the allow list is rejected with 403 and the preview stays blank.',
155
155
  ' headers: { \'Cache-Control\': \'no-cache\' },',
156
156
  ' },',
157
157
  ' define: {',
158
- ' // pecotv の slide convert は print ページを 1 回読み込んで全ページを変換する。',
159
- ' // その print ルートを build 済み SPA に入れるための指定。',
160
- ' // Slidev 内部の define であり、公開 API ではない。',
161
- ' // このフラグが働かない build では、pecotv が警告を出して従来方式で変換する。',
158
+ ' // pecotv slide convert loads the print page once and converts all pages.',
159
+ ' // this setting puts the print route into the built SPA.',
160
+ ' // it is a Slidev-internal define, not a public API.',
161
+ ' // when this flag has no effect on a build, pecotv warns and converts the old way.',
162
162
  ' __SLIDEV_FEATURE_PRINT__: \'true\',',
163
163
  ' },',
164
164
  '})',
@@ -173,14 +173,14 @@ export const START_SCRIPT_SOURCE = [
173
173
  '#!/usr/bin/env node',
174
174
  '',
175
175
  '/**',
176
- ' * OS 非依存の Slidev 起動スクリプト(pecotv が生成する)。',
176
+ ' * OS-independent Slidev start script (generated by pecotv).',
177
177
  ' *',
178
- ' * MCP を使わない環境向けの、手動プレビューの手段。',
179
- ' * 対象は、pecot-visual サーバを登録していないエディタや素の端末。',
180
- ' * このスクリプトのあるディレクトリを動作起点とする。',
181
- ' * node_modules は pecotv slide create と pecotv slide sync が用意する。',
182
- ' * 無ければ sync を案内して終了する。',
183
- ' * Slidev の bin を、node で直接起動する。',
178
+ ' * A way to preview manually in environments that do not use MCP.',
179
+ ' * It targets editors and plain terminals that have not registered the pecot-visual server.',
180
+ ' * The directory of this script is the working root.',
181
+ ' * node_modules is prepared by pecotv slide create and pecotv slide sync.',
182
+ ' * When it is missing, the script points to sync and exits.',
183
+ ' * It starts the Slidev bin directly with node.',
184
184
  ' */',
185
185
  '',
186
186
  'import { fileURLToPath } from \'node:url\'',
@@ -195,7 +195,7 @@ export const START_SCRIPT_SOURCE = [
195
195
  '',
196
196
  'if (!existsSync(slidevBin)) {',
197
197
  ' console.error(\'error: @slidev/cli not found at \' + slidevBin + \'.\')',
198
- ' console.error(\' pecotv slide sync --dir \' + __dirname + \' --node-modules-only を実行してください。\')',
198
+ ' console.error(\' run pecotv slide sync --dir \' + __dirname + \' --node-modules-only\')',
199
199
  ' process.exit(1)',
200
200
  '}',
201
201
  '',
@@ -31,7 +31,7 @@ export async function buildInitialPages(references, files) {
31
31
  const usable = references.filter((entry) => {
32
32
  const isUsable = PAGE_STEM.test(entry.name);
33
33
  if (!isUsable)
34
- warnings.push(`レイアウト名 '${entry.name}' はページのファイル名に使えないため、初期ページから除きました`);
34
+ warnings.push(`layout name cannot be used as a page file name, so it is left out of the initial pages: ${entry.name}`);
35
35
  return isUsable;
36
36
  });
37
37
  const sorted = usable.toSorted((a, b) => a.name.localeCompare(b.name));
@@ -56,15 +56,15 @@ export async function buildInitialPages(references, files) {
56
56
  if (first === undefined) {
57
57
  return {
58
58
  pages: [],
59
- warnings: [...warnings, 'テーマにレイアウトが無いため、初期ページを作れませんでした。テーマの layouts/ を確認してください。'],
59
+ warnings: [...warnings, 'the theme has no layouts, so no initial page was created (fix: check layouts/ in the theme)'],
60
60
  };
61
61
  }
62
62
  return {
63
63
  pages: [{ filename: `${first.name}.md`, content: `---\nlayout: ${first.name}\n---\n` }],
64
64
  warnings: [
65
65
  ...warnings,
66
- `テーマの参照に examples が無いため、初期ページは layout: ${first.name} だけにしました。`
67
- + 'テーマの references/ に examples を足すと、雛形の入った初期ページが作られます。',
66
+ `the theme reference has no examples, so the initial page has only layout: ${first.name}; `
67
+ + 'add examples to references/ in the theme to create initial pages with a skeleton',
68
68
  ],
69
69
  };
70
70
  }
@@ -37,19 +37,19 @@ talk-dir マーカー検証。振り分けは domain/slidev-project/sync.ts の
37
37
  */
38
38
  export async function assertTalkDirectory(directory, fs) {
39
39
  if (!path.isAbsolute(directory)) {
40
- throw new SlideLintUsageError(`--dir には絶対パスを指定してください (受け取った値: '${directory}')`, 'relative-dir');
40
+ throw new SlideLintUsageError(`--dir must be an absolute path: ${directory}`, 'relative-dir');
41
41
  }
42
42
  const info = await fs.talkDirectoryExists(directory);
43
43
  if (!info.exists) {
44
- throw new SlideLintRuntimeError(`'${directory}' はディレクトリとして存在しません`, 'dir-not-found');
44
+ throw new SlideLintRuntimeError(`directory not found: ${directory}`, 'dir-not-found');
45
45
  }
46
46
  if (!info.isDirectory) {
47
- throw new SlideLintRuntimeError(`'${directory}' はディレクトリではありません`, 'not-a-directory');
47
+ throw new SlideLintRuntimeError(`not a directory: ${directory}`, 'not-a-directory');
48
48
  }
49
49
  const hasSlidesMd = await fs.doesSlidesMdExist(directory);
50
50
  if (!hasSlidesMd) {
51
- throw new SlideLintRuntimeError(`'${directory}' に slides.md が無いため talk-dir として扱えません。`
52
- + ' pecotv slide create で作成された talk-dir を指定してください。', 'not-talk-dir');
51
+ throw new SlideLintRuntimeError(`not a talk-dir (no slides.md): ${directory}; `
52
+ + 'specify a talk-dir created by pecotv slide create', 'not-talk-dir');
53
53
  }
54
54
  }
55
55
  /**
@@ -71,13 +71,13 @@ export async function runSlideLint(options, dependencies) {
71
71
  });
72
72
  // timedOut 時も SIGTERM で exitCode は null になるため、起動失敗より先に判定する。
73
73
  if (result.timedOut) {
74
- throw new SlideLintRuntimeError(`eslint が時間内に終了しませんでした: ${summarizeStderr(result.stderr)}`, 'eslint-timeout');
74
+ throw new SlideLintRuntimeError(`eslint did not finish in time: ${summarizeStderr(result.stderr)}`, 'eslint-timeout');
75
75
  }
76
76
  if (result.exitCode === null) {
77
- throw new SlideLintRuntimeError(`eslint の起動に失敗しました: ${summarizeStderr(result.stderr)}`, 'eslint-not-launched');
77
+ throw new SlideLintRuntimeError(`eslint failed to start: ${summarizeStderr(result.stderr)}`, 'eslint-not-launched');
78
78
  }
79
79
  if (result.exitCode !== 0 && result.exitCode !== 1) {
80
- throw new SlideLintRuntimeError(`eslint が異常終了しました (exit ${String(result.exitCode)}): ${summarizeStderr(result.stderr)}`, 'eslint-failed');
80
+ throw new SlideLintRuntimeError(`eslint exited abnormally (exit ${String(result.exitCode)}): ${summarizeStderr(result.stderr)}`, 'eslint-failed');
81
81
  }
82
82
  // eslint が辿れなかった symlink dir の検出は lint 結果と独立。走査失敗以外で
83
83
  // outcome / exit code を動かさないため、集計の外側で合流させる。
@@ -90,10 +90,10 @@ function parseEslintReport(stdout) {
90
90
  parsed = JSON.parse(stdout);
91
91
  }
92
92
  catch (error) {
93
- throw new SlideLintRuntimeError(`eslint の JSON 出力を解析できませんでした: ${formatError(error)}`, 'invalid-report');
93
+ throw new SlideLintRuntimeError(`cannot parse the eslint JSON output: ${formatError(error)}`, 'invalid-report');
94
94
  }
95
95
  if (!Array.isArray(parsed)) {
96
- throw new SlideLintRuntimeError('eslint の JSON 出力が配列ではありません', 'invalid-report');
96
+ throw new SlideLintRuntimeError('eslint JSON output is not an array', 'invalid-report');
97
97
  }
98
98
  // eslint-disable-next-line no-restricted-syntax -- JSON.parse 戻り値の narrowing
99
99
  return parsed;
@@ -147,7 +147,7 @@ const STDERR_EXCERPT_LIMIT = 400;
147
147
  function summarizeStderr(stderr) {
148
148
  const trimmed = stderr.trim();
149
149
  if (trimmed === '')
150
- return '(stderr なし)';
150
+ return '(no stderr)';
151
151
  if (trimmed.length <= STDERR_EXCERPT_LIMIT)
152
152
  return trimmed;
153
153
  return `${trimmed.slice(0, STDERR_EXCERPT_LIMIT)}...`;
@@ -39,28 +39,28 @@ talk-dir マーカー検証。
39
39
  */
40
40
  export async function assertTalkDirectory(directory, fs) {
41
41
  if (!path.isAbsolute(directory)) {
42
- throw new SlideSyncUsageError(`--dir には絶対パスを指定してください (受け取った値: '${directory}')`, 'relative-dir');
42
+ throw new SlideSyncUsageError(`--dir must be an absolute path: ${directory}`, 'relative-dir');
43
43
  }
44
44
  const info = await fs.talkDirectoryExists(directory);
45
45
  if (!info.exists) {
46
- throw new SlideSyncRuntimeError(`'${directory}' はディレクトリとして存在しません`, 'dir-not-found');
46
+ throw new SlideSyncRuntimeError(`directory not found: ${directory}`, 'dir-not-found');
47
47
  }
48
48
  if (!info.isDirectory) {
49
- throw new SlideSyncRuntimeError(`'${directory}' はディレクトリではありません`, 'not-a-directory');
49
+ throw new SlideSyncRuntimeError(`not a directory: ${directory}`, 'not-a-directory');
50
50
  }
51
51
  const hasSlidesMd = await fs.doesSlidesMdExist(directory);
52
52
  if (!hasSlidesMd) {
53
- throw new SlideSyncRuntimeError(`'${directory}' に slides.md が無いため talk-dir として扱えません。`
54
- + ' pecotv slide create で作成された talk-dir を指定してください。', 'not-talk-dir');
53
+ throw new SlideSyncRuntimeError(`not a talk-dir (no slides.md): ${directory}; `
54
+ + 'specify a talk-dir created by pecotv slide create', 'not-talk-dir');
55
55
  }
56
56
  }
57
57
  function themeRequiredMessage(directory) {
58
- return `${directory} はテーマを参照していない移行前の talk-dir です。移行するテーマを指定してください: `
58
+ return `${directory} is a talk-dir from before migration that does not reference a theme; specify the theme to migrate to: `
59
59
  + `slide sync --dir ${directory} --theme <theme-spec>`
60
- + `(MCP では slide_sync の dir: ${directory}, theme: <theme-spec>)`;
60
+ + ` (MCP: slide_sync with dir: ${directory}, theme: <theme-spec>)`;
61
61
  }
62
- const IGNORED_THEME_WARNING = '--theme は使いませんでした。この talk-dir はすでにテーマを参照しています。'
63
- + 'テーマや版を替えるときは、package.json の依存を書き換えてから sync してください';
62
+ const IGNORED_THEME_WARNING = '--theme was not used because this talk-dir already references a theme; '
63
+ + 'to change the theme or its version, edit the dependency in package.json and run sync';
64
64
  /**
65
65
  sync の工程。talk-dir を 3 通りに分けて進める。
66
66
 
@@ -81,8 +81,8 @@ export async function runSlideSync(options, dependencies) {
81
81
  await assertTalkDirectory(options.directory, dependencies.fs);
82
82
  if (options.nodeModulesOnly) {
83
83
  if (options.theme !== undefined) {
84
- throw new SlideSyncUsageError('--node-modules-only と --theme は同時に指定できません。'
85
- + 'node_modules の張り直しだけなら --node-modules-only を、移行なら --theme を指定してください', 'theme-with-node-modules-only');
84
+ throw new SlideSyncUsageError('--node-modules-only and --theme cannot be used together; '
85
+ + 'use --node-modules-only to relink node_modules only, or --theme to migrate', 'theme-with-node-modules-only');
86
86
  }
87
87
  return await relink(options, dependencies, []);
88
88
  }
@@ -151,7 +151,7 @@ async function migrate(directory, themeSpec, dependencies) {
151
151
  catch (error) {
152
152
  if (error instanceof SlideSyncRuntimeError || error instanceof SlideSyncUsageError)
153
153
  throw error;
154
- throw new SlideSyncRuntimeError(`移行に失敗しました: ${formatError(error)}`, 'migrate-failed');
154
+ throw new SlideSyncRuntimeError(`migration failed: ${formatError(error)}`, 'migrate-failed');
155
155
  }
156
156
  let nodeModulesTarget;
157
157
  try {
@@ -183,7 +183,7 @@ function wrapLinkError(error) {
183
183
  // theme-name-mismatch など、原因の文言を持つ例外は包み直さない。
184
184
  if (error instanceof SlideCreateRuntimeError)
185
185
  return error;
186
- return new SlideSyncRuntimeError(`node_modules の張り直しに失敗しました: ${formatError(error)}`, 'symlink-failed');
186
+ return new SlideSyncRuntimeError(`relinking node_modules failed: ${formatError(error)}`, 'symlink-failed');
187
187
  }
188
188
  /* c8 ignore start -- 非 Error 例外 (string throw 等) は本実装範囲では未発生、防御網のみ */
189
189
  function formatError(error) {
@@ -1,6 +1,6 @@
1
1
  // 利用者に伝える警告の文言。create・convert が同じ文言を使う。
2
- export const LINK_COLOR_OMITTED_WARNING = 'pptx.linkColor を省いたため、PPTX ではリンクは変換されません(ハイパーリンクが付きません)。'
3
- + 'リンクを変換するには pecot-theme.json の pptx.linkColor に 6 桁の 16 進で書いてください';
4
- export const EAST_ASIAN_FONT_OMITTED_WARNING = 'pptx.eastAsianFont を省いたため、PPTX では東アジア書体を書き込みません。'
5
- + '日本語の書体を揃えるには pecot-theme.json の pptx.eastAsianFont に書体名を書いてください';
2
+ export const LINK_COLOR_OMITTED_WARNING = 'pptx.linkColor is omitted, so links are not converted in the PPTX (no hyperlinks are added); '
3
+ + 'to convert links, set pptx.linkColor in pecot-theme.json to 6 hex digits';
4
+ export const EAST_ASIAN_FONT_OMITTED_WARNING = 'pptx.eastAsianFont is omitted, so no East Asian font is written to the PPTX; '
5
+ + 'to set the Japanese font, set pptx.eastAsianFont in pecot-theme.json to a font name';
6
6
  //# sourceMappingURL=warnings.js.map
@@ -10,7 +10,7 @@ export const THEME_DECLARATION_FILE_NAME = 'pecot-theme.json';
10
10
  export const SUPPORTED_SCHEMA = 1;
11
11
  // 誤りの文言に添える、契約の節の案内。
12
12
  const CONTRACT_FILE = 'contracts/theme-declaration.md';
13
- const SHAPE_SECTION = `${CONTRACT_FILE} の「\`${THEME_DECLARATION_FILE_NAME}\`」の節`;
13
+ const SHAPE_SECTION = `the \`${THEME_DECLARATION_FILE_NAME}\` section of ${CONTRACT_FILE}`;
14
14
  export class ThemeDeclarationError extends Error {
15
15
  reason;
16
16
  constructor(message, reason) {
@@ -35,7 +35,7 @@ const fontSizesSchema = z.object({
35
35
  });
36
36
  const pptxSchema = z.object({
37
37
  eastAsianFont: name.optional(),
38
- linkColor: z.string().regex(/^[\da-f]{6}$/iu, '6 桁の 16 進で書く').optional(),
38
+ linkColor: z.string().regex(/^[\da-f]{6}$/iu, 'must be 6 hex digits').optional(),
39
39
  });
40
40
  const lintSchema = z.object({ rules: z.record(z.string(), severity).optional() });
41
41
  const layoutsSchema = z.object({ references: name.optional() });
@@ -62,27 +62,27 @@ JSON を読んだ unknown 値を宣言として検証し、省いた項目を既
62
62
  */
63
63
  export function parseThemeDeclaration(raw) {
64
64
  if (!isRecord(raw)) {
65
- throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} がオブジェクトではありません。${SHAPE_SECTION}を参照してください`, 'invalid-shape');
65
+ throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} must be an object (see ${SHAPE_SECTION})`, 'invalid-shape');
66
66
  }
67
67
  const { schema } = raw;
68
68
  if (typeof schema === 'number' && schema !== SUPPORTED_SCHEMA) {
69
69
  return {
70
70
  declaration: DEFAULT_THEME_DECLARATION,
71
71
  warnings: [
72
- `${THEME_DECLARATION_FILE_NAME} の schema ${String(schema)} は、この pecot では読めません(読めるのは ${String(SUPPORTED_SCHEMA)})。宣言を使わず、本体の既定値で続けます`,
72
+ `${THEME_DECLARATION_FILE_NAME} schema ${String(schema)} is not supported (supported: ${String(SUPPORTED_SCHEMA)}); ignoring the declaration and continuing with the defaults`,
73
73
  ],
74
74
  };
75
75
  }
76
76
  const parsed = declarationSchema.safeParse(raw);
77
77
  if (!parsed.success) {
78
78
  const detail = parsed.error.issues
79
- .map(issue => `${issue.path.map(String).join('.') || '(最上位)'}: ${issue.message}`)
79
+ .map(issue => `${issue.path.map(String).join('.') || '(top level)'}: ${issue.message}`)
80
80
  .join('; ');
81
- throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} の形が誤っています: ${detail}。${SHAPE_SECTION}を参照してください`, 'invalid-shape');
81
+ throw new ThemeDeclarationError(`invalid shape of ${THEME_DECLARATION_FILE_NAME}: ${detail} (see ${SHAPE_SECTION})`, 'invalid-shape');
82
82
  }
83
83
  const unknownRules = Object.keys(parsed.data.lint?.rules ?? {}).filter(id => !KNOWN_RULES.has(id));
84
84
  if (unknownRules.length > 0) {
85
- throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} の lint.rules に、本体の deck lint が持たない規則があります: ${unknownRules.join(', ')}。${SHAPE_SECTION}の「lint.rules」の項を参照してください`, 'unknown-rule');
85
+ throw new ThemeDeclarationError(`lint.rules in ${THEME_DECLARATION_FILE_NAME} has rules the deck lint does not have: ${unknownRules.join(', ')} (see the "lint.rules" part of ${SHAPE_SECTION})`, 'unknown-rule');
86
86
  }
87
87
  return { declaration: resolve(parsed.data), warnings: [] };
88
88
  }
@@ -95,7 +95,7 @@ export async function readThemeDeclaration(files, themeRoot) {
95
95
  if (text === undefined) {
96
96
  return {
97
97
  declaration: DEFAULT_THEME_DECLARATION,
98
- warnings: [`テーマ ${themeRoot} に ${THEME_DECLARATION_FILE_NAME} の宣言が無いため、本体の既定値で続けます`],
98
+ warnings: [`theme ${themeRoot} has no ${THEME_DECLARATION_FILE_NAME} declaration; continuing with the defaults`],
99
99
  };
100
100
  }
101
101
  let raw;
@@ -104,7 +104,7 @@ export async function readThemeDeclaration(files, themeRoot) {
104
104
  }
105
105
  catch (error) {
106
106
  const reason = error instanceof Error ? error.message : String(error);
107
- throw new ThemeDeclarationError(`${filePath} を JSON として読めません: ${reason}。${SHAPE_SECTION}を参照してください`, 'invalid-shape');
107
+ throw new ThemeDeclarationError(`cannot read ${filePath} as JSON: ${reason} (see ${SHAPE_SECTION})`, 'invalid-shape');
108
108
  }
109
109
  return parseThemeDeclaration(raw);
110
110
  }
@@ -11,7 +11,7 @@ const COMMON_FILE_NAME = '_common.yaml';
11
11
  /**
12
12
  分類を読めなかったときの復旧導線。テーマ側の宣言を直す案内を、分類まわりの警告に必ず添える。
13
13
  */
14
- const CATEGORY_SYNC_HINT = 'テーマの references/_common.yaml の layout_categories を確認してください';
14
+ const CATEGORY_SYNC_HINT = 'check layout_categories in references/_common.yaml of the theme';
15
15
  function isDeclarationFile(fileName, extension) {
16
16
  return fileName.endsWith(extension) && !fileName.startsWith('_');
17
17
  }
@@ -27,7 +27,7 @@ warnings) {
27
27
  }
28
28
  default: {
29
29
  if (typeof value === 'string' && value !== '') {
30
- warnings.push(`${fileName} の status '${value}' は未知の値です。stable として扱います`);
30
+ warnings.push(`unknown status in ${fileName}: ${value}; treating it as stable`);
31
31
  }
32
32
  return 'stable';
33
33
  }
@@ -97,8 +97,8 @@ export async function resolveLayoutReferences(files, options) {
97
97
  */
98
98
  const UNCATEGORIZED_CATEGORY = {
99
99
  id: UNCATEGORIZED,
100
- label: '未分類',
101
- question: `category が未設定か未知語彙のレイアウト(${CATEGORY_SYNC_HINT})`,
100
+ label: 'Uncategorized',
101
+ question: `layouts whose category is unset or unknown (${CATEGORY_SYNC_HINT})`,
102
102
  };
103
103
  /**
104
104
  `layout_categories` の 1 要素を `LayoutCategory` へ写す。`id` / `label` / `question` が
@@ -119,7 +119,7 @@ function toLayoutCategory(value) {
119
119
  function categoriesUnusable(commonPath, reason) {
120
120
  return {
121
121
  categories: [],
122
- warnings: [`見せ方の分類を読み取れませんでした (${commonPath}: ${reason})。分類なしで続行します。${CATEGORY_SYNC_HINT}`],
122
+ warnings: [`cannot read the layout categories (${commonPath}: ${reason}); continuing without categories (fix: ${CATEGORY_SYNC_HINT})`],
123
123
  };
124
124
  }
125
125
  async function findCommonFile(files, directories) {
@@ -146,14 +146,14 @@ export async function readLayoutCategories(files, directories) {
146
146
  const found = await findCommonFile(files, directories);
147
147
  const lastDirectory = directories.at(-1) ?? '';
148
148
  if (found === undefined) {
149
- return categoriesUnusable(path.join(lastDirectory, COMMON_FILE_NAME), 'ファイルがありません');
149
+ return categoriesUnusable(path.join(lastDirectory, COMMON_FILE_NAME), 'file not found');
150
150
  }
151
151
  let items;
152
152
  try {
153
153
  const parsed = parse(found.text);
154
154
  const raw = isRecord(parsed) ? parsed['layout_categories'] : undefined;
155
155
  if (!Array.isArray(raw))
156
- throw new TypeError('layout_categories が配列として見つかりません');
156
+ throw new TypeError('layout_categories is not found as an array');
157
157
  items = raw;
158
158
  }
159
159
  catch (error) {
@@ -178,14 +178,14 @@ export async function readLayoutCategories(files, directories) {
178
178
  }
179
179
  if (categories.length === 0) {
180
180
  // 全滅は「分類が読めなかった」のと利用者から見て区別がつかないので、同じ 1 行に合流させる。
181
- return categoriesUnusable(found.path, `layout_categories に使える要素がありません (${String(items.length)} 件中 0 件)`);
181
+ return categoriesUnusable(found.path, `layout_categories has no usable item (0 of ${String(items.length)})`);
182
182
  }
183
183
  const warnings = [];
184
184
  if (reserved > 0) {
185
- warnings.push(`layout_categories の id '${UNCATEGORIZED}' は予約語のため無視します (${String(reserved)} 件、${CATEGORY_SYNC_HINT})`);
185
+ warnings.push(`ignoring reserved layout_categories id ${UNCATEGORIZED} (${String(reserved)} item(s)); ${CATEGORY_SYNC_HINT}`);
186
186
  }
187
187
  if (malformed > 0) {
188
- warnings.push(`layout_categories の一部を読み飛ばしました (id/label/question が不揃い: ${String(malformed)} 件)。${CATEGORY_SYNC_HINT}`);
188
+ warnings.push(`skipped part of layout_categories (id, label or question missing: ${String(malformed)} item(s)); ${CATEGORY_SYNC_HINT}`);
189
189
  }
190
190
  return { categories, warnings };
191
191
  }
@@ -86,18 +86,18 @@ export function classifyGitFailure(stderr) {
86
86
  export function gitFailureAdvice(kind, spec) {
87
87
  switch (kind) {
88
88
  case 'connection': {
89
- return `テーマの取得元 ${spec.url} に接続できません。ネットワークとプロキシを確認してください。`
90
- + 'SSL 証明書の検証で止まる場合は、git の http.sslCAInfo に、TLS を中継するプロキシの CA の証明書の束を指定してください。';
89
+ return `cannot connect to the theme source: ${spec.url} (fix: check the network and proxy; `
90
+ + 'if it stops at SSL certificate verification, set git http.sslCAInfo to the CA bundle of the TLS-intercepting proxy)';
91
91
  }
92
92
  case 'auth': {
93
- return `テーマの取得元 ${spec.url} の認証に失敗しました。`
94
- + 'git の認証情報(credential helper か SSH 鍵)を設定してから、やり直してください。';
93
+ return `authentication failed for the theme source: ${spec.url} `
94
+ + '(fix: set up git credentials, a credential helper or an SSH key, and retry)';
95
95
  }
96
96
  case 'tag': {
97
- return `テーマの取得元 ${spec.url} にタグ '${spec.tag}' がありません。タグ名を確認してください。ブランチ名は指定できません。`;
97
+ return `tag not found in the theme source ${spec.url}: ${spec.tag} (fix: check the tag name; branch names are not accepted)`;
98
98
  }
99
99
  case 'unknown': {
100
- return `テーマの取得元 ${spec.url} から git で取得できませんでした。`;
100
+ return `git could not fetch the theme source: ${spec.url}`;
101
101
  }
102
102
  }
103
103
  }
@@ -17,14 +17,14 @@ export class ThemeResolveError extends Error {
17
17
  const NO_THEME = 'none';
18
18
  // 失敗の文言に添える、復旧の案内。CLI と MCP のどちらから呼ばれても読めるよう、両方の手順を 1 か所で持つ。
19
19
  function relinkAdvice(talkDirectory) {
20
- return `slide sync --dir ${talkDirectory} --node-modules-only で張り直してください`
21
- + `(MCP では slide_sync の dir: ${talkDirectory}, node_modules_only: true)`;
20
+ return `run slide sync --dir ${talkDirectory} --node-modules-only to relink`
21
+ + ` (MCP: slide_sync with dir: ${talkDirectory}, node_modules_only: true)`;
22
22
  }
23
23
  /**
24
24
  移行前の talk-dir を止めるときの案内。CLI と MCP のどちらから読んでも打てるよう、両方の手順を持つ。
25
25
  */
26
- export const MIGRATE_ADVICE = 'テーマを参照する形へ移行するには slide sync --theme <theme-spec> を実行してください'
27
- + '(MCP では slide_sync の theme に <theme-spec> を渡します)';
26
+ export const MIGRATE_ADVICE = 'to migrate to a theme reference, run slide sync --theme <theme-spec>'
27
+ + ' (MCP: slide_sync with theme: <theme-spec>)';
28
28
  /**
29
29
  `<talk>/slides.md` の frontmatter `theme:` を読む。
30
30
  無い・読めない・`none` は undefined(テーマを指していない)。
@@ -52,7 +52,7 @@ async function readDependencies(files, talkDirectory) {
52
52
  const file = path.join(talkDirectory, 'package.json');
53
53
  const text = await files.readText(file);
54
54
  if (text === undefined) {
55
- throw new ThemeResolveError(`${file} がありません。talk-dir の package.json の dependencies にテーマが要ります。`
55
+ throw new ThemeResolveError(`file not found: ${file}; the theme must be in dependencies of the talk-dir package.json; `
56
56
  + relinkAdvice(talkDirectory), 'theme-unlinked');
57
57
  }
58
58
  let raw;
@@ -61,7 +61,7 @@ async function readDependencies(files, talkDirectory) {
61
61
  }
62
62
  catch (error) {
63
63
  const reason = error instanceof Error ? error.message : String(error);
64
- throw new ThemeResolveError(`${file} を JSON として読めません: ${reason}。${relinkAdvice(talkDirectory)}`, 'theme-unlinked');
64
+ throw new ThemeResolveError(`cannot read ${file} as JSON: ${reason}; ${relinkAdvice(talkDirectory)}`, 'theme-unlinked');
65
65
  }
66
66
  const record = isRecord(raw) ? raw : {};
67
67
  const rawDependencies = isRecord(record['dependencies']) ? record['dependencies'] : {};
@@ -111,14 +111,14 @@ async function findThemeRoot(files, talkDirectory, name) {
111
111
  }
112
112
  async function requireThemeDependency(files, talkDirectory, theme) {
113
113
  if (isPathTheme(theme)) {
114
- throw new ThemeResolveError(`slides.md の theme: ${theme} はパス形式です。パス形式のテーマは pecotv では未対応です。${MIGRATE_ADVICE}`, 'theme-none');
114
+ throw new ThemeResolveError(`theme in slides.md is a path: ${theme}; path themes are not supported by pecotv; ${MIGRATE_ADVICE}`, 'theme-none');
115
115
  }
116
116
  const dependencies = await readDependencies(files, talkDirectory);
117
117
  const name = candidateNames(theme).find(candidate => dependencies.has(candidate));
118
118
  const spec = name === undefined ? undefined : dependencies.get(name);
119
119
  if (name === undefined || spec === undefined) {
120
- throw new ThemeResolveError(`slides.md の theme: ${theme} に当たるパッケージが package.json の dependencies にありません`
121
- + `(探した名前: ${candidateNames(theme).join(', ')})。dependencies にテーマを足し、`
120
+ throw new ThemeResolveError(`no package for the theme in slides.md is in dependencies of package.json: ${theme} `
121
+ + `(searched names: ${candidateNames(theme).join(', ')}); add the theme to dependencies, then `
122
122
  + relinkAdvice(talkDirectory), 'theme-unlinked');
123
123
  }
124
124
  return { name, spec };
@@ -149,7 +149,7 @@ export async function resolveTalkTheme(files, talkDirectory) {
149
149
  const { name, spec } = await requireThemeDependency(files, talkDirectory, theme);
150
150
  const directory = await findThemeRoot(files, talkDirectory, name);
151
151
  if (directory === undefined) {
152
- throw new ThemeResolveError(`テーマ ${name} が ${path.join(talkDirectory, 'node_modules', name)} にも、上位の node_modules にも見つかりません。`
152
+ throw new ThemeResolveError(`theme not found in ${path.join(talkDirectory, 'node_modules', name)} or in any parent node_modules: ${name}; `
153
153
  + relinkAdvice(talkDirectory), 'theme-unlinked');
154
154
  }
155
155
  return { name, spec, directory, linked: directory === path.join(talkDirectory, 'node_modules', name) };
@@ -167,7 +167,7 @@ async function hasThemeDeclaration(files, directory) {
167
167
  export async function themeNoneError(files, talkDirectory) {
168
168
  const message = await hasThemeDeclaration(files, talkDirectory)
169
169
  ? themeRootMessage(talkDirectory)
170
- : `${talkDirectory} はテーマを参照していません(slides.md の theme: が none か未指定です)。${MIGRATE_ADVICE}`;
170
+ : `${talkDirectory} does not reference a theme (theme in slides.md is none or unset); ${MIGRATE_ADVICE}`;
171
171
  return new ThemeResolveError(message, 'theme-none');
172
172
  }
173
173
  /**
@@ -175,8 +175,8 @@ export async function themeNoneError(files, talkDirectory) {
175
175
  テーマの dir を移行前の talk-dir と取り違えると、sync が layouts・components を消しうるため、文言を分けて止める。
176
176
  */
177
177
  export function themeRootMessage(directory) {
178
- return `${directory} は ${THEME_DECLARATION_FILE_NAME} を持つテーマの dir です。talk-dir ではないため、talk-dir として扱いません。`
179
- + 'テーマを参照する talk-dir を別に作り、その dir を指定してください';
178
+ return `not a talk-dir (it is a theme dir with ${THEME_DECLARATION_FILE_NAME}): ${directory}; `
179
+ + 'create a separate talk-dir that references the theme and specify that dir';
180
180
  }
181
181
  /**
182
182
  talk-dir がテーマをどう持つかを 3 通りに分ける。node_modules には触れない。
@@ -30,23 +30,23 @@ export function parseThemeSpec(text) {
30
30
  if (text.startsWith(FILE_PREFIX)) {
31
31
  const filePath = text.slice(FILE_PREFIX.length);
32
32
  if (filePath === '') {
33
- throw new ThemeSpecError(`テーマの指定 '${text}' に path がありません`, 'unsupported-spec');
33
+ throw new ThemeSpecError(`theme spec has no path: ${text}`, 'unsupported-spec');
34
34
  }
35
35
  return { kind: 'file', path: filePath };
36
36
  }
37
37
  if (!GIT_PREFIX.test(text)) {
38
- throw new ThemeSpecError(`テーマの指定 '${text}' は解釈できません。git+https://<host>/<owner>/<repo>.git#<tag> か file:<path> で書いてください`, 'unsupported-spec');
38
+ throw new ThemeSpecError(`cannot parse the theme spec: ${text} (fix: write git+https://<host>/<owner>/<repo>.git#<tag> or file:<path>)`, 'unsupported-spec');
39
39
  }
40
40
  const hashIndex = text.indexOf('#');
41
41
  if (hashIndex === -1 || hashIndex === text.length - 1) {
42
- throw new ThemeSpecError(`テーマの指定 '${text}' にタグがありません。#<tag> を付けてください`, 'tag-required');
42
+ throw new ThemeSpecError(`theme spec has no tag: ${text} (fix: add #<tag>)`, 'tag-required');
43
43
  }
44
44
  const tag = text.slice(hashIndex + 1);
45
45
  if (tag.startsWith(SEMVER_RANGE_PREFIX)) {
46
- throw new ThemeSpecError(`テーマの指定 '${text}' の範囲指定(#semver:)は使えません。タグを 1 つ書いてください`, 'semver-range');
46
+ throw new ThemeSpecError(`semver ranges (#semver:) are not allowed in the theme spec: ${text} (fix: write a single tag)`, 'semver-range');
47
47
  }
48
48
  if (!isSemverTag(tag)) {
49
- throw new ThemeSpecError(`テーマの指定 '${text}' の '${tag}' はタグの書式でない(例: 1.2.3 か v1.2.3)`, 'tag-format');
49
+ throw new ThemeSpecError(`invalid tag format in the theme spec: ${tag} in ${text} (e.g. 1.2.3 or v1.2.3)`, 'tag-format');
50
50
  }
51
51
  const url = text.slice('git+'.length, hashIndex);
52
52
  return { kind: 'git', url, tag };