Skip to content

Make scripts a workspace package so CI runs its tests - #306

Open
joei4cm wants to merge 2 commits into
CopilotKit:mainfrom
joei4cm:fix/267-scripts-workspace
Open

joei4cm wants to merge 2 commits into
CopilotKit:mainfrom
joei4cm:fix/267-scripts-workspace

Conversation

@joei4cm

@joei4cm joei4cm commented Dec 1, 2026

Copy link
Copy Markdown

What changed

  • Add scripts/ as a pnpm workspace package with its own Vitest and TypeScript tasks so Turbo and CI run the scripts tests and typecheck.
  • Declare the scripts' runtime and development dependencies in the package and update the lockfile.
  • Typecheck the scripts' tests and use generated Prisma delegate types instead of unsafe structural casts.
  • Import Linear mappings through the Outpost workspace package. A source export keeps the documented tsx command usable from a fresh checkout before shared/dist has been built.
  • Leave the shadow-mode behavior from Treat an unclear SHADOW_MODE as on, instead of posting for real #233 unchanged.

Validation

  • NODE_OPTIONS="--max-old-space-size=4096" pnpm exec turbo run typecheck --filter=@copilotkit/outpost-scripts --concurrency=2 — passed.
  • NODE_OPTIONS="--max-old-space-size=4096" pnpm exec turbo run test --filter=@copilotkit/outpost-scripts --concurrency=2 -- --maxWorkers=2 — 4 files, 64 tests passed.
  • Direct tsx startup smoke check with packages/outpost/shared/dist removed — passed module resolution and reached the expected missing-team-id usage message.
  • Prettier check, git diff --check, and code review — passed.

Refs #267

🤖 Generated with Claude Code

Co-Authored-By: Claude Code <noreply@anthropic.com>
@NathanTarbert

Copy link
Copy Markdown
Collaborator

Thanks @joei4cm, this is a really tidy piece of work. Swapping the structural casts for the generated Prisma delegate types makes import-linear.ts much easier to read, and keeping the documented tsx command working from a fresh checkout was a thoughtful touch.

There are two things I'd like to ask for before we merge.

The scripts tests now have two configs. The root vitest.config.ts still includes scripts/__tests__/**/*.test.ts, and the new scripts/vitest.config.ts covers the same files. If someone later adds setup files or an environment to one of them, the same tests will behave differently depending on where they're run from. Could you remove the scripts include from the root config, or the root file entirely if nothing else uses it? The root package.json also still lists @linear/sdk and tsx, which were only there for the scripts. Now that scripts/package.json declares them, could you drop them from the root as well?

The second is the new ./shared/source export in packages/outpost/package.json. It points at the raw .ts source, so it only works under tsx or vitest. Any package in the workspace can import it, though. An app that did would typecheck and build fine, then crash at startup under plain node. It also loads all of shared, including bcrypt, Octokit and the integrations, when the importer only needs the three Linear mapping helpers from sync. Could you narrow it to a ./shared/source/sync subpath pointing at shared/src/sync/index.ts, and add a short comment at the import in import-linear.ts saying the subpath is only for tsx and vitest?

A few older things in the importer came up while reading through it. None of them were introduced here, so I've put them in #307 rather than asking for them in this PR.

Remove the redundant root vitest config and root-only script dependencies. Limit the source export to the sync subpath and document that it is only for tsx and vitest.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@joei4cm

joei4cm commented Dec 2, 2026

Copy link
Copy Markdown
Author

Addressed both requests in f3f0998: removed the redundant root vitest.config.ts and root-only @linear/sdk/tsx devDependencies, and narrowed the source export to ./shared/source/sync with an import comment noting it is only for tsx/vitest. Validation: scripts Vitest 64/64 passed, scripts typecheck passed after building @copilotkit/outpost, Prettier and git diff --check passed.

@NathanTarbert

Copy link
Copy Markdown
Collaborator

Thanks @joei4cm, this looks good. The single vitest config and the narrowed subpath are exactly what I had in mind, and it's great to have the scripts tests running in CI.

There's one thing I'd like to ask for, and it comes from my own earlier request. With tsx gone from the root package.json, running npx tsx scripts/... from the repo root no longer finds a local copy. That's the command in scripts/cutover/README.md and in the usage text of both scripts, so npx will now fetch an unpinned tsx or fail. Could you add tsx back to the root devDependencies? @linear/sdk can stay where it is in scripts/package.json.

This branch has not been deployed

No deployments
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