Skip to content

Run typecheck in CI - #18

Draft
ada33-arch wants to merge 2 commits into
mainfrom
claude/agents-sdk-typescript-setup-wwe1a9
Draft

Run typecheck in CI#18
ada33-arch wants to merge 2 commits into
mainfrom
claude/agents-sdk-typescript-setup-wwe1a9

Conversation

@ada33-arch

@ada33-arch ada33-arch commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Follow-up to #17, which added TypeScript but left nothing in the pipeline checking it — a type error could land on main with CI green.

Rebuilt on current main (4b58087) to resolve a merge conflict; see Conflict resolution below for what changed.

Change

Adds one job to .github/workflows/ci.yml:

typecheck:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: '22'
        cache: 'npm'
    - run: npm ci
    - run: npm run typecheck

A separate job rather than a step on lifecycle-demo, so the two run in parallel and a red check points at the TypeScript instead of the Actions demo. npm ci rather than npm install installs exactly what package-lock.json pins and fails if the lockfile has drifted.

Plus two small CLAUDE.md touch-ups that follow from it:

  • The ci.yml layout entry now names both jobs, and the Commands section notes that CI runs typecheck on every PR — Refresh CLAUDE.md to match what the repo actually contains #19 was written before this job existed.
  • Adds the one gotcha Refresh CLAUDE.md to match what the repo actually contains #19 doesn't cover, and the only one here that has actually broken CI: the root "type": "module" applies to every .js in the repo, including Actions scripts the runner executes directly. That's the entire reason .github/actions/lifecycle-demo/package.json exists — delete it as an apparently redundant two-line manifest and the JS action dies with ReferenceError: require is not defined in ES module scope.

Both edits keep #19's existing bullet style rather than restructuring it.

Conflict resolution

This branch previously carried its own full CLAUDE.md rewrite. #19 landed the same refresh on main while this PR sat in draft, so that commit was dropped rather than merged — it duplicated work that's already on main, and resolving in its favour would have clobbered a merged change. What survived is the typecheck job, which main still doesn't have, plus the two touch-ups above.

On #14 / #15

#14 tried to add Node setup and was reverted after breaking CI — it pasted actions/setup-node boilerplate, every option empty, into .github/actions/docker-demo/action.yml, a Docker action whose runs: block takes an image and args rather than steps. This puts the setup in a workflow job and sets only the two options needed.

Verification

  • npm run typecheck exits 0 on this branch.
  • The gate isn't vacuous: appending const broken: number = "not a number"; to agent.ts makes it exit 1 with TS2322, back to 0 once reverted.
  • main's own documented action recipe still runs verbatim after the rebuild, producing greeting=hello, world!.

@ada33-arch
ada33-arch force-pushed the claude/agents-sdk-typescript-setup-wwe1a9 branch from 64cf7a3 to 6a0a035 Compare August 2, 2026 19:18
@ada33-arch ada33-arch changed the title Run typecheck in CI Run typecheck in CI, and refresh CLAUDE.md Aug 2, 2026
claude added 2 commits August 8, 2026 10:54
Nothing in the pipeline guarded the TypeScript, so a type error could
land on main with CI green.

Adds a typecheck job that sets up Node, installs from the lockfile with
npm ci, and runs npm run typecheck. It is a separate job rather than a
step on lifecycle-demo so the two run in parallel and a red check points
at the TypeScript instead of the Actions demo.

Note the Node setup goes here in the workflow, not in an action.yml —
that is what broke CI in #14 and led to the revert in #15.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011TCU2WiTisr1w6HPuWuAco
#19 refreshed CLAUDE.md while this branch was open, so its CI
description predates the typecheck job this branch adds. Update the
ci.yml layout entry to name both jobs, and note that CI runs typecheck
on every pull request.

Also records the one gotcha #19 doesn't cover, and the only one here
that has actually broken CI: the root "type": "module" applies to every
.js file in the repo, including Actions scripts the runner executes
directly with Node. That is the entire reason
.github/actions/lifecycle-demo/package.json exists — deleting it as an
apparently redundant two-line manifest breaks the JS action with an
error that only half explains itself.

Kept to main's existing bullet style rather than restructuring, since
#19 is merged and this branch should not relitigate it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011TCU2WiTisr1w6HPuWuAco
@ada33-arch
ada33-arch force-pushed the claude/agents-sdk-typescript-setup-wwe1a9 branch from 6a0a035 to 3e8ddcf Compare August 8, 2026 10:54
@ada33-arch ada33-arch changed the title Run typecheck in CI, and refresh CLAUDE.md Run typecheck in CI Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants