ci: typecheck + lint gates, Node 22/24 matrix, package metadata fixes, README#137
Merged
Conversation
CI never ran tsc or eslint, so type errors and lint violations (including
an untypechecked packages/cli) could land silently. Add a `typecheck`
script to every package (tsc --noEmit, or the frontend's existing `tsc -b`
project setup) plus a root script that runs them all, wire both typecheck
and `lint --workspaces --if-present` into the Build job, and bump the pinned
Node 20.x (EOL) to a 22.x/24.x matrix for the Test job.
Fixing packages/cli's typecheck required skipLibCheck (an @types/node
version bump introduced generic TypedArrays that conflict with this
tsconfig's ES2018 lib under this TypeScript version — the frontend
tsconfig already carries the same flag) and a narrow `as any` cast in one
test assertion where the library's own return type is untyped `{}`.
Making frontend lint pass in CI required replacing a handful of
`any`-typed showSaveFilePicker/webkitdirectory workarounds with narrow
structural types, and scoping the lint script to src/ (tests aren't
typechecked by this project either, so this mirrors existing convention)
with a small --max-warnings allowance for the pre-existing react-hooks/
react-refresh warnings.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QMjKvi9vHT3LfikGfW84Kg
packages/metadata's repository/bugs URLs pointed at jspsych/jsPsych (the wrong repo) and would leak that to npm on publish; point them at jspsych/metadata instead. Reorder the exports map so the "types" condition comes first — TS condition matching is order-sensitive, so a trailing "types" entry can be skipped. Drop the dead build:types script (references a nonexistent tsconfig.build.json and isn't part of the build chain) and the vestigial husky devDependency (no .husky/ directory in this repo). packages/cli depended on "@jspsych/metadata": "*", which would happily resolve to an incompatible future major. Pin it to the 0.0.x/0.1.x line (0.1.0 is the pending release in PR #47) rather than a bare "^0.1.0": until that release ships, the local workspace package is still at 0.0.3, and a range that excludes it breaks `npm install` for local dev and CI alike since npm workspaces only symlinks a dependency when the workspace version satisfies the declared range. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMjKvi9vHT3LfikGfW84Kg
The root README was two lines; expand it into a proper overview (what the project is, the monorepo layout, a CLI quick-start, links to the docs/ guides, and dev/contributing commands) without turning it into a duplicate of the package-level READMEs. Also drop --platform=node from the root `build` script: npm silently ignores flags passed after `--workspaces` that aren't recognized by `npm run`, so it had no effect (each package's own build script already sets --platform=node where esbuild needs it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMjKvi9vHT3LfikGfW84Kg
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMjKvi9vHT3LfikGfW84Kg
🦋 Changeset detectedLatest commit: 4941b05 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
# Conflicts: # README.md # packages/frontend/src/global.d.ts # packages/frontend/src/pages/DataUpload.tsx
…docs-site CLI reference - Reconcile README with the merged Docusaurus docs site (#139): keep the monorepo intro/quick-start/development sections, point Documentation at metadata.jspsych.org and website/, drop the legacy docs/ links. - Drop Node 20 support (maintainer decision): engines >=22 in all three packages, release workflow bumped 20.x -> 22.x to match the CI matrix (22/24) that npm test actually runs on. - Widen the CLI's @jspsych/metadata range to '>=0.0.3 <0.2.0' so a future 0.0.x or 0.1.x patch release cannot re-break npm ci (caret ranges on 0.0.x match only that exact version). - Sync website/docs/reference/cli-reference.md with the exit-code scheme and flag-validation behavior that landed in #135 (the docs/ copy was updated there; the site copy predated it). - Resolve merge conflicts from main: take #136's DataUpload busy-state effect (webkitdirectory is now set via JSX spread, making #137's typed effect obsolete) and accept #136's deletion of global.d.ts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the infrastructure workstream of the repository improvement plan (
docs/dev/improvement-plan.md, Phase 3).CI
typecheckscripts + rootnpm run typecheck, wired into CI.packages/cliwas previously never typechecked at all (esbuild build + sucrase test transform = type errors shipped silently).npm run lint --workspaces --if-presentin CI. The frontend had an ESLint config and lint script that nothing ever ran. Lint is scoped tosrcwith--max-warnings 10(9 pre-existingreact-hooks/react-refreshwarnings; ~27no-explicit-anyerrors live only in test mocks and are excluded rather than churned).engines: >=20declared in root and both publishable packages;cache: npmadded to release.yml.Package metadata (affects what ships to npm)
packages/metadata:repository/bugscorrected fromjspsych/jsPsych→jspsych/metadata(the npm page currently links to the wrong repo);typescondition moved first in the exports map (TS condition matching is order-sensitive); deadbuild:typesscript and vestigialhuskydevDependency removed.packages/cli:@jspsych/metadatadependency pinned to^0.0.3 || ^0.1.0instead of*. (A bare^0.1.0empirically breaksnpm citoday — npm only workspace-links when the local version satisfies the range, and metadata is still 0.0.3 until Version Packages #47 lands.)Housekeeping
--platform=nodeflag removed from the root build script; root package gets aname(preventsnpm installin a worktree from rewriting the lockfile's root name).Minimal src touches (required to turn the gates green — called out for review)
packages/cli/tsconfig.json:skipLibCheck: true(same flag frontend already carries, for the same@types/nodeBuffer-typings conflict under TS 5.9).packages/cli/tests/data.test.ts(getMetadata()is typed{}in the library).no-explicit-anyfixes in frontendsrc(typed casts forwebkitdirectory/showSaveFilePickeretc.).Testing
Full suite 656 passed;
npm run typecheckexit 0 across all packages;npm run build --workspacesexit 0; lint 0 errors / 9 warnings (under threshold) — all verified against a freshnpm ci, matching CI.Notes for review
🤖 Generated with Claude Code
https://claude.ai/code/session_01QMjKvi9vHT3LfikGfW84Kg
Generated by Claude Code