@adamhl8/configs 3.5.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -60
- package/dist/adamhl8-tsconfig/index +43 -0
- package/dist/configs/bask.base.d.ts +1 -2
- package/dist/configs/bask.base.js +20 -11
- package/dist/configs/bask.base.js.map +1 -1
- package/dist/configs/commitlint.base.d.ts +1 -2
- package/dist/configs/commitlint.base.js.map +1 -1
- package/dist/configs/configs.d.ts +7 -0
- package/dist/configs/configs.js +7 -0
- package/dist/configs/gitignore.base +0 -1
- package/dist/configs/knip.base.d.ts +17 -6
- package/dist/configs/knip.base.js +18 -9
- package/dist/configs/knip.base.js.map +1 -1
- package/dist/configs/oxfmt.base.d.ts +1 -2
- package/dist/configs/oxlint.base.d.ts +2 -3
- package/dist/configs/oxlint.base.js +12 -3
- package/dist/configs/oxlint.base.js.map +1 -1
- package/dist/configs/release-it.base.d.ts +1 -2
- package/dist/configs/tsconfig.base.json +1 -1
- package/dist/configs/tsconfig.no-dts.base.json +7 -0
- package/dist/configs/tsdown.base.d.ts +1 -2
- package/dist/configs/tsdown.base.js.map +1 -1
- package/dist/dep-report/dep-report.js +66 -0
- package/dist/dep-report/dep-report.js.map +1 -0
- package/dist/dep-report/prompt.md +28 -0
- package/dist/env/index.d.ts +1 -2
- package/dist/env/utils.d.ts +1 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/merge-config/merge-config.d.ts +5 -1
- package/dist/merge-config/merge-config.js +17 -7
- package/dist/merge-config/merge-config.js.map +1 -1
- package/dist/merge-config/merge.types.d.ts +1 -2
- package/dist/test-utils/fixture.d.ts +2 -9
- package/dist/test-utils/fixture.js +2 -3
- package/dist/test-utils/fixture.js.map +1 -1
- package/dist/test-utils/index.d.ts +2 -3
- package/dist/test-utils/index.js +3 -4
- package/dist/test-utils/pack.d.ts +5 -3
- package/dist/test-utils/pack.js +16 -4
- package/dist/test-utils/pack.js.map +1 -1
- package/dist/test-utils/shell/command.d.ts +1 -2
- package/dist/test-utils/shell/command.js +1 -1
- package/dist/test-utils/shell/command.js.map +1 -1
- package/dist/test-utils/shell/env.d.ts +1 -2
- package/dist/test-utils/shell/shell.d.ts +2 -1
- package/dist/test-utils/shell/shell.js +2 -1
- package/dist/test-utils/shell/shell.js.map +1 -1
- package/dist/test-utils/temp-dir.d.ts +2 -3
- package/dist/test-utils/temp-dir.js +5 -3
- package/dist/test-utils/temp-dir.js.map +1 -1
- package/dist/utils.js +11 -2
- package/dist/utils.js.map +1 -1
- package/package.json +28 -48
- package/dist/configs/bask.base.d.ts.map +0 -1
- package/dist/configs/commitlint.base.d.ts.map +0 -1
- package/dist/configs/knip.base.d.ts.map +0 -1
- package/dist/configs/oxfmt.base.d.ts.map +0 -1
- package/dist/configs/oxlint.base.d.ts.map +0 -1
- package/dist/configs/release-it.base.d.ts.map +0 -1
- package/dist/configs/tsdown.base.d.ts.map +0 -1
- package/dist/env/index.d.ts.map +0 -1
- package/dist/env/utils.d.ts.map +0 -1
- package/dist/merge-config/merge-config.d.ts.map +0 -1
- package/dist/merge-config/merge.types.d.ts.map +0 -1
- package/dist/test-utils/fixture.d.ts.map +0 -1
- package/dist/test-utils/pack.d.ts.map +0 -1
- package/dist/test-utils/shell/command.d.ts.map +0 -1
- package/dist/test-utils/shell/env.d.ts.map +0 -1
- package/dist/test-utils/shell/shell.d.ts.map +0 -1
- package/dist/test-utils/subprocess-coverage/child-preload.d.ts +0 -1
- package/dist/test-utils/subprocess-coverage/child-preload.js +0 -73
- package/dist/test-utils/subprocess-coverage/child-preload.js.map +0 -1
- package/dist/test-utils/subprocess-coverage/env.d.ts +0 -7
- package/dist/test-utils/subprocess-coverage/env.d.ts.map +0 -1
- package/dist/test-utils/subprocess-coverage/env.js +0 -19
- package/dist/test-utils/subprocess-coverage/env.js.map +0 -1
- package/dist/test-utils/subprocess-coverage/preload.d.ts +0 -1
- package/dist/test-utils/subprocess-coverage/preload.js +0 -43
- package/dist/test-utils/subprocess-coverage/preload.js.map +0 -1
- package/dist/test-utils/subprocess-coverage/report.js +0 -35
- package/dist/test-utils/subprocess-coverage/report.js.map +0 -1
- package/dist/test-utils/temp-dir.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.js","names":["directiveCommentsPluginRules","regexpPluginRules"],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import cleanModulesPlugin from \"@adamhl8/eslint-plugin-clean-modules\"\nimport e18ePlugin from \"@e18e/eslint-plugin\"\nimport bunismsPlugin from \"eslint-plugin-bunisms\"\nimport honoPlugin from \"eslint-plugin-hono\"\nimport reactWebApiPlugin from \"eslint-plugin-react-web-api\"\nimport reactEffectPlugin from \"eslint-plugin-react-you-might-not-need-an-effect\"\nimport { rules as regexpPluginRules } from \"eslint-plugin-regexp\"\nimport type { DummyRule, OxlintConfig, OxlintOverride } from \"oxlint\"\nimport { rules as directiveCommentsPluginRules } from \"oxlint-plugin-directive-comments\"\nimport tailwindcssPlugin from \"oxlint-tailwindcss\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { readProjectPackageJson, resolvePackagePath, resolveProjectTailwind } from \"#utils.ts\"\n\n/** Sets every rule in a JS plugin to `severity`, because `categories` doesn't apply to JS plugins. */\nconst setAllPluginRules = (name: string, rules: Record<string, unknown>, severity: \"error\" | \"off\") =>\n Object.fromEntries(Object.keys(rules).map((rule) => [`${name}/${rule}`, severity] as const))\n\n// Type plugin rules with oxlint's generic `DummyRule` because its per-rule config types aren't exported, which breaks declaration emit.\ntype PluginRules = Record<string, DummyRule>\n\n/** A JS plugin and the slice of oxlint config that goes with it. Each one is merged into the base config. */\ninterface PluginPart extends Omit<OxlintConfig, \"jsPlugins\" | \"overrides\" | \"rules\"> {\n overrides?: (Omit<OxlintOverride, \"rules\"> & { rules?: PluginRules })[]\n rules?: PluginRules\n /** Loads the plugin only when true. Defaults to true. */\n enabled?: boolean\n package: string\n /** The plugin's rule definitions, used to set every rule to \"error\". The part's own `rules` then take precedence. */\n pluginRules: Record<string, unknown> | undefined\n}\n\nconst { dependencies, engines } = readProjectPackageJson()\nconst tailwindStylesheet = resolveProjectTailwind()\n\n// Key each part by the rule namespace its plugin registers.\nconst plugins: Record<string, PluginPart> = {\n bunisms: {\n overrides: [\n {\n excludeFiles: [\"src/**/__tests__/**\", \"src/**/*.test.{ts,tsx}\", \"src/**/test-setup.ts\", \"src/**/test-utils.ts\"],\n // Turn off Bun suggestions in Node runtime code. Tests and tooling still run on Bun.\n files: engines.has(\"node\") ? [\"src/**\"] : [],\n rules: setAllPluginRules(\"bunisms\", bunismsPlugin.rules, \"off\"),\n },\n ],\n package: \"eslint-plugin-bunisms\",\n pluginRules: bunismsPlugin.rules,\n rules: {\n \"bunisms/prefer-mock-restore-in-after-each\": \"off\", // `test-setup.ts` preloads restore mocks globally\n },\n },\n \"clean-modules\": {\n package: \"@adamhl8/eslint-plugin-clean-modules\",\n pluginRules: cleanModulesPlugin.rules,\n },\n \"directive-comments\": {\n package: \"oxlint-plugin-directive-comments\",\n pluginRules: directiveCommentsPluginRules,\n rules: {\n \"directive-comments/disable-enable-pair\": [\"error\", { allowWholeFile: true }],\n \"directive-comments/no-use\": \"off\", // bans every directive comment\n },\n },\n e18e: {\n package: \"@e18e/eslint-plugin\",\n pluginRules: e18ePlugin.rules,\n rules: {\n \"e18e/no-indexof-equality\": \"off\", // needs type information, which JS plugins don't get\n \"e18e/no-spread-in-reduce\": \"off\", // `oxc/no-accumulating-spread` covers this\n \"e18e/prefer-array-at\": \"off\", // `unicorn/prefer-at` covers this\n \"e18e/prefer-array-some\": \"off\", // `unicorn/prefer-array-some` covers this\n \"e18e/prefer-array-to-reversed\": \"off\", // `unicorn/no-array-reverse` covers this\n \"e18e/prefer-array-to-sorted\": \"off\", // `unicorn/no-array-sort` covers this\n \"e18e/prefer-date-now\": \"off\", // `unicorn/prefer-date-now` covers this\n \"e18e/prefer-exponentiation-operator\": \"off\", // `prefer-exponentiation-operator` covers this\n \"e18e/prefer-flatmap-over-map-flat\": \"off\", // `unicorn/prefer-array-flat-map` covers this\n \"e18e/prefer-includes\": \"off\", // `unicorn/prefer-includes` covers this\n \"e18e/prefer-nullish-coalescing\": \"off\", // `typescript/prefer-nullish-coalescing` covers this\n \"e18e/prefer-object-has-own\": \"off\", // `prefer-object-has-own` covers this\n \"e18e/prefer-slice-over-split-index\": \"off\",\n \"e18e/prefer-spread-syntax\": \"off\", // `unicorn/prefer-spread` and `prefer-object-spread` cover this\n },\n },\n hono: {\n enabled: dependencies.has(\"hono\"),\n package: \"eslint-plugin-hono\",\n pluginRules: honoPlugin.rules,\n rules: {\n \"hono/no-process-env\": \"off\", // tools and tests legitimately read the raw environment\n },\n },\n \"react-web-api\": {\n enabled: dependencies.has(\"react\"),\n package: \"eslint-plugin-react-web-api\",\n pluginRules: reactWebApiPlugin.rules,\n },\n \"react-you-might-not-need-an-effect\": {\n enabled: dependencies.has(\"react\"),\n package: \"eslint-plugin-react-you-might-not-need-an-effect\",\n pluginRules: reactEffectPlugin.rules,\n rules: {\n \"react-you-might-not-need-an-effect/no-adjust-state-on-prop-change\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-chain-state-updates\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-derived-state\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-initialize-state\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change\": \"off\", // `react/set-state-in-effect` covers this\n },\n },\n regexp: {\n package: \"eslint-plugin-regexp\",\n pluginRules: regexpPluginRules,\n rules: {\n \"regexp/letter-case\": [\"error\", { hexadecimalEscape: \"uppercase\", unicodeEscape: \"uppercase\" }], // match `unicorn/escape-case`\n \"regexp/no-control-character\": \"off\", // `no-control-regex` covers this\n \"regexp/no-empty-character-class\": \"off\", // `no-empty-character-class` covers this\n \"regexp/no-invalid-regexp\": \"off\", // `no-invalid-regexp` covers this\n \"regexp/no-super-linear-move\": \"off\",\n \"regexp/no-useless-escape\": \"off\", // `no-useless-escape` covers this\n \"regexp/prefer-named-capture-group\": \"off\", // `prefer-named-capture-group` covers this\n \"regexp/require-unicode-regexp\": \"off\", // `require-unicode-regexp` covers this\n \"regexp/require-unicode-sets-regexp\": \"off\", // `require-unicode-regexp` covers this\n \"regexp/sort-alternatives\": \"off\",\n },\n },\n tailwindcss: {\n // Load the Tailwind plugin only with a stylesheet because it reports every class string without one.\n enabled: Boolean(tailwindStylesheet),\n package: \"oxlint-tailwindcss\",\n pluginRules: tailwindcssPlugin.rules,\n rules: {\n \"tailwindcss/enforce-consistent-line-wrapping\": \"off\", // oxfmt handles line width\n \"tailwindcss/enforce-logical\": \"off\", // conflicts with `tailwindcss/enforce-physical`\n \"tailwindcss/enforce-sort-order\": \"off\", // oxfmt sorts classes\n \"tailwindcss/max-class-count\": \"off\",\n },\n // Keep `entryPoint` relative because the plugin resolves it against the directory of the project's oxlint config.\n settings: { tailwindcss: { entryPoint: tailwindStylesheet } },\n },\n}\n\nconst nativeConfig = {\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n\n plugins: [\n \"eslint\",\n \"react\",\n \"unicorn\",\n \"typescript\",\n \"oxc\",\n \"import\",\n \"jsdoc\",\n \"vitest\",\n \"jsx-a11y\",\n \"react-perf\",\n \"promise\",\n \"node\",\n ],\n\n overrides: [\n {\n files: [\n \".release-it.ts\",\n \"astro.config.ts\",\n \"commitlint.config.ts\",\n \"knip.ts\",\n \"oxfmt.config.ts\",\n \"oxlint.config.ts\",\n \"prisma.config.ts\",\n \"tsdown.config.ts\",\n ],\n rules: {\n \"import/no-default-export\": \"off\",\n },\n },\n {\n files: [\"bask.ts\"],\n rules: {\n \"clean-modules/require-direct-exports\": \"off\",\n \"import/export\": \"off\",\n },\n },\n {\n files: [\".release-it.ts\"],\n rules: {\n \"no-template-curly-in-string\": \"off\",\n },\n },\n {\n files: [\"**/*.tsx\"],\n rules: {\n \"func-style\": [\"error\", \"declaration\", { allowArrowFunctions: true }],\n },\n },\n {\n files: [\"**/fixtures/**\", \"**/fixture/**\"],\n rules: {\n \"clean-modules/require-import-extensions\": \"off\",\n \"clean-modules/require-subpath-imports\": \"off\",\n \"import/no-default-export\": \"off\",\n },\n },\n ],\n\n rules: {\n /* Modified rules */\n\n curly: [\"error\", \"multi-or-nest\"],\n \"func-style\": [\"error\", \"expression\"],\n \"require-unicode-regexp\": [\"error\", { requireFlag: \"v\" }],\n\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"function-declaration\", unnamedComponents: \"arrow-function\" },\n ],\n \"react/jsx-curly-brace-presence\": [\"error\", { children: \"never\", propElementValues: \"always\", props: \"never\" }],\n\n \"unicorn/filename-case\": [\n \"error\",\n {\n cases: { kebabCase: true, pascalCase: true },\n },\n ],\n \"unicorn/no-useless-undefined\": [\"error\", { checkArguments: false }],\n\n /* Disabled rules */\n\n \"capitalized-comments\": \"off\",\n \"id-length\": \"off\",\n \"init-declarations\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-console\": \"off\",\n \"no-continue\": \"off\",\n \"no-duplicate-imports\": \"off\",\n \"no-inline-comments\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-plusplus\": \"off\",\n \"no-regex-spaces\": \"off\", // `regexp/prefer-quantifier` covers this\n \"no-ternary\": \"off\",\n \"no-undef\": \"off\",\n \"no-undefined\": \"off\",\n \"no-useless-return\": \"off\",\n \"no-void\": \"off\",\n \"one-var\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/max-dependencies\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": \"off\",\n \"import/prefer-default-export\": \"off\",\n\n \"jsdoc/require-param\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n\n \"node/callback-return\": \"off\",\n \"node/no-process-env\": \"off\", // tools and tests legitimately read the raw environment\n \"node/no-sync\": \"off\",\n \"node/no-top-level-await\": \"off\",\n\n \"oxc/no-async-await\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n\n \"react/exhaustive-effect-dependencies\": \"off\", // `react/exhaustive-deps` covers this\n \"react/forbid-component-props\": \"off\",\n \"react/hooks\": \"off\", // `react/rules-of-hooks` covers this\n \"react/invariant\": \"off\",\n \"react/jsx-filename-extension\": \"off\",\n \"react/jsx-max-depth\": \"off\",\n \"react/jsx-no-literals\": \"off\",\n \"react/memo-dependencies\": \"off\", // `react/exhaustive-deps` covers this\n \"react/no-deriving-state-in-effects\": \"off\", // `react/set-state-in-effect` covers this\n \"react/react-in-jsx-scope\": \"off\",\n \"react/rule-suppression\": \"off\",\n \"react/todo\": \"off\",\n\n \"typescript/consistent-return\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n\n \"unicorn/no-array-callback-reference\": \"off\",\n \"unicorn/no-array-method-this-argument\": \"off\",\n \"unicorn/no-await-expression-member\": \"off\",\n \"unicorn/no-process-exit\": \"off\",\n \"unicorn/number-literal-case\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n\n \"vitest/no-hooks\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/prefer-importing-vitest-globals\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/require-hook\": \"off\", // reenable when false positives are fixed?\n \"vitest/require-test-timeout\": \"off\",\n },\n} as const satisfies OxlintConfig\n\nconst enabledPluginEntries = Object.entries(plugins).filter(([, plugin]) => plugin.enabled ?? true)\nconst enabledPlugins = enabledPluginEntries.map(([, plugin]) => plugin)\n// Resolve JS plugins to absolute paths so consumers load them from this package's own deps.\nconst resolvedPluginPackages = enabledPlugins.map((plugin) => resolvePackagePath(plugin.package))\nconst pluginOverrides = enabledPlugins.flatMap((plugin) => plugin.overrides ?? [])\nconst pluginSettings = Object.fromEntries(enabledPlugins.flatMap((plugin) => Object.entries(plugin.settings ?? {})))\n\n/** Lists a plugin's rules as entries */\nconst toPluginRuleEntries = ([name, { pluginRules = {}, rules }]: [string, PluginPart]) => {\n const defaultRules = setAllPluginRules(name, pluginRules, \"error\")\n const pluginRuleEntries = Object.entries({ ...defaultRules, ...rules })\n return pluginRuleEntries\n}\n\nconst resolvedPluginRules = Object.fromEntries(enabledPluginEntries.flatMap(toPluginRuleEntries))\n\nconst baseConfig = {\n ...nativeConfig,\n jsPlugins: resolvedPluginPackages,\n overrides: [...nativeConfig.overrides, ...pluginOverrides],\n rules: {\n ...resolvedPluginRules,\n ...nativeConfig.rules,\n },\n settings: pluginSettings,\n} satisfies OxlintConfig\n\nexport const oxlintConfig = createMergeConfigFn<OxlintConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,qBAAqB,MAAc,OAAgC,aACvE,OAAO,YAAY,OAAO,KAAK,KAAK,CAAC,CAAC,KAAK,SAAS,CAAC,GAAG,KAAK,GAAG,QAAQ,QAAQ,CAAU,CAAC;AAgB7F,MAAM,EAAE,cAAc,YAAY,uBAAuB;AACzD,MAAM,qBAAqB,uBAAuB;AAGlD,MAAM,UAA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AuB,OAAO,QAAQ,OAAO,CAAC,CAAC,QAAQ,GAAG,YAAY,OAAO,WAAW,IAAI;AAClG,MAAM,iBAAiB,qBAAqB,KAAK,GAAG,YAAY,MAAM;AAEtE,MAAM,yBAAyB,eAAe,KAAK,WAAW,mBAAmB,OAAO,OAAO,CAAC;AAChG,MAAM,kBAAkB,eAAe,SAAS,WAAW,OAAO,aAAa,CAAC,CAAC;AACjF,MAAM,iBAAiB,OAAO,YAAY,eAAe,SAAS,WAAW,OAAO,QAAQ,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;;AAGnH,MAAM,uBAAuB,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,aAAmC;CACzF,MAAM,eAAe,kBAAkB,MAAM,aAAa,OAAO;CAEjE,OAD0B,OAAO,QAAQ;EAAE,GAAG;EAAc,GAAG;CAAM,CAC9C;AACzB;AAEA,MAAM,sBAAsB,OAAO,YAAY,qBAAqB,QAAQ,mBAAmB,CAAC;AAEhG,MAAM,aAAa;CACjB,GAAG;CACH,WAAW;CACX,WAAW,CAAC,GAAG,aAAa,WAAW,GAAG,eAAe;CACzD,OAAO;EACL,GAAG;EACH,GAAG,aAAa;CAClB;CACA,UAAU;AACZ;AAEA,MAAa,eAAe,oBAAqD,UAAU"}
|
|
1
|
+
{"version":3,"file":"oxlint.base.js","names":["directiveCommentsPluginRules","regexpPluginRules"],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import cleanModulesPlugin from \"@adamhl8/oxlint-plugin-clean-modules\"\nimport packageBoundariesPlugin from \"@adamhl8/oxlint-plugin-package-boundaries\"\nimport e18ePlugin from \"@e18e/eslint-plugin\"\nimport bunismsPlugin from \"eslint-plugin-bunisms\"\nimport honoPlugin from \"eslint-plugin-hono\"\nimport reactWebApiPlugin from \"eslint-plugin-react-web-api\"\nimport reactEffectPlugin from \"eslint-plugin-react-you-might-not-need-an-effect\"\nimport { rules as regexpPluginRules } from \"eslint-plugin-regexp\"\nimport type { DummyRule, OxlintConfig, OxlintOverride } from \"oxlint\"\nimport { rules as directiveCommentsPluginRules } from \"oxlint-plugin-directive-comments\"\nimport tailwindcssPlugin from \"oxlint-tailwindcss\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { readProjectPackageJson, resolvePackagePath, resolveProjectTailwind } from \"#utils.ts\"\n\n/** Sets every rule in a JS plugin to `severity`, because `categories` doesn't apply to JS plugins. */\nconst setAllPluginRules = (name: string, rules: Record<string, unknown>, severity: \"error\" | \"off\") =>\n Object.fromEntries(Object.keys(rules).map((rule) => [`${name}/${rule}`, severity] as const))\n\n// Type plugin rules with oxlint's generic `DummyRule` because its per-rule config types aren't exported, which breaks declaration emit.\ntype PluginRules = Record<string, DummyRule>\n\n/** A JS plugin and the slice of oxlint config that goes with it. Each one is merged into the base config. */\ninterface PluginPart extends Omit<OxlintConfig, \"jsPlugins\" | \"overrides\" | \"rules\"> {\n overrides?: (Omit<OxlintOverride, \"rules\"> & { rules?: PluginRules })[]\n rules?: PluginRules\n /** Loads the plugin only when true. Defaults to true. */\n enabled?: boolean\n package: string\n /** The plugin's rule definitions, used to set every rule to \"error\". The part's own `rules` then take precedence. */\n pluginRules: Record<string, unknown> | undefined\n}\n\nconst { dependencies, engines } = readProjectPackageJson()\nconst tailwindStylesheet = resolveProjectTailwind()\n\n// Key each part by the rule namespace its plugin registers.\nconst plugins: Record<string, PluginPart> = {\n bunisms: {\n overrides: [\n {\n excludeFiles: [\"src/**/__tests__/**\", \"src/**/*.test.{ts,tsx}\", \"src/**/test-setup.ts\", \"src/**/test-utils.ts\"],\n // Turn off Bun suggestions in Node runtime code. Tests and tooling still run on Bun.\n files: engines.has(\"node\") ? [\"src/**\"] : [],\n rules: setAllPluginRules(\"bunisms\", bunismsPlugin.rules, \"off\"),\n },\n ],\n package: \"eslint-plugin-bunisms\",\n pluginRules: bunismsPlugin.rules,\n rules: {\n \"bunisms/prefer-mock-restore-in-after-each\": \"off\", // `test-setup.ts` preloads restore mocks globally\n },\n },\n \"clean-modules\": {\n package: \"@adamhl8/oxlint-plugin-clean-modules\",\n pluginRules: cleanModulesPlugin.rules,\n },\n \"directive-comments\": {\n package: \"oxlint-plugin-directive-comments\",\n pluginRules: directiveCommentsPluginRules,\n rules: {\n \"directive-comments/disable-enable-pair\": [\"error\", { allowWholeFile: true }],\n \"directive-comments/no-use\": \"off\", // bans every directive comment\n },\n },\n e18e: {\n package: \"@e18e/eslint-plugin\",\n pluginRules: e18ePlugin.rules,\n rules: {\n \"e18e/no-indexof-equality\": \"off\", // needs type information, which JS plugins don't get\n \"e18e/no-spread-in-reduce\": \"off\", // `oxc/no-accumulating-spread` covers this\n \"e18e/prefer-array-at\": \"off\", // `unicorn/prefer-at` covers this\n \"e18e/prefer-array-some\": \"off\", // `unicorn/prefer-array-some` covers this\n \"e18e/prefer-array-to-reversed\": \"off\", // `unicorn/no-array-reverse` covers this\n \"e18e/prefer-array-to-sorted\": \"off\", // `unicorn/no-array-sort` covers this\n \"e18e/prefer-date-now\": \"off\", // `unicorn/prefer-date-now` covers this\n \"e18e/prefer-exponentiation-operator\": \"off\", // `prefer-exponentiation-operator` covers this\n \"e18e/prefer-flatmap-over-map-flat\": \"off\", // `unicorn/prefer-array-flat-map` covers this\n \"e18e/prefer-includes\": \"off\", // `unicorn/prefer-includes` covers this\n \"e18e/prefer-nullish-coalescing\": \"off\", // `typescript/prefer-nullish-coalescing` covers this\n \"e18e/prefer-object-has-own\": \"off\", // `prefer-object-has-own` covers this\n \"e18e/prefer-slice-over-split-index\": \"off\",\n \"e18e/prefer-spread-syntax\": \"off\", // `unicorn/prefer-spread` and `prefer-object-spread` cover this\n },\n },\n hono: {\n enabled: dependencies.has(\"hono\"),\n package: \"eslint-plugin-hono\",\n pluginRules: honoPlugin.rules,\n rules: {\n \"hono/no-process-env\": \"off\", // tools and tests legitimately read the raw environment\n },\n },\n \"package-boundaries\": {\n overrides: [\n {\n files: [\"**/__tests__/**\", \"**/*.test.{ts,tsx}\"],\n // Let a test import any module, because it checks a package's internals, not only its public surface.\n rules: setAllPluginRules(\"package-boundaries\", packageBoundariesPlugin.rules, \"off\"),\n },\n ],\n package: \"@adamhl8/oxlint-plugin-package-boundaries\",\n pluginRules: packageBoundariesPlugin.rules,\n },\n \"react-web-api\": {\n enabled: dependencies.has(\"react\"),\n package: \"eslint-plugin-react-web-api\",\n pluginRules: reactWebApiPlugin.rules,\n },\n \"react-you-might-not-need-an-effect\": {\n enabled: dependencies.has(\"react\"),\n package: \"eslint-plugin-react-you-might-not-need-an-effect\",\n pluginRules: reactEffectPlugin.rules,\n rules: {\n \"react-you-might-not-need-an-effect/no-adjust-state-on-prop-change\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-chain-state-updates\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-derived-state\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-initialize-state\": \"off\", // `react/set-state-in-effect` covers this\n \"react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change\": \"off\", // `react/set-state-in-effect` covers this\n },\n },\n regexp: {\n package: \"eslint-plugin-regexp\",\n pluginRules: regexpPluginRules,\n rules: {\n \"regexp/letter-case\": [\"error\", { hexadecimalEscape: \"uppercase\", unicodeEscape: \"uppercase\" }], // match `unicorn/escape-case`\n \"regexp/no-control-character\": \"off\", // `no-control-regex` covers this\n \"regexp/no-empty-character-class\": \"off\", // `no-empty-character-class` covers this\n \"regexp/no-invalid-regexp\": \"off\", // `no-invalid-regexp` covers this\n \"regexp/no-super-linear-move\": \"off\",\n \"regexp/no-useless-escape\": \"off\", // `no-useless-escape` covers this\n \"regexp/prefer-named-capture-group\": \"off\", // `prefer-named-capture-group` covers this\n \"regexp/require-unicode-regexp\": \"off\", // `require-unicode-regexp` covers this\n \"regexp/require-unicode-sets-regexp\": \"off\", // `require-unicode-regexp` covers this\n \"regexp/sort-alternatives\": \"off\",\n },\n },\n tailwindcss: {\n // Load the Tailwind plugin only with a stylesheet because it reports every class string without one.\n enabled: Boolean(tailwindStylesheet),\n package: \"oxlint-tailwindcss\",\n pluginRules: tailwindcssPlugin.rules,\n rules: {\n \"tailwindcss/enforce-consistent-line-wrapping\": \"off\", // oxfmt handles line width\n \"tailwindcss/enforce-logical\": \"off\", // conflicts with `tailwindcss/enforce-physical`\n \"tailwindcss/enforce-sort-order\": \"off\", // oxfmt sorts classes\n \"tailwindcss/max-class-count\": \"off\",\n },\n // Keep `entryPoint` relative because the plugin resolves it against the directory of the project's oxlint config.\n settings: { tailwindcss: { entryPoint: tailwindStylesheet } },\n },\n}\n\nconst nativeConfig = {\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n // Leave `typeCheck` off because `bask lint` runs `tsc`, which also reports declaration errors.\n typeCheck: false,\n },\n\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n\n plugins: [\n \"eslint\",\n \"react\",\n \"unicorn\",\n \"typescript\",\n \"oxc\",\n \"import\",\n \"jsdoc\",\n \"vitest\",\n \"jsx-a11y\",\n \"react-perf\",\n \"promise\",\n \"node\",\n ],\n\n overrides: [\n {\n files: [\n \".release-it.ts\",\n \"astro.config.ts\",\n \"commitlint.config.ts\",\n \"knip.ts\",\n \"oxfmt.config.ts\",\n \"oxlint.config.ts\",\n \"prisma.config.ts\",\n \"tsdown.config.ts\",\n ],\n rules: {\n \"import/no-default-export\": \"off\",\n },\n },\n {\n files: [\"bask.ts\"],\n rules: {\n \"clean-modules/require-direct-exports\": \"off\",\n \"import/export\": \"off\",\n },\n },\n {\n files: [\".release-it.ts\"],\n rules: {\n \"no-template-curly-in-string\": \"off\",\n },\n },\n {\n files: [\"**/*.tsx\"],\n rules: {\n \"func-style\": [\"error\", \"declaration\", { allowArrowFunctions: true }],\n },\n },\n {\n files: [\"**/fixtures/**\", \"**/fixture/**\"],\n rules: {\n \"clean-modules/require-import-extensions\": \"off\",\n \"clean-modules/require-subpath-imports\": \"off\",\n \"import/no-default-export\": \"off\",\n },\n },\n ],\n\n rules: {\n /* Modified rules */\n\n curly: [\"error\", \"multi-or-nest\"],\n \"func-style\": [\"error\", \"expression\"],\n \"require-unicode-regexp\": [\"error\", { requireFlag: \"v\" }],\n\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"function-declaration\", unnamedComponents: \"arrow-function\" },\n ],\n \"react/jsx-curly-brace-presence\": [\"error\", { children: \"never\", propElementValues: \"always\", props: \"never\" }],\n\n \"unicorn/filename-case\": [\n \"error\",\n {\n cases: { kebabCase: true, pascalCase: true },\n },\n ],\n \"unicorn/no-useless-undefined\": [\"error\", { checkArguments: false }],\n\n /* Disabled rules */\n\n \"capitalized-comments\": \"off\",\n \"id-length\": \"off\",\n \"init-declarations\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-console\": \"off\",\n \"no-continue\": \"off\",\n \"no-duplicate-imports\": \"off\",\n \"no-inline-comments\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-plusplus\": \"off\",\n \"no-regex-spaces\": \"off\", // `regexp/prefer-quantifier` covers this\n \"no-ternary\": \"off\",\n \"no-undef\": \"off\",\n \"no-undefined\": \"off\",\n \"no-useless-return\": \"off\",\n \"no-void\": \"off\",\n \"one-var\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/max-dependencies\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": \"off\",\n \"import/prefer-default-export\": \"off\",\n\n \"jsdoc/require-param\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n\n \"node/callback-return\": \"off\",\n \"node/no-process-env\": \"off\", // tools and tests legitimately read the raw environment\n \"node/no-sync\": \"off\",\n \"node/no-top-level-await\": \"off\",\n\n \"oxc/no-async-await\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n\n \"react/exhaustive-effect-dependencies\": \"off\", // `react/exhaustive-deps` covers this\n \"react/forbid-component-props\": \"off\",\n \"react/hooks\": \"off\", // `react/rules-of-hooks` covers this\n \"react/invariant\": \"off\",\n \"react/jsx-filename-extension\": \"off\",\n \"react/jsx-max-depth\": \"off\",\n \"react/jsx-no-literals\": \"off\",\n \"react/memo-dependencies\": \"off\", // `react/exhaustive-deps` covers this\n \"react/no-deriving-state-in-effects\": \"off\", // `react/set-state-in-effect` covers this\n \"react/react-in-jsx-scope\": \"off\",\n \"react/rule-suppression\": \"off\",\n \"react/todo\": \"off\",\n\n \"typescript/consistent-return\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n\n \"unicorn/no-array-callback-reference\": \"off\",\n \"unicorn/no-array-method-this-argument\": \"off\",\n \"unicorn/no-await-expression-member\": \"off\",\n \"unicorn/no-process-exit\": \"off\",\n \"unicorn/number-literal-case\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n\n \"vitest/no-hooks\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/prefer-importing-vitest-globals\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/require-hook\": \"off\", // reenable when false positives are fixed?\n \"vitest/require-test-timeout\": \"off\",\n },\n} as const satisfies OxlintConfig\n\nconst enabledPluginEntries = Object.entries(plugins).filter(([, plugin]) => plugin.enabled ?? true)\nconst enabledPlugins = enabledPluginEntries.map(([, plugin]) => plugin)\n// Resolve JS plugins to absolute paths so consumers load them from this package's own deps.\nconst resolvedPluginPackages = enabledPlugins.map((plugin) => resolvePackagePath(plugin.package))\nconst pluginOverrides = enabledPlugins.flatMap((plugin) => plugin.overrides ?? [])\nconst pluginSettings = Object.fromEntries(enabledPlugins.flatMap((plugin) => Object.entries(plugin.settings ?? {})))\n\n/** Lists a plugin's rules as entries */\nconst toPluginRuleEntries = ([name, { pluginRules = {}, rules }]: [string, PluginPart]) => {\n const defaultRules = setAllPluginRules(name, pluginRules, \"error\")\n const pluginRuleEntries = Object.entries({ ...defaultRules, ...rules })\n return pluginRuleEntries\n}\n\nconst resolvedPluginRules = Object.fromEntries(enabledPluginEntries.flatMap(toPluginRuleEntries))\n\nconst baseConfig = {\n ...nativeConfig,\n jsPlugins: resolvedPluginPackages,\n overrides: [...nativeConfig.overrides, ...pluginOverrides],\n rules: {\n ...resolvedPluginRules,\n ...nativeConfig.rules,\n },\n settings: pluginSettings,\n} satisfies OxlintConfig\n\nexport const oxlintConfig = createMergeConfigFn<OxlintConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAM,qBAAqB,MAAc,OAAgC,aACvE,OAAO,YAAY,OAAO,KAAK,KAAK,CAAC,CAAC,KAAK,SAAS,CAAC,GAAG,KAAK,GAAG,QAAQ,QAAQ,CAAU,CAAC;AAgB7F,MAAM,EAAE,cAAc,YAAY,uBAAuB;AACzD,MAAM,qBAAqB,uBAAuB;AAGlD,MAAM,UAAsC;CAC1C,SAAS;EACP,WAAW,CACT;GACE,cAAc;IAAC;IAAuB;IAA0B;IAAwB;GAAsB;GAE9G,OAAO,QAAQ,IAAI,MAAM,IAAI,CAAC,QAAQ,IAAI,CAAC;GAC3C,OAAO,kBAAkB,WAAW,cAAc,OAAO,KAAK;EAChE,CACF;EACA,SAAS;EACT,aAAa,cAAc;EAC3B,OAAO,EACL,6CAA6C,MAC/C;CACF;CACA,iBAAiB;EACf,S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AAM;AAEtE,MAAM,yBAAyB,eAAe,KAAK,WAAW,mBAAmB,OAAO,OAAO,CAAC;AAChG,MAAM,kBAAkB,eAAe,SAAS,WAAW,OAAO,aAAa,CAAC,CAAC;AACjF,MAAM,iBAAiB,OAAO,YAAY,eAAe,SAAS,WAAW,OAAO,QAAQ,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;;AAGnH,MAAM,uBAAuB,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,aAAmC;CACzF,MAAM,eAAe,kBAAkB,MAAM,aAAa,OAAO;CAEjE,OAD0B,OAAO,QAAQ;EAAE,GAAG;EAAc,GAAG;CAAM,CAC9C;AACzB;AAEA,MAAM,sBAAsB,OAAO,YAAY,qBAAqB,QAAQ,mBAAmB,CAAC;AAEhG,MAAM,aAAa;CACjB,GAAG;CACH,WAAW;CACX,WAAW,CAAC,GAAG,aAAa,WAAW,GAAG,eAAe;CACzD,OAAO;EACL,GAAG;EACH,GAAG,aAAa;CAClB;CACA,UAAU;AACZ;AAEA,MAAa,eAAe,oBAAqD,UAAU"}
|
|
@@ -79,5 +79,4 @@ declare const binConfig: {
|
|
|
79
79
|
export declare const tsdownConfig: MergeConfigFn<StrictConfig, typeof baseConfig>;
|
|
80
80
|
export declare const tsdownBundleConfig: MergeConfigFn<StrictBundleConfig, typeof bundleConfig>;
|
|
81
81
|
export declare const tsdownBinConfig: MergeConfigFn<StrictBinConfig, typeof binConfig>;
|
|
82
|
-
export {};
|
|
83
|
-
//# sourceMappingURL=tsdown.base.d.ts.map
|
|
82
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.base.js","names":[],"sources":["../../src/configs/tsdown.base.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\n\n// Force projects to specify platform\ntype StrictConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n platform: \"neutral\",\n target: false,\n unbundle: true,\n sourcemap: true,\n minify: \"dce-only\",\n fixedExtension: false,\n hash: false,\n dts: {\n generator: \"tsgo\",\n },\n deps: {\n neverBundle: [\"bun\"],\n },\n attw: {\n level: \"error\",\n profile: \"esm-only\",\n },\n publint: true,\n failOnWarn: true,\n suppressWarnings: [\"TypeScript Go is experimental\"],\n} as const satisfies StrictConfig\n\n// Force projects to specify platform and entry\ntype StrictBundleConfig = SetRequired<UserConfig, \"platform\" | \"entry\">\n\n// Single-file bundle (not a published library): bundle everything, drop types/lint/sourcemap.\nconst bundleConfig = {\n ...baseConfig,\n entry: [],\n unbundle: false,\n sourcemap: false,\n dts: false,\n attw: false,\n publint: false,\n inputOptions: {\n experimental: {\n attachDebugInfo: \"none\", // remove region comments from bundled output\n },\n },\n} as const satisfies StrictBundleConfig\n\n// Force projects to specify platform and entry\ntype StrictBinConfig = SetRequired<UserConfig, \"entry\">\n\n// A bin is a node bundle with no output file extension.\nconst binConfig = {\n ...bundleConfig,\n platform: \"node\",\n outExtensions: () => ({ js: \"\" }) as const,\n} as const satisfies StrictBinConfig\n\n// The export annotations forbid the no-arg call
|
|
1
|
+
{"version":3,"file":"tsdown.base.js","names":[],"sources":["../../src/configs/tsdown.base.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\n\n// Force projects to specify platform\ntype StrictConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n platform: \"neutral\",\n target: false,\n unbundle: true,\n sourcemap: true,\n minify: \"dce-only\",\n fixedExtension: false,\n hash: false,\n dts: {\n generator: \"tsgo\",\n },\n deps: {\n neverBundle: [\"bun\"],\n },\n attw: {\n level: \"error\",\n profile: \"esm-only\",\n },\n publint: true,\n failOnWarn: true,\n suppressWarnings: [\"TypeScript Go is experimental\"],\n} as const satisfies StrictConfig\n\n// Force projects to specify platform and entry\ntype StrictBundleConfig = SetRequired<UserConfig, \"platform\" | \"entry\">\n\n// Single-file bundle (not a published library): bundle everything, drop types/lint/sourcemap.\nconst bundleConfig = {\n ...baseConfig,\n entry: [],\n unbundle: false,\n sourcemap: false,\n dts: false,\n attw: false,\n publint: false,\n inputOptions: {\n experimental: {\n attachDebugInfo: \"none\", // remove region comments from bundled output\n },\n },\n} as const satisfies StrictBundleConfig\n\n// Force projects to specify platform and entry\ntype StrictBinConfig = SetRequired<UserConfig, \"entry\">\n\n// A bin is a node bundle with no output file extension.\nconst binConfig = {\n ...bundleConfig,\n platform: \"node\",\n outExtensions: () => ({ js: \"\" }) as const,\n} as const satisfies StrictBinConfig\n\n// The export annotations forbid the no-arg call because `platform` and `entry` must be provided.\n// They also keep the published types correct.\n// Without one, `tsc` fails with TS2883 on tsdown's non-exported internals and the build silently emits `any`.\nexport const tsdownConfig: MergeConfigFn<StrictConfig, typeof baseConfig> = createMergeConfigFn<\n StrictConfig,\n typeof baseConfig\n>(baseConfig)\n\nexport const tsdownBundleConfig: MergeConfigFn<StrictBundleConfig, typeof bundleConfig> = createMergeConfigFn<\n StrictBundleConfig,\n typeof bundleConfig\n>(bundleConfig)\n\nexport const tsdownBinConfig: MergeConfigFn<StrictBinConfig, typeof binConfig> = createMergeConfigFn<\n StrictBinConfig,\n typeof binConfig\n>(binConfig)\n"],"mappings":";;AASA,MAAM,aAAa;CACjB,OAAO,CAAC,gBAAgB;CACxB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,WAAW;CACX,QAAQ;CACR,gBAAgB;CAChB,MAAM;CACN,KAAK,EACH,WAAW,OACb;CACA,MAAM,EACJ,aAAa,CAAC,KAAK,EACrB;CACA,MAAM;EACJ,OAAO;EACP,SAAS;CACX;CACA,SAAS;CACT,YAAY;CACZ,kBAAkB,CAAC,+BAA+B;AACpD;AAMA,MAAM,eAAe;CACnB,GAAG;CACH,OAAO,CAAC;CACR,UAAU;CACV,WAAW;CACX,KAAK;CACL,MAAM;CACN,SAAS;CACT,cAAc,EACZ,cAAc,EACZ,iBAAiB,OACnB,EACF;AACF;AAMA,MAAM,YAAY;CAChB,GAAG;CACH,UAAU;CACV,sBAAsB,EAAE,IAAI,GAAG;AACjC;AAKA,MAAa,eAA+D,oBAG1E,UAAU;AAEZ,MAAa,qBAA6E,oBAGxF,YAAY;AAEd,MAAa,kBAAoE,oBAG/E,SAAS"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { isPlainObject } from "es-toolkit/predicate";
|
|
4
|
+
import { $ } from "bun";
|
|
5
|
+
import { difference, findMinimumForRange, tryParseRange } from "verkit";
|
|
6
|
+
// src/dep-report/dep-report.ts
|
|
7
|
+
const DEPENDENCY_FIELDS = [
|
|
8
|
+
"dependencies",
|
|
9
|
+
"devDependencies",
|
|
10
|
+
"peerDependencies",
|
|
11
|
+
"optionalDependencies"
|
|
12
|
+
];
|
|
13
|
+
/** Reads every dependency range in the project's `package.json`, keyed by `<field> <name>`. */
|
|
14
|
+
const readDependencyRanges = () => {
|
|
15
|
+
const packageJson = JSON.parse(readFileSync("package.json", "utf8"));
|
|
16
|
+
const fields = isPlainObject(packageJson) ? packageJson : {};
|
|
17
|
+
const ranges = /* @__PURE__ */ new Map();
|
|
18
|
+
for (const field of DEPENDENCY_FIELDS) {
|
|
19
|
+
const dependencies = fields[field];
|
|
20
|
+
if (!isPlainObject(dependencies)) continue;
|
|
21
|
+
for (const [name, range] of Object.entries(dependencies)) if (typeof range === "string") ranges.set(`${field} ${name}`, range);
|
|
22
|
+
}
|
|
23
|
+
return ranges;
|
|
24
|
+
};
|
|
25
|
+
/** Returns the lowest version a range allows, or nothing for a missing or non-semver range like `workspace:*`. */
|
|
26
|
+
const lowestVersion = (range) => {
|
|
27
|
+
const parsedRange = range === void 0 ? void 0 : tryParseRange(range);
|
|
28
|
+
return parsedRange ? findMinimumForRange(parsedRange) : void 0;
|
|
29
|
+
};
|
|
30
|
+
/** Checks whether a range change only bumps the patch version of a 1.0+ package. */
|
|
31
|
+
const isPatchOnlyChange = (oldRange, newRange) => {
|
|
32
|
+
const oldVersion = lowestVersion(oldRange);
|
|
33
|
+
const newVersion = lowestVersion(newRange);
|
|
34
|
+
if (!oldVersion || !newVersion) return false;
|
|
35
|
+
return oldVersion.major > 0 && difference(oldVersion, newVersion) === "patch";
|
|
36
|
+
};
|
|
37
|
+
/** Lists each range that changed by more than a patch as `<field> <name>: <old> -> <new>`. */
|
|
38
|
+
const listRangeChanges = (before, after) => {
|
|
39
|
+
return [.../* @__PURE__ */ new Set([...before.keys(), ...after.keys()])].filter((key) => before.get(key) !== after.get(key) && !isPatchOnlyChange(before.get(key), after.get(key))).map((key) => `${key}: ${before.get(key) ?? "(none)"} -> ${after.get(key) ?? "(none)"}`);
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Asks Claude Code to research the dependency ranges that changed since `rangesBefore` and prints its report. Skips the
|
|
43
|
+
* report when nothing changed or `claude` isn't installed.
|
|
44
|
+
*/
|
|
45
|
+
const reportDependencyChanges = async (rangesBefore) => {
|
|
46
|
+
const changes = listRangeChanges(rangesBefore, readDependencyRanges());
|
|
47
|
+
if (changes.length === 0) return;
|
|
48
|
+
if (!Bun.which("claude")) {
|
|
49
|
+
console.log("\nSkipping the dependency report because `claude` isn't installed.");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
console.log("\nAsking Claude to review the dependency changes. This takes a few minutes.");
|
|
53
|
+
const prompt = `${await Bun.file(fileURLToPath(new URL("prompt.md", import.meta.url))).text()}\n${changes.join("\n")}\n`;
|
|
54
|
+
const output = await $`claude -p ${prompt} --output-format json --permission-mode auto --disallowedTools Edit,Write,NotebookEdit --name ${"bump-deps report"}`.nothrow().quiet();
|
|
55
|
+
const parsed = output.exitCode === 0 ? output.json() : void 0;
|
|
56
|
+
if (!parsed || parsed.is_error) {
|
|
57
|
+
console.log(`\nThe dependency report failed:\n${output.stderr.toString() || output.stdout.toString()}`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
console.log(`\n${parsed.result}`);
|
|
61
|
+
const cost = parsed.total_cost_usd === void 0 ? "" : ` (cost: $${parsed.total_cost_usd.toFixed(2)})`;
|
|
62
|
+
console.log(`\nFollow up with: claude --resume ${parsed.session_id}${cost}`);
|
|
63
|
+
};
|
|
64
|
+
export { readDependencyRanges, reportDependencyChanges };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=dep-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dep-report.js","names":[],"sources":["../../src/dep-report/dep-report.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\"\nimport { fileURLToPath } from \"node:url\"\n\nimport { $ } from \"bun\"\nimport { isPlainObject } from \"es-toolkit/predicate\"\nimport { difference, findMinimumForRange, tryParseRange } from \"verkit\"\n\nconst DEPENDENCY_FIELDS = [\"dependencies\", \"devDependencies\", \"peerDependencies\", \"optionalDependencies\"] as const\n\n/** Reads every dependency range in the project's `package.json`, keyed by `<field> <name>`. */\nexport const readDependencyRanges = () => {\n const packageJson: unknown = JSON.parse(readFileSync(\"package.json\", \"utf8\"))\n const fields = isPlainObject(packageJson) ? packageJson : {}\n\n const ranges = new Map<string, string>()\n for (const field of DEPENDENCY_FIELDS) {\n const dependencies: unknown = fields[field]\n if (!isPlainObject(dependencies)) continue\n for (const [name, range] of Object.entries(dependencies))\n if (typeof range === \"string\") ranges.set(`${field} ${name}`, range)\n }\n return ranges\n}\n\n/** Returns the lowest version a range allows, or nothing for a missing or non-semver range like `workspace:*`. */\nconst lowestVersion = (range: string | undefined) => {\n const parsedRange = range === undefined ? undefined : tryParseRange(range)\n return parsedRange ? findMinimumForRange(parsedRange) : undefined\n}\n\n/** Checks whether a range change only bumps the patch version of a 1.0+ package. */\nconst isPatchOnlyChange = (oldRange: string | undefined, newRange: string | undefined) => {\n const oldVersion = lowestVersion(oldRange)\n const newVersion = lowestVersion(newRange)\n if (!oldVersion || !newVersion) return false\n // Keep 0.x patch bumps because a 0.x patch release can add features or break things.\n return oldVersion.major > 0 && difference(oldVersion, newVersion) === \"patch\"\n}\n\n/** Lists each range that changed by more than a patch as `<field> <name>: <old> -> <new>`. */\nconst listRangeChanges = (before: ReadonlyMap<string, string>, after: ReadonlyMap<string, string>) => {\n const keys = new Set([...before.keys(), ...after.keys()])\n return [...keys]\n .filter((key) => before.get(key) !== after.get(key) && !isPatchOnlyChange(before.get(key), after.get(key)))\n .map((key) => `${key}: ${before.get(key) ?? \"(none)\"} -> ${after.get(key) ?? \"(none)\"}`)\n}\n\ninterface ClaudeResult {\n is_error: boolean\n result: string\n session_id: string\n total_cost_usd?: number\n}\n\n/**\n * Asks Claude Code to research the dependency ranges that changed since `rangesBefore` and prints its report. Skips the\n * report when nothing changed or `claude` isn't installed.\n */\nexport const reportDependencyChanges = async (rangesBefore: ReadonlyMap<string, string>) => {\n const changes = listRangeChanges(rangesBefore, readDependencyRanges())\n if (changes.length === 0) return\n if (!Bun.which(\"claude\")) {\n console.log(\"\\nSkipping the dependency report because `claude` isn't installed.\")\n return\n }\n\n console.log(\"\\nAsking Claude to review the dependency changes. This takes a few minutes.\")\n const instructions = await Bun.file(fileURLToPath(new URL(\"prompt.md\", import.meta.url))).text()\n const prompt = `${instructions}\\n${changes.join(\"\\n\")}\\n`\n\n // Use `auto` because the research runs commands that an allowlist can't predict.\n // Deny the file tools because the report must not change the project.\n const output =\n await $`claude -p ${prompt} --output-format json --permission-mode auto --disallowedTools Edit,Write,NotebookEdit --name ${\"bump-deps report\"}`\n .nothrow()\n .quiet()\n\n // Report a failure without throwing because the dependencies are already bumped.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion - trust the shape that `claude --output-format json` prints\n const parsed = output.exitCode === 0 ? (output.json() as ClaudeResult) : undefined\n if (!parsed || parsed.is_error) {\n console.log(`\\nThe dependency report failed:\\n${output.stderr.toString() || output.stdout.toString()}`)\n return\n }\n\n console.log(`\\n${parsed.result}`)\n const cost = parsed.total_cost_usd === undefined ? \"\" : ` (cost: $${parsed.total_cost_usd.toFixed(2)})`\n console.log(`\\nFollow up with: claude --resume ${parsed.session_id}${cost}`)\n}\n"],"mappings":";;;;;;AAOA,MAAM,oBAAoB;CAAC;CAAgB;CAAmB;CAAoB;AAAsB;;AAGxG,MAAa,6BAA6B;CACxC,MAAM,cAAuB,KAAK,MAAM,aAAa,gBAAgB,MAAM,CAAC;CAC5E,MAAM,SAAS,cAAc,WAAW,IAAI,cAAc,CAAC;CAE3D,MAAM,yBAAS,IAAI,IAAoB;CACvC,KAAK,MAAM,SAAS,mBAAmB;EACrC,MAAM,eAAwB,OAAO;EACrC,IAAI,CAAC,cAAc,YAAY,GAAG;EAClC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,YAAY,GACrD,IAAI,OAAO,UAAU,UAAU,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,KAAK;CACvE;CACA,OAAO;AACT;;AAGA,MAAM,iBAAiB,UAA8B;CACnD,MAAM,cAAc,UAAU,KAAA,IAAY,KAAA,IAAY,cAAc,KAAK;CACzE,OAAO,cAAc,oBAAoB,WAAW,IAAI,KAAA;AAC1D;;AAGA,MAAM,qBAAqB,UAA8B,aAAiC;CACxF,MAAM,aAAa,cAAc,QAAQ;CACzC,MAAM,aAAa,cAAc,QAAQ;CACzC,IAAI,CAAC,cAAc,CAAC,YAAY,OAAO;CAEvC,OAAO,WAAW,QAAQ,KAAK,WAAW,YAAY,UAAU,MAAM;AACxE;;AAGA,MAAM,oBAAoB,QAAqC,UAAuC;CAEpG,OAAO,CAAC,mBAAG,IADM,IAAI,CAAC,GAAG,OAAO,KAAK,GAAG,GAAG,MAAM,KAAK,CAAC,CACzC,CAAC,CAAC,CACb,QAAQ,QAAQ,OAAO,IAAI,GAAG,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,kBAAkB,OAAO,IAAI,GAAG,GAAG,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAC1G,KAAK,QAAQ,GAAG,IAAI,IAAI,OAAO,IAAI,GAAG,KAAK,SAAS,MAAM,MAAM,IAAI,GAAG,KAAK,UAAU;AAC3F;;;;;AAaA,MAAa,0BAA0B,OAAO,iBAA8C;CAC1F,MAAM,UAAU,iBAAiB,cAAc,qBAAqB,CAAC;CACrE,IAAI,QAAQ,WAAW,GAAG;CAC1B,IAAI,CAAC,IAAI,MAAM,QAAQ,GAAG;EACxB,QAAQ,IAAI,oEAAoE;EAChF;CACF;CAEA,QAAQ,IAAI,6EAA6E;CAEzF,MAAM,SAAS,GAAG,MADS,IAAI,KAAK,cAAc,IAAI,IAAI,aAAa,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAChE,IAAI,QAAQ,KAAK,IAAI,EAAE;CAItD,MAAM,SACJ,MAAM,CAAC,aAAa,OAAO,gGAAgG,qBACxH,QAAQ,CAAC,CACT,MAAM;CAIX,MAAM,SAAS,OAAO,aAAa,IAAK,OAAO,KAAK,IAAqB,KAAA;CACzE,IAAI,CAAC,UAAU,OAAO,UAAU;EAC9B,QAAQ,IAAI,oCAAoC,OAAO,OAAO,SAAS,KAAK,OAAO,OAAO,SAAS,GAAG;EACtG;CACF;CAEA,QAAQ,IAAI,KAAK,OAAO,QAAQ;CAChC,MAAM,OAAO,OAAO,mBAAmB,KAAA,IAAY,KAAK,YAAY,OAAO,eAAe,QAAQ,CAAC,EAAE;CACrG,QAAQ,IAAI,qCAAqC,OAAO,aAAa,MAAM;AAC7E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
`bask bump-deps` just bumped this project's dependencies and reinstalled them. The changed ranges are listed at the end of this prompt.
|
|
2
|
+
|
|
3
|
+
Find anything in these updates that matters for this project, and report it. Your report prints to the terminal when the task finishes. The user can resume this session to act on it.
|
|
4
|
+
|
|
5
|
+
## Research
|
|
6
|
+
|
|
7
|
+
- Read the project's configs, scripts, and source to see how it uses each package.
|
|
8
|
+
- Read the release notes for every version in each range, not just the newest. Use `gh release list` and `gh release view` on the package's repo, or the changelog in its npm package.
|
|
9
|
+
- Release notes don't always list new rules or options. For lint plugins and configurable tools, compare the two versions directly. Download the old one with `npm pack` into a temp dir, then diff its rule names, config schema, or types against the installed one.
|
|
10
|
+
- Run the project's checks without changing anything: the type checker, the linter without `--fix`, the formatter in check mode, knip, the tests, and the build if there is one.
|
|
11
|
+
- When a check fails, confirm which bump caused it. For example, run the previous version with `bunx <package>@<old version>` and compare.
|
|
12
|
+
|
|
13
|
+
## Rules
|
|
14
|
+
|
|
15
|
+
- Don't edit, create, or delete files in the project. Put downloads in a directory from `mktemp -d`.
|
|
16
|
+
- Don't commit, install, or change dependencies.
|
|
17
|
+
|
|
18
|
+
## Report
|
|
19
|
+
|
|
20
|
+
Write plain text that reads well unrendered: short headings, `-` bullets, and no tables. Group findings under these headings and skip empty ones:
|
|
21
|
+
|
|
22
|
+
- Needs action: failing checks, or config that a bump breaks. Name the file and line, and say what to change. Say whether the linter's `--fix` would rewrite it, and whether that rewrite is safe.
|
|
23
|
+
- Worth knowing: new rules, options, or behavior that changes how the project's tools run, and new features the project might want to use.
|
|
24
|
+
- Nothing to do: one line per remaining package.
|
|
25
|
+
|
|
26
|
+
End with one line that lists the checks you ran and whether they passed.
|
|
27
|
+
|
|
28
|
+
## Changed ranges
|
package/dist/env/index.d.ts
CHANGED
package/dist/env/utils.d.ts
CHANGED
|
@@ -6,5 +6,4 @@ import { type } from "arktype";
|
|
|
6
6
|
* omitted entirely if no fallback is given.
|
|
7
7
|
*/
|
|
8
8
|
export declare function requireWhen<const def>(when: boolean, type: type.validate<def>): ReturnType<type.instantiate<def>["optional"]>;
|
|
9
|
-
export declare function requireWhen<const def>(when: boolean, type: type.validate<def>, fallback: type.infer<def>): type.instantiate<def>;
|
|
10
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
9
|
+
export declare function requireWhen<const def>(when: boolean, type: type.validate<def>, fallback: type.infer<def>): type.instantiate<def>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { commitlintConfig } from "./configs/commitlint.base.js";
|
|
2
|
-
import { knipConfig } from "./configs/knip.base.js";
|
|
2
|
+
import { KnipArgs, knipConfig } from "./configs/knip.base.js";
|
|
3
3
|
import { oxfmtConfig } from "./configs/oxfmt.base.js";
|
|
4
4
|
import { oxlintConfig } from "./configs/oxlint.base.js";
|
|
5
5
|
import { releaseItConfig } from "./configs/release-it.base.js";
|
|
6
6
|
import { tsdownBinConfig, tsdownBundleConfig, tsdownConfig } from "./configs/tsdown.base.js";
|
|
7
|
-
|
|
7
|
+
import "./configs/configs.js";
|
|
8
|
+
export { type KnipArgs, commitlintConfig, knipConfig, oxfmtConfig, oxlintConfig, releaseItConfig, tsdownBinConfig, tsdownBundleConfig, tsdownConfig };
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,5 @@ import { oxfmtConfig } from "./configs/oxfmt.base.js";
|
|
|
4
4
|
import { oxlintConfig } from "./configs/oxlint.base.js";
|
|
5
5
|
import { releaseItConfig } from "./configs/release-it.base.js";
|
|
6
6
|
import { tsdownBinConfig, tsdownBundleConfig, tsdownConfig } from "./configs/tsdown.base.js";
|
|
7
|
+
import "./configs/configs.js";
|
|
7
8
|
export { commitlintConfig, knipConfig, oxfmtConfig, oxlintConfig, releaseItConfig, tsdownBinConfig, tsdownBundleConfig, tsdownConfig };
|
|
@@ -13,4 +13,8 @@ import { ReadonlyDeep } from "type-fest";
|
|
|
13
13
|
export type MergeConfigFn<UserConfig, BaseConfig> = (<const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(userConfig: UserConfigToMerge) => MergedConfig<BaseConfig, UserConfigToMerge>) & (<const UserConfigToMerge extends ReadonlyDeep<UserConfig>, const ReplaceConfigToMerge extends ReadonlyDeep<Partial<UserConfig>>>(userConfig: UserConfigToMerge, replaceConfig: ReplaceConfigToMerge) => MergedConfig<MergedConfig<BaseConfig, UserConfigToMerge>, ReplaceConfigToMerge, "replace">);
|
|
14
14
|
/** A MergeConfigFn that can also be called with no arguments, returning a writable clone of the base config. */
|
|
15
15
|
export type OptionalMergeConfigFn<UserConfig, BaseConfig> = MergeConfigFn<UserConfig, BaseConfig> & (() => Clean<BaseConfig>);
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* An OptionalMergeConfigFn whose result is a function of `Args`, for a tool that calls its config with arguments. The
|
|
18
|
+
* merge waits for that call, because `Args` picks the base config. The result type is the same for any `Args`.
|
|
19
|
+
*/
|
|
20
|
+
export type ArgsMergeConfigFn<UserConfig, BaseConfig, Args> = (<const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(userConfig: UserConfigToMerge) => (args: Args) => MergedConfig<BaseConfig, UserConfigToMerge>) & (<const UserConfigToMerge extends ReadonlyDeep<UserConfig>, const ReplaceConfigToMerge extends ReadonlyDeep<Partial<UserConfig>>>(userConfig: UserConfigToMerge, replaceConfig: ReplaceConfigToMerge) => (args: Args) => MergedConfig<MergedConfig<BaseConfig, UserConfigToMerge>, ReplaceConfigToMerge, "replace">) & (() => (args: Args) => Clean<BaseConfig>);
|
|
@@ -11,19 +11,29 @@ const merge = (target, source, mode) => mergeWith(target, cloneDeep(source), (ob
|
|
|
11
11
|
if (mode === "spread" && Array.isArray(objValue)) return [...objValue, ...userArray];
|
|
12
12
|
return userArray;
|
|
13
13
|
});
|
|
14
|
+
/** Clones `baseConfig`, then merges `userConfig` and `replaceConfig` into the clone. */
|
|
15
|
+
const mergeConfig = (baseConfig, userConfig, replaceConfig) => {
|
|
16
|
+
const result = cloneDeep(baseConfig);
|
|
17
|
+
if (userConfig !== void 0) merge(result, userConfig, "spread");
|
|
18
|
+
if (replaceConfig !== void 0) merge(result, replaceConfig, "replace");
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
14
21
|
/**
|
|
15
22
|
* Creates a config merge function with proper types for merging with a base config. `UserConfig` is not inferrable, so
|
|
16
23
|
* both type arguments must be passed explicitly.
|
|
17
24
|
*/
|
|
18
25
|
const createMergeConfigFn = (baseConfig) => {
|
|
19
|
-
const mergeConfigFn = (userConfig, replaceConfig) =>
|
|
20
|
-
const result = cloneDeep(baseConfig);
|
|
21
|
-
if (userConfig !== void 0) merge(result, userConfig, "spread");
|
|
22
|
-
if (replaceConfig !== void 0) merge(result, replaceConfig, "replace");
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
26
|
+
const mergeConfigFn = (userConfig, replaceConfig) => mergeConfig(baseConfig, userConfig, replaceConfig);
|
|
25
27
|
return mergeConfigFn;
|
|
26
28
|
};
|
|
27
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Creates an ArgsMergeConfigFn, which builds its base config from the tool's arguments with `createBaseConfig`.
|
|
31
|
+
* `UserConfig` is not inferrable, so all three type arguments must be passed explicitly.
|
|
32
|
+
*/
|
|
33
|
+
const createArgsMergeConfigFn = (createBaseConfig) => {
|
|
34
|
+
const argsMergeConfigFn = (userConfig, replaceConfig) => (args) => mergeConfig(createBaseConfig(args), userConfig, replaceConfig);
|
|
35
|
+
return argsMergeConfigFn;
|
|
36
|
+
};
|
|
37
|
+
export { createArgsMergeConfigFn, createMergeConfigFn };
|
|
28
38
|
|
|
29
39
|
//# sourceMappingURL=merge-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-config.js","names":["baseArray"],"sources":["../../src/merge-config/merge-config.ts"],"sourcesContent":["/* oxlint-disable unicorn/prefer-structured-clone - structuredClone does not properly clone functions */\nimport { cloneDeep, mergeWith } from \"es-toolkit\"\nimport type { ReadonlyDeep } from \"type-fest\"\n\nimport type { Clean, MergedConfig, Mode } from \"#merge-config/merge.types.ts\"\n\n/**\n * The runtime counterpart of MergedConfig in merge.types.ts: a deep merge whose customizer applies the array mode. The\n * source is pre-cloned so the result never aliases the caller's objects. The merge visits string keys only, so\n * symbol-keyed properties in user configs are dropped (the types mirror this).\n */\nconst merge = (target: object, source: object, mode: Mode): object =>\n mergeWith(target, cloneDeep(source), (objValue: unknown, srcValue: unknown) => {\n if (!Array.isArray(srcValue)) return\n const userArray: unknown[] = srcValue\n if (mode === \"spread\" && Array.isArray(objValue)) {\n const baseArray: unknown[] = objValue\n return [...baseArray, ...userArray]\n }\n return userArray\n })\n\n/**\n * The merge config function. `userConfig` is deep merged into `BaseConfig` with arrays appended to the base array. The\n * optional `replaceConfig` is then deep merged into that result with arrays used as-is, so putting an array there\n * replaces just that key (sibling keys still merge normally, and a key in both configs gets the replace config's\n * value). Required keys must be provided in `userConfig`.\n *\n * The `const` type parameters keep literal types without requiring `as const` at the call site. The constraints accept\n * readonly arrays/objects (e.g. from `as const`), and the result is writable so it stays assignable to the tools' own\n * (mutable) config types.\n */\nexport type MergeConfigFn<UserConfig, BaseConfig> = (<const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(\n userConfig: UserConfigToMerge,\n) => MergedConfig<BaseConfig, UserConfigToMerge>)\n & (<\n const UserConfigToMerge extends ReadonlyDeep<UserConfig>,\n const ReplaceConfigToMerge extends ReadonlyDeep<Partial<UserConfig>>,\n >(\n userConfig: UserConfigToMerge,\n replaceConfig: ReplaceConfigToMerge,\n ) => MergedConfig<MergedConfig<BaseConfig, UserConfigToMerge>, ReplaceConfigToMerge, \"replace\">)\n\n/** A MergeConfigFn that can also be called with no arguments, returning a writable clone of the base config. */\nexport type OptionalMergeConfigFn<UserConfig, BaseConfig> = MergeConfigFn<UserConfig, BaseConfig>\n & (() => Clean<BaseConfig>)\n\n/**\n * Creates a config merge function with proper types for merging with a base config. `UserConfig` is not inferrable, so\n * both type arguments must be passed explicitly.\n */\nexport const createMergeConfigFn = <UserConfig extends object, BaseConfig extends ReadonlyDeep<UserConfig>>(\n baseConfig: BaseConfig,\n): OptionalMergeConfigFn<UserConfig, BaseConfig> => {\n // Loosely typed on purpose, the assertion below gives it the precise public signature\n const mergeConfigFn = (userConfig?: object, replaceConfig?: object)
|
|
1
|
+
{"version":3,"file":"merge-config.js","names":["baseArray"],"sources":["../../src/merge-config/merge-config.ts"],"sourcesContent":["/* oxlint-disable unicorn/prefer-structured-clone - structuredClone does not properly clone functions */\nimport { cloneDeep, mergeWith } from \"es-toolkit\"\nimport type { ReadonlyDeep } from \"type-fest\"\n\nimport type { Clean, MergedConfig, Mode } from \"#merge-config/merge.types.ts\"\n\n/**\n * The runtime counterpart of MergedConfig in merge.types.ts: a deep merge whose customizer applies the array mode. The\n * source is pre-cloned so the result never aliases the caller's objects. The merge visits string keys only, so\n * symbol-keyed properties in user configs are dropped (the types mirror this).\n */\nconst merge = (target: object, source: object, mode: Mode): object =>\n mergeWith(target, cloneDeep(source), (objValue: unknown, srcValue: unknown) => {\n if (!Array.isArray(srcValue)) return\n const userArray: unknown[] = srcValue\n if (mode === \"spread\" && Array.isArray(objValue)) {\n const baseArray: unknown[] = objValue\n return [...baseArray, ...userArray]\n }\n return userArray\n })\n\n/** Clones `baseConfig`, then merges `userConfig` and `replaceConfig` into the clone. */\nconst mergeConfig = (baseConfig: object, userConfig?: object, replaceConfig?: object) => {\n // Start from a clone so consumers can't mutate the shared base config\n const result = cloneDeep(baseConfig)\n if (userConfig !== undefined) merge(result, userConfig, \"spread\")\n if (replaceConfig !== undefined) merge(result, replaceConfig, \"replace\")\n return result\n}\n\n/**\n * The merge config function. `userConfig` is deep merged into `BaseConfig` with arrays appended to the base array. The\n * optional `replaceConfig` is then deep merged into that result with arrays used as-is, so putting an array there\n * replaces just that key (sibling keys still merge normally, and a key in both configs gets the replace config's\n * value). Required keys must be provided in `userConfig`.\n *\n * The `const` type parameters keep literal types without requiring `as const` at the call site. The constraints accept\n * readonly arrays/objects (e.g. from `as const`), and the result is writable so it stays assignable to the tools' own\n * (mutable) config types.\n */\nexport type MergeConfigFn<UserConfig, BaseConfig> = (<const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(\n userConfig: UserConfigToMerge,\n) => MergedConfig<BaseConfig, UserConfigToMerge>)\n & (<\n const UserConfigToMerge extends ReadonlyDeep<UserConfig>,\n const ReplaceConfigToMerge extends ReadonlyDeep<Partial<UserConfig>>,\n >(\n userConfig: UserConfigToMerge,\n replaceConfig: ReplaceConfigToMerge,\n ) => MergedConfig<MergedConfig<BaseConfig, UserConfigToMerge>, ReplaceConfigToMerge, \"replace\">)\n\n/** A MergeConfigFn that can also be called with no arguments, returning a writable clone of the base config. */\nexport type OptionalMergeConfigFn<UserConfig, BaseConfig> = MergeConfigFn<UserConfig, BaseConfig>\n & (() => Clean<BaseConfig>)\n\n/**\n * Creates a config merge function with proper types for merging with a base config. `UserConfig` is not inferrable, so\n * both type arguments must be passed explicitly.\n */\nexport const createMergeConfigFn = <UserConfig extends object, BaseConfig extends ReadonlyDeep<UserConfig>>(\n baseConfig: BaseConfig,\n): OptionalMergeConfigFn<UserConfig, BaseConfig> => {\n // Loosely typed on purpose, the assertion below gives it the precise public signature\n const mergeConfigFn = (userConfig?: object, replaceConfig?: object) =>\n mergeConfig(baseConfig, userConfig, replaceConfig)\n\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion - give the loosely typed implementation its precise public signature\n return mergeConfigFn as OptionalMergeConfigFn<UserConfig, BaseConfig>\n}\n\n/**\n * An OptionalMergeConfigFn whose result is a function of `Args`, for a tool that calls its config with arguments. The\n * merge waits for that call, because `Args` picks the base config. The result type is the same for any `Args`.\n */\nexport type ArgsMergeConfigFn<UserConfig, BaseConfig, Args> = (<\n const UserConfigToMerge extends ReadonlyDeep<UserConfig>,\n>(\n userConfig: UserConfigToMerge,\n) => (args: Args) => MergedConfig<BaseConfig, UserConfigToMerge>)\n & (<\n const UserConfigToMerge extends ReadonlyDeep<UserConfig>,\n const ReplaceConfigToMerge extends ReadonlyDeep<Partial<UserConfig>>,\n >(\n userConfig: UserConfigToMerge,\n replaceConfig: ReplaceConfigToMerge,\n ) => (args: Args) => MergedConfig<MergedConfig<BaseConfig, UserConfigToMerge>, ReplaceConfigToMerge, \"replace\">)\n & (() => (args: Args) => Clean<BaseConfig>)\n\n/**\n * Creates an ArgsMergeConfigFn, which builds its base config from the tool's arguments with `createBaseConfig`.\n * `UserConfig` is not inferrable, so all three type arguments must be passed explicitly.\n */\nexport const createArgsMergeConfigFn = <UserConfig extends object, BaseConfig extends ReadonlyDeep<UserConfig>, Args>(\n createBaseConfig: (args: Args) => BaseConfig,\n): ArgsMergeConfigFn<UserConfig, BaseConfig, Args> => {\n // Loosely typed on purpose, the assertion below gives it the precise public signature\n const argsMergeConfigFn = (userConfig?: object, replaceConfig?: object) => (args: Args) =>\n mergeConfig(createBaseConfig(args), userConfig, replaceConfig)\n\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion - give the loosely typed implementation its precise public signature\n return argsMergeConfigFn as ArgsMergeConfigFn<UserConfig, BaseConfig, Args>\n}\n"],"mappings":";;;;;;;AAWA,MAAM,SAAS,QAAgB,QAAgB,SAC7C,UAAU,QAAQ,UAAU,MAAM,IAAI,UAAmB,aAAsB;CAC7E,IAAI,CAAC,MAAM,QAAQ,QAAQ,GAAG;CAC9B,MAAM,YAAuB;CAC7B,IAAI,SAAS,YAAY,MAAM,QAAQ,QAAQ,GAE7C,OAAO,CAAC,GAAGA,UAAW,GAAG,SAAS;CAEpC,OAAO;AACT,CAAC;;AAGH,MAAM,eAAe,YAAoB,YAAqB,kBAA2B;CAEvF,MAAM,SAAS,UAAU,UAAU;CACnC,IAAI,eAAe,KAAA,GAAW,MAAM,QAAQ,YAAY,QAAQ;CAChE,IAAI,kBAAkB,KAAA,GAAW,MAAM,QAAQ,eAAe,SAAS;CACvE,OAAO;AACT;;;;;AA+BA,MAAa,uBACX,eACkD;CAElD,MAAM,iBAAiB,YAAqB,kBAC1C,YAAY,YAAY,YAAY,aAAa;CAGnD,OAAO;AACT;;;;;AAwBA,MAAa,2BACX,qBACoD;CAEpD,MAAM,qBAAqB,YAAqB,mBAA4B,SAC1E,YAAY,iBAAiB,IAAI,GAAG,YAAY,aAAa;CAG/D,OAAO;AACT"}
|
|
@@ -45,5 +45,4 @@ type MergeObjects<BaseConfig, UserConfig, Depth extends readonly unknown[], M ex
|
|
|
45
45
|
* arrays show only the user's elements.
|
|
46
46
|
*/
|
|
47
47
|
export type MergedConfig<BaseConfig, UserConfig, M extends Mode = "spread"> = MergeObjects<BaseConfig, UserConfig, MaxDepth, M>;
|
|
48
|
-
export {};
|
|
49
|
-
//# sourceMappingURL=merge.types.d.ts.map
|
|
48
|
+
export {};
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { Shell, ShellOptions } from "./shell/shell.js";
|
|
2
2
|
export interface CopyFixtureOptions {
|
|
3
|
-
/**
|
|
4
|
-
* The start of the temp dir's name.
|
|
5
|
-
*
|
|
6
|
-
* @default `${path.basename(fixture)}-`
|
|
7
|
-
*/
|
|
8
|
-
prefix?: string;
|
|
9
3
|
/** Options for the returned shell, which always runs in the copy. */
|
|
10
4
|
shell?: Omit<ShellOptions, "cwd">;
|
|
11
5
|
}
|
|
12
6
|
/** Copies `fixture` into a new temp dir, and returns the dir and a shell that runs there. */
|
|
13
|
-
export declare const copyFixture: (fixture: string, {
|
|
7
|
+
export declare const copyFixture: (fixture: string, { shell }?: CopyFixtureOptions) => Promise<{
|
|
14
8
|
dir: string;
|
|
15
9
|
run: Shell;
|
|
16
|
-
}>;
|
|
17
|
-
//# sourceMappingURL=fixture.d.ts.map
|
|
10
|
+
}>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { createShell } from "./shell/shell.js";
|
|
2
2
|
import { makeTempDir } from "./temp-dir.js";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
4
|
// src/test-utils/fixture.ts
|
|
6
5
|
/** Copies `fixture` into a new temp dir, and returns the dir and a shell that runs there. */
|
|
7
|
-
const copyFixture = async (fixture, {
|
|
8
|
-
const dir = await makeTempDir(
|
|
6
|
+
const copyFixture = async (fixture, { shell } = {}) => {
|
|
7
|
+
const dir = await makeTempDir();
|
|
9
8
|
await fs.cp(fixture, dir, { recursive: true });
|
|
10
9
|
return {
|
|
11
10
|
dir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.js","names":[],"sources":["../../src/test-utils/fixture.ts"],"sourcesContent":["import fs from \"node:fs/promises\"\
|
|
1
|
+
{"version":3,"file":"fixture.js","names":[],"sources":["../../src/test-utils/fixture.ts"],"sourcesContent":["import fs from \"node:fs/promises\"\n\nimport { createShell } from \"#test-utils/shell/shell.ts\"\nimport type { ShellOptions } from \"#test-utils/shell/shell.ts\"\nimport { makeTempDir } from \"#test-utils/temp-dir.ts\"\n\nexport interface CopyFixtureOptions {\n /** Options for the returned shell, which always runs in the copy. */\n shell?: Omit<ShellOptions, \"cwd\">\n}\n\n/** Copies `fixture` into a new temp dir, and returns the dir and a shell that runs there. */\nexport const copyFixture = async (fixture: string, { shell }: CopyFixtureOptions = {}) => {\n const dir = await makeTempDir()\n await fs.cp(fixture, dir, { recursive: true })\n const run = createShell({ ...shell, cwd: dir })\n return { dir, run }\n}\n"],"mappings":";;;;;AAYA,MAAa,cAAc,OAAO,SAAiB,EAAE,UAA8B,CAAC,MAAM;CACxF,MAAM,MAAM,MAAM,YAAY;CAC9B,MAAM,GAAG,GAAG,SAAS,KAAK,EAAE,WAAW,KAAK,CAAC;CAE7C,OAAO;EAAE;EAAK,KADF,YAAY;GAAE,GAAG;GAAO,KAAK;EAAI,CAC7B;CAAE;AACpB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ShellCommand } from "./shell/command.js";
|
|
2
|
-
import { Shell, ShellEnv, ShellOptions, ShellResult, createShell } from "./shell/shell.js";
|
|
3
2
|
import { minimalEnv } from "./shell/env.js";
|
|
4
3
|
import { CopyFixtureOptions, copyFixture } from "./fixture.js";
|
|
5
4
|
import { packPackage } from "./pack.js";
|
|
6
|
-
import {
|
|
5
|
+
import { Shell, ShellEnv, ShellOptions, ShellResult, createShell } from "./shell/shell.js";
|
|
7
6
|
import { makeTempDir } from "./temp-dir.js";
|
|
8
|
-
export { type CopyFixtureOptions, type Shell, type ShellCommand, type ShellEnv, type ShellOptions, type ShellResult, copyFixture, createShell, makeTempDir, minimalEnv, packPackage
|
|
7
|
+
export { type CopyFixtureOptions, type Shell, type ShellCommand, type ShellEnv, type ShellOptions, type ShellResult, copyFixture, createShell, makeTempDir, minimalEnv, packPackage };
|
package/dist/test-utils/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { minimalEnv } from "./shell/env.js";
|
|
2
|
-
import { createShell } from "./shell/shell.js";
|
|
3
|
-
import { makeTempDir } from "./temp-dir.js";
|
|
4
2
|
import { copyFixture } from "./fixture.js";
|
|
5
3
|
import { packPackage } from "./pack.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import { createShell } from "./shell/shell.js";
|
|
5
|
+
import { makeTempDir } from "./temp-dir.js";
|
|
6
|
+
export { copyFixture, createShell, makeTempDir, minimalEnv, packPackage };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Builds the package at `root` when it has a tsdown config, packs it into a temp dir, and returns the tarball path.
|
|
3
|
+
* Runs once per resolved root for the life of the test process.
|
|
4
|
+
*/
|
|
5
|
+
export declare const packPackage: (root: string) => Promise<string>;
|
package/dist/test-utils/pack.js
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { createShell } from "./shell/shell.js";
|
|
2
2
|
import { makeTempDir } from "./temp-dir.js";
|
|
3
|
-
import path from "node:path";
|
|
4
3
|
import bun from "bun";
|
|
4
|
+
import path from "node:path";
|
|
5
5
|
// src/test-utils/pack.ts
|
|
6
|
-
|
|
7
|
-
const
|
|
6
|
+
const packs = /* @__PURE__ */ new Map();
|
|
7
|
+
const buildAndPack = async (root) => {
|
|
8
8
|
const run = createShell({ cwd: root });
|
|
9
9
|
if (await bun.file(path.join(root, "tsdown.config.ts")).exists()) await run`bun tsdown`;
|
|
10
|
-
const destination = await makeTempDir(
|
|
10
|
+
const destination = await makeTempDir();
|
|
11
11
|
const { stdout } = await run`bun pm pack --ignore-scripts --quiet --destination ${destination}`;
|
|
12
12
|
return path.resolve(destination, stdout);
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Builds the package at `root` when it has a tsdown config, packs it into a temp dir, and returns the tarball path.
|
|
16
|
+
* Runs once per resolved root for the life of the test process.
|
|
17
|
+
*/
|
|
18
|
+
const packPackage = async (root) => {
|
|
19
|
+
const resolvedRoot = path.resolve(root);
|
|
20
|
+
const existingPack = packs.get(resolvedRoot);
|
|
21
|
+
if (existingPack) return existingPack;
|
|
22
|
+
const pack = buildAndPack(resolvedRoot);
|
|
23
|
+
packs.set(resolvedRoot, pack);
|
|
24
|
+
return pack;
|
|
25
|
+
};
|
|
14
26
|
export { packPackage };
|
|
15
27
|
|
|
16
28
|
//# sourceMappingURL=pack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.js","names":[],"sources":["../../src/test-utils/pack.ts"],"sourcesContent":["import path from \"node:path\"\n\nimport bun from \"bun\"\n\nimport { createShell } from \"#test-utils/shell/shell.ts\"\nimport { makeTempDir } from \"#test-utils/temp-dir.ts\"\n\
|
|
1
|
+
{"version":3,"file":"pack.js","names":[],"sources":["../../src/test-utils/pack.ts"],"sourcesContent":["import path from \"node:path\"\n\nimport bun from \"bun\"\n\nimport { createShell } from \"#test-utils/shell/shell.ts\"\nimport { makeTempDir } from \"#test-utils/temp-dir.ts\"\n\nconst packs = new Map<string, Promise<string>>()\n\nconst buildAndPack = async (root: string) => {\n const run = createShell({ cwd: root })\n if (await bun.file(path.join(root, \"tsdown.config.ts\")).exists()) await run`bun tsdown`\n\n const destination = await makeTempDir()\n // Skip lifecycle scripts because a `prepare` script would rebuild and run the package's own tasks.\n const { stdout } = await run`bun pm pack --ignore-scripts --quiet --destination ${destination}`\n return path.resolve(destination, stdout)\n}\n\n/**\n * Builds the package at `root` when it has a tsdown config, packs it into a temp dir, and returns the tarball path.\n * Runs once per resolved root for the life of the test process.\n */\nexport const packPackage = async (root: string) => {\n const resolvedRoot = path.resolve(root)\n const existingPack = packs.get(resolvedRoot)\n if (existingPack) return existingPack\n\n // Cache the promise so concurrent callers share one build.\n const pack = buildAndPack(resolvedRoot)\n packs.set(resolvedRoot, pack)\n return pack\n}\n"],"mappings":";;;;;AAOA,MAAM,wBAAQ,IAAI,IAA6B;AAE/C,MAAM,eAAe,OAAO,SAAiB;CAC3C,MAAM,MAAM,YAAY,EAAE,KAAK,KAAK,CAAC;CACrC,IAAI,MAAM,IAAI,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAC,CAAC,CAAC,OAAO,GAAG,MAAM,GAAG;CAE3E,MAAM,cAAc,MAAM,YAAY;CAEtC,MAAM,EAAE,WAAW,MAAM,GAAG,sDAAsD;CAClF,OAAO,KAAK,QAAQ,aAAa,MAAM;AACzC;;;;;AAMA,MAAa,cAAc,OAAO,SAAiB;CACjD,MAAM,eAAe,KAAK,QAAQ,IAAI;CACtC,MAAM,eAAe,MAAM,IAAI,YAAY;CAC3C,IAAI,cAAc,OAAO;CAGzB,MAAM,OAAO,aAAa,YAAY;CACtC,MAAM,IAAI,cAAc,IAAI;CAC5B,OAAO;AACT"}
|
|
@@ -14,5 +14,4 @@ export declare class ShellCommand implements PromiseLike<ShellResult> {
|
|
|
14
14
|
/** Configure the command to not throw an exception on a non-zero exit code. */
|
|
15
15
|
nothrow(): this;
|
|
16
16
|
then<TResult1 = ShellResult, TResult2 = never>(onfulfilled?: ((value: ShellResult) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=command.d.ts.map
|
|
17
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addBinDirs } from "./bin-dirs.js";
|
|
2
2
|
import { removeNodeShims } from "./node-shim.js";
|
|
3
|
-
import path from "node:path";
|
|
4
3
|
import bun from "bun";
|
|
4
|
+
import path from "node:path";
|
|
5
5
|
// src/test-utils/shell/command.ts
|
|
6
6
|
const FINAL_NEWLINE = /\r?\n$/v;
|
|
7
7
|
const stripFinalNewline = (output) => output.toString().replace(FINAL_NEWLINE, "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","names":[],"sources":["../../../src/test-utils/shell/command.ts"],"sourcesContent":["import path from \"node:path\"\n\nimport bun from \"bun\"\nimport type { $ as BunShell } from \"bun\"\n\nimport { addBinDirs } from \"#test-utils/shell/bin-dirs.ts\"\nimport { removeNodeShims } from \"#test-utils/shell/node-shim.ts\"\nimport type { ShellEnv, ShellOptions, ShellResult } from \"#test-utils/shell/shell.ts\"\n\nconst FINAL_NEWLINE = /\\r?\\n$/v\n\nconst stripFinalNewline = (output: Buffer) => output.toString().replace(FINAL_NEWLINE, \"\")\n\n/** Wraps Bun's `ShellPromise` to apply its settings when it runs and return its output as strings. */\nexport class ShellCommand implements PromiseLike<ShellResult> {\n readonly #shellPromise: BunShell.ShellPromise\n readonly #settings: Required<ShellOptions>\n #result: Promise<ShellResult> | undefined\n\n /** Starts from the shell's settings, which the command's own methods can then override. */\n public constructor(shellPromise: BunShell.ShellPromise, settings: Required<ShellOptions>) {\n this.#shellPromise = shellPromise\n // Copy `settings` so this command's changes don't reach the shell.\n this.#settings = { ...settings }\n }\n\n /** Change the working directory for the command. Relative paths resolve against `process.cwd()`. */\n public cwd(newCwd: string) {\n this.#settings.cwd = newCwd\n return this\n }\n\n /** Add environment variables for the command, on top of the shell's. Set one to `undefined` to remove it. */\n public env(newEnv: ShellEnv) {\n this.#settings.env = { ...this.#settings.env, ...newEnv }\n return this\n }\n\n /** Configure whether the command puts `node_modules/.bin` of its cwd and each of its parents first on `PATH`. */\n public localBins(useLocalBins: boolean) {\n this.#settings.localBins = useLocalBins\n return this\n }\n\n /** Configure the command to not throw an exception on a non-zero exit code. */\n public nothrow() {\n this.#settings.throws = false\n return this\n }\n\n // oxlint-disable-next-line unicorn/no-thenable - awaiting a command runs it, like Bun's `ShellPromise`\n public async then<TResult1 = ShellResult, TResult2 = never>(\n onfulfilled?: ((value: ShellResult) => TResult1 | PromiseLike<TResult1>) | null,\n onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,\n ) {\n // Keep the first run because Bun rejects settings on a command that already started.\n this.#result ??= this.#run()\n return this.#result.then(onfulfilled, onrejected)\n }\n\n async #run(): Promise<ShellResult> {\n const { env, localBins, throws } = this.#settings\n const cwd = path.resolve(this.#settings.cwd)\n const envWithBins = localBins ? addBinDirs(cwd, env) : env\n const finalEnv = removeNodeShims(envWithBins)\n\n const output = await this.#shellPromise\n .cwd(cwd)\n .env(finalEnv)\n .quiet()\n .throws(throws)\n .catch((error: unknown) => {\n if (error instanceof bun.$.ShellError) throw error\n // Name the cwd because Bun's start errors (like a missing cwd) don't.\n throw new Error(`Command failed to start (cwd: ${cwd})`, { cause: error })\n })\n\n return {\n stdout: stripFinalNewline(output.stdout),\n stderr: stripFinalNewline(output.stderr),\n exitCode: output.exitCode,\n }\n }\n}\n"],"mappings":";;;;;AASA,MAAM,gBAAgB;AAEtB,MAAM,qBAAqB,WAAmB,OAAO,SAAS,CAAC,CAAC,QAAQ,eAAe,EAAE;;AAGzF,IAAa,eAAb,MAA8D;CAC5D;CACA;CACA;;CAGA,YAAmB,cAAqC,UAAkC;EACxF,KAAK,gBAAgB;EAErB,KAAK,YAAY,EAAE,GAAG,SAAS;CACjC;;CAGA,IAAW,QAAgB;EACzB,KAAK,UAAU,MAAM;EACrB,OAAO;CACT;;CAGA,IAAW,QAAkB;EAC3B,KAAK,UAAU,MAAM;GAAE,GAAG,KAAK,UAAU;GAAK,GAAG;EAAO;EACxD,OAAO;CACT;;CAGA,UAAiB,cAAuB;EACtC,KAAK,UAAU,YAAY;EAC3B,OAAO;CACT;;CAGA,UAAiB;EACf,KAAK,UAAU,SAAS;EACxB,OAAO;CACT;CAGA,MAAa,KACX,aACA,YACA;EAEA,KAAK,YAAY,KAAK,KAAK;
|
|
1
|
+
{"version":3,"file":"command.js","names":[],"sources":["../../../src/test-utils/shell/command.ts"],"sourcesContent":["import path from \"node:path\"\n\nimport bun from \"bun\"\nimport type { $ as BunShell } from \"bun\"\n\nimport { addBinDirs } from \"#test-utils/shell/bin-dirs.ts\"\nimport { removeNodeShims } from \"#test-utils/shell/node-shim.ts\"\nimport type { ShellEnv, ShellOptions, ShellResult } from \"#test-utils/shell/shell.ts\"\n\nconst FINAL_NEWLINE = /\\r?\\n$/v\n\nconst stripFinalNewline = (output: Buffer) => output.toString().replace(FINAL_NEWLINE, \"\")\n\n/** Wraps Bun's `ShellPromise` to apply its settings when it runs and return its output as strings. */\nexport class ShellCommand implements PromiseLike<ShellResult> {\n readonly #shellPromise: BunShell.ShellPromise\n readonly #settings: Required<ShellOptions>\n #result: Promise<ShellResult> | undefined\n\n /** Starts from the shell's settings, which the command's own methods can then override. */\n public constructor(shellPromise: BunShell.ShellPromise, settings: Required<ShellOptions>) {\n this.#shellPromise = shellPromise\n // Copy `settings` so this command's changes don't reach the shell.\n this.#settings = { ...settings }\n }\n\n /** Change the working directory for the command. Relative paths resolve against `process.cwd()`. */\n public cwd(newCwd: string) {\n this.#settings.cwd = newCwd\n return this\n }\n\n /** Add environment variables for the command, on top of the shell's. Set one to `undefined` to remove it. */\n public env(newEnv: ShellEnv) {\n this.#settings.env = { ...this.#settings.env, ...newEnv }\n return this\n }\n\n /** Configure whether the command puts `node_modules/.bin` of its cwd and each of its parents first on `PATH`. */\n public localBins(useLocalBins: boolean) {\n this.#settings.localBins = useLocalBins\n return this\n }\n\n /** Configure the command to not throw an exception on a non-zero exit code. */\n public nothrow() {\n this.#settings.throws = false\n return this\n }\n\n // oxlint-disable-next-line unicorn/no-thenable - awaiting a command runs it, like Bun's `ShellPromise`\n public async then<TResult1 = ShellResult, TResult2 = never>(\n onfulfilled?: ((value: ShellResult) => TResult1 | PromiseLike<TResult1>) | null,\n onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,\n ) {\n // Keep the first run because Bun rejects settings on a command that already started.\n this.#result ??= this.#run()\n // oxlint-disable-next-line promise/prefer-catch - forward both handlers so `onrejected` doesn't catch errors from `onfulfilled`\n return this.#result.then(onfulfilled, onrejected)\n }\n\n async #run(): Promise<ShellResult> {\n const { env, localBins, throws } = this.#settings\n const cwd = path.resolve(this.#settings.cwd)\n const envWithBins = localBins ? addBinDirs(cwd, env) : env\n const finalEnv = removeNodeShims(envWithBins)\n\n const output = await this.#shellPromise\n .cwd(cwd)\n .env(finalEnv)\n .quiet()\n .throws(throws)\n .catch((error: unknown) => {\n if (error instanceof bun.$.ShellError) throw error\n // Name the cwd because Bun's start errors (like a missing cwd) don't.\n throw new Error(`Command failed to start (cwd: ${cwd})`, { cause: error })\n })\n\n return {\n stdout: stripFinalNewline(output.stdout),\n stderr: stripFinalNewline(output.stderr),\n exitCode: output.exitCode,\n }\n }\n}\n"],"mappings":";;;;;AASA,MAAM,gBAAgB;AAEtB,MAAM,qBAAqB,WAAmB,OAAO,SAAS,CAAC,CAAC,QAAQ,eAAe,EAAE;;AAGzF,IAAa,eAAb,MAA8D;CAC5D;CACA;CACA;;CAGA,YAAmB,cAAqC,UAAkC;EACxF,KAAK,gBAAgB;EAErB,KAAK,YAAY,EAAE,GAAG,SAAS;CACjC;;CAGA,IAAW,QAAgB;EACzB,KAAK,UAAU,MAAM;EACrB,OAAO;CACT;;CAGA,IAAW,QAAkB;EAC3B,KAAK,UAAU,MAAM;GAAE,GAAG,KAAK,UAAU;GAAK,GAAG;EAAO;EACxD,OAAO;CACT;;CAGA,UAAiB,cAAuB;EACtC,KAAK,UAAU,YAAY;EAC3B,OAAO;CACT;;CAGA,UAAiB;EACf,KAAK,UAAU,SAAS;EACxB,OAAO;CACT;CAGA,MAAa,KACX,aACA,YACA;EAEA,KAAK,YAAY,KAAK,KAAK;EAE3B,OAAO,KAAK,QAAQ,KAAK,aAAa,UAAU;CAClD;CAEA,MAAM,OAA6B;EACjC,MAAM,EAAE,KAAK,WAAW,WAAW,KAAK;EACxC,MAAM,MAAM,KAAK,QAAQ,KAAK,UAAU,GAAG;EAC3C,MAAM,cAAc,YAAY,WAAW,KAAK,GAAG,IAAI;EACvD,MAAM,WAAW,gBAAgB,WAAW;EAE5C,MAAM,SAAS,MAAM,KAAK,cACvB,IAAI,GAAG,CAAC,CACR,IAAI,QAAQ,CAAC,CACb,MAAM,CAAC,CACP,OAAO,MAAM,CAAC,CACd,OAAO,UAAmB;GACzB,IAAI,iBAAiB,IAAI,EAAE,YAAY,MAAM;GAE7C,MAAM,IAAI,MAAM,iCAAiC,IAAI,IAAI,EAAE,OAAO,MAAM,CAAC;EAC3E,CAAC;EAEH,OAAO;GACL,QAAQ,kBAAkB,OAAO,MAAM;GACvC,QAAQ,kBAAkB,OAAO,MAAM;GACvC,UAAU,OAAO;EACnB;CACF;AACF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ShellEnv } from "./shell.js";
|
|
2
2
|
/** Returns `PATH` and `HOME` from `process.env`, merged with `extra`. */
|
|
3
|
-
export declare const minimalEnv: (extra?: ShellEnv) => ShellEnv;
|
|
4
|
-
//# sourceMappingURL=env.d.ts.map
|
|
3
|
+
export declare const minimalEnv: (extra?: ShellEnv) => ShellEnv;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ShellCommand } from "./command.js";
|
|
2
|
+
import { minimalEnv } from "./env.js";
|
|
2
3
|
import { ShellExpression } from "bun";
|
|
3
4
|
export type ShellEnv = Record<string, string | undefined>;
|
|
4
5
|
export interface ShellOptions {
|
|
@@ -39,4 +40,4 @@ export type Shell = (strings: TemplateStringsArray, ...expressions: ShellExpress
|
|
|
39
40
|
* read the test runner's stdin, so add `< /dev/null` to a command that might prompt.
|
|
40
41
|
*/
|
|
41
42
|
export declare const createShell: (options?: ShellOptions) => Shell;
|
|
42
|
-
|
|
43
|
+
export { type ShellCommand, minimalEnv };
|