@joshuafolkken/kit 1.887.0 → 1.921.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 (108) hide show
  1. package/.claude/skills/workflow-commands/fullrun-steps.md +4 -2
  2. package/.claude/skills/workflow-commands/halfrun.md +3 -1
  3. package/.claude/skills/workflow-commands/kickoff.md +5 -3
  4. package/.claude/skills/workflow-commands/observation-filing.md +3 -1
  5. package/.claude/skills/workflow-commands/prerequisite.md +3 -1
  6. package/.claude/skills/workflow-commands/target-repository.md +1 -1
  7. package/.github/pull_request_template.md +12 -0
  8. package/.github/release.yml +3 -0
  9. package/.github/workflows/ci.yml +8 -0
  10. package/.github/workflows/production.yml +10 -1
  11. package/.github/workflows/publish.yml +72 -2
  12. package/CLAUDE.md +2 -0
  13. package/dist/CLAUDE.md +2 -0
  14. package/dist/CLAUDE.static.md +8 -0
  15. package/dist/hooks/batch-guard.js +4 -4
  16. package/dist/hooks/{chunk-36UE53LS.js → chunk-3HZ5MJIW.js} +2 -2
  17. package/dist/hooks/chunk-3V37IID6.js +82 -0
  18. package/dist/hooks/{chunk-FRJKVSK3.js → chunk-77RLKZ5V.js} +2 -2
  19. package/dist/hooks/{chunk-VGYSA2NT.js → chunk-LC765SUA.js} +16 -2
  20. package/dist/hooks/{chunk-ZBK4XRAS.js → chunk-NWD47MW3.js} +3 -3
  21. package/dist/hooks/{chunk-4OXFU3MK.js → chunk-O2FBZPSW.js} +619 -156
  22. package/dist/hooks/{chunk-6MQCXEEA.js → chunk-OLTAGGHH.js} +25 -88
  23. package/dist/hooks/{chunk-FNFOLFFV.js → chunk-OYU6KPRA.js} +1 -1
  24. package/dist/hooks/{chunk-PRDCNGA6.js → chunk-UANRLZV7.js} +4 -4
  25. package/dist/hooks/{chunk-264QY6KS.js → chunk-UULARQ5Q.js} +23 -1
  26. package/dist/hooks/{chunk-Y5OYCU2F.js → chunk-XMR3BS35.js} +3 -3
  27. package/dist/hooks/codex-hook-adapter.js +11 -10
  28. package/dist/hooks/duplicate-read-guard.js +5 -5
  29. package/dist/hooks/format-edited.js +3 -2
  30. package/dist/hooks/investigation-guard.js +5 -5
  31. package/dist/hooks/pretool-guard.js +10 -9
  32. package/dist/hooks/stop-guard.js +3 -3
  33. package/dist/josh.js +155 -12
  34. package/package.json +68 -17
  35. package/prettier/index.js +3 -8
  36. package/prettier/static.d.ts +3 -0
  37. package/prettier/static.js +10 -0
  38. package/prompts/collaboration-workflow/issue-template.md +11 -4
  39. package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
  40. package/prompts/collaboration-workflow/wip-cap.md +2 -2
  41. package/prompts/review.md +2 -2
  42. package/prompts/testing-guide.md +1 -0
  43. package/scripts/build/build-claude-md.ts +6 -1
  44. package/scripts/ci/pr-classification.ts +114 -0
  45. package/scripts/document/document-byte-budget.ts +3 -2
  46. package/scripts/gate/gate-report.ts +2 -0
  47. package/scripts/gate/gate-steps.ts +50 -0
  48. package/scripts/gate/project-checks.ts +121 -0
  49. package/scripts/gate/verification-gate.ts +14 -43
  50. package/scripts/git/git-common-directory.ts +9 -1
  51. package/scripts/git/git-gh-pr-rollup.ts +29 -1
  52. package/scripts/git/git-gh-pr.ts +61 -1
  53. package/scripts/git/git-pr.ts +62 -13
  54. package/scripts/git/issue-labels.ts +9 -0
  55. package/scripts/init/distributed-paths.ts +9 -5
  56. package/scripts/init/hook-command-bootstrap.ts +40 -8
  57. package/scripts/init/hook-command-rewrite.ts +7 -3
  58. package/scripts/init/init-actions.ts +94 -7
  59. package/scripts/init/init-ai-copy.ts +104 -19
  60. package/scripts/init/init-static.ts +52 -0
  61. package/scripts/init/init.ts +97 -30
  62. package/scripts/init/project-profile-cli.ts +14 -0
  63. package/scripts/init/project-profile.ts +149 -0
  64. package/scripts/init/start.ts +30 -0
  65. package/scripts/issue/issue-bug-label.ts +13 -0
  66. package/scripts/issue/issue-classification.ts +74 -0
  67. package/scripts/issue/issue-lint-cli.ts +10 -3
  68. package/scripts/issue/markdown-section.ts +38 -4
  69. package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +27 -1
  70. package/scripts/josh/josh-command-map.ts +3 -0
  71. package/scripts/josh/josh-commands-development.ts +6 -0
  72. package/scripts/josh/josh-commands-project.ts +14 -1
  73. package/scripts/josh/josh-logic.ts +13 -0
  74. package/scripts/josh/run-github-prerequisite.ts +32 -0
  75. package/scripts/lane/lane-await.ts +8 -1
  76. package/scripts/lane/openai-lane-ship.ts +30 -0
  77. package/scripts/lane/openai-lane-supervisor.ts +35 -8
  78. package/scripts/lane/openai-review-broker.ts +260 -0
  79. package/scripts/lint/cspell-cached.ts +21 -0
  80. package/scripts/lint/lint-parallel.ts +44 -1
  81. package/scripts/observations/observations-flush.ts +1 -1
  82. package/scripts/package/production-dependency-graph.ts +68 -0
  83. package/scripts/package/verify-optional-eslint-install.ts +62 -0
  84. package/scripts/release/github-release-cli.ts +11 -0
  85. package/scripts/release/github-release.ts +220 -0
  86. package/scripts/release/publish-tag-cli.ts +8 -0
  87. package/scripts/release/publish-tag.ts +11 -0
  88. package/scripts/release/release-publish.ts +7 -2
  89. package/scripts/rules/delivered-rules.ts +2 -0
  90. package/scripts/rules/issue-bug-label.ts +85 -0
  91. package/scripts/rules/issue-filing-args.ts +50 -0
  92. package/scripts/run/run-merge-cli.ts +19 -0
  93. package/scripts/run/run-merge.ts +9 -1
  94. package/scripts/run/run-ship-cli.ts +20 -0
  95. package/scripts/run/run-ship-detach.ts +180 -14
  96. package/scripts/run/run-ship-review-steps.ts +45 -25
  97. package/scripts/run/run-wake-session.ts +3 -1
  98. package/scripts/test/pilot-files.ts +0 -2
  99. package/scripts/test/skip-marker.ts +3 -0
  100. package/scripts/test/test-declared-changed.ts +2 -1
  101. package/scripts/test/test-declared-logic.ts +15 -10
  102. package/scripts/test/test-declared.ts +20 -8
  103. package/scripts/test/test-red-logic.ts +3 -3
  104. package/scripts/test/test-unit-guard.ts +24 -12
  105. package/templates/CLAUDE.static.md +8 -0
  106. package/templates/cursorrules.static +1 -0
  107. package/templates/prettierignore.static +12 -0
  108. package/templates/workflows/ci.yml +5 -0
@@ -3,7 +3,9 @@ import { existsSync, globSync } from 'node:fs'
3
3
  import path from 'node:path'
4
4
  import { fileURLToPath } from 'node:url'
5
5
  import { PROJECT_ENVIRONMENT_KEYS } from '#ports'
6
+ import { project_checks } from '#scripts/gate/project-checks'
6
7
  import { execa } from 'execa'
8
+ import { SKIP_MARKER } from './skip-marker'
7
9
  import { unit_worker_share } from './unit-worker-share'
8
10
 
9
11
  const PNPM = 'pnpm'
@@ -19,10 +21,10 @@ const NODE_MODULES = 'node_modules'
19
21
  // - **`vitest` absent is the young project.** `josh init` installs no vitest and writes no
20
22
  // `test:unit` script, so a freshly-bootstrapped project always lands here — which is the case the
21
23
  // skip was written for, and it keeps it.
22
- // - **`vitest` present is the project declaring that it runs unit tests.** Zero matching files
23
- // there is a broken state rather than a young one — a mis-scoped glob, or a suite that was
24
- // deleted — and reporting it as a passing check hands `pnpm josh followup`, which reads
25
- // only the exit code, a verification that verified nothing. That half fails.
24
+ // - **`vitest` present is the node project's declaration that it runs unit tests.** Zero matching
25
+ // files there is a broken state — a mis-scoped glob, or a deleted suite — and fails. A static
26
+ // project may carry vitest as an unused dependency without declaring a unit suite; zero files
27
+ // there are reported as skipped, never as a test pass.
26
28
  //
27
29
  // Rejected: leaving both halves green — joshuafolkken/kit#1216's `--verbose` makes the zero count
28
30
  // *readable* in the CI log, but nobody reads a green log and the merge gate reads only pass/fail;
@@ -35,25 +37,29 @@ const NODE_MODULES = 'node_modules'
35
37
  // `@playwright/test` is not one: it is an optional peer dependency that vitest's browser mode also
36
38
  // needs, so a project can legitimately have it installed with no `*.e2e.{ts,js}` file at all.
37
39
  const SKIP_ACTION = 'skip-missing-package'
40
+ const SKIP_NO_TESTS_ACTION = 'skip-no-tests'
38
41
  const FAIL_ACTION = 'fail-no-tests'
39
42
 
40
- type GuardAction = 'run' | typeof SKIP_ACTION | typeof FAIL_ACTION
43
+ type GuardAction = 'run' | typeof SKIP_ACTION | typeof SKIP_NO_TESTS_ACTION | typeof FAIL_ACTION
41
44
 
42
45
  // The word the gate looks for to know a passing step did not actually run. Exported and reused on
43
46
  // both sides rather than matched by eye: joshuafolkken/kit#967 stopped printing a passing check's
44
47
  // body, and without this a gate that skipped the whole unit suite printed the same five lines as one
45
48
  // that ran it.
46
- const SKIP_MARKER = '— skipping'
47
-
48
49
  const SKIP_REASON = 'vitest is not installed'
50
+ const SKIP_NO_TESTS_REASON = 'no unit test files were found in this static project'
49
51
  const FAIL_REASON =
50
52
  'vitest is installed but no *.{test,spec}.{ts,js} test file was found — refusing to report a unit check that ran nothing'
51
53
 
52
- function resolve_guard_action(is_installed: boolean, has_tests: boolean): GuardAction {
54
+ function resolve_guard_action(
55
+ is_installed: boolean,
56
+ has_tests: boolean,
57
+ is_static = false,
58
+ ): GuardAction {
53
59
  if (!is_installed) return SKIP_ACTION
54
- if (!has_tests) return FAIL_ACTION
60
+ if (has_tests) return 'run'
55
61
 
56
- return 'run'
62
+ return is_static ? SKIP_NO_TESTS_ACTION : FAIL_ACTION
57
63
  }
58
64
 
59
65
  function is_vitest_installed(project_directory: string): boolean {
@@ -132,7 +138,9 @@ function report_no_run(action: Exclude<GuardAction, 'run'>, command_label: strin
132
138
  return FAIL_EXIT_CODE
133
139
  }
134
140
 
135
- console.info(`josh ${command_label}: ${SKIP_REASON} ${SKIP_MARKER} vitest unit tests.`)
141
+ const reason = action === SKIP_NO_TESTS_ACTION ? SKIP_NO_TESTS_REASON : SKIP_REASON
142
+
143
+ console.info(`josh ${command_label}: ${reason} ${SKIP_MARKER} vitest unit tests.`)
136
144
 
137
145
  return 0
138
146
  }
@@ -149,7 +157,11 @@ async function run_guarded_vitest(
149
157
  ): Promise<number> {
150
158
  const is_installed = is_vitest_installed(project_directory)
151
159
  const has_tests = has_unit_tests(project_directory)
152
- const action = resolve_guard_action(is_installed, has_tests)
160
+ const action = resolve_guard_action(
161
+ is_installed,
162
+ has_tests,
163
+ project_checks.is_static(project_directory),
164
+ )
153
165
 
154
166
  if (action !== 'run') return report_no_run(action, command_label)
155
167
  if (announcement !== undefined) process.stdout.write(`${announcement}\n`)
@@ -0,0 +1,8 @@
1
+ # Project instructions
2
+
3
+ - 既存のファイルと利用者の設定を尊重し、変更する前に内容を確認する。
4
+ - 変更には検証を付け、実行した結果を報告する。
5
+ - HTML、CSS、JavaScript のファイルがある場合は Prettier で整形する。
6
+ - 画面に見える変更をした場合はブラウザーで表示と操作を確認する。
7
+ - JavaScript または TypeScript の動作を変更した場合は、その動作を確認する自動テストを追加する。
8
+ - Git や GitHub を使う場合だけ、それぞれのワークフローを利用する。
@@ -0,0 +1 @@
1
+ Read CLAUDE.md before making changes in this project. It contains the project instructions.
@@ -0,0 +1,12 @@
1
+ # Dependencies and generated files
2
+ node_modules/
3
+ dist/
4
+ build/
5
+ .pnpm-store/
6
+
7
+ # Package manager lock files
8
+ package-lock.json
9
+ pnpm-lock.yaml
10
+ yarn.lock
11
+ bun.lock
12
+ bun.lockb
@@ -6,6 +6,7 @@ on:
6
6
 
7
7
  pull_request:
8
8
  branches: [main]
9
+ types: [opened, synchronize, reopened, labeled, unlabeled]
9
10
 
10
11
  # A push run is grouped by the commit it carries, so a later push to the default branch never
11
12
  # cancels an earlier one. Without the sha every such push shares one group — `github.ref` is
@@ -220,6 +221,10 @@ jobs:
220
221
  - name: Run unit tests
221
222
  run: pnpm josh test:unit
222
223
 
224
+ - name: Check release classification
225
+ if: github.event_name == 'pull_request'
226
+ run: pnpm josh pr:classification
227
+
223
228
  - name: Check bundle size
224
229
  run: pnpm size-limit
225
230