@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.
- package/.claude/skills/workflow-commands/fullrun-steps.md +4 -2
- package/.claude/skills/workflow-commands/halfrun.md +3 -1
- package/.claude/skills/workflow-commands/kickoff.md +5 -3
- package/.claude/skills/workflow-commands/observation-filing.md +3 -1
- package/.claude/skills/workflow-commands/prerequisite.md +3 -1
- package/.claude/skills/workflow-commands/target-repository.md +1 -1
- package/.github/pull_request_template.md +12 -0
- package/.github/release.yml +3 -0
- package/.github/workflows/ci.yml +8 -0
- package/.github/workflows/production.yml +10 -1
- package/.github/workflows/publish.yml +72 -2
- package/CLAUDE.md +2 -0
- package/dist/CLAUDE.md +2 -0
- package/dist/CLAUDE.static.md +8 -0
- package/dist/hooks/batch-guard.js +4 -4
- package/dist/hooks/{chunk-36UE53LS.js → chunk-3HZ5MJIW.js} +2 -2
- package/dist/hooks/chunk-3V37IID6.js +82 -0
- package/dist/hooks/{chunk-FRJKVSK3.js → chunk-77RLKZ5V.js} +2 -2
- package/dist/hooks/{chunk-VGYSA2NT.js → chunk-LC765SUA.js} +16 -2
- package/dist/hooks/{chunk-ZBK4XRAS.js → chunk-NWD47MW3.js} +3 -3
- package/dist/hooks/{chunk-4OXFU3MK.js → chunk-O2FBZPSW.js} +619 -156
- package/dist/hooks/{chunk-6MQCXEEA.js → chunk-OLTAGGHH.js} +25 -88
- package/dist/hooks/{chunk-FNFOLFFV.js → chunk-OYU6KPRA.js} +1 -1
- package/dist/hooks/{chunk-PRDCNGA6.js → chunk-UANRLZV7.js} +4 -4
- package/dist/hooks/{chunk-264QY6KS.js → chunk-UULARQ5Q.js} +23 -1
- package/dist/hooks/{chunk-Y5OYCU2F.js → chunk-XMR3BS35.js} +3 -3
- package/dist/hooks/codex-hook-adapter.js +11 -10
- package/dist/hooks/duplicate-read-guard.js +5 -5
- package/dist/hooks/format-edited.js +3 -2
- package/dist/hooks/investigation-guard.js +5 -5
- package/dist/hooks/pretool-guard.js +10 -9
- package/dist/hooks/stop-guard.js +3 -3
- package/dist/josh.js +155 -12
- package/package.json +68 -17
- package/prettier/index.js +3 -8
- package/prettier/static.d.ts +3 -0
- package/prettier/static.js +10 -0
- package/prompts/collaboration-workflow/issue-template.md +11 -4
- package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
- package/prompts/collaboration-workflow/wip-cap.md +2 -2
- package/prompts/review.md +2 -2
- package/prompts/testing-guide.md +1 -0
- package/scripts/build/build-claude-md.ts +6 -1
- package/scripts/ci/pr-classification.ts +114 -0
- package/scripts/document/document-byte-budget.ts +3 -2
- package/scripts/gate/gate-report.ts +2 -0
- package/scripts/gate/gate-steps.ts +50 -0
- package/scripts/gate/project-checks.ts +121 -0
- package/scripts/gate/verification-gate.ts +14 -43
- package/scripts/git/git-common-directory.ts +9 -1
- package/scripts/git/git-gh-pr-rollup.ts +29 -1
- package/scripts/git/git-gh-pr.ts +61 -1
- package/scripts/git/git-pr.ts +62 -13
- package/scripts/git/issue-labels.ts +9 -0
- package/scripts/init/distributed-paths.ts +9 -5
- package/scripts/init/hook-command-bootstrap.ts +40 -8
- package/scripts/init/hook-command-rewrite.ts +7 -3
- package/scripts/init/init-actions.ts +94 -7
- package/scripts/init/init-ai-copy.ts +104 -19
- package/scripts/init/init-static.ts +52 -0
- package/scripts/init/init.ts +97 -30
- package/scripts/init/project-profile-cli.ts +14 -0
- package/scripts/init/project-profile.ts +149 -0
- package/scripts/init/start.ts +30 -0
- package/scripts/issue/issue-bug-label.ts +13 -0
- package/scripts/issue/issue-classification.ts +74 -0
- package/scripts/issue/issue-lint-cli.ts +10 -3
- package/scripts/issue/markdown-section.ts +38 -4
- package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +27 -1
- package/scripts/josh/josh-command-map.ts +3 -0
- package/scripts/josh/josh-commands-development.ts +6 -0
- package/scripts/josh/josh-commands-project.ts +14 -1
- package/scripts/josh/josh-logic.ts +13 -0
- package/scripts/josh/run-github-prerequisite.ts +32 -0
- package/scripts/lane/lane-await.ts +8 -1
- package/scripts/lane/openai-lane-ship.ts +30 -0
- package/scripts/lane/openai-lane-supervisor.ts +35 -8
- package/scripts/lane/openai-review-broker.ts +260 -0
- package/scripts/lint/cspell-cached.ts +21 -0
- package/scripts/lint/lint-parallel.ts +44 -1
- package/scripts/observations/observations-flush.ts +1 -1
- package/scripts/package/production-dependency-graph.ts +68 -0
- package/scripts/package/verify-optional-eslint-install.ts +62 -0
- package/scripts/release/github-release-cli.ts +11 -0
- package/scripts/release/github-release.ts +220 -0
- package/scripts/release/publish-tag-cli.ts +8 -0
- package/scripts/release/publish-tag.ts +11 -0
- package/scripts/release/release-publish.ts +7 -2
- package/scripts/rules/delivered-rules.ts +2 -0
- package/scripts/rules/issue-bug-label.ts +85 -0
- package/scripts/rules/issue-filing-args.ts +50 -0
- package/scripts/run/run-merge-cli.ts +19 -0
- package/scripts/run/run-merge.ts +9 -1
- package/scripts/run/run-ship-cli.ts +20 -0
- package/scripts/run/run-ship-detach.ts +180 -14
- package/scripts/run/run-ship-review-steps.ts +45 -25
- package/scripts/run/run-wake-session.ts +3 -1
- package/scripts/test/pilot-files.ts +0 -2
- package/scripts/test/skip-marker.ts +3 -0
- package/scripts/test/test-declared-changed.ts +2 -1
- package/scripts/test/test-declared-logic.ts +15 -10
- package/scripts/test/test-declared.ts +20 -8
- package/scripts/test/test-red-logic.ts +3 -3
- package/scripts/test/test-unit-guard.ts +24 -12
- package/templates/CLAUDE.static.md +8 -0
- package/templates/cursorrules.static +1 -0
- package/templates/prettierignore.static +12 -0
- 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
|
|
23
|
-
// there is a broken state
|
|
24
|
-
//
|
|
25
|
-
//
|
|
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(
|
|
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 (
|
|
60
|
+
if (has_tests) return 'run'
|
|
55
61
|
|
|
56
|
-
return
|
|
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
|
-
|
|
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(
|
|
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.
|
|
@@ -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
|
|