Skip to content

[NO-JIRA][nx][ci] Promote token-sync to its own backpack-token-sync Nx project; drop npx in CI#4537

Open
Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 1 commit into
mainfrom
gert-janvercauteren/token-sync-nx-project
Open

[NO-JIRA][nx][ci] Promote token-sync to its own backpack-token-sync Nx project; drop npx in CI#4537
Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 1 commit into
mainfrom
gert-janvercauteren/token-sync-nx-project

Conversation

@gert-janvercauteren
Copy link
Copy Markdown
Contributor

Summary

  • Move token-sync/libs/backpack-token-sync/ as a self-contained Nx project (workspace name bpk-token-sync, project name backpack-token-sync). Targets tokens-fetch / tokens-build-css / tokens-sync / lint / typecheck / test live in the project's project.json with scoped inputs and outputs. Root npm scripts (tokens:fetch etc.) become thin wrappers over nx run … so existing callers keep working. The sync-figma-variables workflow now invokes the project's nx targets directly.
  • Drop npx from CI to remove a supply-chain footgun. All workflows that already run npm ci now call ./node_modules/.bin/<bin> instead of npx, so binaries are resolved exclusively from the lockfile-pinned local install. _build.yml (4× nx affected …) and sync-figma-variables.yml (nx run backpack-token-sync:…) updated. sync-figma-code-connect.yml was the worst offender — it had no npm ci step at all and pulled @figma/code-connect fresh from the registry on every run; it now installs deps the standard way and uses the local figma binary.

Not addressed in this PR: release.yml still has npx @supernovaio/cli … in SupernovaPublish. That package isn't in our devDependencies and the job has no npm ci, so fixing it is a slightly larger change worth its own PR.

Validated locally: nx run backpack-token-sync:typecheck ✅, :lint ✅, :test (203 tests) ✅, npm run tokens:build-css ✅.

Test plan

  • nx run backpack-token-sync:typecheck
  • nx run backpack-token-sync:lint
  • nx run backpack-token-sync:test
  • npm run tokens:build-css (root alias still works)
  • CI: confirm _build.yml, sync-figma-variables.yml, and sync-figma-code-connect.yml all pass
  • Manually trigger Sync Figma variables workflow once after merge to confirm the renamed nx target runs end-to-end

🤖 Generated with Claude Code

…t; drop npx in CI

Move token-sync/ → libs/backpack-token-sync/ as a self-contained Nx
project (workspace name bpk-token-sync, project name backpack-token-sync).
Targets tokens-fetch / tokens-build-css / tokens-sync / lint / typecheck /
test live in the project's project.json with scoped inputs and outputs;
root npm scripts (tokens:fetch etc.) become thin wrappers over nx.

The sync-figma-variables GHA workflow now runs the project's nx targets
directly. While there, replace npx with ./node_modules/.bin/* across all
workflows that have npm ci available, so CI never resolves binaries from
the registry: _build.yml (nx affected build/lint/typecheck/test) and
sync-figma-code-connect.yml (which previously had no npm ci at all and
pulled @figma/code-connect fresh on every run — now installs via npm ci
and uses the local figma binary).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4537 to see this build running in a browser.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants