knip 6.2.0 → 6.3.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.
@@ -527,6 +527,11 @@ export declare class ConfigurationChief {
527
527
  entry?: string | string[] | undefined;
528
528
  project?: string | string[] | undefined;
529
529
  } | undefined;
530
+ rolldown?: string | boolean | string[] | {
531
+ config?: string | string[] | undefined;
532
+ entry?: string | string[] | undefined;
533
+ project?: string | string[] | undefined;
534
+ } | undefined;
530
535
  rollup?: string | boolean | string[] | {
531
536
  config?: string | string[] | undefined;
532
537
  entry?: string | string[] | undefined;
@@ -880,6 +885,7 @@ export declare class ConfigurationChief {
880
885
  "release-it"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
881
886
  remark?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
882
887
  remix?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
888
+ rolldown?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
883
889
  rollup?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
884
890
  rsbuild?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
885
891
  rslib?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
@@ -475,6 +475,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
475
475
  entry?: string | string[] | undefined;
476
476
  project?: string | string[] | undefined;
477
477
  } | undefined;
478
+ rolldown?: string | boolean | string[] | {
479
+ config?: string | string[] | undefined;
480
+ entry?: string | string[] | undefined;
481
+ project?: string | string[] | undefined;
482
+ } | undefined;
478
483
  rollup?: string | boolean | string[] | {
479
484
  config?: string | string[] | undefined;
480
485
  entry?: string | string[] | undefined;
@@ -1186,6 +1191,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
1186
1191
  entry?: string | string[] | undefined;
1187
1192
  project?: string | string[] | undefined;
1188
1193
  } | undefined;
1194
+ rolldown?: string | boolean | string[] | {
1195
+ config?: string | string[] | undefined;
1196
+ entry?: string | string[] | undefined;
1197
+ project?: string | string[] | undefined;
1198
+ } | undefined;
1189
1199
  rollup?: string | boolean | string[] | {
1190
1200
  config?: string | string[] | undefined;
1191
1201
  entry?: string | string[] | undefined;
@@ -175,11 +175,8 @@ export async function build({ chief, collector, counselor, deputy, principal, is
175
175
  const ws = (input.containingFilePath && chief.findWorkspaceByFilePath(input.containingFilePath)) || workspace;
176
176
  const resolvedFilePath = handleInput(input, ws);
177
177
  if (resolvedFilePath) {
178
- if (isDeferResolveProductionEntry(input)) {
179
- addPattern(productionPatternsSkipExports, input, resolvedFilePath);
180
- }
181
- else if (isDeferResolveEntry(input)) {
182
- if (!options.isProduction || !input.optional)
178
+ if (isDeferResolveEntry(input) && options.isProduction && !isDeferResolveProductionEntry(input)) {
179
+ if (!input.optional)
183
180
  addPattern(entryPatternsSkipExports, input, resolvedFilePath);
184
181
  }
185
182
  else {
@@ -98,6 +98,7 @@ export declare const Plugins: {
98
98
  'release-it': import("../types/config.ts").Plugin;
99
99
  remark: import("../types/config.ts").Plugin;
100
100
  remix: import("../types/config.ts").Plugin;
101
+ rolldown: import("../types/config.ts").Plugin;
101
102
  rollup: import("../types/config.ts").Plugin;
102
103
  rsbuild: import("../types/config.ts").Plugin;
103
104
  rslib: import("../types/config.ts").Plugin;
@@ -92,6 +92,7 @@ import { default as relay } from "./relay/index.js";
92
92
  import { default as releaseIt } from "./release-it/index.js";
93
93
  import { default as remark } from "./remark/index.js";
94
94
  import { default as remix } from "./remix/index.js";
95
+ import { default as rolldown } from "./rolldown/index.js";
95
96
  import { default as rollup } from "./rollup/index.js";
96
97
  import { default as rsbuild } from "./rsbuild/index.js";
97
98
  import { default as rslib } from "./rslib/index.js";
@@ -235,6 +236,7 @@ export const Plugins = {
235
236
  'release-it': releaseIt,
236
237
  remark,
237
238
  remix,
239
+ rolldown,
238
240
  rollup,
239
241
  rsbuild,
240
242
  rslib,
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,19 @@
1
+ import { toProductionEntry } from "../../util/input.js";
2
+ import { hasDependency } from "../../util/plugin.js";
3
+ import { getInputFromAST } from "./resolveFromAST.js";
4
+ const title = 'Rolldown';
5
+ const enablers = ['rolldown'];
6
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
+ const config = ['rolldown.config.{js,cjs,mjs,ts,cts,mts}'];
8
+ const resolveFromAST = program => {
9
+ const inputs = getInputFromAST(program);
10
+ return [...inputs].map(id => toProductionEntry(id));
11
+ };
12
+ const plugin = {
13
+ title,
14
+ enablers,
15
+ isEnabled,
16
+ config,
17
+ resolveFromAST,
18
+ };
19
+ export default plugin;
@@ -0,0 +1,2 @@
1
+ import type { Program } from 'oxc-parser';
2
+ export declare const getInputFromAST: (program: Program) => Set<string>;
@@ -0,0 +1,4 @@
1
+ import { collectPropertyValues } from "../../typescript/ast-helpers.js";
2
+ export const getInputFromAST = (program) => {
3
+ return collectPropertyValues(program, 'input');
4
+ };
@@ -1,19 +1,26 @@
1
+ import { toProductionEntry } from "../../util/input.js";
1
2
  import { hasDependency } from "../../util/plugin.js";
3
+ import { getInputFromAST } from "./resolveFromAST.js";
2
4
  const title = 'Rollup';
3
5
  const enablers = ['rollup'];
4
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const entry = ['rollup.config.{js,cjs,mjs,ts}'];
7
+ const config = ['rollup.config.{js,cjs,mjs,ts}'];
6
8
  const args = {
7
9
  alias: { plugin: ['p'] },
8
10
  args: (args) => args.map(arg => (arg.startsWith('--watch.onEnd') ? `--_exec${arg.slice(13)}` : arg)),
9
11
  fromArgs: ['_exec'],
10
12
  resolve: ['plugin', 'configPlugin'],
11
13
  };
14
+ const resolveFromAST = program => {
15
+ const inputs = getInputFromAST(program);
16
+ return [...inputs].map(id => toProductionEntry(id));
17
+ };
12
18
  const plugin = {
13
19
  title,
14
20
  enablers,
15
21
  isEnabled,
16
- entry,
22
+ config,
17
23
  args,
24
+ resolveFromAST,
18
25
  };
19
26
  export default plugin;
@@ -0,0 +1,2 @@
1
+ import type { Program } from 'oxc-parser';
2
+ export declare const getInputFromAST: (program: Program) => Set<string>;
@@ -0,0 +1,4 @@
1
+ import { collectPropertyValues } from "../../typescript/ast-helpers.js";
2
+ export const getInputFromAST = (program) => {
3
+ return collectPropertyValues(program, 'input');
4
+ };
@@ -472,6 +472,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
472
472
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
473
473
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
474
474
  }, z.core.$strip>]>>;
475
+ rolldown: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
476
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
477
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
478
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
479
+ }, z.core.$strip>]>>;
475
480
  rollup: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
476
481
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
477
482
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1194,6 +1199,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1194
1199
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1195
1200
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1196
1201
  }, z.core.$strip>]>>;
1202
+ rolldown: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1203
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1204
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1205
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1206
+ }, z.core.$strip>]>>;
1197
1207
  rollup: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1198
1208
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1199
1209
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1905,6 +1915,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1905
1915
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1906
1916
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1907
1917
  }, z.core.$strip>]>>;
1918
+ rolldown: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1919
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1920
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1921
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1922
+ }, z.core.$strip>]>>;
1908
1923
  rollup: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1909
1924
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1910
1925
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -476,6 +476,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
476
476
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
477
477
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
478
478
  }, z.core.$strip>]>;
479
+ rolldown: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
480
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
481
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
482
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
483
+ }, z.core.$strip>]>;
479
484
  rollup: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
480
485
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
481
486
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -104,6 +104,7 @@ export const pluginsSchema = z.object({
104
104
  'release-it': pluginSchema,
105
105
  remark: pluginSchema,
106
106
  remix: pluginSchema,
107
+ rolldown: pluginSchema,
107
108
  rollup: pluginSchema,
108
109
  rsbuild: pluginSchema,
109
110
  rslib: pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'execa' | 'expo' | 'expressive-code' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'oxfmt' | 'oxlint' | 'parcel' | 'payload' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
- export declare const pluginNames: readonly ["angular", "astro", "astro-db", "astro-og-canvas", "ava", "babel", "biome", "bumpp", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "danger", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "execa", "expo", "expressive-code", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "knex", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mdx", "mdxlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "next-intl", "next-mdx", "nitro", "node", "node-modules-inspector", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "openapi-ts", "oxfmt", "oxlint", "parcel", "payload", "playwright", "playwright-ct", "playwright-test", "plop", "pm2", "pnpm", "postcss", "preconstruct", "prettier", "prisma", "qwik", "raycast", "react-cosmos", "react-native", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rslib", "rspack", "rstest", "sanity", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "stencil", "storybook", "stryker", "stylelint", "svelte", "sveltekit", "svgo", "svgr", "swc", "syncpack", "tailwind", "tanstack-router", "taskfile", "travis", "ts-node", "tsdown", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitepress", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie", "zx"];
1
+ export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'execa' | 'expo' | 'expressive-code' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'oxfmt' | 'oxlint' | 'parcel' | 'payload' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
+ export declare const pluginNames: readonly ["angular", "astro", "astro-db", "astro-og-canvas", "ava", "babel", "biome", "bumpp", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "danger", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "execa", "expo", "expressive-code", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "knex", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mdx", "mdxlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "next-intl", "next-mdx", "nitro", "node", "node-modules-inspector", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "openapi-ts", "oxfmt", "oxlint", "parcel", "payload", "playwright", "playwright-ct", "playwright-test", "plop", "pm2", "pnpm", "postcss", "preconstruct", "prettier", "prisma", "qwik", "raycast", "react-cosmos", "react-native", "react-router", "relay", "release-it", "remark", "remix", "rolldown", "rollup", "rsbuild", "rslib", "rspack", "rstest", "sanity", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "stencil", "storybook", "stryker", "stylelint", "svelte", "sveltekit", "svgo", "svgr", "swc", "syncpack", "tailwind", "tanstack-router", "taskfile", "travis", "ts-node", "tsdown", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitepress", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie", "zx"];
@@ -93,6 +93,7 @@ export const pluginNames = [
93
93
  'release-it',
94
94
  'remark',
95
95
  'remix',
96
+ 'rolldown',
96
97
  'rollup',
97
98
  'rsbuild',
98
99
  'rslib',
@@ -32,21 +32,13 @@ export function handleCallExpression(node, s) {
32
32
  s.addImport(specifier, undefined, undefined, undefined, node.arguments[0].start, IMPORT_FLAGS.ENTRY);
33
33
  return;
34
34
  }
35
- if (node.callee.type === 'MemberExpression' &&
36
- node.callee.object.type === 'Identifier' &&
37
- node.callee.object.name === 'module' &&
38
- !node.callee.computed &&
39
- node.callee.property.name === 'register' &&
40
- node.arguments.length >= 1 &&
41
- isStringLiteral(node.arguments[0])) {
42
- const specifier = getStringValue(node.arguments[0]);
43
- if (specifier)
44
- s.addImport(specifier, undefined, undefined, undefined, node.arguments[0].start, IMPORT_FLAGS.ENTRY);
45
- return;
46
- }
47
35
  if (s.hasNodeModuleImport &&
48
- node.callee.type === 'Identifier' &&
49
- node.callee.name === 'register' &&
36
+ ((node.callee.type === 'MemberExpression' &&
37
+ node.callee.object.type === 'Identifier' &&
38
+ node.callee.object.name === 'module' &&
39
+ !node.callee.computed &&
40
+ node.callee.property.name === 'register') ||
41
+ (node.callee.type === 'Identifier' && node.callee.name === 'register')) &&
50
42
  node.arguments.length >= 1 &&
51
43
  isStringLiteral(node.arguments[0])) {
52
44
  const specifier = getStringValue(node.arguments[0]);
@@ -512,6 +512,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
512
512
  entry?: string | string[] | undefined;
513
513
  project?: string | string[] | undefined;
514
514
  } | undefined;
515
+ rolldown?: string | boolean | string[] | {
516
+ config?: string | string[] | undefined;
517
+ entry?: string | string[] | undefined;
518
+ project?: string | string[] | undefined;
519
+ } | undefined;
515
520
  rollup?: string | boolean | string[] | {
516
521
  config?: string | string[] | undefined;
517
522
  entry?: string | string[] | undefined;
@@ -1223,6 +1228,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1223
1228
  entry?: string | string[] | undefined;
1224
1229
  project?: string | string[] | undefined;
1225
1230
  } | undefined;
1231
+ rolldown?: string | boolean | string[] | {
1232
+ config?: string | string[] | undefined;
1233
+ entry?: string | string[] | undefined;
1234
+ project?: string | string[] | undefined;
1235
+ } | undefined;
1226
1236
  rollup?: string | boolean | string[] | {
1227
1237
  config?: string | string[] | undefined;
1228
1238
  entry?: string | string[] | undefined;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.2.0";
1
+ export declare const version = "6.3.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '6.2.0';
1
+ export const version = '6.3.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "keywords": [
6
6
  "analysis",
@@ -124,7 +124,7 @@
124
124
  "prebuild": "pnpm run generate-plugin-defs && node rmdir.js dist",
125
125
  "build": "tsc",
126
126
  "qa": "pnpm lint && pnpm build && pnpm knip && pnpm knip:production && pnpm run test",
127
- "release": "release-it",
127
+ "release": "NODE_OPTIONS=--no-deprecation release-it",
128
128
  "create-plugin": "node ./scripts/create-new-plugin.ts",
129
129
  "postcreate-plugin": "pnpm run build && (oxfmt schema.json schema-jsonc.json src/schema/plugins.ts || true)",
130
130
  "generate-plugin-defs": "node ./scripts/generate-plugin-defs.js && (oxfmt src/plugins/index.ts src/types/PluginNames.ts src/schema/plugins.ts || true)"
package/schema.json CHANGED
@@ -616,22 +616,22 @@
616
616
  "title": "nyc plugin configuration (https://knip.dev/reference/plugins/nyc)",
617
617
  "$ref": "#/definitions/plugin"
618
618
  },
619
- "openapi-ts": {
620
- "title": "openapi-ts plugin configuration (https://knip.dev/reference/plugins/openapi-ts)",
621
- "$ref": "#/definitions/plugin"
622
- },
623
619
  "oclif": {
624
620
  "title": "oclif plugin configuration (https://knip.dev/reference/plugins/oclif)",
625
621
  "$ref": "#/definitions/plugin"
626
622
  },
627
- "oxlint": {
628
- "title": "oxlint plugin configuration (https://knip.dev/reference/plugins/oxlint)",
623
+ "openapi-ts": {
624
+ "title": "openapi-ts plugin configuration (https://knip.dev/reference/plugins/openapi-ts)",
629
625
  "$ref": "#/definitions/plugin"
630
626
  },
631
627
  "oxfmt": {
632
628
  "title": "oxfmt plugin configuration (https://knip.dev/reference/plugins/oxfmt)",
633
629
  "$ref": "#/definitions/plugin"
634
630
  },
631
+ "oxlint": {
632
+ "title": "oxlint plugin configuration (https://knip.dev/reference/plugins/oxlint)",
633
+ "$ref": "#/definitions/plugin"
634
+ },
635
635
  "payload": {
636
636
  "title": "payload plugin configuration (https://knip.dev/reference/plugins/payload)",
637
637
  "$ref": "#/definitions/plugin"
@@ -704,6 +704,10 @@
704
704
  "title": "Remix plugin configuration (https://knip.dev/reference/plugins/remix)",
705
705
  "$ref": "#/definitions/plugin"
706
706
  },
707
+ "rolldown": {
708
+ "title": "rolldown plugin configuration (https://knip.dev/reference/plugins/rolldown)",
709
+ "$ref": "#/definitions/plugin"
710
+ },
707
711
  "rollup": {
708
712
  "title": "Rollup plugin configuration (https://knip.dev/reference/plugins/rollup)",
709
713
  "$ref": "#/definitions/plugin"