@oddessentials/repo-standards 5.3.0 → 6.0.1

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
@@ -1,6 +1,14 @@
1
1
  [![npm version](https://img.shields.io/npm/v/@oddessentials/repo-standards.svg)](https://www.npmjs.com/package/@oddessentials/repo-standards)
2
+ [![npm downloads](https://img.shields.io/npm/dm/@oddessentials/repo-standards.svg)](https://www.npmjs.com/package/@oddessentials/repo-standards)
2
3
  [![CI](https://github.com/oddessentials/repo-standards/actions/workflows/ci.yml/badge.svg)](https://github.com/oddessentials/repo-standards/actions/workflows/ci.yml)
4
+ [![Release](https://github.com/oddessentials/repo-standards/actions/workflows/release.yml/badge.svg)](https://github.com/oddessentials/repo-standards/actions/workflows/release.yml)
5
+ [![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
6
+ [![semantic-release](https://img.shields.io/badge/semantic--release-%E2%9C%93-brightgreen?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
7
+ [![semantic-release](https://img.shields.io/badge/semantic--release-24-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
8
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
3
9
  [![license](https://img.shields.io/npm/l/@oddessentials/repo-standards.svg)](LICENSE)
10
+ [![node](https://img.shields.io/node/v/@oddessentials/repo-standards.svg)](https://nodejs.org)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](https://www.typescriptlang.org/)
4
12
 
5
13
  # 🐝 Repository Standards & CI Checklist
6
14
 
@@ -68,7 +76,7 @@ The master spec includes a `meta` block that defines system-wide expectations:
68
76
 
69
77
  ## Structure of `config/standards.json`
70
78
 
71
- - `version` — schema version (currently `5`)
79
+ - `version` — schema version (currently `6`)
72
80
  - `meta` — global rules and migration policy
73
81
  - `ciSystems` — supported CI platforms
74
82
  _(currently `github-actions`, `azure-devops`)_
@@ -105,6 +113,7 @@ The `version` field indicates schema compatibility:
105
113
  - `3` — Expands release, build determinism, and provenance/CI automation requirements; adds unified release workflow and template automation guidance.
106
114
  - `4` — Stable API contract with `getStandards()`, `getSchema()`, `STANDARDS_VERSION` exports; Node 22 LTS alignment.
107
115
  - `5` — Adds automated version-guard guidance for repositories using semantic-release; schema aligned to package major version 5.
116
+ - `6` — Schema version aligned to package major version 6; introduces automated pre-test version sync.
108
117
 
109
118
  To keep `config/standards.json` in sync with semantic-release major bumps, use
110
119
  `scripts/sync-standards-version.cjs` during the semantic-release prepare step
@@ -1250,5 +1250,5 @@
1250
1250
  },
1251
1251
  "stack": "csharp-dotnet",
1252
1252
  "stackLabel": "C# / .NET",
1253
- "version": 5
1253
+ "version": 6
1254
1254
  }
@@ -1250,5 +1250,5 @@
1250
1250
  },
1251
1251
  "stack": "csharp-dotnet",
1252
1252
  "stackLabel": "C# / .NET",
1253
- "version": 5
1253
+ "version": 6
1254
1254
  }
@@ -1402,5 +1402,5 @@
1402
1402
  },
1403
1403
  "stack": "csharp-dotnet",
1404
1404
  "stackLabel": "C# / .NET",
1405
- "version": 5
1405
+ "version": 6
1406
1406
  }
@@ -1233,5 +1233,5 @@
1233
1233
  },
1234
1234
  "stack": "go",
1235
1235
  "stackLabel": "Go",
1236
- "version": 5
1236
+ "version": 6
1237
1237
  }
@@ -1233,5 +1233,5 @@
1233
1233
  },
1234
1234
  "stack": "go",
1235
1235
  "stackLabel": "Go",
1236
- "version": 5
1236
+ "version": 6
1237
1237
  }
@@ -1385,5 +1385,5 @@
1385
1385
  },
1386
1386
  "stack": "go",
1387
1387
  "stackLabel": "Go",
1388
- "version": 5
1388
+ "version": 6
1389
1389
  }
@@ -129,7 +129,7 @@
129
129
  "description": "Verify no CRLF in shell/script files",
130
130
  "expectExitCode": 0
131
131
  },
132
- "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false.",
132
+ "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false and core.safecrlf=warn (safecrlf=true blocks normalization with fatal errors).",
133
133
  "optionalFiles": [
134
134
  ".editorconfig"
135
135
  ],
@@ -4706,5 +4706,5 @@
4706
4706
  "languageFamily": "js"
4707
4707
  }
4708
4708
  },
4709
- "version": 5
4709
+ "version": 6
4710
4710
  }
@@ -1287,5 +1287,5 @@
1287
1287
  },
1288
1288
  "stack": "python",
1289
1289
  "stackLabel": "Python",
1290
- "version": 5
1290
+ "version": 6
1291
1291
  }
@@ -1287,5 +1287,5 @@
1287
1287
  },
1288
1288
  "stack": "python",
1289
1289
  "stackLabel": "Python",
1290
- "version": 5
1290
+ "version": 6
1291
1291
  }
@@ -1439,5 +1439,5 @@
1439
1439
  },
1440
1440
  "stack": "python",
1441
1441
  "stackLabel": "Python",
1442
- "version": 5
1442
+ "version": 6
1443
1443
  }
@@ -1246,5 +1246,5 @@
1246
1246
  },
1247
1247
  "stack": "rust",
1248
1248
  "stackLabel": "Rust",
1249
- "version": 5
1249
+ "version": 6
1250
1250
  }
@@ -1246,5 +1246,5 @@
1246
1246
  },
1247
1247
  "stack": "rust",
1248
1248
  "stackLabel": "Rust",
1249
- "version": 5
1249
+ "version": 6
1250
1250
  }
@@ -1398,5 +1398,5 @@
1398
1398
  },
1399
1399
  "stack": "rust",
1400
1400
  "stackLabel": "Rust",
1401
- "version": 5
1401
+ "version": 6
1402
1402
  }
@@ -24,7 +24,7 @@
24
24
  "description": "Verify no CRLF in shell/script files",
25
25
  "expectExitCode": 0
26
26
  },
27
- "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false.",
27
+ "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false and core.safecrlf=warn (safecrlf=true blocks normalization with fatal errors).",
28
28
  "optionalFiles": [
29
29
  ".editorconfig"
30
30
  ],
@@ -1306,5 +1306,5 @@
1306
1306
  },
1307
1307
  "stack": "typescript-js",
1308
1308
  "stackLabel": "TypeScript / JavaScript",
1309
- "version": 5
1309
+ "version": 6
1310
1310
  }
@@ -24,7 +24,7 @@
24
24
  "description": "Verify no CRLF in shell/script files",
25
25
  "expectExitCode": 0
26
26
  },
27
- "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false.",
27
+ "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false and core.safecrlf=warn (safecrlf=true blocks normalization with fatal errors).",
28
28
  "optionalFiles": [
29
29
  ".editorconfig"
30
30
  ],
@@ -1306,5 +1306,5 @@
1306
1306
  },
1307
1307
  "stack": "typescript-js",
1308
1308
  "stackLabel": "TypeScript / JavaScript",
1309
- "version": 5
1309
+ "version": 6
1310
1310
  }
@@ -28,7 +28,7 @@
28
28
  "description": "Verify no CRLF in shell/script files",
29
29
  "expectExitCode": 0
30
30
  },
31
- "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false.",
31
+ "notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false and core.safecrlf=warn (safecrlf=true blocks normalization with fatal errors).",
32
32
  "optionalFiles": [
33
33
  ".editorconfig"
34
34
  ],
@@ -1458,5 +1458,5 @@
1458
1458
  },
1459
1459
  "stack": "typescript-js",
1460
1460
  "stackLabel": "TypeScript / JavaScript",
1461
- "version": 5
1461
+ "version": 6
1462
1462
  }
package/dist/index.cjs CHANGED
@@ -41,8 +41,8 @@ var import_node_fs = require("fs");
41
41
  var import_node_path = require("path");
42
42
 
43
43
  // src/version.ts
44
- var STANDARDS_VERSION = "5.2.0";
45
- var STANDARDS_SCHEMA_VERSION = 5;
44
+ var STANDARDS_VERSION = "6.0.0";
45
+ var STANDARDS_SCHEMA_VERSION = 6;
46
46
 
47
47
  // src/index.ts
48
48
  var __filename2 = (0, import_node_url.fileURLToPath)(importMetaUrl);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../node_modules/tsup/assets/cjs_shims.js","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '5.2.0';\nexport const STANDARDS_SCHEMA_VERSION = 5;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;;;ADZ9D,sBAA8B;AAC9B,qBAA6B;AAC7B,uBAA8B;;;AEOvB,IAAM,oBAAoB;AAC1B,IAAM,2BAA2B;;;AFQxC,IAAMA,kBAAa,+BAAc,aAAe;AAChD,IAAM,gBAAY,0BAAQA,WAAU;AAKpC,IAAM,YAAY,UAAU,SAAS,KAAK;AAC1C,IAAM,YAAY,gBACd,uBAAK,WAAW,MAAM,QAAQ,QAC9B,uBAAK,WAAW,QAAQ;AAGrB,SAAS,iBAA6B;AAC3C,QAAM,eAAW,uBAAK,WAAW,gBAAgB;AACjD,SAAO,KAAK,UAAM,6BAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,aACd,OACA,IACoB;AACpB,QAAM,SAAS,KAAK,IAAI,EAAE,KAAK;AAC/B,QAAM,OAAO,aAAa,KAAK,GAAG,MAAM;AACxC,QAAM,eAAW,uBAAK,WAAW,IAAI;AACrC,SAAO,KAAK,UAAM,6BAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,sBAA0C;AACxD,QAAM,OAAO,eAAe;AAC5B,SAAO,OAAO,KAAK,KAAK,MAAM;AAChC;AAGO,SAAS,yBAA8C;AAC5D,QAAM,OAAO,eAAe;AAC5B,SAAO,KAAK;AACd;AAOO,SAAS,aACd,OACA,IACoB;AACpB,SAAO,aAAa,OAAO,EAAE;AAC/B;AAOO,SAAS,YAAwB;AACtC,SAAO,eAAe;AACxB;","names":["__filename"]}
1
+ {"version":3,"sources":["../src/index.ts","../node_modules/tsup/assets/cjs_shims.js","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '6.0.0';\nexport const STANDARDS_SCHEMA_VERSION = 6;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;;;ADZ9D,sBAA8B;AAC9B,qBAA6B;AAC7B,uBAA8B;;;AEOvB,IAAM,oBAAoB;AAC1B,IAAM,2BAA2B;;;AFQxC,IAAMA,kBAAa,+BAAc,aAAe;AAChD,IAAM,gBAAY,0BAAQA,WAAU;AAKpC,IAAM,YAAY,UAAU,SAAS,KAAK;AAC1C,IAAM,YAAY,gBACd,uBAAK,WAAW,MAAM,QAAQ,QAC9B,uBAAK,WAAW,QAAQ;AAGrB,SAAS,iBAA6B;AAC3C,QAAM,eAAW,uBAAK,WAAW,gBAAgB;AACjD,SAAO,KAAK,UAAM,6BAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,aACd,OACA,IACoB;AACpB,QAAM,SAAS,KAAK,IAAI,EAAE,KAAK;AAC/B,QAAM,OAAO,aAAa,KAAK,GAAG,MAAM;AACxC,QAAM,eAAW,uBAAK,WAAW,IAAI;AACrC,SAAO,KAAK,UAAM,6BAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,sBAA0C;AACxD,QAAM,OAAO,eAAe;AAC5B,SAAO,OAAO,KAAK,KAAK,MAAM;AAChC;AAGO,SAAS,yBAA8C;AAC5D,QAAM,OAAO,eAAe;AAC5B,SAAO,KAAK;AACd;AAOO,SAAS,aACd,OACA,IACoB;AACpB,SAAO,aAAa,OAAO,EAAE;AAC/B;AAOO,SAAS,YAAwB;AACtC,SAAO,eAAe;AACxB;","names":["__filename"]}
package/dist/index.d.cts CHANGED
@@ -156,8 +156,8 @@ interface StackChecklistJson {
156
156
  * Consumers should import from here instead of package.json to avoid
157
157
  * ESM/CJS interop issues.
158
158
  */
159
- declare const STANDARDS_VERSION = "5.2.0";
160
- declare const STANDARDS_SCHEMA_VERSION = 5;
159
+ declare const STANDARDS_VERSION = "6.0.0";
160
+ declare const STANDARDS_SCHEMA_VERSION = 6;
161
161
 
162
162
  /** Load the master spec JSON from the packaged dist directory */
163
163
  declare function loadMasterSpec(): MasterJson;
package/dist/index.d.ts CHANGED
@@ -156,8 +156,8 @@ interface StackChecklistJson {
156
156
  * Consumers should import from here instead of package.json to avoid
157
157
  * ESM/CJS interop issues.
158
158
  */
159
- declare const STANDARDS_VERSION = "5.2.0";
160
- declare const STANDARDS_SCHEMA_VERSION = 5;
159
+ declare const STANDARDS_VERSION = "6.0.0";
160
+ declare const STANDARDS_SCHEMA_VERSION = 6;
161
161
 
162
162
  /** Load the master spec JSON from the packaged dist directory */
163
163
  declare function loadMasterSpec(): MasterJson;
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@ import { readFileSync } from "fs";
4
4
  import { join, dirname } from "path";
5
5
 
6
6
  // src/version.ts
7
- var STANDARDS_VERSION = "5.2.0";
8
- var STANDARDS_SCHEMA_VERSION = 5;
7
+ var STANDARDS_VERSION = "6.0.0";
8
+ var STANDARDS_SCHEMA_VERSION = 6;
9
9
 
10
10
  // src/index.ts
11
11
  var __filename2 = fileURLToPath(import.meta.url);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '5.2.0';\nexport const STANDARDS_SCHEMA_VERSION = 5;\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,MAAM,eAAe;;;ACOvB,IAAM,oBAAoB;AAC1B,IAAM,2BAA2B;;;ADQxC,IAAMA,cAAa,cAAc,YAAY,GAAG;AAChD,IAAMC,aAAY,QAAQD,WAAU;AAKpC,IAAM,YAAYC,WAAU,SAAS,KAAK;AAC1C,IAAM,YAAY,YACd,KAAKA,YAAW,MAAM,QAAQ,IAC9B,KAAKA,YAAW,QAAQ;AAGrB,SAAS,iBAA6B;AAC3C,QAAM,WAAW,KAAK,WAAW,gBAAgB;AACjD,SAAO,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,aACd,OACA,IACoB;AACpB,QAAM,SAAS,KAAK,IAAI,EAAE,KAAK;AAC/B,QAAM,OAAO,aAAa,KAAK,GAAG,MAAM;AACxC,QAAM,WAAW,KAAK,WAAW,IAAI;AACrC,SAAO,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,sBAA0C;AACxD,QAAM,OAAO,eAAe;AAC5B,SAAO,OAAO,KAAK,KAAK,MAAM;AAChC;AAGO,SAAS,yBAA8C;AAC5D,QAAM,OAAO,eAAe;AAC5B,SAAO,KAAK;AACd;AAOO,SAAS,aACd,OACA,IACoB;AACpB,SAAO,aAAa,OAAO,EAAE;AAC/B;AAOO,SAAS,YAAwB;AACtC,SAAO,eAAe;AACxB;","names":["__filename","__dirname"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '6.0.0';\nexport const STANDARDS_SCHEMA_VERSION = 6;\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,MAAM,eAAe;;;ACOvB,IAAM,oBAAoB;AAC1B,IAAM,2BAA2B;;;ADQxC,IAAMA,cAAa,cAAc,YAAY,GAAG;AAChD,IAAMC,aAAY,QAAQD,WAAU;AAKpC,IAAM,YAAYC,WAAU,SAAS,KAAK;AAC1C,IAAM,YAAY,YACd,KAAKA,YAAW,MAAM,QAAQ,IAC9B,KAAKA,YAAW,QAAQ;AAGrB,SAAS,iBAA6B;AAC3C,QAAM,WAAW,KAAK,WAAW,gBAAgB;AACjD,SAAO,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,aACd,OACA,IACoB;AACpB,QAAM,SAAS,KAAK,IAAI,EAAE,KAAK;AAC/B,QAAM,OAAO,aAAa,KAAK,GAAG,MAAM;AACxC,QAAM,WAAW,KAAK,WAAW,IAAI;AACrC,SAAO,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,sBAA0C;AACxD,QAAM,OAAO,eAAe;AAC5B,SAAO,OAAO,KAAK,KAAK,MAAM;AAChC;AAGO,SAAS,yBAA8C;AAC5D,QAAM,OAAO,eAAe;AAC5B,SAAO,KAAK;AACd;AAOO,SAAS,aACd,OACA,IACoB;AACpB,SAAO,aAAa,OAAO,EAAE;AAC/B;AAOO,SAAS,YAAwB;AACtC,SAAO,eAAe;AACxB;","names":["__filename","__dirname"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oddessentials/repo-standards",
3
3
  "private": false,
4
- "version": "5.3.0",
4
+ "version": "6.0.1",
5
5
  "description": "Standards and CI filtering utilities for multi-stack repository governance.",
6
6
  "type": "module",
7
7
  "bin": {
@@ -16,9 +16,10 @@
16
16
  "format:check": "prettier . --check",
17
17
  "test": "vitest run",
18
18
  "typecheck": "tsc --noEmit",
19
+ "sync:version": "node scripts/sync-schema-version-pretest.cjs",
19
20
  "prepare": "husky",
20
21
  "postinstall": "git config core.hooksPath .husky || true",
21
- "ci": "npm run lint && npm run format:check && npm run typecheck && npm run test && npm run build",
22
+ "ci": "npm run lint && npm run format:check && npm run typecheck && npm run sync:version && npm run test && npm run build",
22
23
  "generate:standards": "tsx scripts/generate-standards.ts",
23
24
  "validate:schema": "tsx scripts/validate-schema.ts",
24
25
  "verify": "npm run ci"
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Pre-test schema version sync.
3
+ * Ensures config/standards.json version matches package.json major version
4
+ * before tests run. This prevents CI failures when semantic-release has
5
+ * bumped package.json but tests run before build.
6
+ *
7
+ * Usage: node scripts/sync-schema-version-pretest.cjs
8
+ */
9
+ const fs = require("fs");
10
+ const path = require("path");
11
+
12
+ const rootDir = process.cwd();
13
+ const pkgPath = path.join(rootDir, "package.json");
14
+ const standardsPath = path.join(rootDir, "config", "standards.json");
15
+
16
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
17
+ const standards = JSON.parse(fs.readFileSync(standardsPath, "utf8"));
18
+
19
+ const pkgMajor = parseInt(pkg.version.split(".")[0], 10);
20
+
21
+ if (Number.isNaN(pkgMajor)) {
22
+ console.error(
23
+ `[sync-schema-version] Unable to parse major version from ${pkg.version}`,
24
+ );
25
+ process.exit(1);
26
+ }
27
+
28
+ if (pkgMajor > standards.version) {
29
+ console.log(
30
+ `[sync-schema-version] Upgrading schema version: ${standards.version} -> ${pkgMajor}`,
31
+ );
32
+ standards.version = pkgMajor;
33
+ fs.writeFileSync(standardsPath, JSON.stringify(standards, null, 2) + "\n");
34
+ } else if (standards.version > pkgMajor) {
35
+ console.error(
36
+ `[sync-schema-version] ERROR: Schema version ${standards.version} is ahead of package.json major ${pkgMajor}`,
37
+ );
38
+ process.exit(1);
39
+ } else {
40
+ console.log(
41
+ `[sync-schema-version] Schema version ${standards.version} already matches package.json major`,
42
+ );
43
+ }