Skip to content

Collect repo automation under toolchain/ - #54

Merged
sistrall merged 1 commit into
mainfrom
chore/collect-repo-automation-under-toolchain
Aug 28, 2026
Merged

Collect repo automation under toolchain/#54
sistrall merged 1 commit into
mainfrom
chore/collect-repo-automation-under-toolchain

Conversation

@sistrall

@sistrall sistrall commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

bin/publish.mjs and generate/ both move into toolchain/.

Why

They are the same kind of thing: scripts that act on this repo, rather than code we ship. They already call each other — publish.mjs runs setClientVersion.ts, and writeChangeset.ts exists only to feed a release — but nothing in the layout showed that.

bin/ was also a weak name for them. In several of our repos it holds files the package manager generates, mixed in with scripts we wrote, so the name does not tell you which is which. toolchain/ says what the folder is for.

We plan to keep replacing third-party tooling with our own scripts, so it is worth having a name for this before the pile grows.

The one real change

reExportEverything.ts locates files relative to its own path, because the build runs it from a package directory. One level deeper meant three paths needed an extra hop:

const repoRoot = path.resolve(__dirname, '../..');   // was '..'
`../../packages/${targetPackage}/src/index.ts`        // was '../packages/…'
'../../packages/cma-client/dist/types'                // was '../packages/…'

Everything else resolves paths from the working directory and did not change. All 14 files are recorded as renames, so git blame still works.

Checks

  • npm run build: 9/9. Then forced a rebuild of the two packages that run reExportEverything.ts — the output was byte-identical, so the new paths point at the same files.
  • setClientVersion.ts and writeChangeset.ts: ran, same results as before.
  • npm run lint: clean.
  • node toolchain/publish.mjs: loads, finds the repo root, stops at the branch check as designed.

Not run: npm test (hits the real API, CI covers it) and npm run generate (needs the schema over the network).

No changeset — nothing we publish behaves differently.

Open question

jest-helpers/ stayed where it is. It is test fixture code that jest imports, not a script that does something to the repo. Easy to move if you would rather the rule be "everything that is not packages/".

@sistrall
sistrall force-pushed the chore/collect-repo-automation-under-toolchain branch from 6b1d75e to 14d3c62 Compare August 28, 2026 08:03
@sistrall
sistrall merged commit 29774fc into main Aug 28, 2026
2 checks passed
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.

1 participant