@stll/oxlint-config 1.6.2 → 1.7.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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/cloud-setup-cli.mjs +1 -1
  3. package/dist/consumer-compat-cli.cjs.map +1 -1
  4. package/dist/consumer-compat-cli.mjs.map +1 -1
  5. package/dist/consumer-node-support.mjs +1 -1
  6. package/dist/dependabot.d.cts +10 -0
  7. package/dist/dependabot.d.mts +10 -0
  8. package/dist/engine-support-cli.cjs.map +1 -1
  9. package/dist/engine-support-cli.mjs.map +1 -1
  10. package/dist/git-tracked-output.cjs.map +1 -1
  11. package/dist/git-tracked-output.mjs.map +1 -1
  12. package/dist/publish-artifact-syntax.cjs.map +1 -1
  13. package/dist/publish-artifact-syntax.mjs.map +1 -1
  14. package/dist/publish-build-target-vite-dts-helper2.cjs.map +1 -1
  15. package/dist/publish-build-target-vite-dts-helper2.mjs.map +1 -1
  16. package/dist/publish-contract-cli.cjs.map +1 -1
  17. package/dist/publish-contract-cli.mjs.map +1 -1
  18. package/dist/quarantine-policy2.cjs.map +1 -1
  19. package/dist/quarantine-policy2.mjs.map +1 -1
  20. package/dist/toolchain-changed.cjs +1 -3
  21. package/dist/toolchain-changed.cjs.map +1 -1
  22. package/dist/toolchain-changed.mjs +2 -4
  23. package/dist/toolchain-changed.mjs.map +1 -1
  24. package/dist/toolchain-dependabot.cjs.map +1 -1
  25. package/dist/toolchain-dependabot.mjs +1 -1
  26. package/dist/toolchain-dependabot.mjs.map +1 -1
  27. package/dist/toolchain-guard.cjs +11 -4
  28. package/dist/toolchain-guard.cjs.map +1 -1
  29. package/dist/toolchain-guard.mjs +12 -5
  30. package/dist/toolchain-guard.mjs.map +1 -1
  31. package/dist/toolchain-inputs.cjs +99 -9
  32. package/dist/toolchain-inputs.cjs.map +1 -1
  33. package/dist/toolchain-inputs.mjs +88 -10
  34. package/dist/toolchain-inputs.mjs.map +1 -1
  35. package/dist/toolchain-schema.cjs +179 -1
  36. package/dist/toolchain-schema.cjs.map +1 -1
  37. package/dist/toolchain-schema.mjs +167 -3
  38. package/dist/toolchain-schema.mjs.map +1 -1
  39. package/dist/typecheck-parity.cjs.map +1 -1
  40. package/dist/typecheck-parity.mjs.map +1 -1
  41. package/dist/wasi-loader-normalizer-cli.cjs.map +1 -1
  42. package/dist/wasi-loader-normalizer-cli.mjs.map +1 -1
  43. package/package.json +2 -4
  44. package/toolchain.json +54 -12
@@ -1 +1 @@
1
- {"version":3,"file":"quarantine-policy2.cjs","names":["parseJsonc","parse"],"sources":["../src/quarantine-policy-core.ts","../src/quarantine-policy.ts"],"sourcesContent":["import { parseJsonc } from \"./jsonc\";\n\nexport const REQUIRED_RELEASE_AGE_SECONDS = 5 * 24 * 60 * 60;\nexport const NPM_REGISTRY = \"https://registry.npmjs.org\";\nexport const EXACT_UTC_TIMESTAMP =\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/u;\nconst HOUR_MS = 60 * 60 * 1000;\nconst EXACT_PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/u;\nconst REGISTRY_VERSION =\n /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/u;\n\ntype ParseToml = (text: string) => unknown;\ntype FirstPartyPackages = ReadonlySet<string> | readonly string[];\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\nconst fail: (message: string) => never = (message) => {\n throw new Error(message);\n};\nconst ownPackage = (name: string) => name.startsWith(\"@stll/\");\nconst exactPackage = (name: string) =>\n name.length <= 214 && EXACT_PACKAGE.test(name);\nexport const isFirstPartyPackageName = (name: string): boolean =>\n exactPackage(name) && ownPackage(name);\n\nexport const exactTimestamp = (value: string): boolean => {\n const timestamp = Date.parse(value);\n return (\n EXACT_UTC_TIMESTAMP.test(value) &&\n !Number.isNaN(timestamp) &&\n new Date(timestamp).toISOString() === value\n );\n};\n\nexport const readParsedExcludes = (\n bunfig: string,\n parseToml: ParseToml,\n): string[] => {\n const parsed = parseToml(bunfig);\n if (!isRecord(parsed) || !isRecord(parsed[\"install\"]))\n return fail(\"bunfig.toml must contain an [install] table\");\n const install = parsed[\"install\"];\n if (\n (\"registry\" in install && install[\"registry\"] !== NPM_REGISTRY) ||\n (\"scopes\" in install &&\n (!isRecord(install[\"scopes\"]) ||\n Object.keys(install[\"scopes\"]).length > 0))\n )\n fail(\"bunfig.toml quarantine policy requires the canonical npm registry\");\n if (install[\"minimumReleaseAge\"] !== REQUIRED_RELEASE_AGE_SECONDS)\n fail(\n `bunfig.toml must set minimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}`,\n );\n if (!Array.isArray(install[\"minimumReleaseAgeExcludes\"]))\n return fail(\n \"bunfig.toml must declare minimumReleaseAgeExcludes as an array\",\n );\n const names: string[] = [];\n for (const value of install[\"minimumReleaseAgeExcludes\"]) {\n if (typeof value !== \"string\" || !exactPackage(value))\n return fail(\n \"bunfig.toml minimumReleaseAgeExcludes must contain only exact npm package names\",\n );\n names.push(value);\n }\n if (new Set(names).size !== names.length)\n fail(\"bunfig.toml minimumReleaseAgeExcludes must not contain duplicates\");\n return names;\n};\n\ntype Token = {\n type: \"string\" | \"atom\" | \"punctuation\" | \"comment\" | \"newline\";\n start: number;\n end: number;\n text: string;\n};\n// Tokenize before locating declarations: text in comments, multiline strings and\n// unrelated tables cannot masquerade as the install policy's source array.\nconst tokensOf = (text: string): Token[] => {\n const tokens: Token[] = [];\n let index = 0;\n while (index < text.length) {\n const start = index;\n const character = text.charAt(index++);\n if (character === \"\\n\") {\n tokens.push({ type: \"newline\", start, end: index, text: character });\n continue;\n }\n if (/\\s/u.test(character)) continue;\n let type: Token[\"type\"];\n if (character === \"#\") {\n type = \"comment\";\n while (index < text.length && text.charAt(index) !== \"\\n\") index++;\n } else if (character === '\"' || character === \"'\") {\n type = \"string\";\n const triple = text.slice(start, start + 3) === character.repeat(3);\n if (triple) index = start + 3;\n while (index < text.length) {\n const current = text.charAt(index++);\n if (character === '\"' && current === \"\\\\\") {\n index++;\n continue;\n }\n if (current !== character) continue;\n if (!triple) break;\n if (text.slice(index - 1, index + 2) !== character.repeat(3)) continue;\n index += 2;\n while (text.charAt(index) === character) index++;\n break;\n }\n } else if (\"[]=.,{}\".includes(character)) type = \"punctuation\";\n else {\n type = \"atom\";\n while (\n index < text.length &&\n !/[\\s#[\\]=.,{}\"']/u.test(text.charAt(index))\n )\n index++;\n }\n tokens.push({\n type,\n start,\n end: index,\n text:\n type === \"comment\"\n ? text.slice(start, index).replace(/\\r$/u, \"\")\n : text.slice(start, index),\n });\n }\n return tokens;\n};\n\nconst stringValue = (token: Token, parseToml: ParseToml): string => {\n const parsed = parseToml(`value = ${token.text}`);\n if (!isRecord(parsed) || typeof parsed[\"value\"] !== \"string\")\n return fail(\"bunfig.toml has an unsupported quarantine string\");\n return parsed[\"value\"];\n};\nconst keyParts = (tokens: readonly Token[], parseToml: ParseToml): string[] =>\n tokens\n .filter(({ text }) => text !== \".\")\n .map((token) =>\n token.type === \"string\" ? stringValue(token, parseToml) : token.text,\n );\n\ntype Entry = {\n name: string;\n token: Token;\n comment: Token | undefined;\n comma: Token | undefined;\n};\ntype SourceArray = {\n open: Token;\n close: Token;\n entries: Entry[];\n comments: Token[];\n};\nconst readSourceArray = (bunfig: string, parseToml: ParseToml): SourceArray => {\n const names = readParsedExcludes(bunfig, parseToml);\n let table: string[] = [];\n let statement: Token[] = [];\n let depth = 0;\n let found: SourceArray | undefined;\n const visitStatement = () => {\n const meaningful = statement.filter(\n ({ type }) => type !== \"comment\" && type !== \"newline\",\n );\n const first = meaningful.at(0);\n if (first?.text === \"[\") {\n const end = meaningful.at(-1);\n if (end?.text === \"]\")\n table = keyParts(meaningful.slice(1, -1), parseToml);\n return;\n }\n const equals = meaningful.findIndex(({ text }) => text === \"=\");\n if (equals < 0) return;\n const key = [...table, ...keyParts(meaningful.slice(0, equals), parseToml)];\n if (\n key.join(\".\") !== \"install.minimumReleaseAgeExcludes\" ||\n key.length !== 2\n )\n return;\n const open = meaningful.at(equals + 1);\n const close = meaningful.at(-1);\n if (\n open === undefined ||\n close === undefined ||\n open.text !== \"[\" ||\n close.text !== \"]\" ||\n found !== undefined\n )\n fail(\n \"bunfig.toml must declare a single install minimumReleaseAgeExcludes array\",\n );\n const values = meaningful.slice(equals + 2, -1);\n if (values.some(({ type, text }) => type !== \"string\" && text !== \",\"))\n fail(\"bunfig.toml quarantine array must contain package strings\");\n const strings = values.filter(({ type }) => type === \"string\");\n const comments = statement.filter(({ type }) => type === \"comment\");\n const entries = strings.map((token, index) => {\n const next = strings.at(index + 1)?.start ?? Number.POSITIVE_INFINITY;\n const comment = comments.find(\n (candidate) =>\n candidate.start >= token.end &&\n candidate.start < next &&\n !bunfig.slice(token.end, candidate.start).includes(\"\\n\"),\n );\n const following = values.find(\n (candidate) => candidate.start >= token.end,\n );\n return {\n name: stringValue(token, parseToml),\n token,\n comment,\n comma: following?.text === \",\" ? following : undefined,\n };\n });\n if (\n entries.length !== names.length ||\n entries.some(({ name }, index) => name !== names.at(index))\n )\n fail(\n \"bunfig.toml quarantine source does not match its parsed install array\",\n );\n found = { open, close, entries, comments };\n };\n for (const token of tokensOf(bunfig)) {\n if (token.type === \"newline\" && depth === 0) {\n visitStatement();\n statement = [];\n continue;\n }\n statement.push(token);\n if (token.type !== \"punctuation\") continue;\n if (token.text === \"[\" || token.text === \"{\") depth++;\n if (token.text === \"]\" || token.text === \"}\") depth--;\n }\n visitStatement();\n if (found === undefined)\n return fail(\n \"bunfig.toml must declare an explicit [install] minimumReleaseAgeExcludes array\",\n );\n return found;\n};\n\ntype Annotation =\n | { type: \"none\" }\n | { type: \"invalid\" }\n | { type: \"expires\" | \"excluded-since\"; timestamp: string };\nconst annotationOf = ({ comment }: Entry): Annotation => {\n if (comment === undefined) return { type: \"none\" };\n const match = /^#\\s*quarantine-(expires|excluded-since):\\s*(\\S+)\\s*$/u.exec(\n comment.text,\n );\n const marker = match?.at(1);\n const timestamp = match?.at(2);\n if (\n (marker === \"expires\" || marker === \"excluded-since\") &&\n timestamp !== undefined\n )\n return { type: marker, timestamp };\n return { type: \"invalid\" };\n};\n\nexport const readRegistryFirstPartyPackages = (\n lockfile: string | undefined,\n): Set<string> => {\n if (lockfile === undefined) return new Set();\n const parsed = parseJsonc(lockfile);\n if (!isRecord(parsed) || !isRecord(parsed[\"packages\"]))\n return fail(\"bun.lock must contain a packages mapping\");\n const names = new Set<string>();\n for (const value of Object.values(parsed[\"packages\"])) {\n if (!Array.isArray(value)) continue;\n const identity: unknown = value.at(0);\n if (typeof identity !== \"string\") continue;\n const separator = identity.lastIndexOf(\"@\");\n const name = identity.slice(0, separator);\n if (\n exactPackage(name) &&\n ownPackage(name) &&\n REGISTRY_VERSION.test(identity.slice(separator + 1))\n )\n names.add(name);\n }\n return names;\n};\n\nconst ownNames = (names: FirstPartyPackages): Set<string> => {\n const result = new Set(names);\n for (const name of result)\n if (!exactPackage(name) || !ownPackage(name))\n fail(`Expected an exact first-party npm package name: ${name}`);\n return result;\n};\nconst validNow = (now: Date): number => {\n if (!Number.isFinite(now.getTime()))\n return fail(\"Quarantine policy requires a valid current date\");\n return now.getTime();\n};\nexport type CheckResult = { errors: string[]; warnings: string[] };\ntype CheckOptions = {\n bunfig: string;\n lockfile: string | undefined;\n parseToml: ParseToml;\n npmrcPresent?: boolean;\n now?: Date;\n firstPartyPackages?: FirstPartyPackages;\n};\nexport const checkQuarantinePolicy = ({\n bunfig,\n lockfile,\n parseToml,\n npmrcPresent = false,\n now = new Date(),\n firstPartyPackages,\n}: CheckOptions): CheckResult => {\n const errors: string[] = [];\n const warnings: string[] = [];\n try {\n const nowMs = validNow(now);\n const { entries } = readSourceArray(bunfig, parseToml);\n if (npmrcPresent)\n errors.push(\n \"bunfig.toml quarantine policy does not allow a repository .npmrc\",\n );\n for (const entry of entries) {\n const annotation = annotationOf(entry);\n if (ownPackage(entry.name) && annotation.type === \"none\") continue;\n if (annotation.type === \"none\" || annotation.type === \"invalid\") {\n errors.push(\n `bunfig.toml has an unannotated or malformed quarantine exclude: ${entry.name}`,\n );\n continue;\n }\n if (!exactTimestamp(annotation.timestamp)) {\n errors.push(\n `bunfig.toml quarantine exclude \"${entry.name}\" has an invalid UTC timestamp: ${annotation.timestamp}`,\n );\n continue;\n }\n const timestampMs = Date.parse(annotation.timestamp);\n if (ownPackage(entry.name)) {\n if (annotation.type !== \"excluded-since\")\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" must be permanent (quarantine-excluded-since: or no timestamp)`,\n );\n else if (timestampMs > nowMs)\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" has a future exclusion date`,\n );\n continue;\n }\n if (annotation.type !== \"expires\") {\n errors.push(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must use quarantine-expires:`,\n );\n continue;\n }\n if (nowMs >= timestampMs + 24 * HOUR_MS)\n errors.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp} and is still present`,\n );\n else if (nowMs >= timestampMs)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp}; its removal PR should be merged`,\n );\n else if (nowMs >= timestampMs - 48 * HOUR_MS)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expires at ${annotation.timestamp}; prepare its removal PR`,\n );\n }\n const required = readRegistryFirstPartyPackages(lockfile);\n if (firstPartyPackages !== undefined) {\n for (const name of ownNames(firstPartyPackages)) required.add(name);\n }\n const declared = new Set(entries.map(({ name }) => name));\n const missing = [...required].filter((name) => !declared.has(name)).sort();\n if (missing.length > 0)\n errors.push(\n `bunfig.toml is missing registry-backed first-party quarantine excludes: ${missing.join(\", \")}`,\n );\n } catch (error) {\n errors.push(error instanceof Error ? error.message : String(error));\n }\n return { errors, warnings };\n};\n\ntype PruneOptions = { bunfig: string; parseToml: ParseToml; now?: Date };\nexport const pruneExpiredExcludes = ({\n bunfig,\n parseToml,\n now = new Date(),\n}: PruneOptions): { bunfig: string; pruned: string[] } => {\n const nowMs = validNow(now);\n const { entries, close } = readSourceArray(bunfig, parseToml);\n const removals: { start: number; end: number }[] = [];\n const pruned: string[] = [];\n for (const entry of entries) {\n if (ownPackage(entry.name)) continue;\n const annotation = annotationOf(entry);\n if (annotation.type !== \"expires\" || !exactTimestamp(annotation.timestamp))\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n if (nowMs < Date.parse(annotation.timestamp)) continue;\n const lineStart = bunfig.lastIndexOf(\"\\n\", entry.token.start - 1) + 1;\n const nextNewline = bunfig.indexOf(\"\\n\", entry.token.end);\n const lineEnd = nextNewline < 0 ? bunfig.length : nextNewline;\n const commentInside =\n entry.comment !== undefined && entry.comment.start < close.start;\n const end = commentInside\n ? (entry.comment?.end ?? entry.token.end)\n : (entry.comma?.end ?? entry.token.end);\n if (\n bunfig.slice(lineStart, entry.token.start).trim() === \"\" &&\n bunfig.slice(end, lineEnd).trim() === \"\"\n )\n removals.push({\n start: lineStart,\n end: nextNewline < 0 ? lineEnd : lineEnd + 1,\n });\n else removals.push({ start: entry.token.start, end });\n if (entry.comment !== undefined && !commentInside)\n removals.push({ start: entry.comment.start, end: entry.comment.end });\n pruned.push(entry.name);\n }\n let result = bunfig;\n for (const removal of removals.toReversed())\n result = result.slice(0, removal.start) + result.slice(removal.end);\n // Never return edited TOML without confirming the resulting source is valid.\n readSourceArray(result, parseToml);\n return { bunfig: result, pruned };\n};\n\ntype SynchronizeOptions = {\n bunfig: string;\n firstPartyPackages: FirstPartyPackages;\n parseToml: ParseToml;\n now?: Date;\n};\nexport const synchronizeFirstPartyExcludes = ({\n bunfig,\n firstPartyPackages,\n parseToml,\n now = new Date(),\n}: SynchronizeOptions): string => {\n validNow(now);\n const required = ownNames(firstPartyPackages);\n const { open, close, entries, comments } = readSourceArray(bunfig, parseToml);\n const attachedComments = new Set(\n entries.flatMap(({ comment }) => (comment === undefined ? [] : [comment])),\n );\n const lines = comments\n .filter((comment) => !attachedComments.has(comment))\n .map(({ text }) => ` ${text}`);\n const seen = new Set<string>();\n for (const entry of entries) {\n if (!ownPackage(entry.name)) {\n const annotation = annotationOf(entry);\n if (\n annotation.type !== \"expires\" ||\n !exactTimestamp(annotation.timestamp)\n )\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n lines.push(\n ` ${entry.token.text},${entry.comment === undefined ? \"\" : ` ${entry.comment.text}`}`,\n );\n continue;\n }\n if (!required.has(entry.name)) continue;\n seen.add(entry.name);\n const annotation = annotationOf(entry);\n const timestamp =\n annotation.type === \"excluded-since\" &&\n exactTimestamp(annotation.timestamp)\n ? annotation.timestamp\n : now.toISOString();\n lines.push(\n ` ${JSON.stringify(entry.name)}, # quarantine-excluded-since: ${timestamp}`,\n );\n }\n for (const name of [...required]\n .filter((requiredPackage) => !seen.has(requiredPackage))\n .sort())\n lines.push(\n ` ${JSON.stringify(name)}, # quarantine-excluded-since: ${now.toISOString()}`,\n );\n const newline = bunfig.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n const trailingComment = entries.at(-1)?.comment;\n const end =\n trailingComment !== undefined && trailingComment.start > close.end\n ? trailingComment.end\n : close.end;\n const result =\n bunfig.slice(0, open.start) +\n `[${newline}${lines.join(newline)}${lines.length === 0 ? \"\" : newline}]` +\n bunfig.slice(end);\n readSourceArray(result, parseToml);\n return result;\n};\n","import { parse } from \"smol-toml\";\n\nimport {\n REQUIRED_RELEASE_AGE_SECONDS,\n checkQuarantinePolicy,\n isFirstPartyPackageName,\n pruneExpiredExcludes,\n readRegistryFirstPartyPackages,\n synchronizeFirstPartyExcludes,\n} from \"./quarantine-policy-core\";\n\nexport {\n EXACT_UTC_TIMESTAMP,\n NPM_REGISTRY,\n REQUIRED_RELEASE_AGE_SECONDS,\n exactTimestamp,\n} from \"./quarantine-policy-core\";\n\nconst record = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/** Derive exact registry identities before install, including catalog references. */\nexport const declaredFirstPartyPackages = (files: Record<string, string>) => {\n const names = new Set<string>();\n for (const [file, text] of Object.entries(files)) {\n if (!/(?:^|\\/)package\\.json$/.test(file)) continue;\n const manifest: unknown = JSON.parse(text);\n if (!record(manifest)) throw new Error(`${file} must contain an object`);\n for (const field of [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n ]) {\n const dependencies = manifest[field];\n if (!record(dependencies)) continue;\n for (const [name, specifier] of Object.entries(dependencies)) {\n if (typeof specifier !== \"string\") continue;\n if (\n /^(?:workspace:|file:|link:|git(?:\\+|:)|https?:|github:|\\.\\.?\\/|\\/)/.test(\n specifier,\n )\n )\n continue;\n if (specifier.startsWith(\"npm:\")) {\n const alias = /^npm:(@[^/]+\\/[^@]+|[^@]+)@/.exec(specifier)?.at(1);\n if (alias !== undefined && isFirstPartyPackageName(alias))\n names.add(alias);\n continue;\n }\n if (isFirstPartyPackageName(name)) names.add(name);\n }\n }\n }\n return names;\n};\n\ntype RepositoryQuarantineOptions = {\n files: Record<string, string>;\n now?: Date | undefined;\n npmrcPresent?: boolean | undefined;\n};\n\nexport const checkRepositoryQuarantine = ({\n files,\n now,\n npmrcPresent,\n}: RepositoryQuarantineOptions) =>\n checkQuarantinePolicy({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n lockfile: files[\"bun.lock\"],\n firstPartyPackages: declaredFirstPartyPackages(files),\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n ...(npmrcPresent === undefined ? {} : { npmrcPresent }),\n });\n\nexport const synchronizeRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) => {\n const firstPartyPackages = new Set([\n ...declaredFirstPartyPackages(files),\n ...readRegistryFirstPartyPackages(files[\"bun.lock\"]),\n ]);\n return synchronizeFirstPartyExcludes({\n bunfig:\n files[\"bunfig.toml\"] ??\n `[install]\\nminimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}\\nminimumReleaseAgeExcludes = []\\n`,\n firstPartyPackages,\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n};\n\nexport const pruneRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) =>\n pruneExpiredExcludes({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n"],"mappings":";;;AAEA,MAAa,+BAA+B;AAC5C,MAAa,eAAe;AAC5B,MAAa,sBACX;AACF,MAAM,UAAU;AAChB,MAAM,gBAAgB;AACtB,MAAM,mBACJ;AAIF,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AACrE,MAAM,QAAoC,YAAY;CACpD,MAAM,IAAI,MAAM,OAAO;AACzB;AACA,MAAM,cAAc,SAAiB,KAAK,WAAW,QAAQ;AAC7D,MAAM,gBAAgB,SACpB,KAAK,UAAU,OAAO,cAAc,KAAK,IAAI;AAC/C,MAAa,2BAA2B,SACtC,aAAa,IAAI,KAAK,WAAW,IAAI;AAEvC,MAAa,kBAAkB,UAA2B;CACxD,MAAM,YAAY,KAAK,MAAM,KAAK;CAClC,OACE,oBAAoB,KAAK,KAAK,KAC9B,CAAC,OAAO,MAAM,SAAS,KACvB,IAAI,KAAK,SAAS,CAAC,CAAC,YAAY,MAAM;AAE1C;AAEA,MAAa,sBACX,QACA,cACa;CACb,MAAM,SAAS,UAAU,MAAM;CAC/B,IAAI,CAAC,SAAS,MAAM,KAAK,CAAC,SAAS,OAAO,UAAU,GAClD,OAAO,KAAK,6CAA6C;CAC3D,MAAM,UAAU,OAAO;CACvB,IACG,cAAc,WAAW,QAAQ,gBAAA,gCACjC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Y,CAAC,IAAI,EAAE,aAAa;AACvD,CAAC;AAEH,MAAa,mCAAmC,EAC9C,OACA,UACiC;CACjC,MAAM,qCAAqB,IAAI,IAAI,CACjC,GAAG,2BAA2B,KAAK,GACnC,GAAG,+BAA+B,MAAM,WAAW,CACrD,CAAC;CACD,OAAO,8BAA8B;EACnC,QACE,MAAM,kBACN;EACF;EACA,WAAWA,UAAAA;EACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;CACrC,CAAC;AACH;AAEA,MAAa,6BAA6B,EACxC,OACA,UAEA,qBAAqB;CACnB,QAAQ,MAAM,kBAAkB;CAChC,WAAWA,UAAAA;CACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;AACrC,CAAC"}
1
+ {"version":3,"file":"quarantine-policy2.cjs","names":["parseJsonc","parse"],"sources":["../src/quarantine-policy-core.ts","../src/quarantine-policy.ts"],"sourcesContent":["import { parseJsonc } from \"./jsonc\";\n\nexport const REQUIRED_RELEASE_AGE_SECONDS = 5 * 24 * 60 * 60;\nexport const NPM_REGISTRY = \"https://registry.npmjs.org\";\nexport const EXACT_UTC_TIMESTAMP =\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/u;\nconst HOUR_MS = 60 * 60 * 1000;\nconst EXACT_PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/u;\nconst REGISTRY_VERSION =\n /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/u;\n\ntype ParseToml = (text: string) => unknown;\ntype FirstPartyPackages = ReadonlySet<string> | readonly string[];\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\nconst fail: (message: string) => never = (message) => {\n throw new Error(message);\n};\nconst ownPackage = (name: string) => name.startsWith(\"@stll/\");\nconst exactPackage = (name: string) =>\n name.length <= 214 && EXACT_PACKAGE.test(name);\nexport const isFirstPartyPackageName = (name: string): boolean =>\n exactPackage(name) && ownPackage(name);\n\nexport const exactTimestamp = (value: string): boolean => {\n const timestamp = Date.parse(value);\n return (\n EXACT_UTC_TIMESTAMP.test(value) &&\n !Number.isNaN(timestamp) &&\n new Date(timestamp).toISOString() === value\n );\n};\n\nexport const readParsedExcludes = (\n bunfig: string,\n parseToml: ParseToml,\n): string[] => {\n const parsed = parseToml(bunfig);\n if (!isRecord(parsed) || !isRecord(parsed[\"install\"]))\n return fail(\"bunfig.toml must contain an [install] table\");\n const install = parsed[\"install\"];\n if (\n (\"registry\" in install && install[\"registry\"] !== NPM_REGISTRY) ||\n (\"scopes\" in install &&\n (!isRecord(install[\"scopes\"]) ||\n Object.keys(install[\"scopes\"]).length > 0))\n )\n fail(\"bunfig.toml quarantine policy requires the canonical npm registry\");\n if (install[\"minimumReleaseAge\"] !== REQUIRED_RELEASE_AGE_SECONDS)\n fail(\n `bunfig.toml must set minimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}`,\n );\n if (!Array.isArray(install[\"minimumReleaseAgeExcludes\"]))\n return fail(\n \"bunfig.toml must declare minimumReleaseAgeExcludes as an array\",\n );\n const names: string[] = [];\n for (const value of install[\"minimumReleaseAgeExcludes\"]) {\n if (typeof value !== \"string\" || !exactPackage(value))\n return fail(\n \"bunfig.toml minimumReleaseAgeExcludes must contain only exact npm package names\",\n );\n names.push(value);\n }\n if (new Set(names).size !== names.length)\n fail(\"bunfig.toml minimumReleaseAgeExcludes must not contain duplicates\");\n return names;\n};\n\ntype Token = {\n type: \"string\" | \"atom\" | \"punctuation\" | \"comment\" | \"newline\";\n start: number;\n end: number;\n text: string;\n};\n// Tokenize before locating declarations: text in comments, multiline strings and\n// unrelated tables cannot masquerade as the install policy's source array.\nconst tokensOf = (text: string): Token[] => {\n const tokens: Token[] = [];\n let index = 0;\n while (index < text.length) {\n const start = index;\n const character = text.charAt(index++);\n if (character === \"\\n\") {\n tokens.push({ type: \"newline\", start, end: index, text: character });\n continue;\n }\n if (/\\s/u.test(character)) continue;\n let type: Token[\"type\"];\n if (character === \"#\") {\n type = \"comment\";\n while (index < text.length && text.charAt(index) !== \"\\n\") index++;\n } else if (character === '\"' || character === \"'\") {\n type = \"string\";\n const triple = text.slice(start, start + 3) === character.repeat(3);\n if (triple) index = start + 3;\n while (index < text.length) {\n const current = text.charAt(index++);\n if (character === '\"' && current === \"\\\\\") {\n index++;\n continue;\n }\n if (current !== character) continue;\n if (!triple) break;\n if (text.slice(index - 1, index + 2) !== character.repeat(3)) continue;\n index += 2;\n while (text.charAt(index) === character) index++;\n break;\n }\n } else if (\"[]=.,{}\".includes(character)) type = \"punctuation\";\n else {\n type = \"atom\";\n while (\n index < text.length &&\n !/[\\s#[\\]=.,{}\"']/u.test(text.charAt(index))\n )\n index++;\n }\n tokens.push({\n type,\n start,\n end: index,\n text:\n type === \"comment\"\n ? text.slice(start, index).replace(/\\r$/u, \"\")\n : text.slice(start, index),\n });\n }\n return tokens;\n};\n\nconst stringValue = (token: Token, parseToml: ParseToml): string => {\n const parsed = parseToml(`value = ${token.text}`);\n if (!isRecord(parsed) || typeof parsed[\"value\"] !== \"string\")\n return fail(\"bunfig.toml has an unsupported quarantine string\");\n return parsed[\"value\"];\n};\nconst keyParts = (tokens: readonly Token[], parseToml: ParseToml): string[] =>\n tokens\n .filter(({ text }) => text !== \".\")\n .map((token) =>\n token.type === \"string\" ? stringValue(token, parseToml) : token.text,\n );\n\ntype Entry = {\n name: string;\n token: Token;\n comment: Token | undefined;\n comma: Token | undefined;\n};\ntype SourceArray = {\n open: Token;\n close: Token;\n entries: Entry[];\n comments: Token[];\n};\nconst readSourceArray = (bunfig: string, parseToml: ParseToml): SourceArray => {\n const names = readParsedExcludes(bunfig, parseToml);\n let table: string[] = [];\n let statement: Token[] = [];\n let depth = 0;\n let found: SourceArray | undefined;\n const visitStatement = () => {\n const meaningful = statement.filter(\n ({ type }) => type !== \"comment\" && type !== \"newline\",\n );\n const first = meaningful.at(0);\n if (first?.text === \"[\") {\n const end = meaningful.at(-1);\n if (end?.text === \"]\")\n table = keyParts(meaningful.slice(1, -1), parseToml);\n return;\n }\n const equals = meaningful.findIndex(({ text }) => text === \"=\");\n if (equals < 0) return;\n const key = [...table, ...keyParts(meaningful.slice(0, equals), parseToml)];\n if (\n key.join(\".\") !== \"install.minimumReleaseAgeExcludes\" ||\n key.length !== 2\n )\n return;\n const open = meaningful.at(equals + 1);\n const close = meaningful.at(-1);\n if (\n open === undefined ||\n close === undefined ||\n open.text !== \"[\" ||\n close.text !== \"]\" ||\n found !== undefined\n )\n fail(\n \"bunfig.toml must declare a single install minimumReleaseAgeExcludes array\",\n );\n const values = meaningful.slice(equals + 2, -1);\n if (values.some(({ type, text }) => type !== \"string\" && text !== \",\"))\n fail(\"bunfig.toml quarantine array must contain package strings\");\n const strings = values.filter(({ type }) => type === \"string\");\n const comments = statement.filter(({ type }) => type === \"comment\");\n const entries = strings.map((token, index) => {\n const next = strings.at(index + 1)?.start ?? Number.POSITIVE_INFINITY;\n const comment = comments.find(\n (candidate) =>\n candidate.start >= token.end &&\n candidate.start < next &&\n !bunfig.slice(token.end, candidate.start).includes(\"\\n\"),\n );\n const following = values.find(\n (candidate) => candidate.start >= token.end,\n );\n return {\n name: stringValue(token, parseToml),\n token,\n comment,\n comma: following?.text === \",\" ? following : undefined,\n };\n });\n if (\n entries.length !== names.length ||\n entries.some(({ name }, index) => name !== names.at(index))\n )\n fail(\n \"bunfig.toml quarantine source does not match its parsed install array\",\n );\n found = { open, close, entries, comments };\n };\n for (const token of tokensOf(bunfig)) {\n if (token.type === \"newline\" && depth === 0) {\n visitStatement();\n statement = [];\n continue;\n }\n statement.push(token);\n if (token.type !== \"punctuation\") continue;\n if (token.text === \"[\" || token.text === \"{\") depth++;\n if (token.text === \"]\" || token.text === \"}\") depth--;\n }\n visitStatement();\n if (found === undefined)\n return fail(\n \"bunfig.toml must declare an explicit [install] minimumReleaseAgeExcludes array\",\n );\n return found;\n};\n\ntype Annotation =\n | { type: \"none\" }\n | { type: \"invalid\" }\n | { type: \"expires\" | \"excluded-since\"; timestamp: string };\nconst annotationOf = ({ comment }: Entry): Annotation => {\n if (comment === undefined) return { type: \"none\" };\n const match = /^#\\s*quarantine-(expires|excluded-since):\\s*(\\S+)\\s*$/u.exec(\n comment.text,\n );\n const marker = match?.at(1);\n const timestamp = match?.at(2);\n if (\n (marker === \"expires\" || marker === \"excluded-since\") &&\n timestamp !== undefined\n )\n return { type: marker, timestamp };\n return { type: \"invalid\" };\n};\n\nexport const readRegistryFirstPartyPackages = (\n lockfile: string | undefined,\n): Set<string> => {\n if (lockfile === undefined) return new Set();\n const parsed = parseJsonc(lockfile);\n if (!isRecord(parsed) || !isRecord(parsed[\"packages\"]))\n return fail(\"bun.lock must contain a packages mapping\");\n const names = new Set<string>();\n for (const value of Object.values(parsed[\"packages\"])) {\n if (!Array.isArray(value)) continue;\n const identity: unknown = value.at(0);\n if (typeof identity !== \"string\") continue;\n const separator = identity.lastIndexOf(\"@\");\n const name = identity.slice(0, separator);\n if (\n exactPackage(name) &&\n ownPackage(name) &&\n REGISTRY_VERSION.test(identity.slice(separator + 1))\n )\n names.add(name);\n }\n return names;\n};\n\nconst ownNames = (names: FirstPartyPackages): Set<string> => {\n const result = new Set(names);\n for (const name of result)\n if (!exactPackage(name) || !ownPackage(name))\n fail(`Expected an exact first-party npm package name: ${name}`);\n return result;\n};\nconst validNow = (now: Date): number => {\n if (!Number.isFinite(now.getTime()))\n return fail(\"Quarantine policy requires a valid current date\");\n return now.getTime();\n};\nexport type CheckResult = { errors: string[]; warnings: string[] };\ntype CheckOptions = {\n bunfig: string;\n lockfile: string | undefined;\n parseToml: ParseToml;\n npmrcPresent?: boolean;\n now?: Date;\n firstPartyPackages?: FirstPartyPackages;\n};\nexport const checkQuarantinePolicy = ({\n bunfig,\n lockfile,\n parseToml,\n npmrcPresent = false,\n now = new Date(),\n firstPartyPackages,\n}: CheckOptions): CheckResult => {\n const errors: string[] = [];\n const warnings: string[] = [];\n try {\n const nowMs = validNow(now);\n const { entries } = readSourceArray(bunfig, parseToml);\n if (npmrcPresent)\n errors.push(\n \"bunfig.toml quarantine policy does not allow a repository .npmrc\",\n );\n for (const entry of entries) {\n const annotation = annotationOf(entry);\n if (ownPackage(entry.name) && annotation.type === \"none\") continue;\n if (annotation.type === \"none\" || annotation.type === \"invalid\") {\n errors.push(\n `bunfig.toml has an unannotated or malformed quarantine exclude: ${entry.name}`,\n );\n continue;\n }\n if (!exactTimestamp(annotation.timestamp)) {\n errors.push(\n `bunfig.toml quarantine exclude \"${entry.name}\" has an invalid UTC timestamp: ${annotation.timestamp}`,\n );\n continue;\n }\n const timestampMs = Date.parse(annotation.timestamp);\n if (ownPackage(entry.name)) {\n if (annotation.type !== \"excluded-since\")\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" must be permanent (quarantine-excluded-since: or no timestamp)`,\n );\n else if (timestampMs > nowMs)\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" has a future exclusion date`,\n );\n continue;\n }\n if (annotation.type !== \"expires\") {\n errors.push(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must use quarantine-expires:`,\n );\n continue;\n }\n if (nowMs >= timestampMs + 24 * HOUR_MS)\n errors.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp} and is still present`,\n );\n else if (nowMs >= timestampMs)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp}; its removal PR should be merged`,\n );\n else if (nowMs >= timestampMs - 48 * HOUR_MS)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expires at ${annotation.timestamp}; prepare its removal PR`,\n );\n }\n const required = readRegistryFirstPartyPackages(lockfile);\n if (firstPartyPackages !== undefined) {\n for (const name of ownNames(firstPartyPackages)) required.add(name);\n }\n const declared = new Set(entries.map(({ name }) => name));\n const missing = [...required].filter((name) => !declared.has(name)).sort();\n if (missing.length > 0)\n errors.push(\n `bunfig.toml is missing registry-backed first-party quarantine excludes: ${missing.join(\", \")}`,\n );\n } catch (error) {\n errors.push(error instanceof Error ? error.message : String(error));\n }\n return { errors, warnings };\n};\n\ntype PruneOptions = { bunfig: string; parseToml: ParseToml; now?: Date };\nexport const pruneExpiredExcludes = ({\n bunfig,\n parseToml,\n now = new Date(),\n}: PruneOptions): { bunfig: string; pruned: string[] } => {\n const nowMs = validNow(now);\n const { entries, close } = readSourceArray(bunfig, parseToml);\n const removals: { start: number; end: number }[] = [];\n const pruned: string[] = [];\n for (const entry of entries) {\n if (ownPackage(entry.name)) continue;\n const annotation = annotationOf(entry);\n if (annotation.type !== \"expires\" || !exactTimestamp(annotation.timestamp))\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n if (nowMs < Date.parse(annotation.timestamp)) continue;\n const lineStart = bunfig.lastIndexOf(\"\\n\", entry.token.start - 1) + 1;\n const nextNewline = bunfig.indexOf(\"\\n\", entry.token.end);\n const lineEnd = nextNewline < 0 ? bunfig.length : nextNewline;\n const commentInside =\n entry.comment !== undefined && entry.comment.start < close.start;\n const end = commentInside\n ? (entry.comment?.end ?? entry.token.end)\n : (entry.comma?.end ?? entry.token.end);\n if (\n bunfig.slice(lineStart, entry.token.start).trim() === \"\" &&\n bunfig.slice(end, lineEnd).trim() === \"\"\n )\n removals.push({\n start: lineStart,\n end: nextNewline < 0 ? lineEnd : lineEnd + 1,\n });\n else removals.push({ start: entry.token.start, end });\n if (entry.comment !== undefined && !commentInside)\n removals.push({ start: entry.comment.start, end: entry.comment.end });\n pruned.push(entry.name);\n }\n let result = bunfig;\n for (const removal of removals.toReversed())\n result = result.slice(0, removal.start) + result.slice(removal.end);\n // Never return edited TOML without confirming the resulting source is valid.\n readSourceArray(result, parseToml);\n return { bunfig: result, pruned };\n};\n\ntype SynchronizeOptions = {\n bunfig: string;\n firstPartyPackages: FirstPartyPackages;\n parseToml: ParseToml;\n now?: Date;\n};\nexport const synchronizeFirstPartyExcludes = ({\n bunfig,\n firstPartyPackages,\n parseToml,\n now = new Date(),\n}: SynchronizeOptions): string => {\n validNow(now);\n const required = ownNames(firstPartyPackages);\n const { open, close, entries, comments } = readSourceArray(bunfig, parseToml);\n const attachedComments = new Set(\n entries.flatMap(({ comment }) => (comment === undefined ? [] : [comment])),\n );\n const lines = comments\n .filter((comment) => !attachedComments.has(comment))\n .map(({ text }) => ` ${text}`);\n const seen = new Set<string>();\n for (const entry of entries) {\n if (!ownPackage(entry.name)) {\n const annotation = annotationOf(entry);\n if (\n annotation.type !== \"expires\" ||\n !exactTimestamp(annotation.timestamp)\n )\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n lines.push(\n ` ${entry.token.text},${entry.comment === undefined ? \"\" : ` ${entry.comment.text}`}`,\n );\n continue;\n }\n if (!required.has(entry.name)) continue;\n seen.add(entry.name);\n const annotation = annotationOf(entry);\n const timestamp =\n annotation.type === \"excluded-since\" &&\n exactTimestamp(annotation.timestamp)\n ? annotation.timestamp\n : now.toISOString();\n lines.push(\n ` ${JSON.stringify(entry.name)}, # quarantine-excluded-since: ${timestamp}`,\n );\n }\n for (const name of [...required]\n .filter((requiredPackage) => !seen.has(requiredPackage))\n .sort())\n lines.push(\n ` ${JSON.stringify(name)}, # quarantine-excluded-since: ${now.toISOString()}`,\n );\n const newline = bunfig.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n const trailingComment = entries.at(-1)?.comment;\n const end =\n trailingComment !== undefined && trailingComment.start > close.end\n ? trailingComment.end\n : close.end;\n const result =\n bunfig.slice(0, open.start) +\n `[${newline}${lines.join(newline)}${lines.length === 0 ? \"\" : newline}]` +\n bunfig.slice(end);\n readSourceArray(result, parseToml);\n return result;\n};\n","import { parse } from \"smol-toml\";\n\nimport {\n checkQuarantinePolicy,\n isFirstPartyPackageName,\n pruneExpiredExcludes,\n readRegistryFirstPartyPackages,\n REQUIRED_RELEASE_AGE_SECONDS,\n synchronizeFirstPartyExcludes,\n} from \"./quarantine-policy-core\";\n\nexport {\n EXACT_UTC_TIMESTAMP,\n NPM_REGISTRY,\n REQUIRED_RELEASE_AGE_SECONDS,\n exactTimestamp,\n} from \"./quarantine-policy-core\";\n\nconst record = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/** Derive exact registry identities before install, including catalog references. */\nexport const declaredFirstPartyPackages = (files: Record<string, string>) => {\n const names = new Set<string>();\n for (const [file, text] of Object.entries(files)) {\n if (!/(?:^|\\/)package\\.json$/.test(file)) continue;\n const manifest: unknown = JSON.parse(text);\n if (!record(manifest)) throw new Error(`${file} must contain an object`);\n for (const field of [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n ]) {\n const dependencies = manifest[field];\n if (!record(dependencies)) continue;\n for (const [name, specifier] of Object.entries(dependencies)) {\n if (typeof specifier !== \"string\") continue;\n if (\n /^(?:workspace:|file:|link:|git(?:\\+|:)|https?:|github:|\\.\\.?\\/|\\/)/.test(\n specifier,\n )\n )\n continue;\n if (specifier.startsWith(\"npm:\")) {\n const alias = /^npm:(@[^/]+\\/[^@]+|[^@]+)@/.exec(specifier)?.at(1);\n if (alias !== undefined && isFirstPartyPackageName(alias))\n names.add(alias);\n continue;\n }\n if (isFirstPartyPackageName(name)) names.add(name);\n }\n }\n }\n return names;\n};\n\ntype RepositoryQuarantineOptions = {\n files: Record<string, string>;\n now?: Date | undefined;\n npmrcPresent?: boolean | undefined;\n};\n\nexport const checkRepositoryQuarantine = ({\n files,\n now,\n npmrcPresent,\n}: RepositoryQuarantineOptions) =>\n checkQuarantinePolicy({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n lockfile: files[\"bun.lock\"],\n firstPartyPackages: declaredFirstPartyPackages(files),\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n ...(npmrcPresent === undefined ? {} : { npmrcPresent }),\n });\n\nexport const synchronizeRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) => {\n const firstPartyPackages = new Set([\n ...declaredFirstPartyPackages(files),\n ...readRegistryFirstPartyPackages(files[\"bun.lock\"]),\n ]);\n return synchronizeFirstPartyExcludes({\n bunfig:\n files[\"bunfig.toml\"] ??\n `[install]\\nminimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}\\nminimumReleaseAgeExcludes = []\\n`,\n firstPartyPackages,\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n};\n\nexport const pruneRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) =>\n pruneExpiredExcludes({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n"],"mappings":";;;AAEA,MAAa,+BAA+B;AAC5C,MAAa,eAAe;AAC5B,MAAa,sBACX;AACF,MAAM,UAAU;AAChB,MAAM,gBAAgB;AACtB,MAAM,mBACJ;AAIF,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AACrE,MAAM,QAAoC,YAAY;CACpD,MAAM,IAAI,MAAM,OAAO;AACzB;AACA,MAAM,cAAc,SAAiB,KAAK,WAAW,QAAQ;AAC7D,MAAM,gBAAgB,SACpB,KAAK,UAAU,OAAO,cAAc,KAAK,IAAI;AAC/C,MAAa,2BAA2B,SACtC,aAAa,IAAI,KAAK,WAAW,IAAI;AAEvC,MAAa,kBAAkB,UAA2B;CACxD,MAAM,YAAY,KAAK,MAAM,KAAK;CAClC,OACE,oBAAoB,KAAK,KAAK,KAC9B,CAAC,OAAO,MAAM,SAAS,KACvB,IAAI,KAAK,SAAS,CAAC,CAAC,YAAY,MAAM;AAE1C;AAEA,MAAa,sBACX,QACA,cACa;CACb,MAAM,SAAS,UAAU,MAAM;CAC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;CAChC,UAAU,MAAM;CAChB,oBAAoB,2BAA2B,KAAK;CACpD,WAAWC,UAAAA;CACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;CACnC,GAAI,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,aAAa;AACvD,CAAC;AAEH,MAAa,mCAAmC,EAC9C,OACA,UACiC;CACjC,MAAM,qCAAqB,IAAI,IAAI,CACjC,GAAG,2BAA2B,KAAK,GACnC,GAAG,+BAA+B,MAAM,WAAW,CACrD,CAAC;CACD,OAAO,8BAA8B;EACnC,QACE,MAAM,kBACN;EACF;EACA,WAAWA,UAAAA;EACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;CACrC,CAAC;AACH;AAEA,MAAa,6BAA6B,EACxC,OACA,UAEA,qBAAqB;CACnB,QAAQ,MAAM,kBAAkB;CAChC,WAAWA,UAAAA;CACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;AACrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"quarantine-policy2.mjs","names":[],"sources":["../src/quarantine-policy-core.ts","../src/quarantine-policy.ts"],"sourcesContent":["import { parseJsonc } from \"./jsonc\";\n\nexport const REQUIRED_RELEASE_AGE_SECONDS = 5 * 24 * 60 * 60;\nexport const NPM_REGISTRY = \"https://registry.npmjs.org\";\nexport const EXACT_UTC_TIMESTAMP =\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/u;\nconst HOUR_MS = 60 * 60 * 1000;\nconst EXACT_PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/u;\nconst REGISTRY_VERSION =\n /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/u;\n\ntype ParseToml = (text: string) => unknown;\ntype FirstPartyPackages = ReadonlySet<string> | readonly string[];\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\nconst fail: (message: string) => never = (message) => {\n throw new Error(message);\n};\nconst ownPackage = (name: string) => name.startsWith(\"@stll/\");\nconst exactPackage = (name: string) =>\n name.length <= 214 && EXACT_PACKAGE.test(name);\nexport const isFirstPartyPackageName = (name: string): boolean =>\n exactPackage(name) && ownPackage(name);\n\nexport const exactTimestamp = (value: string): boolean => {\n const timestamp = Date.parse(value);\n return (\n EXACT_UTC_TIMESTAMP.test(value) &&\n !Number.isNaN(timestamp) &&\n new Date(timestamp).toISOString() === value\n );\n};\n\nexport const readParsedExcludes = (\n bunfig: string,\n parseToml: ParseToml,\n): string[] => {\n const parsed = parseToml(bunfig);\n if (!isRecord(parsed) || !isRecord(parsed[\"install\"]))\n return fail(\"bunfig.toml must contain an [install] table\");\n const install = parsed[\"install\"];\n if (\n (\"registry\" in install && install[\"registry\"] !== NPM_REGISTRY) ||\n (\"scopes\" in install &&\n (!isRecord(install[\"scopes\"]) ||\n Object.keys(install[\"scopes\"]).length > 0))\n )\n fail(\"bunfig.toml quarantine policy requires the canonical npm registry\");\n if (install[\"minimumReleaseAge\"] !== REQUIRED_RELEASE_AGE_SECONDS)\n fail(\n `bunfig.toml must set minimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}`,\n );\n if (!Array.isArray(install[\"minimumReleaseAgeExcludes\"]))\n return fail(\n \"bunfig.toml must declare minimumReleaseAgeExcludes as an array\",\n );\n const names: string[] = [];\n for (const value of install[\"minimumReleaseAgeExcludes\"]) {\n if (typeof value !== \"string\" || !exactPackage(value))\n return fail(\n \"bunfig.toml minimumReleaseAgeExcludes must contain only exact npm package names\",\n );\n names.push(value);\n }\n if (new Set(names).size !== names.length)\n fail(\"bunfig.toml minimumReleaseAgeExcludes must not contain duplicates\");\n return names;\n};\n\ntype Token = {\n type: \"string\" | \"atom\" | \"punctuation\" | \"comment\" | \"newline\";\n start: number;\n end: number;\n text: string;\n};\n// Tokenize before locating declarations: text in comments, multiline strings and\n// unrelated tables cannot masquerade as the install policy's source array.\nconst tokensOf = (text: string): Token[] => {\n const tokens: Token[] = [];\n let index = 0;\n while (index < text.length) {\n const start = index;\n const character = text.charAt(index++);\n if (character === \"\\n\") {\n tokens.push({ type: \"newline\", start, end: index, text: character });\n continue;\n }\n if (/\\s/u.test(character)) continue;\n let type: Token[\"type\"];\n if (character === \"#\") {\n type = \"comment\";\n while (index < text.length && text.charAt(index) !== \"\\n\") index++;\n } else if (character === '\"' || character === \"'\") {\n type = \"string\";\n const triple = text.slice(start, start + 3) === character.repeat(3);\n if (triple) index = start + 3;\n while (index < text.length) {\n const current = text.charAt(index++);\n if (character === '\"' && current === \"\\\\\") {\n index++;\n continue;\n }\n if (current !== character) continue;\n if (!triple) break;\n if (text.slice(index - 1, index + 2) !== character.repeat(3)) continue;\n index += 2;\n while (text.charAt(index) === character) index++;\n break;\n }\n } else if (\"[]=.,{}\".includes(character)) type = \"punctuation\";\n else {\n type = \"atom\";\n while (\n index < text.length &&\n !/[\\s#[\\]=.,{}\"']/u.test(text.charAt(index))\n )\n index++;\n }\n tokens.push({\n type,\n start,\n end: index,\n text:\n type === \"comment\"\n ? text.slice(start, index).replace(/\\r$/u, \"\")\n : text.slice(start, index),\n });\n }\n return tokens;\n};\n\nconst stringValue = (token: Token, parseToml: ParseToml): string => {\n const parsed = parseToml(`value = ${token.text}`);\n if (!isRecord(parsed) || typeof parsed[\"value\"] !== \"string\")\n return fail(\"bunfig.toml has an unsupported quarantine string\");\n return parsed[\"value\"];\n};\nconst keyParts = (tokens: readonly Token[], parseToml: ParseToml): string[] =>\n tokens\n .filter(({ text }) => text !== \".\")\n .map((token) =>\n token.type === \"string\" ? stringValue(token, parseToml) : token.text,\n );\n\ntype Entry = {\n name: string;\n token: Token;\n comment: Token | undefined;\n comma: Token | undefined;\n};\ntype SourceArray = {\n open: Token;\n close: Token;\n entries: Entry[];\n comments: Token[];\n};\nconst readSourceArray = (bunfig: string, parseToml: ParseToml): SourceArray => {\n const names = readParsedExcludes(bunfig, parseToml);\n let table: string[] = [];\n let statement: Token[] = [];\n let depth = 0;\n let found: SourceArray | undefined;\n const visitStatement = () => {\n const meaningful = statement.filter(\n ({ type }) => type !== \"comment\" && type !== \"newline\",\n );\n const first = meaningful.at(0);\n if (first?.text === \"[\") {\n const end = meaningful.at(-1);\n if (end?.text === \"]\")\n table = keyParts(meaningful.slice(1, -1), parseToml);\n return;\n }\n const equals = meaningful.findIndex(({ text }) => text === \"=\");\n if (equals < 0) return;\n const key = [...table, ...keyParts(meaningful.slice(0, equals), parseToml)];\n if (\n key.join(\".\") !== \"install.minimumReleaseAgeExcludes\" ||\n key.length !== 2\n )\n return;\n const open = meaningful.at(equals + 1);\n const close = meaningful.at(-1);\n if (\n open === undefined ||\n close === undefined ||\n open.text !== \"[\" ||\n close.text !== \"]\" ||\n found !== undefined\n )\n fail(\n \"bunfig.toml must declare a single install minimumReleaseAgeExcludes array\",\n );\n const values = meaningful.slice(equals + 2, -1);\n if (values.some(({ type, text }) => type !== \"string\" && text !== \",\"))\n fail(\"bunfig.toml quarantine array must contain package strings\");\n const strings = values.filter(({ type }) => type === \"string\");\n const comments = statement.filter(({ type }) => type === \"comment\");\n const entries = strings.map((token, index) => {\n const next = strings.at(index + 1)?.start ?? Number.POSITIVE_INFINITY;\n const comment = comments.find(\n (candidate) =>\n candidate.start >= token.end &&\n candidate.start < next &&\n !bunfig.slice(token.end, candidate.start).includes(\"\\n\"),\n );\n const following = values.find(\n (candidate) => candidate.start >= token.end,\n );\n return {\n name: stringValue(token, parseToml),\n token,\n comment,\n comma: following?.text === \",\" ? following : undefined,\n };\n });\n if (\n entries.length !== names.length ||\n entries.some(({ name }, index) => name !== names.at(index))\n )\n fail(\n \"bunfig.toml quarantine source does not match its parsed install array\",\n );\n found = { open, close, entries, comments };\n };\n for (const token of tokensOf(bunfig)) {\n if (token.type === \"newline\" && depth === 0) {\n visitStatement();\n statement = [];\n continue;\n }\n statement.push(token);\n if (token.type !== \"punctuation\") continue;\n if (token.text === \"[\" || token.text === \"{\") depth++;\n if (token.text === \"]\" || token.text === \"}\") depth--;\n }\n visitStatement();\n if (found === undefined)\n return fail(\n \"bunfig.toml must declare an explicit [install] minimumReleaseAgeExcludes array\",\n );\n return found;\n};\n\ntype Annotation =\n | { type: \"none\" }\n | { type: \"invalid\" }\n | { type: \"expires\" | \"excluded-since\"; timestamp: string };\nconst annotationOf = ({ comment }: Entry): Annotation => {\n if (comment === undefined) return { type: \"none\" };\n const match = /^#\\s*quarantine-(expires|excluded-since):\\s*(\\S+)\\s*$/u.exec(\n comment.text,\n );\n const marker = match?.at(1);\n const timestamp = match?.at(2);\n if (\n (marker === \"expires\" || marker === \"excluded-since\") &&\n timestamp !== undefined\n )\n return { type: marker, timestamp };\n return { type: \"invalid\" };\n};\n\nexport const readRegistryFirstPartyPackages = (\n lockfile: string | undefined,\n): Set<string> => {\n if (lockfile === undefined) return new Set();\n const parsed = parseJsonc(lockfile);\n if (!isRecord(parsed) || !isRecord(parsed[\"packages\"]))\n return fail(\"bun.lock must contain a packages mapping\");\n const names = new Set<string>();\n for (const value of Object.values(parsed[\"packages\"])) {\n if (!Array.isArray(value)) continue;\n const identity: unknown = value.at(0);\n if (typeof identity !== \"string\") continue;\n const separator = identity.lastIndexOf(\"@\");\n const name = identity.slice(0, separator);\n if (\n exactPackage(name) &&\n ownPackage(name) &&\n REGISTRY_VERSION.test(identity.slice(separator + 1))\n )\n names.add(name);\n }\n return names;\n};\n\nconst ownNames = (names: FirstPartyPackages): Set<string> => {\n const result = new Set(names);\n for (const name of result)\n if (!exactPackage(name) || !ownPackage(name))\n fail(`Expected an exact first-party npm package name: ${name}`);\n return result;\n};\nconst validNow = (now: Date): number => {\n if (!Number.isFinite(now.getTime()))\n return fail(\"Quarantine policy requires a valid current date\");\n return now.getTime();\n};\nexport type CheckResult = { errors: string[]; warnings: string[] };\ntype CheckOptions = {\n bunfig: string;\n lockfile: string | undefined;\n parseToml: ParseToml;\n npmrcPresent?: boolean;\n now?: Date;\n firstPartyPackages?: FirstPartyPackages;\n};\nexport const checkQuarantinePolicy = ({\n bunfig,\n lockfile,\n parseToml,\n npmrcPresent = false,\n now = new Date(),\n firstPartyPackages,\n}: CheckOptions): CheckResult => {\n const errors: string[] = [];\n const warnings: string[] = [];\n try {\n const nowMs = validNow(now);\n const { entries } = readSourceArray(bunfig, parseToml);\n if (npmrcPresent)\n errors.push(\n \"bunfig.toml quarantine policy does not allow a repository .npmrc\",\n );\n for (const entry of entries) {\n const annotation = annotationOf(entry);\n if (ownPackage(entry.name) && annotation.type === \"none\") continue;\n if (annotation.type === \"none\" || annotation.type === \"invalid\") {\n errors.push(\n `bunfig.toml has an unannotated or malformed quarantine exclude: ${entry.name}`,\n );\n continue;\n }\n if (!exactTimestamp(annotation.timestamp)) {\n errors.push(\n `bunfig.toml quarantine exclude \"${entry.name}\" has an invalid UTC timestamp: ${annotation.timestamp}`,\n );\n continue;\n }\n const timestampMs = Date.parse(annotation.timestamp);\n if (ownPackage(entry.name)) {\n if (annotation.type !== \"excluded-since\")\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" must be permanent (quarantine-excluded-since: or no timestamp)`,\n );\n else if (timestampMs > nowMs)\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" has a future exclusion date`,\n );\n continue;\n }\n if (annotation.type !== \"expires\") {\n errors.push(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must use quarantine-expires:`,\n );\n continue;\n }\n if (nowMs >= timestampMs + 24 * HOUR_MS)\n errors.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp} and is still present`,\n );\n else if (nowMs >= timestampMs)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp}; its removal PR should be merged`,\n );\n else if (nowMs >= timestampMs - 48 * HOUR_MS)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expires at ${annotation.timestamp}; prepare its removal PR`,\n );\n }\n const required = readRegistryFirstPartyPackages(lockfile);\n if (firstPartyPackages !== undefined) {\n for (const name of ownNames(firstPartyPackages)) required.add(name);\n }\n const declared = new Set(entries.map(({ name }) => name));\n const missing = [...required].filter((name) => !declared.has(name)).sort();\n if (missing.length > 0)\n errors.push(\n `bunfig.toml is missing registry-backed first-party quarantine excludes: ${missing.join(\", \")}`,\n );\n } catch (error) {\n errors.push(error instanceof Error ? error.message : String(error));\n }\n return { errors, warnings };\n};\n\ntype PruneOptions = { bunfig: string; parseToml: ParseToml; now?: Date };\nexport const pruneExpiredExcludes = ({\n bunfig,\n parseToml,\n now = new Date(),\n}: PruneOptions): { bunfig: string; pruned: string[] } => {\n const nowMs = validNow(now);\n const { entries, close } = readSourceArray(bunfig, parseToml);\n const removals: { start: number; end: number }[] = [];\n const pruned: string[] = [];\n for (const entry of entries) {\n if (ownPackage(entry.name)) continue;\n const annotation = annotationOf(entry);\n if (annotation.type !== \"expires\" || !exactTimestamp(annotation.timestamp))\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n if (nowMs < Date.parse(annotation.timestamp)) continue;\n const lineStart = bunfig.lastIndexOf(\"\\n\", entry.token.start - 1) + 1;\n const nextNewline = bunfig.indexOf(\"\\n\", entry.token.end);\n const lineEnd = nextNewline < 0 ? bunfig.length : nextNewline;\n const commentInside =\n entry.comment !== undefined && entry.comment.start < close.start;\n const end = commentInside\n ? (entry.comment?.end ?? entry.token.end)\n : (entry.comma?.end ?? entry.token.end);\n if (\n bunfig.slice(lineStart, entry.token.start).trim() === \"\" &&\n bunfig.slice(end, lineEnd).trim() === \"\"\n )\n removals.push({\n start: lineStart,\n end: nextNewline < 0 ? lineEnd : lineEnd + 1,\n });\n else removals.push({ start: entry.token.start, end });\n if (entry.comment !== undefined && !commentInside)\n removals.push({ start: entry.comment.start, end: entry.comment.end });\n pruned.push(entry.name);\n }\n let result = bunfig;\n for (const removal of removals.toReversed())\n result = result.slice(0, removal.start) + result.slice(removal.end);\n // Never return edited TOML without confirming the resulting source is valid.\n readSourceArray(result, parseToml);\n return { bunfig: result, pruned };\n};\n\ntype SynchronizeOptions = {\n bunfig: string;\n firstPartyPackages: FirstPartyPackages;\n parseToml: ParseToml;\n now?: Date;\n};\nexport const synchronizeFirstPartyExcludes = ({\n bunfig,\n firstPartyPackages,\n parseToml,\n now = new Date(),\n}: SynchronizeOptions): string => {\n validNow(now);\n const required = ownNames(firstPartyPackages);\n const { open, close, entries, comments } = readSourceArray(bunfig, parseToml);\n const attachedComments = new Set(\n entries.flatMap(({ comment }) => (comment === undefined ? [] : [comment])),\n );\n const lines = comments\n .filter((comment) => !attachedComments.has(comment))\n .map(({ text }) => ` ${text}`);\n const seen = new Set<string>();\n for (const entry of entries) {\n if (!ownPackage(entry.name)) {\n const annotation = annotationOf(entry);\n if (\n annotation.type !== \"expires\" ||\n !exactTimestamp(annotation.timestamp)\n )\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n lines.push(\n ` ${entry.token.text},${entry.comment === undefined ? \"\" : ` ${entry.comment.text}`}`,\n );\n continue;\n }\n if (!required.has(entry.name)) continue;\n seen.add(entry.name);\n const annotation = annotationOf(entry);\n const timestamp =\n annotation.type === \"excluded-since\" &&\n exactTimestamp(annotation.timestamp)\n ? annotation.timestamp\n : now.toISOString();\n lines.push(\n ` ${JSON.stringify(entry.name)}, # quarantine-excluded-since: ${timestamp}`,\n );\n }\n for (const name of [...required]\n .filter((requiredPackage) => !seen.has(requiredPackage))\n .sort())\n lines.push(\n ` ${JSON.stringify(name)}, # quarantine-excluded-since: ${now.toISOString()}`,\n );\n const newline = bunfig.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n const trailingComment = entries.at(-1)?.comment;\n const end =\n trailingComment !== undefined && trailingComment.start > close.end\n ? trailingComment.end\n : close.end;\n const result =\n bunfig.slice(0, open.start) +\n `[${newline}${lines.join(newline)}${lines.length === 0 ? \"\" : newline}]` +\n bunfig.slice(end);\n readSourceArray(result, parseToml);\n return result;\n};\n","import { parse } from \"smol-toml\";\n\nimport {\n REQUIRED_RELEASE_AGE_SECONDS,\n checkQuarantinePolicy,\n isFirstPartyPackageName,\n pruneExpiredExcludes,\n readRegistryFirstPartyPackages,\n synchronizeFirstPartyExcludes,\n} from \"./quarantine-policy-core\";\n\nexport {\n EXACT_UTC_TIMESTAMP,\n NPM_REGISTRY,\n REQUIRED_RELEASE_AGE_SECONDS,\n exactTimestamp,\n} from \"./quarantine-policy-core\";\n\nconst record = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/** Derive exact registry identities before install, including catalog references. */\nexport const declaredFirstPartyPackages = (files: Record<string, string>) => {\n const names = new Set<string>();\n for (const [file, text] of Object.entries(files)) {\n if (!/(?:^|\\/)package\\.json$/.test(file)) continue;\n const manifest: unknown = JSON.parse(text);\n if (!record(manifest)) throw new Error(`${file} must contain an object`);\n for (const field of [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n ]) {\n const dependencies = manifest[field];\n if (!record(dependencies)) continue;\n for (const [name, specifier] of Object.entries(dependencies)) {\n if (typeof specifier !== \"string\") continue;\n if (\n /^(?:workspace:|file:|link:|git(?:\\+|:)|https?:|github:|\\.\\.?\\/|\\/)/.test(\n specifier,\n )\n )\n continue;\n if (specifier.startsWith(\"npm:\")) {\n const alias = /^npm:(@[^/]+\\/[^@]+|[^@]+)@/.exec(specifier)?.at(1);\n if (alias !== undefined && isFirstPartyPackageName(alias))\n names.add(alias);\n continue;\n }\n if (isFirstPartyPackageName(name)) names.add(name);\n }\n }\n }\n return names;\n};\n\ntype RepositoryQuarantineOptions = {\n files: Record<string, string>;\n now?: Date | undefined;\n npmrcPresent?: boolean | undefined;\n};\n\nexport const checkRepositoryQuarantine = ({\n files,\n now,\n npmrcPresent,\n}: RepositoryQuarantineOptions) =>\n checkQuarantinePolicy({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n lockfile: files[\"bun.lock\"],\n firstPartyPackages: declaredFirstPartyPackages(files),\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n ...(npmrcPresent === undefined ? {} : { npmrcPresent }),\n });\n\nexport const synchronizeRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) => {\n const firstPartyPackages = new Set([\n ...declaredFirstPartyPackages(files),\n ...readRegistryFirstPartyPackages(files[\"bun.lock\"]),\n ]);\n return synchronizeFirstPartyExcludes({\n bunfig:\n files[\"bunfig.toml\"] ??\n `[install]\\nminimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}\\nminimumReleaseAgeExcludes = []\\n`,\n firstPartyPackages,\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n};\n\nexport const pruneRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) =>\n pruneExpiredExcludes({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n"],"mappings":";;;AAEA,MAAa,+BAA+B;AAC5C,MAAa,eAAe;AAC5B,MAAa,sBACX;AACF,MAAM,UAAU;AAChB,MAAM,gBAAgB;AACtB,MAAM,mBACJ;AAIF,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AACrE,MAAM,QAAoC,YAAY;CACpD,MAAM,IAAI,MAAM,OAAO;AACzB;AACA,MAAM,cAAc,SAAiB,KAAK,WAAW,QAAQ;AAC7D,MAAM,gBAAgB,SACpB,KAAK,UAAU,OAAO,cAAc,KAAK,IAAI;AAC/C,MAAa,2BAA2B,SACtC,aAAa,IAAI,KAAK,WAAW,IAAI;AAEvC,MAAa,kBAAkB,UAA2B;CACxD,MAAM,YAAY,KAAK,MAAM,KAAK;CAClC,OACE,oBAAoB,KAAK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BAAwB,IAAI,GAAG,MAAM,IAAI,IAAI;GACnD;EACF;CACF;CACA,OAAO;AACT;AAQA,MAAa,6BAA6B,EACxC,OACA,KACA,mBAEA,sBAAsB;CACpB,QAAQ,MAAM,kBAAkB;CAChC,UAAU,MAAM;CAChB,oBAAoB,2BAA2B,KAAK;CACpD,WAAW;CACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;CACnC,GAAI,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,aAAa;AACvD,CAAC;AAEH,MAAa,mCAAmC,EAC9C,OACA,UACiC;CACjC,MAAM,qCAAqB,IAAI,IAAI,CACjC,GAAG,2BAA2B,KAAK,GACnC,GAAG,+BAA+B,MAAM,WAAW,CACrD,CAAC;CACD,OAAO,8BAA8B;EACnC,QACE,MAAM,kBACN;EACF;EACA,WAAW;EACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;CACrC,CAAC;AACH;AAEA,MAAa,6BAA6B,EACxC,OACA,UAEA,qBAAqB;CACnB,QAAQ,MAAM,kBAAkB;CAChC,WAAW;CACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;AACrC,CAAC"}
1
+ {"version":3,"file":"quarantine-policy2.mjs","names":[],"sources":["../src/quarantine-policy-core.ts","../src/quarantine-policy.ts"],"sourcesContent":["import { parseJsonc } from \"./jsonc\";\n\nexport const REQUIRED_RELEASE_AGE_SECONDS = 5 * 24 * 60 * 60;\nexport const NPM_REGISTRY = \"https://registry.npmjs.org\";\nexport const EXACT_UTC_TIMESTAMP =\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/u;\nconst HOUR_MS = 60 * 60 * 1000;\nconst EXACT_PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/u;\nconst REGISTRY_VERSION =\n /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/u;\n\ntype ParseToml = (text: string) => unknown;\ntype FirstPartyPackages = ReadonlySet<string> | readonly string[];\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\nconst fail: (message: string) => never = (message) => {\n throw new Error(message);\n};\nconst ownPackage = (name: string) => name.startsWith(\"@stll/\");\nconst exactPackage = (name: string) =>\n name.length <= 214 && EXACT_PACKAGE.test(name);\nexport const isFirstPartyPackageName = (name: string): boolean =>\n exactPackage(name) && ownPackage(name);\n\nexport const exactTimestamp = (value: string): boolean => {\n const timestamp = Date.parse(value);\n return (\n EXACT_UTC_TIMESTAMP.test(value) &&\n !Number.isNaN(timestamp) &&\n new Date(timestamp).toISOString() === value\n );\n};\n\nexport const readParsedExcludes = (\n bunfig: string,\n parseToml: ParseToml,\n): string[] => {\n const parsed = parseToml(bunfig);\n if (!isRecord(parsed) || !isRecord(parsed[\"install\"]))\n return fail(\"bunfig.toml must contain an [install] table\");\n const install = parsed[\"install\"];\n if (\n (\"registry\" in install && install[\"registry\"] !== NPM_REGISTRY) ||\n (\"scopes\" in install &&\n (!isRecord(install[\"scopes\"]) ||\n Object.keys(install[\"scopes\"]).length > 0))\n )\n fail(\"bunfig.toml quarantine policy requires the canonical npm registry\");\n if (install[\"minimumReleaseAge\"] !== REQUIRED_RELEASE_AGE_SECONDS)\n fail(\n `bunfig.toml must set minimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}`,\n );\n if (!Array.isArray(install[\"minimumReleaseAgeExcludes\"]))\n return fail(\n \"bunfig.toml must declare minimumReleaseAgeExcludes as an array\",\n );\n const names: string[] = [];\n for (const value of install[\"minimumReleaseAgeExcludes\"]) {\n if (typeof value !== \"string\" || !exactPackage(value))\n return fail(\n \"bunfig.toml minimumReleaseAgeExcludes must contain only exact npm package names\",\n );\n names.push(value);\n }\n if (new Set(names).size !== names.length)\n fail(\"bunfig.toml minimumReleaseAgeExcludes must not contain duplicates\");\n return names;\n};\n\ntype Token = {\n type: \"string\" | \"atom\" | \"punctuation\" | \"comment\" | \"newline\";\n start: number;\n end: number;\n text: string;\n};\n// Tokenize before locating declarations: text in comments, multiline strings and\n// unrelated tables cannot masquerade as the install policy's source array.\nconst tokensOf = (text: string): Token[] => {\n const tokens: Token[] = [];\n let index = 0;\n while (index < text.length) {\n const start = index;\n const character = text.charAt(index++);\n if (character === \"\\n\") {\n tokens.push({ type: \"newline\", start, end: index, text: character });\n continue;\n }\n if (/\\s/u.test(character)) continue;\n let type: Token[\"type\"];\n if (character === \"#\") {\n type = \"comment\";\n while (index < text.length && text.charAt(index) !== \"\\n\") index++;\n } else if (character === '\"' || character === \"'\") {\n type = \"string\";\n const triple = text.slice(start, start + 3) === character.repeat(3);\n if (triple) index = start + 3;\n while (index < text.length) {\n const current = text.charAt(index++);\n if (character === '\"' && current === \"\\\\\") {\n index++;\n continue;\n }\n if (current !== character) continue;\n if (!triple) break;\n if (text.slice(index - 1, index + 2) !== character.repeat(3)) continue;\n index += 2;\n while (text.charAt(index) === character) index++;\n break;\n }\n } else if (\"[]=.,{}\".includes(character)) type = \"punctuation\";\n else {\n type = \"atom\";\n while (\n index < text.length &&\n !/[\\s#[\\]=.,{}\"']/u.test(text.charAt(index))\n )\n index++;\n }\n tokens.push({\n type,\n start,\n end: index,\n text:\n type === \"comment\"\n ? text.slice(start, index).replace(/\\r$/u, \"\")\n : text.slice(start, index),\n });\n }\n return tokens;\n};\n\nconst stringValue = (token: Token, parseToml: ParseToml): string => {\n const parsed = parseToml(`value = ${token.text}`);\n if (!isRecord(parsed) || typeof parsed[\"value\"] !== \"string\")\n return fail(\"bunfig.toml has an unsupported quarantine string\");\n return parsed[\"value\"];\n};\nconst keyParts = (tokens: readonly Token[], parseToml: ParseToml): string[] =>\n tokens\n .filter(({ text }) => text !== \".\")\n .map((token) =>\n token.type === \"string\" ? stringValue(token, parseToml) : token.text,\n );\n\ntype Entry = {\n name: string;\n token: Token;\n comment: Token | undefined;\n comma: Token | undefined;\n};\ntype SourceArray = {\n open: Token;\n close: Token;\n entries: Entry[];\n comments: Token[];\n};\nconst readSourceArray = (bunfig: string, parseToml: ParseToml): SourceArray => {\n const names = readParsedExcludes(bunfig, parseToml);\n let table: string[] = [];\n let statement: Token[] = [];\n let depth = 0;\n let found: SourceArray | undefined;\n const visitStatement = () => {\n const meaningful = statement.filter(\n ({ type }) => type !== \"comment\" && type !== \"newline\",\n );\n const first = meaningful.at(0);\n if (first?.text === \"[\") {\n const end = meaningful.at(-1);\n if (end?.text === \"]\")\n table = keyParts(meaningful.slice(1, -1), parseToml);\n return;\n }\n const equals = meaningful.findIndex(({ text }) => text === \"=\");\n if (equals < 0) return;\n const key = [...table, ...keyParts(meaningful.slice(0, equals), parseToml)];\n if (\n key.join(\".\") !== \"install.minimumReleaseAgeExcludes\" ||\n key.length !== 2\n )\n return;\n const open = meaningful.at(equals + 1);\n const close = meaningful.at(-1);\n if (\n open === undefined ||\n close === undefined ||\n open.text !== \"[\" ||\n close.text !== \"]\" ||\n found !== undefined\n )\n fail(\n \"bunfig.toml must declare a single install minimumReleaseAgeExcludes array\",\n );\n const values = meaningful.slice(equals + 2, -1);\n if (values.some(({ type, text }) => type !== \"string\" && text !== \",\"))\n fail(\"bunfig.toml quarantine array must contain package strings\");\n const strings = values.filter(({ type }) => type === \"string\");\n const comments = statement.filter(({ type }) => type === \"comment\");\n const entries = strings.map((token, index) => {\n const next = strings.at(index + 1)?.start ?? Number.POSITIVE_INFINITY;\n const comment = comments.find(\n (candidate) =>\n candidate.start >= token.end &&\n candidate.start < next &&\n !bunfig.slice(token.end, candidate.start).includes(\"\\n\"),\n );\n const following = values.find(\n (candidate) => candidate.start >= token.end,\n );\n return {\n name: stringValue(token, parseToml),\n token,\n comment,\n comma: following?.text === \",\" ? following : undefined,\n };\n });\n if (\n entries.length !== names.length ||\n entries.some(({ name }, index) => name !== names.at(index))\n )\n fail(\n \"bunfig.toml quarantine source does not match its parsed install array\",\n );\n found = { open, close, entries, comments };\n };\n for (const token of tokensOf(bunfig)) {\n if (token.type === \"newline\" && depth === 0) {\n visitStatement();\n statement = [];\n continue;\n }\n statement.push(token);\n if (token.type !== \"punctuation\") continue;\n if (token.text === \"[\" || token.text === \"{\") depth++;\n if (token.text === \"]\" || token.text === \"}\") depth--;\n }\n visitStatement();\n if (found === undefined)\n return fail(\n \"bunfig.toml must declare an explicit [install] minimumReleaseAgeExcludes array\",\n );\n return found;\n};\n\ntype Annotation =\n | { type: \"none\" }\n | { type: \"invalid\" }\n | { type: \"expires\" | \"excluded-since\"; timestamp: string };\nconst annotationOf = ({ comment }: Entry): Annotation => {\n if (comment === undefined) return { type: \"none\" };\n const match = /^#\\s*quarantine-(expires|excluded-since):\\s*(\\S+)\\s*$/u.exec(\n comment.text,\n );\n const marker = match?.at(1);\n const timestamp = match?.at(2);\n if (\n (marker === \"expires\" || marker === \"excluded-since\") &&\n timestamp !== undefined\n )\n return { type: marker, timestamp };\n return { type: \"invalid\" };\n};\n\nexport const readRegistryFirstPartyPackages = (\n lockfile: string | undefined,\n): Set<string> => {\n if (lockfile === undefined) return new Set();\n const parsed = parseJsonc(lockfile);\n if (!isRecord(parsed) || !isRecord(parsed[\"packages\"]))\n return fail(\"bun.lock must contain a packages mapping\");\n const names = new Set<string>();\n for (const value of Object.values(parsed[\"packages\"])) {\n if (!Array.isArray(value)) continue;\n const identity: unknown = value.at(0);\n if (typeof identity !== \"string\") continue;\n const separator = identity.lastIndexOf(\"@\");\n const name = identity.slice(0, separator);\n if (\n exactPackage(name) &&\n ownPackage(name) &&\n REGISTRY_VERSION.test(identity.slice(separator + 1))\n )\n names.add(name);\n }\n return names;\n};\n\nconst ownNames = (names: FirstPartyPackages): Set<string> => {\n const result = new Set(names);\n for (const name of result)\n if (!exactPackage(name) || !ownPackage(name))\n fail(`Expected an exact first-party npm package name: ${name}`);\n return result;\n};\nconst validNow = (now: Date): number => {\n if (!Number.isFinite(now.getTime()))\n return fail(\"Quarantine policy requires a valid current date\");\n return now.getTime();\n};\nexport type CheckResult = { errors: string[]; warnings: string[] };\ntype CheckOptions = {\n bunfig: string;\n lockfile: string | undefined;\n parseToml: ParseToml;\n npmrcPresent?: boolean;\n now?: Date;\n firstPartyPackages?: FirstPartyPackages;\n};\nexport const checkQuarantinePolicy = ({\n bunfig,\n lockfile,\n parseToml,\n npmrcPresent = false,\n now = new Date(),\n firstPartyPackages,\n}: CheckOptions): CheckResult => {\n const errors: string[] = [];\n const warnings: string[] = [];\n try {\n const nowMs = validNow(now);\n const { entries } = readSourceArray(bunfig, parseToml);\n if (npmrcPresent)\n errors.push(\n \"bunfig.toml quarantine policy does not allow a repository .npmrc\",\n );\n for (const entry of entries) {\n const annotation = annotationOf(entry);\n if (ownPackage(entry.name) && annotation.type === \"none\") continue;\n if (annotation.type === \"none\" || annotation.type === \"invalid\") {\n errors.push(\n `bunfig.toml has an unannotated or malformed quarantine exclude: ${entry.name}`,\n );\n continue;\n }\n if (!exactTimestamp(annotation.timestamp)) {\n errors.push(\n `bunfig.toml quarantine exclude \"${entry.name}\" has an invalid UTC timestamp: ${annotation.timestamp}`,\n );\n continue;\n }\n const timestampMs = Date.parse(annotation.timestamp);\n if (ownPackage(entry.name)) {\n if (annotation.type !== \"excluded-since\")\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" must be permanent (quarantine-excluded-since: or no timestamp)`,\n );\n else if (timestampMs > nowMs)\n errors.push(\n `bunfig.toml first-party quarantine exclude \"${entry.name}\" has a future exclusion date`,\n );\n continue;\n }\n if (annotation.type !== \"expires\") {\n errors.push(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must use quarantine-expires:`,\n );\n continue;\n }\n if (nowMs >= timestampMs + 24 * HOUR_MS)\n errors.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp} and is still present`,\n );\n else if (nowMs >= timestampMs)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expired at ${annotation.timestamp}; its removal PR should be merged`,\n );\n else if (nowMs >= timestampMs - 48 * HOUR_MS)\n warnings.push(\n `bunfig.toml temporary quarantine exclude \"${entry.name}\" expires at ${annotation.timestamp}; prepare its removal PR`,\n );\n }\n const required = readRegistryFirstPartyPackages(lockfile);\n if (firstPartyPackages !== undefined) {\n for (const name of ownNames(firstPartyPackages)) required.add(name);\n }\n const declared = new Set(entries.map(({ name }) => name));\n const missing = [...required].filter((name) => !declared.has(name)).sort();\n if (missing.length > 0)\n errors.push(\n `bunfig.toml is missing registry-backed first-party quarantine excludes: ${missing.join(\", \")}`,\n );\n } catch (error) {\n errors.push(error instanceof Error ? error.message : String(error));\n }\n return { errors, warnings };\n};\n\ntype PruneOptions = { bunfig: string; parseToml: ParseToml; now?: Date };\nexport const pruneExpiredExcludes = ({\n bunfig,\n parseToml,\n now = new Date(),\n}: PruneOptions): { bunfig: string; pruned: string[] } => {\n const nowMs = validNow(now);\n const { entries, close } = readSourceArray(bunfig, parseToml);\n const removals: { start: number; end: number }[] = [];\n const pruned: string[] = [];\n for (const entry of entries) {\n if (ownPackage(entry.name)) continue;\n const annotation = annotationOf(entry);\n if (annotation.type !== \"expires\" || !exactTimestamp(annotation.timestamp))\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n if (nowMs < Date.parse(annotation.timestamp)) continue;\n const lineStart = bunfig.lastIndexOf(\"\\n\", entry.token.start - 1) + 1;\n const nextNewline = bunfig.indexOf(\"\\n\", entry.token.end);\n const lineEnd = nextNewline < 0 ? bunfig.length : nextNewline;\n const commentInside =\n entry.comment !== undefined && entry.comment.start < close.start;\n const end = commentInside\n ? (entry.comment?.end ?? entry.token.end)\n : (entry.comma?.end ?? entry.token.end);\n if (\n bunfig.slice(lineStart, entry.token.start).trim() === \"\" &&\n bunfig.slice(end, lineEnd).trim() === \"\"\n )\n removals.push({\n start: lineStart,\n end: nextNewline < 0 ? lineEnd : lineEnd + 1,\n });\n else removals.push({ start: entry.token.start, end });\n if (entry.comment !== undefined && !commentInside)\n removals.push({ start: entry.comment.start, end: entry.comment.end });\n pruned.push(entry.name);\n }\n let result = bunfig;\n for (const removal of removals.toReversed())\n result = result.slice(0, removal.start) + result.slice(removal.end);\n // Never return edited TOML without confirming the resulting source is valid.\n readSourceArray(result, parseToml);\n return { bunfig: result, pruned };\n};\n\ntype SynchronizeOptions = {\n bunfig: string;\n firstPartyPackages: FirstPartyPackages;\n parseToml: ParseToml;\n now?: Date;\n};\nexport const synchronizeFirstPartyExcludes = ({\n bunfig,\n firstPartyPackages,\n parseToml,\n now = new Date(),\n}: SynchronizeOptions): string => {\n validNow(now);\n const required = ownNames(firstPartyPackages);\n const { open, close, entries, comments } = readSourceArray(bunfig, parseToml);\n const attachedComments = new Set(\n entries.flatMap(({ comment }) => (comment === undefined ? [] : [comment])),\n );\n const lines = comments\n .filter((comment) => !attachedComments.has(comment))\n .map(({ text }) => ` ${text}`);\n const seen = new Set<string>();\n for (const entry of entries) {\n if (!ownPackage(entry.name)) {\n const annotation = annotationOf(entry);\n if (\n annotation.type !== \"expires\" ||\n !exactTimestamp(annotation.timestamp)\n )\n return fail(\n `bunfig.toml third-party quarantine exclude \"${entry.name}\" must have an exact UTC quarantine-expires: annotation`,\n );\n lines.push(\n ` ${entry.token.text},${entry.comment === undefined ? \"\" : ` ${entry.comment.text}`}`,\n );\n continue;\n }\n if (!required.has(entry.name)) continue;\n seen.add(entry.name);\n const annotation = annotationOf(entry);\n const timestamp =\n annotation.type === \"excluded-since\" &&\n exactTimestamp(annotation.timestamp)\n ? annotation.timestamp\n : now.toISOString();\n lines.push(\n ` ${JSON.stringify(entry.name)}, # quarantine-excluded-since: ${timestamp}`,\n );\n }\n for (const name of [...required]\n .filter((requiredPackage) => !seen.has(requiredPackage))\n .sort())\n lines.push(\n ` ${JSON.stringify(name)}, # quarantine-excluded-since: ${now.toISOString()}`,\n );\n const newline = bunfig.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n const trailingComment = entries.at(-1)?.comment;\n const end =\n trailingComment !== undefined && trailingComment.start > close.end\n ? trailingComment.end\n : close.end;\n const result =\n bunfig.slice(0, open.start) +\n `[${newline}${lines.join(newline)}${lines.length === 0 ? \"\" : newline}]` +\n bunfig.slice(end);\n readSourceArray(result, parseToml);\n return result;\n};\n","import { parse } from \"smol-toml\";\n\nimport {\n checkQuarantinePolicy,\n isFirstPartyPackageName,\n pruneExpiredExcludes,\n readRegistryFirstPartyPackages,\n REQUIRED_RELEASE_AGE_SECONDS,\n synchronizeFirstPartyExcludes,\n} from \"./quarantine-policy-core\";\n\nexport {\n EXACT_UTC_TIMESTAMP,\n NPM_REGISTRY,\n REQUIRED_RELEASE_AGE_SECONDS,\n exactTimestamp,\n} from \"./quarantine-policy-core\";\n\nconst record = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/** Derive exact registry identities before install, including catalog references. */\nexport const declaredFirstPartyPackages = (files: Record<string, string>) => {\n const names = new Set<string>();\n for (const [file, text] of Object.entries(files)) {\n if (!/(?:^|\\/)package\\.json$/.test(file)) continue;\n const manifest: unknown = JSON.parse(text);\n if (!record(manifest)) throw new Error(`${file} must contain an object`);\n for (const field of [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n ]) {\n const dependencies = manifest[field];\n if (!record(dependencies)) continue;\n for (const [name, specifier] of Object.entries(dependencies)) {\n if (typeof specifier !== \"string\") continue;\n if (\n /^(?:workspace:|file:|link:|git(?:\\+|:)|https?:|github:|\\.\\.?\\/|\\/)/.test(\n specifier,\n )\n )\n continue;\n if (specifier.startsWith(\"npm:\")) {\n const alias = /^npm:(@[^/]+\\/[^@]+|[^@]+)@/.exec(specifier)?.at(1);\n if (alias !== undefined && isFirstPartyPackageName(alias))\n names.add(alias);\n continue;\n }\n if (isFirstPartyPackageName(name)) names.add(name);\n }\n }\n }\n return names;\n};\n\ntype RepositoryQuarantineOptions = {\n files: Record<string, string>;\n now?: Date | undefined;\n npmrcPresent?: boolean | undefined;\n};\n\nexport const checkRepositoryQuarantine = ({\n files,\n now,\n npmrcPresent,\n}: RepositoryQuarantineOptions) =>\n checkQuarantinePolicy({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n lockfile: files[\"bun.lock\"],\n firstPartyPackages: declaredFirstPartyPackages(files),\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n ...(npmrcPresent === undefined ? {} : { npmrcPresent }),\n });\n\nexport const synchronizeRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) => {\n const firstPartyPackages = new Set([\n ...declaredFirstPartyPackages(files),\n ...readRegistryFirstPartyPackages(files[\"bun.lock\"]),\n ]);\n return synchronizeFirstPartyExcludes({\n bunfig:\n files[\"bunfig.toml\"] ??\n `[install]\\nminimumReleaseAge = ${REQUIRED_RELEASE_AGE_SECONDS}\\nminimumReleaseAgeExcludes = []\\n`,\n firstPartyPackages,\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n};\n\nexport const pruneRepositoryQuarantine = ({\n files,\n now,\n}: RepositoryQuarantineOptions) =>\n pruneExpiredExcludes({\n bunfig: files[\"bunfig.toml\"] ?? \"\",\n parseToml: parse,\n ...(now === undefined ? {} : { now }),\n });\n"],"mappings":";;;AAEA,MAAa,+BAA+B;AAC5C,MAAa,eAAe;AAC5B,MAAa,sBACX;AACF,MAAM,UAAU;AAChB,MAAM,gBAAgB;AACtB,MAAM,mBACJ;AAIF,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AACrE,MAAM,QAAoC,YAAY;CACpD,MAAM,IAAI,MAAM,OAAO;AACzB;AACA,MAAM,cAAc,SAAiB,KAAK,WAAW,QAAQ;AAC7D,MAAM,gBAAgB,SACpB,KAAK,UAAU,OAAO,cAAc,KAAK,IAAI;AAC/C,MAAa,2BAA2B,SACtC,aAAa,IAAI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AAE,GAAG,CAAC;KACjE,IAAI,UAAU,KAAA,KAAa,wBAAwB,KAAK,GACtD,MAAM,IAAI,KAAK;KACjB;IACF;IACA,IAAI,wBAAwB,IAAI,GAAG,MAAM,IAAI,IAAI;GACnD;EACF;CACF;CACA,OAAO;AACT;AAQA,MAAa,6BAA6B,EACxC,OACA,KACA,mBAEA,sBAAsB;CACpB,QAAQ,MAAM,kBAAkB;CAChC,UAAU,MAAM;CAChB,oBAAoB,2BAA2B,KAAK;CACpD,WAAW;CACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;CACnC,GAAI,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,aAAa;AACvD,CAAC;AAEH,MAAa,mCAAmC,EAC9C,OACA,UACiC;CACjC,MAAM,qCAAqB,IAAI,IAAI,CACjC,GAAG,2BAA2B,KAAK,GACnC,GAAG,+BAA+B,MAAM,WAAW,CACrD,CAAC;CACD,OAAO,8BAA8B;EACnC,QACE,MAAM,kBACN;EACF;EACA,WAAW;EACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;CACrC,CAAC;AACH;AAEA,MAAa,6BAA6B,EACxC,OACA,UAEA,qBAAqB;CACnB,QAAQ,MAAM,kBAAkB;CAChC,WAAW;CACX,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;AACrC,CAAC"}
@@ -16,13 +16,12 @@ const toolchainChangedTools = [
16
16
  "typescript",
17
17
  "oxlint",
18
18
  "oxlint-tsgolint",
19
- "oxfmt",
20
19
  "shared"
21
20
  ];
22
21
  const changedRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
23
22
  const changedPackageTool = (name) => {
24
23
  if (require_compiler_packages.isCompilerPackage(name)) return "typescript";
25
- if (name === "oxlint" || name === "oxfmt" || name === "oxlint-tsgolint") return name;
24
+ if (name === "oxlint" || name === "oxlint-tsgolint") return name;
26
25
  if (name.startsWith("@stll/") || name === "@oxlint/plugins" || name === "lefthook") return "shared";
27
26
  };
28
27
  /** Compiler patch declarations retain hashes as well as referenced source paths. */
@@ -850,7 +849,6 @@ const inventory = () => ({
850
849
  typescript: /* @__PURE__ */ new Set(),
851
850
  oxlint: /* @__PURE__ */ new Set(),
852
851
  "oxlint-tsgolint": /* @__PURE__ */ new Set(),
853
- oxfmt: /* @__PURE__ */ new Set(),
854
852
  shared: /* @__PURE__ */ new Set()
855
853
  });
856
854
  const installedFields = [