@vwala/tooling-config 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,6 +13,8 @@ src/
13
13
  │ ├── action.yml
14
14
  │ ├── commitlint.config.js
15
15
  │ └── hooks/
16
+ ├── syncpack/ pnpm catalog policy (consumed via npm)
17
+ │ └── syncpack.config.json
16
18
  ├── typescript/ tsconfig presets (consumed via npm)
17
19
  │ ├── base.json
18
20
  │ ├── bundler.json
@@ -63,19 +65,99 @@ On top of Biome's `recommended` preset, four GritQL plugins enforce Vwala conven
63
65
 
64
66
  Each plugin file carries a header comment explaining the rule and linking to the governing reference in the [`vwala-conventions`](https://github.com/vwala-be/skills) skill. The plugins have tests in `src/biome/plugins/__tests__/` that drive the real Biome binary over fixture workspaces, so a rule that silently stops matching fails CI.
65
67
 
68
+ ### Naming
69
+
70
+ Two of Biome's own rules carry the naming convention, both at `warn`:
71
+
72
+ | Rule | Enforces |
73
+ | --- | --- |
74
+ | `useFilenamingConvention` | Filenames are kebab-case. Every dot-separated part counts, so `payment.service.ts`, `complete-invoice.command-handler.ts`, `invoice.types.ts` and `invoice.test.ts` all pass while `paymentService.ts` does not. |
75
+ | `useNamingConvention` | `camelCase` variables and functions, `PascalCase` types, classes, interfaces and components, `CONSTANT_CASE` for module-level constants. |
76
+
77
+ They are warnings because the convention applies to new code and asks that existing files be renamed only when meaningfully touched — a repository does not have to rename its way in. `useNamingConvention` deliberately does not check object literal or type properties: those keys are usually dictated by an external payload rather than chosen. `strictCase` is off, so `HTTPServer` is accepted alongside `HttpServer`.
78
+
79
+ `check-naming` (see [Convention checks](#convention-checks)) supplies the two halves the rules cannot express — folder names, which Biome never sees, and an error for files **added since the base ref**, which no static severity can express. Existing offenders are printed as warnings and leave the exit code at 0; a new file or a new folder that breaks the convention exits 1. The base ref defaults to `origin/main` — set `NAMING_BASE_REF` for a differently named default branch, and note that a shallow CI clone that cannot resolve it degrades the check to warnings only, so fetch enough history for `git merge-base` to work.
80
+
81
+ `__tests__`, `__mocks__`, `_scripts`, hidden folders, and the `[slug]` / `(group)` / `@slot` segments Next.js and Expo give meaning to are exempt from the folder check.
82
+
66
83
  ### Test layout boundaries
67
84
 
68
- `use-tests-folder-location` can only check syntax — a GritQL plugin cannot see its own file path. The path-level halves of that convention (no `tests/` folder, no non-test files in `__tests__/`, no production code importing test code) live in a script you run yourself:
85
+ `use-tests-folder-location` can only check syntax — a GritQL plugin cannot see its own file path. The path-level halves of that convention — no `tests/` folder, no non-test files in `__tests__/`, no production code importing test code — are the second of the [convention checks](#convention-checks).
86
+
87
+ ### Convention checks
88
+
89
+ Some conventions are about paths rather than syntax, and Biome reasons about syntax. Those live in scripts, behind one entry point:
69
90
 
70
91
  ```jsonc
71
92
  {
72
93
  "scripts": {
73
- "check-test-boundaries": "node node_modules/@vwala/tooling-config/src/biome/plugins/_scripts/check-test-layout.mjs"
94
+ "check-conventions": "node node_modules/@vwala/tooling-config/src/_scripts/check-conventions.mjs"
74
95
  }
75
96
  }
76
97
  ```
77
98
 
78
- It reads tracked files from `git ls-files`, so run it from the repository root.
99
+ | Check | Enforces |
100
+ | --- | --- |
101
+ | `naming` | Folders are kebab-case, and a file added since the base ref is named kebab-case — the error half of the [naming](#naming) rules. |
102
+ | `test layout` | The path-level halves of [test layout boundaries](#test-layout-boundaries). |
103
+
104
+ Wire that single script into your own preflight and new checks arrive with an upgrade, rather than as another `&&` you have to add by hand. It runs every check even after one fails — a bad filename and a misplaced test are independent problems, and seeing both in one run beats fixing one to discover the other. Each check is still a standalone script under `src/**/_scripts/` if you want to run one on its own.
105
+
106
+ Every check reads the repository through `git`, so run this from the repository root — and in CI, from a checkout deep enough for `git merge-base` to reach the default branch. With `actions/checkout` that means `fetch-depth: 0`; on a shallow clone the naming check cannot tell a new file from an old one and silently reports everything as a warning.
107
+
108
+ ---
109
+
110
+ ## pnpm catalog
111
+
112
+ Every external dependency in a pnpm workspace must be declared once in the `pnpm-workspace.yaml` catalog and referenced everywhere as `catalog:`.
113
+
114
+ The rule exists because of a specific failure. `next-intl` was declared as `^4.13.2` in three apps; an install re-resolved it to `4.13.4`, which brought `use-intl@4.13.4` with it, while `platform-i18n` and `app-mobile` still pinned `use-intl@4.13.2`. Two copies of `use-intl` in the tree, and type errors that pointed everywhere except the actual cause. Nothing looked inconsistent beforehand — every declaration read `^4.13.2`. The drift arrived with a resolution, not with an edit, which is why the rule is unconditional: **a dependency used by only one package is still cataloged**, because the second use is exactly what nobody notices adding.
115
+
116
+ ```bash
117
+ pnpm add -Dw syncpack
118
+ ```
119
+
120
+ ```jsonc
121
+ {
122
+ "scripts": {
123
+ "check-catalog": "syncpack lint --config ./node_modules/@vwala/tooling-config/src/syncpack/syncpack.config.json"
124
+ }
125
+ }
126
+ ```
127
+
128
+ Run it from the repository root, and add it to the repo's `isEverythingOk`.
129
+
130
+ Syncpack has no `extends`, so this cannot be wired the way `biome.json` is — unknown top-level keys are a hard error, not a warning. If a repo needs to override something, spread the config from a `.syncpackrc.mjs` instead:
131
+
132
+ ```js
133
+ import base from "@vwala/tooling-config/syncpack" with { type: "json" };
134
+
135
+ export default { ...base };
136
+ ```
137
+
138
+ That spread is shallow: replacing `versionGroups` replaces all of them, including the exemptions the config depends on. Read the comments in `syncpack.config.json` before overriding it.
139
+
140
+ ### What is in scope
141
+
142
+ `dependencies`, `devDependencies` and `optionalDependencies`, in every workspace package **and in the root manifest** — root dependencies install a real copy too, so a root `typescript@^5.7` alongside a package's `typescript@^5.9` is the same bug in the tooling layer.
143
+
144
+ `peerDependencies` are deliberately excluded. A peer range is a compatibility statement, intentionally wide; collapsing `>=18` to `catalog:` would pin a published package to one version of its own peer. The devDependency that actually installs the copy is in scope, so nothing is lost.
145
+
146
+ `workspace:`, `link:` and `file:` specifiers are exempt — all three resolve relative to the declaring package, so there is nothing for a central catalog to hold.
147
+
148
+ ### Migrating
149
+
150
+ `syncpack fix` rewrites specifiers to `catalog:` and writes the entries into `pnpm-workspace.yaml`, preserving comments and key order.
151
+
152
+ > **It picks the winner for you.** Where two packages disagree, `fix` takes the highest range and says so only in passing. That is usually right and occasionally an unannounced major bump, so resolve the genuine disagreements by hand first, then let `fix` do the mechanical rest. Re-run `pnpm install` and typecheck afterwards.
153
+
154
+ When two packages genuinely need different versions, use a [named catalog](https://pnpm.io/catalogs) (`catalog:react18`) rather than a literal range. Note that once more than one catalog exists, every dependency must live in exactly one of them — syncpack reports anything ambiguous as an unfixable error.
155
+
156
+ ### Stopping drift at the source
157
+
158
+ Set `catalogMode: strict` in `pnpm-workspace.yaml` (pnpm >= 10.12) so `pnpm add` writes catalog entries instead of literal ranges.
159
+
160
+ > **That is not a substitute for the CI check.** `catalogMode` applies only when `pnpm add` runs. It does not re-validate existing manifests on install, so a hand-edited `package.json` or a bad merge passes straight through. The two are complementary: `catalogMode` prevents most drift, `syncpack lint` catches the rest.
79
161
 
80
162
  ---
81
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vwala/tooling-config",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "description": "Shared tooling configuration for Vwala repositories",
6
6
  "license": "UNLICENSED",
@@ -19,6 +19,7 @@
19
19
  "exports": {
20
20
  "./biome": "./src/biome/biome.config.json",
21
21
  "./commitlint": "./src/commitlint/commitlint.config.js",
22
+ "./syncpack": "./src/syncpack/syncpack.config.json",
22
23
  "./typescript/base": "./src/typescript/base.json",
23
24
  "./typescript/bundler": "./src/typescript/bundler.json",
24
25
  "./typescript/node": "./src/typescript/node.json",
@@ -34,9 +35,10 @@
34
35
  "format": "biome check --write .",
35
36
  "typecheck": "tsc --noEmit",
36
37
  "test": "vitest run",
38
+ "check-conventions": "node src/_scripts/check-conventions.mjs",
37
39
  "commit": "cz",
38
40
  "prepare": "husky && node src/commitlint/_scripts/install-hooks.mjs",
39
- "isEverythingOk": "biome ci . && tsc --noEmit && vitest run"
41
+ "isEverythingOk": "biome ci . && tsc --noEmit && vitest run && node src/_scripts/check-conventions.mjs"
40
42
  },
41
43
  "config": {
42
44
  "commitizen": {
@@ -58,12 +60,14 @@
58
60
  "cz-emoji-conventional": "^1.2.1",
59
61
  "husky": "^9.1.7",
60
62
  "lint-staged": "^17.0.8",
63
+ "syncpack": "^15.3.2",
61
64
  "typescript": "^7.0.2",
62
65
  "vitest": "^4.1.10"
63
66
  },
64
67
  "peerDependencies": {
65
68
  "@biomejs/biome": ">=2.5.0",
66
69
  "@commitlint/cli": ">=19",
70
+ "syncpack": ">=15.0.0",
67
71
  "typescript": ">=5.7.0"
68
72
  },
69
73
  "peerDependenciesMeta": {
@@ -73,6 +77,9 @@
73
77
  "@commitlint/cli": {
74
78
  "optional": true
75
79
  },
80
+ "syncpack": {
81
+ "optional": true
82
+ },
76
83
  "typescript": {
77
84
  "optional": true
78
85
  }
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * One entry point for every convention check that is a script rather than a
4
+ * Biome rule — so a repository wires up `check-conventions` once and keeps
5
+ * getting new checks as they ship, instead of growing another `&&` in
6
+ * `isEverythingOk` each time one is added.
7
+ *
8
+ * Unlike the `&&` chain it replaces, this runs every check even after one
9
+ * fails. A failing name and a misplaced test are independent problems, and
10
+ * seeing both in one run beats fixing one to discover the other.
11
+ *
12
+ * Each check stays runnable on its own — they are separate scripts with their
13
+ * own tests, and this only sequences them.
14
+ */
15
+ import { spawnSync } from "node:child_process";
16
+ import path from "node:path";
17
+ import { fileURLToPath } from "node:url";
18
+
19
+ // `src/` — the checks are addressed from there rather than relative to this
20
+ // file, so moving a check does not mean counting `..` hops.
21
+ const sourceRoot = path.resolve(
22
+ path.dirname(fileURLToPath(import.meta.url)),
23
+ "..",
24
+ );
25
+
26
+ const CHECKS = [
27
+ { name: "naming", script: "biome/_scripts/check-naming.mjs" },
28
+ {
29
+ name: "test layout",
30
+ script: "biome/plugins/_scripts/check-test-layout.mjs",
31
+ },
32
+ ];
33
+
34
+ const failed = [];
35
+
36
+ for (const check of CHECKS) {
37
+ console.log(`\n▸ ${check.name}`);
38
+ // The checks read the repository through git, so they inherit this process's
39
+ // working directory — which is why every one of them has to be run from the
40
+ // repository root.
41
+ const { status } = spawnSync(
42
+ process.execPath,
43
+ [path.join(sourceRoot, check.script)],
44
+ { stdio: "inherit" },
45
+ );
46
+ if (status !== 0) {
47
+ failed.push(check.name);
48
+ }
49
+ }
50
+
51
+ if (failed.length > 0) {
52
+ console.error(
53
+ `\n ✖ ${failed.length} of ${CHECKS.length} convention checks failed: ${failed.join(", ")}\n`,
54
+ );
55
+ process.exit(1);
56
+ }
57
+
58
+ console.log(`\n ✔ ${CHECKS.length} convention checks passed\n`);
@@ -0,0 +1,153 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The two halves of the naming convention that Biome's `useFilenamingConvention`
4
+ * rule cannot express.
5
+ *
6
+ * 1. Folders. Biome only ever sees a filename, never the directories above it,
7
+ * so `SomeFolder/invoice.ts` passes the rule untouched.
8
+ * 2. Severity by age. The convention applies to new code and asks that existing
9
+ * files be renamed only when meaningfully touched, so the shared config sets
10
+ * the rule to `warn`. A Biome severity is fixed per glob and cannot depend on
11
+ * git history — this script supplies the other half, failing only on files
12
+ * added since the base ref. Existing offenders are printed as warnings and do
13
+ * not affect the exit code.
14
+ *
15
+ * Filenames are re-checked here rather than left to Biome, because the rule's
16
+ * warning never fails a build; a file added in this branch has to be an error
17
+ * somewhere, and this is that somewhere. Expect a new badly-named file to be
18
+ * reported twice — once by `biome ci` as a warning, once here as an error.
19
+ *
20
+ * Wire this into a repository's own check script and run it from the repository
21
+ * root. Set NAMING_BASE_REF when the default branch is not `origin/main`; when
22
+ * the base ref cannot be resolved at all (a shallow CI clone, a fresh repo with
23
+ * no remote) nothing counts as new and the script degrades to warnings only.
24
+ *
25
+ * See: .agents/skills/vwala-conventions/references/typescript-naming.md
26
+ */
27
+ import { execFileSync } from "node:child_process";
28
+
29
+ const BASE_REF = process.env.NAMING_BASE_REF ?? "origin/main";
30
+ const IGNORED_PREFIXES = [".agents/", ".claude/", ".husky/"];
31
+ const SOURCE_FILE = /\.[cm]?[jt]sx?$/;
32
+ const KEBAB_CASE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
33
+ // Folder names that are a convention in their own right rather than a name:
34
+ // the test and story folders, the `_scripts` prefix this package uses for
35
+ // runnable helpers, anything hidden, and the bracket/paren/@ segments that
36
+ // Next.js and Expo routing give meaning to.
37
+ const RESERVED_FOLDER = /^(__[a-z]+__|_[a-z-]+|\..+|\[.+\]|\(.+\)|@.+|\+.+)$/;
38
+
39
+ const trackedFiles = git(["ls-files"]);
40
+ const untrackedFiles = git(["ls-files", "--others", "--exclude-standard"]);
41
+ const files = [...trackedFiles, ...untrackedFiles].filter(
42
+ (file) => !IGNORED_PREFIXES.some((prefix) => file.startsWith(prefix)),
43
+ );
44
+ const newFiles = new Set([...untrackedFiles, ...addedSinceBaseRef()]);
45
+
46
+ const errors = [];
47
+ const warnings = [];
48
+
49
+ /**
50
+ * A folder is reported once, not once per file inside it, and counts as new
51
+ * only when every file under it is new — a rename of a long-standing folder
52
+ * would otherwise read as an error the moment one file is added to it.
53
+ */
54
+ const folders = new Map();
55
+ for (const file of files) {
56
+ const segments = file.split("/");
57
+ for (const [index, segment] of segments.slice(0, -1).entries()) {
58
+ const folder = segments.slice(0, index + 1).join("/");
59
+ const existing = folders.get(folder);
60
+ folders.set(folder, {
61
+ segment,
62
+ isNew: (existing?.isNew ?? true) && newFiles.has(file),
63
+ });
64
+ }
65
+ }
66
+
67
+ for (const [folder, { segment, isNew }] of folders) {
68
+ if (!KEBAB_CASE.test(segment) && !RESERVED_FOLDER.test(segment)) {
69
+ report({
70
+ isNew,
71
+ violation: `${folder}/\n Folder "${segment}" is not kebab-case.`,
72
+ });
73
+ }
74
+ }
75
+
76
+ for (const file of files) {
77
+ if (!SOURCE_FILE.test(file)) {
78
+ continue;
79
+ }
80
+ // `payment.service.ts` is a name plus two extensions; the convention allows a
81
+ // dot-separated responsibility suffix, so every part has to be kebab-case
82
+ // rather than just the part before the first dot.
83
+ const parts = basename(file).split(".");
84
+ const offending = parts.find((part) => !KEBAB_CASE.test(part));
85
+ if (offending !== undefined) {
86
+ report({
87
+ isNew: newFiles.has(file),
88
+ violation: `${file}\n "${offending}" is not kebab-case. Name the file after its primary export: \`PaymentService\` → \`payment.service.ts\`.`,
89
+ });
90
+ }
91
+ }
92
+
93
+ if (warnings.length > 0) {
94
+ console.warn(
95
+ `\n ! ${warnings.length} naming violation(s) in existing files — rename when you next touch them:\n`,
96
+ );
97
+ for (const warning of warnings) {
98
+ console.warn(` ${warning}\n`);
99
+ }
100
+ }
101
+
102
+ if (errors.length > 0) {
103
+ console.error(`\n ✖ ${errors.length} naming violation(s) in new files:\n`);
104
+ for (const error of errors) {
105
+ console.error(` ${error}\n`);
106
+ }
107
+ process.exit(1);
108
+ }
109
+
110
+ console.log(" ✔ no naming violations in new files");
111
+
112
+ function report({ isNew, violation }) {
113
+ if (isNew) {
114
+ errors.push(violation);
115
+ } else {
116
+ warnings.push(violation);
117
+ }
118
+ }
119
+
120
+ function basename(file) {
121
+ const segments = file.split("/");
122
+ return segments[segments.length - 1];
123
+ }
124
+
125
+ /**
126
+ * Diffs the merge base against the working tree rather than against HEAD, so
127
+ * files added but not yet committed are held to the same standard as the ones
128
+ * already on the branch.
129
+ */
130
+ function addedSinceBaseRef() {
131
+ let mergeBase;
132
+ try {
133
+ mergeBase = execFileSync("git", ["merge-base", BASE_REF, "HEAD"], {
134
+ encoding: "utf8",
135
+ stdio: ["ignore", "pipe", "ignore"],
136
+ }).trim();
137
+ } catch {
138
+ console.warn(
139
+ ` ! Cannot resolve ${BASE_REF} — reporting every violation as a warning.`,
140
+ );
141
+ return [];
142
+ }
143
+ return git(["diff", "--diff-filter=A", "--name-only", mergeBase]);
144
+ }
145
+
146
+ function git(args) {
147
+ return execFileSync("git", args, {
148
+ encoding: "utf8",
149
+ maxBuffer: 1024 * 1024 * 64,
150
+ })
151
+ .split("\n")
152
+ .filter(Boolean);
153
+ }
@@ -124,7 +124,29 @@
124
124
  }
125
125
  }
126
126
  },
127
- "useBlockStatements": "warn"
127
+ "useBlockStatements": "warn",
128
+ "useFilenamingConvention": {
129
+ "level": "warn",
130
+ "options": {
131
+ "filenameCases": ["kebab-case"],
132
+ "requireAscii": true,
133
+ "strictCase": false
134
+ }
135
+ },
136
+ "useNamingConvention": {
137
+ "level": "warn",
138
+ "options": {
139
+ "conventions": [
140
+ {
141
+ "match": ".*",
142
+ "selector": { "kind": "objectLiteralProperty" }
143
+ },
144
+ { "match": ".*", "selector": { "kind": "typeProperty" } }
145
+ ],
146
+ "requireAscii": true,
147
+ "strictCase": false
148
+ }
149
+ }
128
150
  },
129
151
  "suspicious": {
130
152
  "noArrayIndexKey": "warn",
@@ -17,8 +17,10 @@
17
17
  * point rather than a leak:
18
18
  * - Storybook apps, whose whole job is rendering real fixtures, and whose
19
19
  * story helpers are not always named `*.stories.tsx`;
20
- * - `testSupport.ts` barrels, which re-export a package's own
21
- * `test-support/` through a published `"./test-support"` export.
20
+ * - `test-support.ts` barrels, which re-export a package's own
21
+ * `test-support/` through a published `"./test-support"` export. The
22
+ * camelCase spelling is still accepted, because the kebab-case filename
23
+ * rule only reaches code written since it shipped.
22
24
  *
23
25
  * See: .agents/skills/vwala-conventions/references/test-style.md
24
26
  */
@@ -29,7 +31,7 @@ const TEST_FILE = /\.test\.[cm]?[jt]sx?$/;
29
31
  // Matches any Storybook app rather than one repository's name for it.
30
32
  const STORY_FILE =
31
33
  /(\.stories\.[jt]sx?$|\/__stories__\/|^apps\/[^/]*storybook[^/]*\/)/;
32
- const TEST_SUPPORT_BARREL = /(^|\/)testSupport\.[cm]?ts$/;
34
+ const TEST_SUPPORT_BARREL = /(^|\/)(test-support|testSupport)\.[cm]?ts$/;
33
35
 
34
36
  const files = execFileSync("git", ["ls-files"], {
35
37
  encoding: "utf8",
@@ -5,6 +5,10 @@
5
5
  // shape and is not matched, and template-literal titles are skipped because the
6
6
  // interpolated text is not visible to the regex.
7
7
  //
8
+ // `$...` after the title absorbs the callback and any trailing timeout, so
9
+ // `test(title, fn)` and `test(title, fn, timeout)` are both visible. Matching
10
+ // exactly two arguments left the three-argument form unchecked.
11
+ //
8
12
  // This matches `test(...)` only, not `it(...)` — which is why the
9
13
  // `useConsistentTestIt` rule in biome.json has to stay on. Turn that off and a
10
14
  // title reverted to `it()` becomes invisible here.
@@ -13,7 +17,7 @@
13
17
  // makes Biome reformat the line to single quotes, which fails `biome ci`.
14
18
  //
15
19
  // See: .agents/skills/vwala-conventions/references/test-style.md
16
- `test($title, $body)` as $node where {
20
+ `test($title, $...)` as $node where {
17
21
  $title <: r"(?s)\"[^\"]*\"",
18
22
  $title <: not r"(?s).*GIVEN.*WHEN.*THEN.*",
19
23
  register_diagnostic(span=$title, message="Name the test GIVEN … WHEN … THEN … so the failure describes the scenario.", severity="error")
@@ -0,0 +1,33 @@
1
+ {
2
+ "// rule": "Every external dependency must be declared in the pnpm-workspace.yaml catalog and referenced as `catalog:`. Two declarations of the same package re-resolve independently, which is how a second copy lands in the tree even when the ranges look identical today.",
3
+ "// source": "No `source` key on purpose. Syncpack discovers packages from pnpm-workspace.yaml `packages:` and then appends the root package.json. Setting `source` (default sourceMode `replace`) replaces discovery and silently drops the root manifest, whose dependencies install a real copy too. Override with `sourceMode: extend` if you must.",
4
+ "// peers": "peerDependencies are out of scope. A peer range is a deliberately wide compatibility statement; collapsing it to `catalog:` would pin a published package to one version of its own peer. The devDependency that actually installs the copy is in scope.",
5
+ "// customTypes": "optionalDependencies is not one of syncpack's built-in dependency types (dev, local, overrides, peer, pnpmOverrides, prod, resolutions). Without the custom type below, the string \"optional\" passes schema validation and silently matches nothing. Never add a `//` comment key inside `customTypes` itself — it is parsed as a custom type, fails to deserialise, and syncpack falls back to its default version group without reporting an error.",
6
+ "customTypes": {
7
+ "optional": {
8
+ "strategy": "versionsByName",
9
+ "path": "optionalDependencies"
10
+ }
11
+ },
12
+ "versionGroups": [
13
+ {
14
+ "// order": "Must stay first. Version groups are first-match-wins, and `policy: catalog` does not exempt these itself — syncpack only refuses to catalog a package's own `version` field. Without this group, `syncpack fix` rewrites workspace:, link: and file: specifiers to `catalog:`, which breaks them: all three resolve relative to the declaring package.",
15
+ "// types": "`link` is a real specifier type at runtime but is missing from the JSON schema's enum, so editors will not suggest it. Verified against syncpack 15.3.2.",
16
+ "label": "Locally-resolved specifiers cannot be centralised in a catalog",
17
+ "dependencyTypes": ["prod", "dev", "optional"],
18
+ "specifierTypes": ["workspace-protocol", "file", "link"],
19
+ "isIgnored": true
20
+ },
21
+ {
22
+ "// scope": "Registry ranges, tags, npm: aliases, git refs and tarball URLs all stay in scope — each is a globally resolvable identifier a catalog can legitimately centralise.",
23
+ "label": "Every external dependency comes from the pnpm catalog",
24
+ "dependencyTypes": ["prod", "dev", "optional"],
25
+ "policy": "catalog"
26
+ },
27
+ {
28
+ "// order": "Must stay last, and must exist. Anything no explicit group claims falls into syncpack's built-in \"Default Version Group\", which enforces highest-semver agreement across packages — a second, unrelated rule this config does not intend to impose. Without this group, peerDependencies, overrides and resolutions are all quietly linted for version agreement.",
29
+ "label": "Everything else is outside the scope of this config",
30
+ "isIgnored": true
31
+ }
32
+ ]
33
+ }