release-metadata.mjs 939 B

1234567891011121314151617181920212223
  1. import { readFileSync } from "node:fs";
  2. import path from "node:path";
  3. // Canonical locations of the machine-read release contracts. These are build and
  4. // verification inputs, not documentation: `release/extraction.json` pins the source
  5. // baseline and package scope, `release/public-source.json` is the reviewed file
  6. // inventory, and `release/dependency-licenses.json` records declared dependency
  7. // licenses. Import these constants instead of repeating the literal paths.
  8. export const extractionPath = "release/extraction.json";
  9. export const inventoryPath = "release/public-source.json";
  10. export const dependencyLicensesPath = "release/dependency-licenses.json";
  11. function readJson(root, relative) {
  12. return JSON.parse(readFileSync(path.join(root, relative), "utf8"));
  13. }
  14. export function readExtraction(root) {
  15. return readJson(root, extractionPath);
  16. }
  17. export function readInventory(root) {
  18. return readJson(root, inventoryPath);
  19. }