@cubing/dev-config 0.8.2 → 0.9.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.
@@ -242,6 +242,7 @@ try {
242
242
  "optionalDependencies",
243
243
  "peerDependencies",
244
244
  "bundleDependencies",
245
+ "overrides",
245
246
  "devEngines",
246
247
  "files",
247
248
  "scripts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/bin/package.json/index.ts"],
4
- "sourcesContent": ["#!/usr/bin/env -S bun run --\n\n/** biome-ignore-all lint/complexity/useLiteralKeys: https://github.com/biomejs/biome/discussions/7404 */\n\nimport assert from \"node:assert\";\nimport { constants } from \"node:fs/promises\";\nimport { argv, exit } from \"node:process\";\nimport type { JSONSchemaForNPMPackageJsonFiles } from \"@schemastore/package\";\nimport { semver } from \"bun\";\nimport { Path, ResolutionPrefix, stringifyIfPath } from \"path-class\";\nimport { PrintableShellCommand } from \"printable-shell-command\";\n\n// Licenses from https://github.com/cubing/infra?tab=readme-ov-file#conventions\nconst PERMITTED_LICENSES = new Set([\n \"MPL-2.0\",\n \"MIT\",\n \"Unlicense\",\n \"GPL-3.0-or-later\",\n]);\n\n// TODO: proper CLI parsing once this gets more complicated.\nconst subcommand: \"check\" | \"format\" = (() => {\n const subcommand = argv[2];\n if (![\"check\", \"format\"].includes(subcommand)) {\n console.error(\"Must specify subcommand: `check` or `format`\");\n exit(1);\n }\n return subcommand as \"check\" | \"format\";\n})();\n\nlet exitCode: number = 0;\nlet foundFixableErrors: boolean = false;\n\nconst PACKAGE_JSON_PATH = new Path(\"./package.json\");\n\n/*\n\nNote: this checker is opinionated, and does not allow certain patterns.\n\nIt also assumes certain conventions about package structure and maintenance.\n\n*/\n\n// TODO: Schema validation.\n\nconsole.log(\"Parsing `package.json`:\");\nconst packageJSONString = await PACKAGE_JSON_PATH.readText();\nlet packageJSON: JSONSchemaForNPMPackageJsonFiles = (() => {\n try {\n const packageJSON: JSONSchemaForNPMPackageJsonFiles =\n JSON.parse(packageJSONString);\n console.log(\"\u2705 `package.json` is valid JSON.\");\n return packageJSON;\n } catch {\n console.log(\n \"\u274C `package.json` must be valid JSON (not JSONC or JSON5 or anything else).\",\n );\n exit(1);\n }\n})();\n\nconsole.log(\"Checking field order:\");\nconst opinionatedFieldOrder = [\n \"name\",\n \"version\",\n \"homepage\",\n \"description\",\n \"author\",\n \"license\",\n \"repository\",\n \"engines\",\n \"os\",\n \"cpu\",\n \"type\",\n \"main\",\n \"types\",\n \"module\",\n \"browser\",\n \"exports\",\n \"bin\",\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n \"bundleDependencies\",\n \"devEngines\",\n \"files\",\n \"scripts\",\n \"keywords\",\n \"@cubing/deploy\",\n \"$schema\",\n] as const;\nconst opinionatedFields = new Set(opinionatedFieldOrder);\n\nconst packageJSONOrder: string[] = [];\nfor (const key in packageJSON) {\n // biome-ignore lint/suspicious/noExplicitAny: Type wrangling\n if (opinionatedFields.has(key as any)) {\n packageJSONOrder.push(key);\n } else {\n console.warn(`\u26A0\uFE0F [${JSON.stringify(key)}] Unexpected field.`);\n }\n}\nconst packageJSONByOpinionatedOrder: string[] = [];\nfor (const field of opinionatedFieldOrder) {\n if (field in packageJSON) {\n packageJSONByOpinionatedOrder.push(field);\n }\n}\n\ntry {\n assert.deepEqual(packageJSONOrder, packageJSONByOpinionatedOrder);\n console.log(`\u2705 Field order is good.`);\n} catch {\n switch (subcommand) {\n case \"check\": {\n console.log(`\u274C Found opinionated fields out of order:`);\n console.log(`\u21A4 ${packageJSONOrder.join(\", \")}`);\n console.log(\"Expected:\");\n console.log(`\u21A6 ${packageJSONByOpinionatedOrder.join(\", \")}`);\n console.log(\n \"\uD83D\uDCDD Run with the `sort` subcommand to sort. (Additional fields will kept after the field they previously followed.)\",\n );\n foundFixableErrors = true;\n exitCode = 1;\n break;\n }\n case \"format\": {\n console.log(\"\uD83D\uDCDD Invalid field order. Formatting\u2026\");\n exitCode = 1;\n const newKeyOrder: string[] = [];\n for (const key of packageJSONByOpinionatedOrder) {\n newKeyOrder.push(key);\n }\n for (const { value: key, previous } of withOrderingMetadata(\n Object.keys(packageJSON),\n )) {\n if (newKeyOrder.includes(key)) {\n continue;\n }\n if (!previous) {\n newKeyOrder.unshift(key);\n } else {\n const { value: previousKey } = previous;\n const idx = newKeyOrder.indexOf(previousKey);\n newKeyOrder.splice(idx + 1, 0, key);\n }\n }\n const newPackageJSON: JSONSchemaForNPMPackageJsonFiles = {};\n for (const key of newKeyOrder) {\n newPackageJSON[key] = packageJSON[key];\n }\n packageJSON = newPackageJSON;\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description\ntype TypeOfType =\n | \"undefined\"\n | \"object\"\n | \"boolean\"\n | \"number\"\n | \"bigint\"\n | \"string\"\n | \"symbol\"\n | \"function\"\n | \"object\";\ntype Categorization = \"array\" | \"null\" | TypeOfType;\n// biome-ignore lint/suspicious/noExplicitAny: `any` is correct.\nfunction categorize(v: any): Categorization {\n if (Array.isArray(v)) {\n return \"array\";\n }\n if (v === null) {\n return \"null\";\n }\n return typeof v;\n}\n\ninterface OrderingMetadata<T> {\n value: T;\n previous: { value: T } | null;\n isLast: boolean;\n}\nfunction* withOrderingMetadata<T>(\n iter: Iterable<T>,\n): Iterable<OrderingMetadata<T>> {\n // The following functions as an `Option<T>`, even when `T` is undefined.\n let previous: [OrderingMetadata<T>] | undefined;\n for (const value of iter) {\n if (previous) {\n yield previous[0];\n previous = [\n { value, previous: { value: previous[0].value }, isLast: false },\n ];\n } else {\n previous = [{ value, previous: null, isLast: false }];\n }\n }\n if (previous) {\n yield { ...previous[0], isLast: true };\n }\n}\ntype Breadcrumbs = (string | [string] | number)[];\nfunction traverse<T>(\n breadcrumbs: Breadcrumbs,\n options?: { set?: T },\n): {\n breadcrumbString: string;\n maybeValue: [T] | null;\n} {\n assert(breadcrumbs.length > 0);\n // biome-ignore lint/suspicious/noExplicitAny: Type wrangling\n let maybeValue: [T | any] | null = [packageJSON];\n let breadcrumbString = \"\";\n for (let { value: breadcrumb, isLast } of withOrderingMetadata(breadcrumbs)) {\n if (Array.isArray(breadcrumb)) {\n assert(breadcrumb.length === 1);\n assert(typeof breadcrumb[0] === \"string\");\n breadcrumb = breadcrumb[0];\n breadcrumbString += `[${JSON.stringify(breadcrumb)}]`;\n } else if (typeof breadcrumb === \"string\") {\n breadcrumbString += `.${breadcrumb}`;\n } else {\n breadcrumbString += `[${breadcrumb}]`;\n }\n if (options && \"set\" in options && isLast) {\n if (\n !maybeValue ||\n ![\"array\", \"object\"].includes(categorize(maybeValue[0]))\n ) {\n // This okay for now, because we currently only write to values we have read.\n throw new Error(\n \"Missing (but expected) traversal path while setting a value\",\n ) as never;\n }\n maybeValue[0][breadcrumb] = stringifyIfPath(options.set);\n } else if (\n maybeValue &&\n [\"array\", \"object\"].includes(categorize(maybeValue[0])) &&\n breadcrumb in maybeValue[0]\n ) {\n maybeValue = [maybeValue[0][breadcrumb]];\n } else {\n maybeValue = null;\n }\n }\n return { breadcrumbString, maybeValue };\n}\n\nfunction field<T>(\n breadcrumbs: Breadcrumbs,\n type: Categorization | Categorization[],\n options?: {\n optional?: boolean;\n additionalChecks?: { [requirementMessage: string]: (t: T) => boolean };\n skipPrintingSuccess?: boolean;\n mustBePopulatedMessage?: string;\n },\n) {\n const mustBePopulatedMessage = () =>\n options?.mustBePopulatedMessage ?? \"Field must be populated.\";\n const { breadcrumbString, maybeValue } = traverse(breadcrumbs);\n if (!maybeValue) {\n if (options?.optional) {\n if (!options.skipPrintingSuccess) {\n console.log(`\u2611\uFE0F ${breadcrumbString}`);\n }\n return;\n } else {\n console.log(`\u274C ${breadcrumbString} \u2014 ${mustBePopulatedMessage()}`);\n exitCode = 1;\n return;\n }\n }\n const [value] = maybeValue;\n\n const typeArray = Array.isArray(type) ? type : [type];\n const category = categorize(value);\n if (typeArray.includes(category)) {\n for (const [failureMessage, fn] of Object.entries(\n options?.additionalChecks ?? {},\n )) {\n if (!fn) {\n console.log(`\u274C ${breadcrumbString} | ${failureMessage}`);\n exitCode = 1;\n return;\n }\n }\n if (!options?.skipPrintingSuccess) {\n console.log(`\u2705 ${breadcrumbString}`);\n }\n } else {\n if (category === \"undefined\") {\n console.log(`\u274C ${breadcrumbString} \u2014 ${mustBePopulatedMessage()}.`);\n } else if (type === \"undefined\") {\n console.log(\n `\u274C ${breadcrumbString} \u2014 Field is populated (but must not be).`,\n );\n } else {\n if (Array.isArray(type)) {\n console.log(\n `\u274C ${breadcrumbString} \u2014 Does not match an expected type: ${type.join(\", \")}`,\n );\n } else {\n console.log(\n `\u274C ${breadcrumbString} \u2014 Does not match expected type: ${type}`,\n );\n }\n }\n exitCode = 1;\n return;\n }\n}\n\nfunction mustNotBePopulated(breadcrumbs: Breadcrumbs) {\n const { breadcrumbString, maybeValue } = traverse(breadcrumbs);\n if (maybeValue) {\n console.log(`\u274C ${breadcrumbString} \u2014 Must not be present.`);\n exitCode = 1;\n return;\n }\n}\n\nconsole.log(\"Checking presence and type of fields:\");\n\nfield([\"name\"], \"string\");\nfield([\"version\"], \"string\", {\n additionalChecks: {\n \"Version must parse successfully.\": (version: string) =>\n semver.order(version, version) === 0,\n },\n});\nfield([\"homepage\"], \"string\", { optional: true });\nfield([\"description\"], \"string\");\n// TODO: format author.\nfield([\"author\"], [\"string\", \"object\"]);\nif (categorize(packageJSON[\"author\"]) === \"object\") {\n field([\"author\", \"name\"], \"string\");\n field([\"author\", \"email\"], \"string\");\n field([\"author\", \"url\"], \"string\", {\n additionalChecks: {\n \"URL must parse.\": (url: string) => {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n },\n },\n });\n}\nfield([\"license\"], \"string\", {\n additionalChecks: {\n \"Must contain a non-permitted license.\": (license: string) => {\n for (const licenseEntry of license.split(\" OR \")) {\n if (!PERMITTED_LICENSES.has(licenseEntry)) {\n return false;\n }\n }\n return true;\n },\n },\n});\n// TODO: format repo.\nfield([\"repository\"], \"object\");\nfield([\"repository\", \"type\"], \"string\");\nconst GIT_URL_PREFIX = \"git+\";\nconst GIT_URL_SUFFIX = \".\";\nfield([\"repository\", \"url\"], \"string\", {\n additionalChecks: {\n [`URL must be prefixed with \\`${GIT_URL_PREFIX}\\`.`]: (url: string) =>\n url.startsWith(GIT_URL_PREFIX),\n [`URL must end with with \\`.${GIT_URL_SUFFIX}\\`.`]: (url: string) =>\n url.endsWith(GIT_URL_SUFFIX),\n \"URL must parse.\": (url: string) => {\n try {\n new URL(url.slice());\n return true;\n } catch {\n return false;\n }\n },\n },\n});\n// TODO: Validate version range syntax.\nfield([\"engines\"], \"object\", { optional: true });\nfield([\"os\"], \"array\", { optional: true });\nfield([\"cpu\"], \"array\", { optional: true });\nfield([\"type\"], \"string\", {\n additionalChecks: {\n 'Type must be `\"module\"`.': (type: string) => type === \"module\",\n },\n});\nconst mainOrTypesArePopoulated = (() => {\n if (\"types\" in packageJSON) {\n field([\"main\"], \"string\", {\n mustBePopulatedMessage: \"Must be populated if `.types` is populated.\",\n });\n field([\"types\"], \"string\");\n return true;\n } else if (\"main\" in packageJSON) {\n field([\"main\"], \"string\", {});\n if (packageJSON[\"main\"]?.endsWith(\".js\")) {\n field([\"types\"], \"string\", {\n mustBePopulatedMessage:\n \"Must be populated if `.main` is with a path ending in `.js`.\",\n });\n } else {\n console.log(\"\u2611\uFE0F .types\");\n }\n return true;\n } else {\n console.log(\"\u2611\uFE0F .main\");\n console.log(\"\u2611\uFE0F .types\");\n return false;\n }\n})();\nmustNotBePopulated([\"module\"]);\nmustNotBePopulated([\"browser\"]);\nfield([\"exports\"], \"object\", {\n optional: !mainOrTypesArePopoulated,\n mustBePopulatedMessage:\n \"Must be populated if `.main` or `.types` are populated.\",\n});\nfield([\"bin\"], \"object\", { optional: true });\nfield([\"dependencies\"], \"object\", { optional: true });\nfield([\"devDependencies\"], \"object\", { optional: true });\nfield([\"optionalDependencies\"], \"object\", { optional: true });\nfield([\"peerDependencies\"], \"object\", { optional: true });\nfield([\"bundleDependencies\"], \"object\", { optional: true });\nfield([\"devEngines\"], \"object\", { optional: true });\n// TODO: check for path resolution prefix?\n// Set to `[\"*\"]` if needed.\nfield([\"files\"], \"array\");\nfield([\"scripts\"], \"object\");\n// Set to `\"# no-op\"` if needed.\nfield([\"scripts\", \"prepublishOnly\"], \"string\");\n\nconsole.log(\"Checking paths of binaries and exports:\");\n\nconst tempDir = await Path.makeTempDir();\nawait using tempDirDisposable = {\n [Symbol.asyncDispose]: async () => {\n console.log(\"Disposing temporary dir.\");\n await tempDir.rm_rf();\n },\n};\nconst extractionDir = await tempDir.join(\"extracted\").mkdir();\n// TODO: is there a 100% reliable way to test against paths that *will* be packed?\n// Note that this has to take into account `.gitignore`, `.npmignore`, and `\"files\"` \u2014 with globs and excludes.\n// For now, we print the command to make it clear that some heavy lifting is going on (and that it's not our fault that it's slow).\nconst data: { filename: string }[] = await new PrintableShellCommand(\"npm\", [\n \"pack\",\n \"--json\",\n \"--ignore-scripts\",\n [\"--pack-destination\", tempDir],\n])\n .print()\n .json();\nconst tgzPath = tempDir.join(data[0].filename);\nawait new PrintableShellCommand(\"tar\", [\n [\"-C\", extractionDir],\n [\"-xvzf\", tgzPath],\n]).spawn().success;\n\nconst extractedRoot = extractionDir.join(\"package/\");\nassert(await extractedRoot.existsAsDir());\n\nconst checks: Promise<string>[] = [];\n\n// TODO: check compilability\nfunction checkPath(\n breadcrumbs: Breadcrumbs,\n options: { expectPrefix: ResolutionPrefix; mustBeExecutable?: true },\n) {\n const { breadcrumbString, maybeValue } = traverse(breadcrumbs);\n if (!maybeValue) {\n return;\n }\n const [value] = maybeValue;\n checks.push(\n (async () => {\n if (typeof value !== \"string\") {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Non-string value`;\n }\n if (value.includes(\"*\")) {\n return `\u23ED\uFE0F ${breadcrumbString} \u2014 Skipping due to glob (*) \u2014 ${value}`;\n }\n const unresolvedPath = new Path(value);\n if (unresolvedPath.resolutionPrefix !== options.expectPrefix) {\n if (unresolvedPath.resolutionPrefix === ResolutionPrefix.Absolute) {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Incorrect resolution prefix (${unresolvedPath.resolutionPrefix}) \u2014 ${value}`;\n } else {\n switch (subcommand) {\n case \"check\": {\n exitCode = 1;\n foundFixableErrors = true;\n return `\u274C ${breadcrumbString} \u2014 Incorrect resolution prefix (${unresolvedPath.resolutionPrefix}) \u2014 \uD83D\uDCDD fixable! \u2014 ${value}`;\n }\n case \"format\": {\n console.log(\n `\uD83D\uDCDD \u2014 Incorrect resolution prefix (${unresolvedPath.resolutionPrefix}) \u2014 fixing! \u2014 ${value}`,\n );\n // TODO: do this calculation before reporting as fixable\n const newPath =\n options.expectPrefix === ResolutionPrefix.Bare\n ? unresolvedPath.asBare()\n : unresolvedPath.asRelative();\n traverse(breadcrumbs, { set: newPath });\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n }\n }\n if (\n unresolvedPath.path.startsWith(\"../\") ||\n unresolvedPath.path === \"..\"\n ) {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Invalid traversal of parent path. \u2014 ${value}`;\n }\n const resolvedPath = Path.resolve(unresolvedPath, extractedRoot);\n // TODO: allow folders (with a required trailing slash)?\n if (!(await resolvedPath.existsAsFile())) {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Path must be present in the package. \u2014 ${value}`;\n }\n if (options.mustBeExecutable) {\n if (!((await resolvedPath.stat()).mode ^ constants.X_OK)) {\n // This is not considered fixable because the binary may be the output\n // of a build process. In that case, the build process is responsible\n // for marking it as executable.\n return `\u274C ${breadcrumbString} \u2014 File at path must be executable. \u2014 ${value}`;\n }\n }\n return `\u2705 ${breadcrumbString} \u2014 Path must be present in the package. \u2014 ${value}`;\n })(),\n );\n}\n\ncheckPath([\"main\"], { expectPrefix: ResolutionPrefix.Relative });\ncheckPath([\"types\"], { expectPrefix: ResolutionPrefix.Relative });\ncheckPath([\"module\"], { expectPrefix: ResolutionPrefix.Relative });\ncheckPath([\"browser\"], { expectPrefix: ResolutionPrefix.Relative });\n\nconst { exports } = packageJSON;\nif (exports) {\n for (const [subpath, value] of Object.entries(exports)) {\n if (!value) {\n // biome-ignore lint/complexity/noUselessContinue: Explicit control flow.\n continue;\n } else if (typeof value === \"string\") {\n // TODO: error?\n checkPath([\"exports\", [subpath]], {\n expectPrefix: ResolutionPrefix.Relative,\n });\n } else if (value === null) {\n // biome-ignore lint/complexity/noUselessContinue: Explicit control flow.\n continue;\n } else if (Array.isArray(value)) {\n throw new Error(\n \"\u274C .exports \u2014 Must use an object (instead of an array).\",\n );\n } else {\n const keys = Object.keys(value as Record<string, string>);\n\n checks.push(\n (async () => {\n const { breadcrumbString } = traverse([\"exports\", [subpath]]);\n const fixingLines = [];\n const orderingErrorLines = [];\n /**\n * https://nodejs.org/api/packages.html#conditional-exports\n */\n let updateKeys = false;\n if (keys.includes(\"types\")) {\n if (keys[0] !== \"types\") {\n switch (subcommand) {\n case \"check\": {\n orderingErrorLines.push(\n ` \u21AA \"types\" must be the first export if present \u2014 \uD83D\uDCDD fixable!`,\n );\n break;\n }\n case \"format\": {\n fixingLines.push(\n ` \u21AA \"types\" must be the first export if present \u2014 \uD83D\uDCDD fixing!`,\n );\n keys.splice(keys.indexOf(\"types\"), 1);\n keys.splice(0, 0, \"types\");\n updateKeys = true;\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n }\n }\n if (keys.includes(\"default\")) {\n if (keys.at(-1) !== \"default\") {\n switch (subcommand) {\n case \"check\": {\n orderingErrorLines.push(\n ` \u21AA \"default\" must be the last export if present \u2014 \uD83D\uDCDD fixable!`,\n );\n break;\n }\n case \"format\": {\n fixingLines.push(\n ` \u21AA \"default\" must be the last export if present \u2014 \uD83D\uDCDD fixing!`,\n );\n keys.splice(keys.indexOf(\"default\"), 1);\n keys.push(\"default\");\n updateKeys = true;\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n }\n }\n if (updateKeys) {\n // TODO: avoid type wrangling.\n const newConditionalExports: Record<string, string> = {};\n for (const key of keys) {\n newConditionalExports[key] = (value as Record<string, string>)[\n key\n ];\n }\n (exports as Record<string, Record<string, string>>)[subpath] =\n newConditionalExports;\n }\n for (const key of keys) {\n // Note `\"require\"` is *emphatically not allowed*.\n if (![\"types\", \"import\", \"default\"].includes(key)) {\n orderingErrorLines.push(\n ` \u21AA Key must not be present: ${JSON.stringify(key)}`,\n );\n }\n }\n if (orderingErrorLines.length > 0) {\n exitCode = 1;\n return [\n `\u274C ${breadcrumbString} \u2014 Invalid keys:`,\n ...orderingErrorLines,\n ].join(\"\\n\");\n } else {\n if (fixingLines.length > 0) {\n return [\n `\u2705 ${breadcrumbString} \u2014 Fixing key ordering:`,\n ...fixingLines,\n ].join(\"\\n\");\n } else {\n return `\u2705 ${breadcrumbString} \u2014 Key set and ordering is OK.`;\n }\n }\n })(),\n );\n for (const secondaryKey of keys) {\n checkPath([\"exports\", [subpath], secondaryKey], {\n expectPrefix: ResolutionPrefix.Relative,\n });\n }\n }\n }\n}\n\nconst { bin } = packageJSON;\nif (bin) {\n for (const binEntry of Object.keys(bin as Record<string, string>)) {\n checkPath([\"bin\", [binEntry]], {\n // `npm pkg fix` prefers bare paths for `bin` entries for some reason. \uD83E\uDD37\n expectPrefix: ResolutionPrefix.Bare,\n // `npm` will technically make binary entry points executable, but we want\n // to enforce that the unpackaged path also is. This is particularly\n // important when the package is linked.\n mustBeExecutable: true,\n });\n }\n}\n\nconsole.log((await Promise.all(checks)).join(\"\\n\"));\n\nif (subcommand === \"format\") {\n console.log(\"\uD83D\uDCDD Writing formatting fixes.\");\n // TODO: support trailing space in `path-class`.\n await PACKAGE_JSON_PATH.write(`${JSON.stringify(packageJSON, null, \" \")}\\n`);\n console.log(PACKAGE_JSON_PATH.path);\n console.log(\"\uD83D\uDCDD Running `npm pkg fix`.\");\n await new PrintableShellCommand(\"npm\", [\"pkg\", \"fix\"])\n .print({ argumentLineWrapping: \"inline\" })\n .spawn().success;\n} else if (foundFixableErrors) {\n console.log();\n console.log(\n \"\uD83D\uDCDD Found fixable errors. Run with the `format` subcommand to fix.\",\n );\n console.log();\n}\n\nawait tempDirDisposable[Symbol.asyncDispose]();\n\nexit(exitCode);\n"],
5
- "mappings": ";;;;;;;AAIA,OAAO,YAAY;AACnB,SAAS,iBAAiB;AAC1B,SAAS,MAAM,YAAY;AAE3B,SAAS,cAAc;AACvB,SAAS,MAAM,kBAAkB,uBAAuB;AACxD,SAAS,6BAA6B;AAmKtC,SAAS,WAAW,GAAwB;AAC1C,MAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,WAAO;AAAA,EACT;AACA,MAAI,MAAM,MAAM;AACd,WAAO;AAAA,EACT;AACA,SAAO,OAAO;AAChB;AAOA,UAAU,qBACR,MAC+B;AAE/B,MAAI;AACJ,aAAW,SAAS,MAAM;AACxB,QAAI,UAAU;AACZ,YAAM,SAAS,CAAC;AAChB,iBAAW;AAAA,QACT,EAAE,OAAO,UAAU,EAAE,OAAO,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,MAAM;AAAA,MACjE;AAAA,IACF,OAAO;AACL,iBAAW,CAAC,EAAE,OAAO,UAAU,MAAM,QAAQ,MAAM,CAAC;AAAA,IACtD;AAAA,EACF;AACA,MAAI,UAAU;AACZ,UAAM,EAAE,GAAG,SAAS,CAAC,GAAG,QAAQ,KAAK;AAAA,EACvC;AACF;AAEA,SAAS,SACP,aACA,SAIA;AACA,SAAO,YAAY,SAAS,CAAC;AAE7B,MAAI,aAA+B,CAAC,WAAW;AAC/C,MAAI,mBAAmB;AACvB,WAAS,EAAE,OAAO,YAAY,OAAO,KAAK,qBAAqB,WAAW,GAAG;AAC3E,QAAI,MAAM,QAAQ,UAAU,GAAG;AAC7B,aAAO,WAAW,WAAW,CAAC;AAC9B,aAAO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/complexity/useLiteralKeys: https://github.com/biomejs/biome/discussions/7404 */\n\nimport assert from \"node:assert\";\nimport { constants } from \"node:fs/promises\";\nimport { argv, exit } from \"node:process\";\nimport type { JSONSchemaForNPMPackageJsonFiles } from \"@schemastore/package\";\nimport { semver } from \"bun\";\nimport { Path, ResolutionPrefix, stringifyIfPath } from \"path-class\";\nimport { PrintableShellCommand } from \"printable-shell-command\";\n\n// Licenses from https://github.com/cubing/infra?tab=readme-ov-file#conventions\nconst PERMITTED_LICENSES = new Set([\n \"MPL-2.0\",\n \"MIT\",\n \"Unlicense\",\n \"GPL-3.0-or-later\",\n]);\n\n// TODO: proper CLI parsing once this gets more complicated.\nconst subcommand: \"check\" | \"format\" = (() => {\n const subcommand = argv[2];\n if (![\"check\", \"format\"].includes(subcommand)) {\n console.error(\"Must specify subcommand: `check` or `format`\");\n exit(1);\n }\n return subcommand as \"check\" | \"format\";\n})();\n\nlet exitCode: number = 0;\nlet foundFixableErrors: boolean = false;\n\nconst PACKAGE_JSON_PATH = new Path(\"./package.json\");\n\n/*\n\nNote: this checker is opinionated, and does not allow certain patterns.\n\nIt also assumes certain conventions about package structure and maintenance.\n\n*/\n\n// TODO: Schema validation.\n\nconsole.log(\"Parsing `package.json`:\");\nconst packageJSONString = await PACKAGE_JSON_PATH.readText();\nlet packageJSON: JSONSchemaForNPMPackageJsonFiles = (() => {\n try {\n const packageJSON: JSONSchemaForNPMPackageJsonFiles =\n JSON.parse(packageJSONString);\n console.log(\"\u2705 `package.json` is valid JSON.\");\n return packageJSON;\n } catch {\n console.log(\n \"\u274C `package.json` must be valid JSON (not JSONC or JSON5 or anything else).\",\n );\n exit(1);\n }\n})();\n\nconsole.log(\"Checking field order:\");\nconst opinionatedFieldOrder = [\n \"name\",\n \"version\",\n \"homepage\",\n \"description\",\n \"author\",\n \"license\",\n \"repository\",\n \"engines\",\n \"os\",\n \"cpu\",\n \"type\",\n \"main\",\n \"types\",\n \"module\",\n \"browser\",\n \"exports\",\n \"bin\",\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n \"bundleDependencies\",\n \"overrides\",\n \"devEngines\",\n \"files\",\n \"scripts\",\n \"keywords\",\n \"@cubing/deploy\",\n \"$schema\",\n] as const;\nconst opinionatedFields = new Set(opinionatedFieldOrder);\n\nconst packageJSONOrder: string[] = [];\nfor (const key in packageJSON) {\n // biome-ignore lint/suspicious/noExplicitAny: Type wrangling\n if (opinionatedFields.has(key as any)) {\n packageJSONOrder.push(key);\n } else {\n console.warn(`\u26A0\uFE0F [${JSON.stringify(key)}] Unexpected field.`);\n }\n}\nconst packageJSONByOpinionatedOrder: string[] = [];\nfor (const field of opinionatedFieldOrder) {\n if (field in packageJSON) {\n packageJSONByOpinionatedOrder.push(field);\n }\n}\n\ntry {\n assert.deepEqual(packageJSONOrder, packageJSONByOpinionatedOrder);\n console.log(`\u2705 Field order is good.`);\n} catch {\n switch (subcommand) {\n case \"check\": {\n console.log(`\u274C Found opinionated fields out of order:`);\n console.log(`\u21A4 ${packageJSONOrder.join(\", \")}`);\n console.log(\"Expected:\");\n console.log(`\u21A6 ${packageJSONByOpinionatedOrder.join(\", \")}`);\n console.log(\n \"\uD83D\uDCDD Run with the `sort` subcommand to sort. (Additional fields will kept after the field they previously followed.)\",\n );\n foundFixableErrors = true;\n exitCode = 1;\n break;\n }\n case \"format\": {\n console.log(\"\uD83D\uDCDD Invalid field order. Formatting\u2026\");\n exitCode = 1;\n const newKeyOrder: string[] = [];\n for (const key of packageJSONByOpinionatedOrder) {\n newKeyOrder.push(key);\n }\n for (const { value: key, previous } of withOrderingMetadata(\n Object.keys(packageJSON),\n )) {\n if (newKeyOrder.includes(key)) {\n continue;\n }\n if (!previous) {\n newKeyOrder.unshift(key);\n } else {\n const { value: previousKey } = previous;\n const idx = newKeyOrder.indexOf(previousKey);\n newKeyOrder.splice(idx + 1, 0, key);\n }\n }\n const newPackageJSON: JSONSchemaForNPMPackageJsonFiles = {};\n for (const key of newKeyOrder) {\n newPackageJSON[key] = packageJSON[key];\n }\n packageJSON = newPackageJSON;\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description\ntype TypeOfType =\n | \"undefined\"\n | \"object\"\n | \"boolean\"\n | \"number\"\n | \"bigint\"\n | \"string\"\n | \"symbol\"\n | \"function\"\n | \"object\";\ntype Categorization = \"array\" | \"null\" | TypeOfType;\n// biome-ignore lint/suspicious/noExplicitAny: `any` is correct.\nfunction categorize(v: any): Categorization {\n if (Array.isArray(v)) {\n return \"array\";\n }\n if (v === null) {\n return \"null\";\n }\n return typeof v;\n}\n\ninterface OrderingMetadata<T> {\n value: T;\n previous: { value: T } | null;\n isLast: boolean;\n}\nfunction* withOrderingMetadata<T>(\n iter: Iterable<T>,\n): Iterable<OrderingMetadata<T>> {\n // The following functions as an `Option<T>`, even when `T` is undefined.\n let previous: [OrderingMetadata<T>] | undefined;\n for (const value of iter) {\n if (previous) {\n yield previous[0];\n previous = [\n { value, previous: { value: previous[0].value }, isLast: false },\n ];\n } else {\n previous = [{ value, previous: null, isLast: false }];\n }\n }\n if (previous) {\n yield { ...previous[0], isLast: true };\n }\n}\ntype Breadcrumbs = (string | [string] | number)[];\nfunction traverse<T>(\n breadcrumbs: Breadcrumbs,\n options?: { set?: T },\n): {\n breadcrumbString: string;\n maybeValue: [T] | null;\n} {\n assert(breadcrumbs.length > 0);\n // biome-ignore lint/suspicious/noExplicitAny: Type wrangling\n let maybeValue: [T | any] | null = [packageJSON];\n let breadcrumbString = \"\";\n for (let { value: breadcrumb, isLast } of withOrderingMetadata(breadcrumbs)) {\n if (Array.isArray(breadcrumb)) {\n assert(breadcrumb.length === 1);\n assert(typeof breadcrumb[0] === \"string\");\n breadcrumb = breadcrumb[0];\n breadcrumbString += `[${JSON.stringify(breadcrumb)}]`;\n } else if (typeof breadcrumb === \"string\") {\n breadcrumbString += `.${breadcrumb}`;\n } else {\n breadcrumbString += `[${breadcrumb}]`;\n }\n if (options && \"set\" in options && isLast) {\n if (\n !maybeValue ||\n ![\"array\", \"object\"].includes(categorize(maybeValue[0]))\n ) {\n // This okay for now, because we currently only write to values we have read.\n throw new Error(\n \"Missing (but expected) traversal path while setting a value\",\n ) as never;\n }\n maybeValue[0][breadcrumb] = stringifyIfPath(options.set);\n } else if (\n maybeValue &&\n [\"array\", \"object\"].includes(categorize(maybeValue[0])) &&\n breadcrumb in maybeValue[0]\n ) {\n maybeValue = [maybeValue[0][breadcrumb]];\n } else {\n maybeValue = null;\n }\n }\n return { breadcrumbString, maybeValue };\n}\n\nfunction field<T>(\n breadcrumbs: Breadcrumbs,\n type: Categorization | Categorization[],\n options?: {\n optional?: boolean;\n additionalChecks?: { [requirementMessage: string]: (t: T) => boolean };\n skipPrintingSuccess?: boolean;\n mustBePopulatedMessage?: string;\n },\n) {\n const mustBePopulatedMessage = () =>\n options?.mustBePopulatedMessage ?? \"Field must be populated.\";\n const { breadcrumbString, maybeValue } = traverse(breadcrumbs);\n if (!maybeValue) {\n if (options?.optional) {\n if (!options.skipPrintingSuccess) {\n console.log(`\u2611\uFE0F ${breadcrumbString}`);\n }\n return;\n } else {\n console.log(`\u274C ${breadcrumbString} \u2014 ${mustBePopulatedMessage()}`);\n exitCode = 1;\n return;\n }\n }\n const [value] = maybeValue;\n\n const typeArray = Array.isArray(type) ? type : [type];\n const category = categorize(value);\n if (typeArray.includes(category)) {\n for (const [failureMessage, fn] of Object.entries(\n options?.additionalChecks ?? {},\n )) {\n if (!fn) {\n console.log(`\u274C ${breadcrumbString} | ${failureMessage}`);\n exitCode = 1;\n return;\n }\n }\n if (!options?.skipPrintingSuccess) {\n console.log(`\u2705 ${breadcrumbString}`);\n }\n } else {\n if (category === \"undefined\") {\n console.log(`\u274C ${breadcrumbString} \u2014 ${mustBePopulatedMessage()}.`);\n } else if (type === \"undefined\") {\n console.log(\n `\u274C ${breadcrumbString} \u2014 Field is populated (but must not be).`,\n );\n } else {\n if (Array.isArray(type)) {\n console.log(\n `\u274C ${breadcrumbString} \u2014 Does not match an expected type: ${type.join(\", \")}`,\n );\n } else {\n console.log(\n `\u274C ${breadcrumbString} \u2014 Does not match expected type: ${type}`,\n );\n }\n }\n exitCode = 1;\n return;\n }\n}\n\nfunction mustNotBePopulated(breadcrumbs: Breadcrumbs) {\n const { breadcrumbString, maybeValue } = traverse(breadcrumbs);\n if (maybeValue) {\n console.log(`\u274C ${breadcrumbString} \u2014 Must not be present.`);\n exitCode = 1;\n return;\n }\n}\n\nconsole.log(\"Checking presence and type of fields:\");\n\nfield([\"name\"], \"string\");\nfield([\"version\"], \"string\", {\n additionalChecks: {\n \"Version must parse successfully.\": (version: string) =>\n semver.order(version, version) === 0,\n },\n});\nfield([\"homepage\"], \"string\", { optional: true });\nfield([\"description\"], \"string\");\n// TODO: format author.\nfield([\"author\"], [\"string\", \"object\"]);\nif (categorize(packageJSON[\"author\"]) === \"object\") {\n field([\"author\", \"name\"], \"string\");\n field([\"author\", \"email\"], \"string\");\n field([\"author\", \"url\"], \"string\", {\n additionalChecks: {\n \"URL must parse.\": (url: string) => {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n },\n },\n });\n}\nfield([\"license\"], \"string\", {\n additionalChecks: {\n \"Must contain a non-permitted license.\": (license: string) => {\n for (const licenseEntry of license.split(\" OR \")) {\n if (!PERMITTED_LICENSES.has(licenseEntry)) {\n return false;\n }\n }\n return true;\n },\n },\n});\n// TODO: format repo.\nfield([\"repository\"], \"object\");\nfield([\"repository\", \"type\"], \"string\");\nconst GIT_URL_PREFIX = \"git+\";\nconst GIT_URL_SUFFIX = \".\";\nfield([\"repository\", \"url\"], \"string\", {\n additionalChecks: {\n [`URL must be prefixed with \\`${GIT_URL_PREFIX}\\`.`]: (url: string) =>\n url.startsWith(GIT_URL_PREFIX),\n [`URL must end with with \\`.${GIT_URL_SUFFIX}\\`.`]: (url: string) =>\n url.endsWith(GIT_URL_SUFFIX),\n \"URL must parse.\": (url: string) => {\n try {\n new URL(url.slice());\n return true;\n } catch {\n return false;\n }\n },\n },\n});\n// TODO: Validate version range syntax.\nfield([\"engines\"], \"object\", { optional: true });\nfield([\"os\"], \"array\", { optional: true });\nfield([\"cpu\"], \"array\", { optional: true });\nfield([\"type\"], \"string\", {\n additionalChecks: {\n 'Type must be `\"module\"`.': (type: string) => type === \"module\",\n },\n});\nconst mainOrTypesArePopoulated = (() => {\n if (\"types\" in packageJSON) {\n field([\"main\"], \"string\", {\n mustBePopulatedMessage: \"Must be populated if `.types` is populated.\",\n });\n field([\"types\"], \"string\");\n return true;\n } else if (\"main\" in packageJSON) {\n field([\"main\"], \"string\", {});\n if (packageJSON[\"main\"]?.endsWith(\".js\")) {\n field([\"types\"], \"string\", {\n mustBePopulatedMessage:\n \"Must be populated if `.main` is with a path ending in `.js`.\",\n });\n } else {\n console.log(\"\u2611\uFE0F .types\");\n }\n return true;\n } else {\n console.log(\"\u2611\uFE0F .main\");\n console.log(\"\u2611\uFE0F .types\");\n return false;\n }\n})();\nmustNotBePopulated([\"module\"]);\nmustNotBePopulated([\"browser\"]);\nfield([\"exports\"], \"object\", {\n optional: !mainOrTypesArePopoulated,\n mustBePopulatedMessage:\n \"Must be populated if `.main` or `.types` are populated.\",\n});\nfield([\"bin\"], \"object\", { optional: true });\nfield([\"dependencies\"], \"object\", { optional: true });\nfield([\"devDependencies\"], \"object\", { optional: true });\nfield([\"optionalDependencies\"], \"object\", { optional: true });\nfield([\"peerDependencies\"], \"object\", { optional: true });\nfield([\"bundleDependencies\"], \"object\", { optional: true });\nfield([\"devEngines\"], \"object\", { optional: true });\n// TODO: check for path resolution prefix?\n// Set to `[\"*\"]` if needed.\nfield([\"files\"], \"array\");\nfield([\"scripts\"], \"object\");\n// Set to `\"# no-op\"` if needed.\nfield([\"scripts\", \"prepublishOnly\"], \"string\");\n\nconsole.log(\"Checking paths of binaries and exports:\");\n\nconst tempDir = await Path.makeTempDir();\nawait using tempDirDisposable = {\n [Symbol.asyncDispose]: async () => {\n console.log(\"Disposing temporary dir.\");\n await tempDir.rm_rf();\n },\n};\nconst extractionDir = await tempDir.join(\"extracted\").mkdir();\n// TODO: is there a 100% reliable way to test against paths that *will* be packed?\n// Note that this has to take into account `.gitignore`, `.npmignore`, and `\"files\"` \u2014 with globs and excludes.\n// For now, we print the command to make it clear that some heavy lifting is going on (and that it's not our fault that it's slow).\nconst data: { filename: string }[] = await new PrintableShellCommand(\"npm\", [\n \"pack\",\n \"--json\",\n \"--ignore-scripts\",\n [\"--pack-destination\", tempDir],\n])\n .print()\n .json();\nconst tgzPath = tempDir.join(data[0].filename);\nawait new PrintableShellCommand(\"tar\", [\n [\"-C\", extractionDir],\n [\"-xvzf\", tgzPath],\n]).spawn().success;\n\nconst extractedRoot = extractionDir.join(\"package/\");\nassert(await extractedRoot.existsAsDir());\n\nconst checks: Promise<string>[] = [];\n\n// TODO: check compilability\nfunction checkPath(\n breadcrumbs: Breadcrumbs,\n options: { expectPrefix: ResolutionPrefix; mustBeExecutable?: true },\n) {\n const { breadcrumbString, maybeValue } = traverse(breadcrumbs);\n if (!maybeValue) {\n return;\n }\n const [value] = maybeValue;\n checks.push(\n (async () => {\n if (typeof value !== \"string\") {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Non-string value`;\n }\n if (value.includes(\"*\")) {\n return `\u23ED\uFE0F ${breadcrumbString} \u2014 Skipping due to glob (*) \u2014 ${value}`;\n }\n const unresolvedPath = new Path(value);\n if (unresolvedPath.resolutionPrefix !== options.expectPrefix) {\n if (unresolvedPath.resolutionPrefix === ResolutionPrefix.Absolute) {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Incorrect resolution prefix (${unresolvedPath.resolutionPrefix}) \u2014 ${value}`;\n } else {\n switch (subcommand) {\n case \"check\": {\n exitCode = 1;\n foundFixableErrors = true;\n return `\u274C ${breadcrumbString} \u2014 Incorrect resolution prefix (${unresolvedPath.resolutionPrefix}) \u2014 \uD83D\uDCDD fixable! \u2014 ${value}`;\n }\n case \"format\": {\n console.log(\n `\uD83D\uDCDD \u2014 Incorrect resolution prefix (${unresolvedPath.resolutionPrefix}) \u2014 fixing! \u2014 ${value}`,\n );\n // TODO: do this calculation before reporting as fixable\n const newPath =\n options.expectPrefix === ResolutionPrefix.Bare\n ? unresolvedPath.asBare()\n : unresolvedPath.asRelative();\n traverse(breadcrumbs, { set: newPath });\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n }\n }\n if (\n unresolvedPath.path.startsWith(\"../\") ||\n unresolvedPath.path === \"..\"\n ) {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Invalid traversal of parent path. \u2014 ${value}`;\n }\n const resolvedPath = Path.resolve(unresolvedPath, extractedRoot);\n // TODO: allow folders (with a required trailing slash)?\n if (!(await resolvedPath.existsAsFile())) {\n exitCode = 1;\n return `\u274C ${breadcrumbString} \u2014 Path must be present in the package. \u2014 ${value}`;\n }\n if (options.mustBeExecutable) {\n if (!((await resolvedPath.stat()).mode ^ constants.X_OK)) {\n // This is not considered fixable because the binary may be the output\n // of a build process. In that case, the build process is responsible\n // for marking it as executable.\n return `\u274C ${breadcrumbString} \u2014 File at path must be executable. \u2014 ${value}`;\n }\n }\n return `\u2705 ${breadcrumbString} \u2014 Path must be present in the package. \u2014 ${value}`;\n })(),\n );\n}\n\ncheckPath([\"main\"], { expectPrefix: ResolutionPrefix.Relative });\ncheckPath([\"types\"], { expectPrefix: ResolutionPrefix.Relative });\ncheckPath([\"module\"], { expectPrefix: ResolutionPrefix.Relative });\ncheckPath([\"browser\"], { expectPrefix: ResolutionPrefix.Relative });\n\nconst { exports } = packageJSON;\nif (exports) {\n for (const [subpath, value] of Object.entries(exports)) {\n if (!value) {\n // biome-ignore lint/complexity/noUselessContinue: Explicit control flow.\n continue;\n } else if (typeof value === \"string\") {\n // TODO: error?\n checkPath([\"exports\", [subpath]], {\n expectPrefix: ResolutionPrefix.Relative,\n });\n } else if (value === null) {\n // biome-ignore lint/complexity/noUselessContinue: Explicit control flow.\n continue;\n } else if (Array.isArray(value)) {\n throw new Error(\n \"\u274C .exports \u2014 Must use an object (instead of an array).\",\n );\n } else {\n const keys = Object.keys(value as Record<string, string>);\n\n checks.push(\n (async () => {\n const { breadcrumbString } = traverse([\"exports\", [subpath]]);\n const fixingLines = [];\n const orderingErrorLines = [];\n /**\n * https://nodejs.org/api/packages.html#conditional-exports\n */\n let updateKeys = false;\n if (keys.includes(\"types\")) {\n if (keys[0] !== \"types\") {\n switch (subcommand) {\n case \"check\": {\n orderingErrorLines.push(\n ` \u21AA \"types\" must be the first export if present \u2014 \uD83D\uDCDD fixable!`,\n );\n break;\n }\n case \"format\": {\n fixingLines.push(\n ` \u21AA \"types\" must be the first export if present \u2014 \uD83D\uDCDD fixing!`,\n );\n keys.splice(keys.indexOf(\"types\"), 1);\n keys.splice(0, 0, \"types\");\n updateKeys = true;\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n }\n }\n if (keys.includes(\"default\")) {\n if (keys.at(-1) !== \"default\") {\n switch (subcommand) {\n case \"check\": {\n orderingErrorLines.push(\n ` \u21AA \"default\" must be the last export if present \u2014 \uD83D\uDCDD fixable!`,\n );\n break;\n }\n case \"format\": {\n fixingLines.push(\n ` \u21AA \"default\" must be the last export if present \u2014 \uD83D\uDCDD fixing!`,\n );\n keys.splice(keys.indexOf(\"default\"), 1);\n keys.push(\"default\");\n updateKeys = true;\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n }\n }\n }\n if (updateKeys) {\n // TODO: avoid type wrangling.\n const newConditionalExports: Record<string, string> = {};\n for (const key of keys) {\n newConditionalExports[key] = (value as Record<string, string>)[\n key\n ];\n }\n (exports as Record<string, Record<string, string>>)[subpath] =\n newConditionalExports;\n }\n for (const key of keys) {\n // Note `\"require\"` is *emphatically not allowed*.\n if (![\"types\", \"import\", \"default\"].includes(key)) {\n orderingErrorLines.push(\n ` \u21AA Key must not be present: ${JSON.stringify(key)}`,\n );\n }\n }\n if (orderingErrorLines.length > 0) {\n exitCode = 1;\n return [\n `\u274C ${breadcrumbString} \u2014 Invalid keys:`,\n ...orderingErrorLines,\n ].join(\"\\n\");\n } else {\n if (fixingLines.length > 0) {\n return [\n `\u2705 ${breadcrumbString} \u2014 Fixing key ordering:`,\n ...fixingLines,\n ].join(\"\\n\");\n } else {\n return `\u2705 ${breadcrumbString} \u2014 Key set and ordering is OK.`;\n }\n }\n })(),\n );\n for (const secondaryKey of keys) {\n checkPath([\"exports\", [subpath], secondaryKey], {\n expectPrefix: ResolutionPrefix.Relative,\n });\n }\n }\n }\n}\n\nconst { bin } = packageJSON;\nif (bin) {\n for (const binEntry of Object.keys(bin as Record<string, string>)) {\n checkPath([\"bin\", [binEntry]], {\n // `npm pkg fix` prefers bare paths for `bin` entries for some reason. \uD83E\uDD37\n expectPrefix: ResolutionPrefix.Bare,\n // `npm` will technically make binary entry points executable, but we want\n // to enforce that the unpackaged path also is. This is particularly\n // important when the package is linked.\n mustBeExecutable: true,\n });\n }\n}\n\nconsole.log((await Promise.all(checks)).join(\"\\n\"));\n\nif (subcommand === \"format\") {\n console.log(\"\uD83D\uDCDD Writing formatting fixes.\");\n // TODO: support trailing space in `path-class`.\n await PACKAGE_JSON_PATH.write(`${JSON.stringify(packageJSON, null, \" \")}\\n`);\n console.log(PACKAGE_JSON_PATH.path);\n console.log(\"\uD83D\uDCDD Running `npm pkg fix`.\");\n await new PrintableShellCommand(\"npm\", [\"pkg\", \"fix\"])\n .print({ argumentLineWrapping: \"inline\" })\n .spawn().success;\n} else if (foundFixableErrors) {\n console.log();\n console.log(\n \"\uD83D\uDCDD Found fixable errors. Run with the `format` subcommand to fix.\",\n );\n console.log();\n}\n\nawait tempDirDisposable[Symbol.asyncDispose]();\n\nexit(exitCode);\n"],
5
+ "mappings": ";;;;;;;AAIA,OAAO,YAAY;AACnB,SAAS,iBAAiB;AAC1B,SAAS,MAAM,YAAY;AAE3B,SAAS,cA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,IAAI,IAAI;AAChB,MAAI,KAAK;AACP,eAAW,YAAY,OAAO,KAAK,GAA6B,GAAG;AACjE,gBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;AAAA;AAAA,QAE7B,cAAc,iBAAiB;AAAA;AAAA;AAAA;AAAA,QAI/B,kBAAkB;AAAA,MACpB,CAAC;AAAA,IACH;AAAA,EACF;AAEA,UAAQ,KAAK,MAAM,QAAQ,IAAI,MAAM,GAAG,KAAK,IAAI,CAAC;AAElD,MAAI,eAAe,UAAU;AAC3B,YAAQ,IAAI,qCAA8B;AAE1C,UAAM,kBAAkB,MAAM,GAAG,KAAK,UAAU,aAAa,MAAM,IAAI,CAAC;AAAA,CAAI;AAC5E,YAAQ,IAAI,kBAAkB,IAAI;AAClC,YAAQ,IAAI,kCAA2B;AACvC,UAAM,IAAI,sBAAsB,OAAO,CAAC,OAAO,KAAK,CAAC,EAClD,MAAM,EAAE,sBAAsB,SAAS,CAAC,EACxC,MAAM,EAAE;AAAA,EACb,WAAW,oBAAoB;AAC7B,YAAQ,IAAI;AACZ,YAAQ;AAAA,MACN;AAAA,IACF;AACA,YAAQ,IAAI;AAAA,EACd;AAEA,QAAM,kBAAkB,OAAO,YAAY,EAAE;AAE7C,OAAK,QAAQ;AAAA,SAzQb;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": ["subcommand", "packageJSON", "field"]
7
7
  }
package/biome/biome.json CHANGED
@@ -7,6 +7,9 @@
7
7
  },
8
8
  "linter": {
9
9
  "rules": {
10
+ "nursery": {
11
+ "noFloatingPromises": "error"
12
+ },
10
13
  "style": {
11
14
  "useBlockStatements": "error"
12
15
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubing/dev-config",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "description": "Common dev configs for projects.",
5
5
  "author": {
6
6
  "name": "Lucas Garron",
@@ -32,7 +32,7 @@
32
32
  "printable-shell-command": ">=4.0.3"
33
33
  },
34
34
  "devDependencies": {
35
- "@biomejs/biome": "^2.3.10",
35
+ "@biomejs/biome": "^2.3.11",
36
36
  "@schemastore/package": "^0.0.10",
37
37
  "@types/bun": "^1.3.5",
38
38
  "@types/node": "^25.0.3",