chore(packages): extract @nswds/prettier-config to its own repo#39
Merged
Conversation
Remove packages/eslint-config. It now lives at digitalnsw/nswds-eslint-config. The package could never be published from here: this repo is `"private": true` at the root and deliberately comments out @semantic-release/npm, so it releases a changelog and a GitHub release but never touches npm. That is why it sat at 0.0.0 with zero adopters while all 12 Next.js repos kept hand-maintaining their own eslint.config.mjs — the "single source of truth" had no way to reach a consumer. The new repo mirrors the nswds-tokens release setup: semantic-release with @semantic-release/npm, publishing via OIDC trusted publishing rather than a long-lived NPM_TOKEN, and a CI smoke test that lints a JSX file through the real ESLint API so the ESLint 10 getFilename regression cannot come back silently. Keeping the copy here would have let the two drift, and the stale one is the one people would find first via the docs. Update docs/config-single-source-of-truth.md: record the new home, note that adopting repos drop both their local config body and their @eslint/compat fixupConfigRules wrapper (the shim lives in the package now), and flag that @nswds/prettier-config is still here and still unpublishable for exactly the same reason.
Remove packages/prettier-config. It now lives at digitalnsw/nswds-prettier-config. With this, packages/ is empty and gone. Same reason as @nswds/eslint-config in the previous commit: this repo is `"private": true` at the root and comments out @semantic-release/npm, so it can never publish. The package sat at 0.0.0 with no adopters while repos kept copy-pasting a .prettierrc. publishConfig moves from restricted to public, matching @nswds/tokens and @nswds/eslint-config — restricted needs a paid npm org plan plus registry auth in every consumer's CI, which none of them have. Update docs/config-single-source-of-truth.md: record both new homes, collapse the two now-identical explanations into one, rewrite Phase 3 to describe the actual remaining work (one-time manual first publish, then trusted-publisher config, then per-repo migration), and resolve the stale "decide a licence before publishing" item — both repos ship ISC, matching what the packages already declared, though that differs from @nswds/tokens (MPL-2.0) and is worth a deliberate call.
There was a problem hiding this comment.
Pull request overview
Removes the in-repo @nswds/prettier-config package now that it has been extracted to its own public repository, and updates the “single source of truth” documentation to point consumers at the new homes for both shared config packages.
Changes:
- Deleted
packages/prettier-config(README,package.json, andindex.json) now that it lives indigitalnsw/nswds-prettier-config. - Updated
docs/config-single-source-of-truth.mdto reference the new repo locations and to revise Phase 3 rollout steps accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/prettier-config/README.md | Removed now that the package has been extracted to its own repository. |
| packages/prettier-config/package.json | Removed package manifest as part of extracting/deleting the in-repo package. |
| packages/prettier-config/index.json | Removed shared Prettier option JSON from this repo (now hosted externally). |
| docs/config-single-source-of-truth.md | Updated docs to reflect the new repo locations and revised migration steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Both extracted packages are now MPL-2.0, matching @nswds/tokens, so the whole @nswds/* scope is consistent. Replaces the note flagging the ISC mismatch as an open decision — it has been made and applied in both repos ahead of first publish, so no prior distribution under ISC needs reconciling.
Removing the "Enabling it needs: 1... 2..." block left item 3 behind. It does not render as a list at all: CommonMark only lets an ordered list interrupt a paragraph when it starts at 1, so with no blank line before it the `3.` was swallowed into the preceding paragraph as lazy continuation and rendered as a stray literal "3." mid-sentence (confirmed against GitHub's own markdown renderer). Its content was also stale — it asked for a licence decision and a LICENSE file, both of which now exist: the extracted repos are MPL-2.0 with the same LICENSE as nswds-tokens. So it is deleted rather than reformatted into a list. The trailing "Until then the packages are the reviewed source of truth but not installable" went with it. "Until then" pointed at that removed list, so it no longer had an antecedent, and the claim is false now that the packages live in their own repos.
Picks up the orphaned-fragment cleanup from the base branch and resolves the overlap in the Mechanism B section. Conflict resolution keeps this branch's text — both packages have moved out, so the base branch's "@nswds/prettier-config still lives in packages/" sentence is superseded — and drops the trailing "Until then the packages are the reviewed source of truth but not installable", which lost its antecedent when the enabling-requirements list was removed and is false now that neither package lives here. Also inserts the blank line before the MPL-2.0 paragraph. Without it that paragraph was lazily continued onto the preceding CI-test paragraph and the two rendered as one run-on block. The section now renders as four discrete paragraphs (verified against GitHub's markdown renderer).
`globalIgnores([...repo-specific])` parses, but the hyphen makes it a subtraction: it evaluates to `[...(repo - specific)]` and throws `TypeError: (repo - specific) is not iterable`. The leading `...` was doing double duty as both a spread and an "and your stuff here" ellipsis, and only the second reading works. Use `globalIgnores(['repo-specific/**'])` instead. It evaluates, and it shows the shape the API actually takes — an array of glob strings, as in the package README's `globalIgnores(['src/lib/blocks/generated.ts'])` — rather than a placeholder that reads like an identifier. The snippet predates this branch; only the Home column was added to that row here. Fixing it while the row is already being touched.
Picks up the usage-snippet fix from the base branch. Conflict was the two Mechanism B table rows: takes the corrected eslint-config snippet from the base, and keeps this branch's prettier-config row, whose Home column points at the new repo rather than `packages/` here.
#38 was squash-merged, so main gained a single commit that does not match the individual commits this branch already merged from that branch. Git could not reconcile the two histories and flagged the doc as conflicting once GitHub retargeted this PR from chore/extract-eslint-config to main. Both conflict hunks are the same shape: this branch holds the later state (both packages extracted, packages/ gone) and main holds #38's earlier snapshot (eslint extracted, prettier still in packages/). Resolved in favour of this branch throughout — it is a superset, since #38's content was merged here before the squash. Verified nothing from main was dropped: every line unique to main's copy is superseded eslint-only phrasing that this branch rewrites to cover both packages. Also re-checked that the earlier review fixes survived — the valid usage snippet, no orphaned list item, no dangling "Until then" sentence, both Home links, and four discrete paragraphs in Mechanism B.
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.
chore/extract-eslint-config, notmain. Both edit the same doc section, so stacking avoids a conflict. GitHub retargets tomainonce #38 merges. Merge #38 first.Removes
packages/prettier-config. It now lives at digitalnsw/nswds-prettier-config (public). With this,packages/is empty and gone.Why
Identical to #38: this repo is
"private": trueat the root and comments out@semantic-release/npm, so it can never publish. The package sat at0.0.0with no adopters while repos kept copy-pasting a.prettierrc.publishConfigmovesrestricted→public, matching@nswds/tokensand@nswds/eslint-config. Restricted needs a paid npm org plan plus registry auth in every consumer's CI — which none of them have.The new repo
Mirrors nswds-eslint-config: semantic-release +
@semantic-release/npm+ OIDC trusted publishing, noNPM_TOKEN.It ships a real test suite (4 tests, all passing) — the important one:
That is the failure mode a shared formatting config can least afford — silent, invisible, and it drifts every consumer apart. The others assert
singleQuote,semi: falseandjsxSingleQuoteactually format as intended.Docs
docs/config-single-source-of-truth.md:Licence
Both new repos are MPL-2.0, matching
@nswds/tokens, so the whole@nswds/*scope is consistent. They initially carriedISC— inherited from this repo's root rather than chosen for a published package — and were relicensed before either was published, so there is no prior distribution under ISC to reconcile. The doc records the settled outcome.(This paragraph previously said the repos ship ISC and that the licence was still an open decision. That was written before the relicense commit and is corrected here — the doc was already accurate.)
Still needed for either package to be usable
Neither is on npm yet. Each needs a one-time
npm publish --access public, then trusted-publisher config on npmjs.com. Nothing is blocked by these PRs — the 12 repos keep their local configs until they migrate.