knip 6.21.0 → 6.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +4 -4
  2. package/dist/ConfigurationChief.d.ts +12 -0
  3. package/dist/DependencyDeputy.js +1 -1
  4. package/dist/binaries/resolvers/index.d.ts +2 -0
  5. package/dist/binaries/resolvers/index.js +3 -0
  6. package/dist/binaries/resolvers/nub.d.ts +2 -0
  7. package/dist/binaries/resolvers/nub.js +46 -0
  8. package/dist/compilers/index.d.ts +20 -0
  9. package/dist/constants.js +2 -0
  10. package/dist/plugins/astro/index.js +13 -1
  11. package/dist/plugins/astro-markdoc/index.d.ts +3 -0
  12. package/dist/plugins/astro-markdoc/index.js +34 -0
  13. package/dist/plugins/astro-markdoc/types.d.ts +12 -0
  14. package/dist/plugins/astro-markdoc/types.js +1 -0
  15. package/dist/plugins/execa/visitors/execa.js +14 -3
  16. package/dist/plugins/index.d.ts +2 -0
  17. package/dist/plugins/index.js +4 -0
  18. package/dist/plugins/lunaria/index.d.ts +3 -0
  19. package/dist/plugins/lunaria/index.js +30 -0
  20. package/dist/plugins/lunaria/types.d.ts +16 -0
  21. package/dist/plugins/lunaria/types.js +1 -0
  22. package/dist/plugins/node/index.js +1 -1
  23. package/dist/plugins/starlight/index.js +14 -1
  24. package/dist/plugins/vite/index.js +1 -1
  25. package/dist/plugins/vitest/index.js +3 -3
  26. package/dist/plugins/xo/index.js +9 -6
  27. package/dist/schema/configuration.d.ts +30 -0
  28. package/dist/schema/plugins.d.ts +10 -0
  29. package/dist/schema/plugins.js +2 -0
  30. package/dist/types/PluginNames.d.ts +2 -2
  31. package/dist/types/PluginNames.js +2 -0
  32. package/dist/util/create-options.d.ts +20 -0
  33. package/dist/version.d.ts +1 -1
  34. package/dist/version.js +1 -1
  35. package/package.json +1 -1
  36. package/schema.json +8 -0
package/README.md CHANGED
@@ -46,16 +46,16 @@ following projects:
46
46
  - [file-entry-cache][22] ([MIT][23])
47
47
  - [json-parse-even-better-errors][24] ([MIT][25])
48
48
 
49
- [1]: https://www.npmjs.com/package/knip
49
+ [1]: https://www.npmx.dev/package/knip
50
50
  [2]: https://img.shields.io/npm/v/knip?color=f56e0f
51
51
  [3]: https://img.shields.io/npm/dm/knip?color=f56e0f
52
52
  [4]: https://github.com/webpro-nl/knip
53
53
  [5]:
54
54
  https://img.shields.io/github/stars/webpro-nl/knip?style=flat-square&color=f56e0f
55
55
  [6]: https://knip.dev
56
- [7]: https://www.npmjs.com/package/@knip/create-config
57
- [8]: https://www.npmjs.com/package/@knip/language-server
58
- [9]: https://www.npmjs.com/package/@knip/mcp
56
+ [7]: https://www.npmx.dev/package/@knip/create-config
57
+ [8]: https://www.npmx.dev/package/@knip/language-server
58
+ [9]: https://www.npmx.dev/package/@knip/mcp
59
59
  [10]: https://marketplace.visualstudio.com/items?itemName=webpro.vscode-knip
60
60
  [11]: https://open-vsx.org/extension/webpro/vscode-knip
61
61
  [12]: https://github.com/webpro-nl/knip/blob/main/.github/CONTRIBUTING.md
@@ -72,6 +72,11 @@ export declare class ConfigurationChief {
72
72
  entry?: string | string[] | undefined;
73
73
  project?: string | string[] | undefined;
74
74
  } | undefined;
75
+ 'astro-markdoc'?: string | boolean | string[] | {
76
+ config?: string | string[] | undefined;
77
+ entry?: string | string[] | undefined;
78
+ project?: string | string[] | undefined;
79
+ } | undefined;
75
80
  'astro-og-canvas'?: string | boolean | string[] | {
76
81
  config?: string | string[] | undefined;
77
82
  entry?: string | string[] | undefined;
@@ -312,6 +317,11 @@ export declare class ConfigurationChief {
312
317
  entry?: string | string[] | undefined;
313
318
  project?: string | string[] | undefined;
314
319
  } | undefined;
320
+ lunaria?: string | boolean | string[] | {
321
+ config?: string | string[] | undefined;
322
+ entry?: string | string[] | undefined;
323
+ project?: string | string[] | undefined;
324
+ } | undefined;
315
325
  markdownlint?: string | boolean | string[] | {
316
326
  config?: string | string[] | undefined;
317
327
  entry?: string | string[] | undefined;
@@ -862,6 +872,7 @@ export declare class ConfigurationChief {
862
872
  angular?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
863
873
  astro?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
864
874
  "astro-db"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
875
+ "astro-markdoc"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
865
876
  "astro-og-canvas"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
866
877
  ava?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
867
878
  babel?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
@@ -910,6 +921,7 @@ export declare class ConfigurationChief {
910
921
  lit?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
911
922
  "lockfile-lint"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
912
923
  "lost-pixel"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
924
+ lunaria?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
913
925
  markdownlint?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
914
926
  mdx?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
915
927
  mdxlint?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
@@ -240,7 +240,7 @@ export class DependencyDeputy {
240
240
  devDependencyIssues.push({ type: 'devDependencies', filePath, workspace, symbol, fixes: [], ...position });
241
241
  }
242
242
  for (const symbol of this.getOptionalPeerDependencies(workspace)) {
243
- if (!isReferencedDependency(symbol))
243
+ if (!referencedDependencies?.has(symbol))
244
244
  continue;
245
245
  if (manifest.dependencies.includes(symbol) || manifest.devDependencies.includes(symbol))
246
246
  continue;
@@ -1,6 +1,8 @@
1
1
  declare const _default: {
2
2
  bun: import("../../types/config.ts").BinaryResolver;
3
3
  bunx: import("../../types/config.ts").BinaryResolver;
4
+ nub: import("../../types/config.ts").BinaryResolver;
5
+ nubx: import("../../types/config.ts").BinaryResolver;
4
6
  find: import("../../types/config.ts").BinaryResolver;
5
7
  npm: import("../../types/config.ts").BinaryResolver;
6
8
  npx: import("../../types/config.ts").BinaryResolver;
@@ -3,12 +3,15 @@ import * as bunx from './bunx.js';
3
3
  import * as find from './find.js';
4
4
  import * as npm from './npm.js';
5
5
  import * as npx from './npx.js';
6
+ import * as nub from './nub.js';
6
7
  import * as pnpm from './pnpm.js';
7
8
  import * as pnpx from './pnpx.js';
8
9
  import * as yarn from './yarn.js';
9
10
  export default {
10
11
  bun: bun.resolve,
11
12
  bunx: bunx.resolve,
13
+ nub: nub.resolve,
14
+ nubx: bunx.resolve,
12
15
  find: find.resolve,
13
16
  npm: npm.resolve,
14
17
  npx: npx.resolve,
@@ -0,0 +1,2 @@
1
+ import type { BinaryResolver } from '../../types/config.ts';
2
+ export declare const resolve: BinaryResolver;
@@ -0,0 +1,46 @@
1
+ import parseArgs from '../../util/parse-args.js';
2
+ import { toBinary, toEntry } from '../../util/input.js';
3
+ import { isAbsolute, join } from '../../util/path.js';
4
+ import { _resolveSync } from '../../util/resolve.js';
5
+ import { resolveX } from './bunx.js';
6
+ const runtimes = new Set(['x', 'dlx', 'exec']);
7
+ const runners = new Set(['run', 'watch']);
8
+ const commands = new Set([
9
+ 'add',
10
+ 'approve-builds',
11
+ 'audit',
12
+ 'ci',
13
+ 'create',
14
+ 'init',
15
+ 'install',
16
+ 'link',
17
+ 'node',
18
+ 'outdated',
19
+ 'pm',
20
+ 'publish',
21
+ 'remove',
22
+ 'unlink',
23
+ 'update',
24
+ 'why',
25
+ ]);
26
+ export const resolve = (_binary, args, options) => {
27
+ const binary = toBinary(_binary);
28
+ const { manifest, cwd, fromArgs } = options;
29
+ const parsed = parseArgs(args, { string: ['filter'], boolean: ['recursive'], alias: { recursive: 'r' } });
30
+ const [command, script] = parsed._;
31
+ if (runtimes.has(command)) {
32
+ const rest = args.filter(arg => arg !== command);
33
+ return [binary, ...resolveX(rest, options)];
34
+ }
35
+ if (parsed.recursive || parsed.filter)
36
+ return [binary];
37
+ if (runners.has(command)) {
38
+ if (!script || manifest.scriptNames.has(script))
39
+ return [binary];
40
+ const resolved = _resolveSync(isAbsolute(script) ? script : join(cwd, script), cwd);
41
+ return resolved ? [binary, toEntry(resolved)] : [binary];
42
+ }
43
+ if (command && (commands.has(command) || manifest.scriptNames.has(command)))
44
+ return [binary];
45
+ return [binary, ...fromArgs(['node', ...args])];
46
+ };
@@ -18,6 +18,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
18
18
  entry?: string | string[] | undefined;
19
19
  project?: string | string[] | undefined;
20
20
  } | undefined;
21
+ 'astro-markdoc'?: string | boolean | string[] | {
22
+ config?: string | string[] | undefined;
23
+ entry?: string | string[] | undefined;
24
+ project?: string | string[] | undefined;
25
+ } | undefined;
21
26
  'astro-og-canvas'?: string | boolean | string[] | {
22
27
  config?: string | string[] | undefined;
23
28
  entry?: string | string[] | undefined;
@@ -258,6 +263,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
258
263
  entry?: string | string[] | undefined;
259
264
  project?: string | string[] | undefined;
260
265
  } | undefined;
266
+ lunaria?: string | boolean | string[] | {
267
+ config?: string | string[] | undefined;
268
+ entry?: string | string[] | undefined;
269
+ project?: string | string[] | undefined;
270
+ } | undefined;
261
271
  markdownlint?: string | boolean | string[] | {
262
272
  config?: string | string[] | undefined;
263
273
  entry?: string | string[] | undefined;
@@ -815,6 +825,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
815
825
  entry?: string | string[] | undefined;
816
826
  project?: string | string[] | undefined;
817
827
  } | undefined;
828
+ 'astro-markdoc'?: string | boolean | string[] | {
829
+ config?: string | string[] | undefined;
830
+ entry?: string | string[] | undefined;
831
+ project?: string | string[] | undefined;
832
+ } | undefined;
818
833
  'astro-og-canvas'?: string | boolean | string[] | {
819
834
  config?: string | string[] | undefined;
820
835
  entry?: string | string[] | undefined;
@@ -1055,6 +1070,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
1055
1070
  entry?: string | string[] | undefined;
1056
1071
  project?: string | string[] | undefined;
1057
1072
  } | undefined;
1073
+ lunaria?: string | boolean | string[] | {
1074
+ config?: string | string[] | undefined;
1075
+ entry?: string | string[] | undefined;
1076
+ project?: string | string[] | undefined;
1077
+ } | undefined;
1058
1078
  markdownlint?: string | boolean | string[] | {
1059
1079
  config?: string | string[] | undefined;
1060
1080
  entry?: string | string[] | undefined;
package/dist/constants.js CHANGED
@@ -84,6 +84,8 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
84
84
  'npm',
85
85
  'nproc',
86
86
  'npx',
87
+ 'nub',
88
+ 'nubx',
87
89
  'paste',
88
90
  'pnpm',
89
91
  'pnpx',
@@ -1,4 +1,5 @@
1
- import { toDependency, toEntry, toProductionEntry } from '../../util/input.js';
1
+ import { findCallArg, getDefaultImportName, getImportMap, getPropertyValues } from '../../typescript/ast-helpers.js';
2
+ import { toConfig, toDependency, toEntry, toProductionEntry } from '../../util/input.js';
2
3
  import { hasDependency } from '../../util/plugin.js';
3
4
  import { getAliasInputs } from '../vitest/helpers.js';
4
5
  import compiler from './compiler.js';
@@ -28,6 +29,17 @@ const resolveFromAST = (program, options) => {
28
29
  ];
29
30
  if (!usesPassthroughImageService(program))
30
31
  inputs.push(toDependency('sharp', { optional: true }));
32
+ const importMap = getImportMap(program);
33
+ const lunariaImportName = getDefaultImportName(importMap, '@lunariajs/starlight');
34
+ if (lunariaImportName) {
35
+ const lunariaConfig = findCallArg(program, lunariaImportName);
36
+ if (lunariaConfig) {
37
+ const configPaths = getPropertyValues(lunariaConfig, 'configPath');
38
+ for (const id of configPaths) {
39
+ inputs.push(toConfig('lunaria', id));
40
+ }
41
+ }
42
+ }
31
43
  return inputs;
32
44
  };
33
45
  const registerCompilers = ({ registerCompiler, hasDependency }) => {
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,34 @@
1
+ import { toProductionEntry } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
+ const title = 'Astro Markdoc';
4
+ const enablers = ['@astrojs/markdoc'];
5
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
+ const config = ['markdoc.config.{js,ts,mjs,mts}'];
7
+ const extractSpecifiers = (renderField) => {
8
+ if (typeof renderField === 'string') {
9
+ return [renderField.split('#')[0]];
10
+ }
11
+ if (renderField && typeof renderField === 'object') {
12
+ for (const key of ['Component', 'file', 'path']) {
13
+ if (typeof renderField[key] === 'string') {
14
+ return [renderField[key].split('#')[0]];
15
+ }
16
+ }
17
+ }
18
+ return [];
19
+ };
20
+ const resolveConfig = async (localConfig) => {
21
+ if (!localConfig)
22
+ return [];
23
+ const entries = [...Object.values(localConfig.nodes ?? {}), ...Object.values(localConfig.tags ?? {})];
24
+ const specifiers = entries.flatMap(item => item && typeof item === 'object' && 'render' in item ? extractSpecifiers(item.render) : []);
25
+ return specifiers.map(id => toProductionEntry(id));
26
+ };
27
+ const plugin = {
28
+ title,
29
+ enablers,
30
+ isEnabled,
31
+ config,
32
+ resolveConfig,
33
+ };
34
+ export default plugin;
@@ -0,0 +1,12 @@
1
+ export type MarkdocRenderSpecifier = string | {
2
+ [key: string]: unknown;
3
+ };
4
+ type MarkdocRenderableNode = {
5
+ render?: MarkdocRenderSpecifier;
6
+ [key: string]: unknown;
7
+ };
8
+ export type MarkdocConfig = {
9
+ nodes?: Record<string, MarkdocRenderableNode>;
10
+ tags?: Record<string, MarkdocRenderableNode>;
11
+ };
12
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { getSafeScriptFromArgs, getStringValue, isStringLiteral } from '../../../typescript/ast-nodes.js';
2
2
  const tags = new Set(['$', '$sync']);
3
- const methods = new Set(['execa', 'execaSync', 'execaCommand', 'execaCommandSync', '$sync']);
3
+ const methods = new Set(['execa', 'execaSync', 'execaCommand', 'execaCommandSync', 'execaNode', '$sync']);
4
4
  export function createExecaVisitor(ctx) {
5
5
  return {
6
6
  TaggedTemplateExpression(node) {
@@ -10,7 +10,13 @@ export function createExecaVisitor(ctx) {
10
10
  : tag.type === 'CallExpression' && tag.callee.type === 'Identifier'
11
11
  ? tag.callee.name
12
12
  : undefined;
13
- if (tagName && tags.has(tagName)) {
13
+ if (tagName === 'execaNode') {
14
+ for (const q of node.quasi.quasis) {
15
+ if (q.value.raw)
16
+ ctx.addScript(`node ${q.value.raw}`);
17
+ }
18
+ }
19
+ else if (tagName && tags.has(tagName)) {
14
20
  for (const q of node.quasi.quasis) {
15
21
  if (q.value.raw)
16
22
  ctx.addScript(q.value.raw);
@@ -21,7 +27,12 @@ export function createExecaVisitor(ctx) {
21
27
  if (node.callee.type !== 'Identifier' || !methods.has(node.callee.name))
22
28
  return;
23
29
  const fnName = node.callee.name;
24
- if (fnName.startsWith('execaCommand')) {
30
+ if (fnName === 'execaNode') {
31
+ const script = getSafeScriptFromArgs(node.arguments[0], node.arguments[1]);
32
+ if (script)
33
+ ctx.addScript(`node ${script}`);
34
+ }
35
+ else if (fnName.startsWith('execaCommand')) {
25
36
  if (node.arguments[0] && isStringLiteral(node.arguments[0])) {
26
37
  const val = getStringValue(node.arguments[0]);
27
38
  if (val)
@@ -2,6 +2,7 @@ export declare const Plugins: {
2
2
  angular: import("../types/config.ts").Plugin;
3
3
  astro: import("../types/config.ts").Plugin;
4
4
  'astro-db': import("../types/config.ts").Plugin;
5
+ 'astro-markdoc': import("../types/config.ts").Plugin;
5
6
  'astro-og-canvas': import("../types/config.ts").Plugin;
6
7
  ava: import("../types/config.ts").Plugin;
7
8
  babel: import("../types/config.ts").Plugin;
@@ -55,6 +56,7 @@ export declare const Plugins: {
55
56
  lit: import("../types/config.ts").Plugin;
56
57
  'lockfile-lint': import("../types/config.ts").Plugin;
57
58
  'lost-pixel': import("../types/config.ts").Plugin;
59
+ lunaria: import("../types/config.ts").Plugin;
58
60
  markdownlint: import("../types/config.ts").Plugin;
59
61
  mdx: import("../types/config.ts").Plugin;
60
62
  mdxlint: import("../types/config.ts").Plugin;
@@ -1,6 +1,7 @@
1
1
  import { default as angular } from './angular/index.js';
2
2
  import { default as astro } from './astro/index.js';
3
3
  import { default as astroDb } from './astro-db/index.js';
4
+ import { default as astroMarkdoc } from './astro-markdoc/index.js';
4
5
  import { default as astroOgCanvas } from './astro-og-canvas/index.js';
5
6
  import { default as ava } from './ava/index.js';
6
7
  import { default as babel } from './babel/index.js';
@@ -49,6 +50,7 @@ import { default as linthtml } from './linthtml/index.js';
49
50
  import { default as lit } from './lit/index.js';
50
51
  import { default as lockfileLint } from './lockfile-lint/index.js';
51
52
  import { default as lostPixel } from './lost-pixel/index.js';
53
+ import { default as lunaria } from './lunaria/index.js';
52
54
  import { default as markdownlint } from './markdownlint/index.js';
53
55
  import { default as mdx } from './mdx/index.js';
54
56
  import { default as mdxlint } from './mdxlint/index.js';
@@ -157,6 +159,7 @@ export const Plugins = {
157
159
  angular,
158
160
  astro,
159
161
  'astro-db': astroDb,
162
+ 'astro-markdoc': astroMarkdoc,
160
163
  'astro-og-canvas': astroOgCanvas,
161
164
  ava,
162
165
  babel,
@@ -205,6 +208,7 @@ export const Plugins = {
205
208
  lit,
206
209
  'lockfile-lint': lockfileLint,
207
210
  'lost-pixel': lostPixel,
211
+ lunaria,
208
212
  markdownlint,
209
213
  mdx,
210
214
  mdxlint,
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,30 @@
1
+ import { isAbsolute, join } from '../../util/path.js';
2
+ import { toProductionEntry } from '../../util/input.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
+ const title = 'Lunaria';
5
+ const enablers = ['@lunariajs/core', '@lunariajs/starlight'];
6
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
+ const config = ['lunaria.config.json'];
8
+ const resolveConfig = async (localConfig, options) => {
9
+ if (!localConfig)
10
+ return [];
11
+ const files = localConfig.files?.map(f => f.location) ?? [];
12
+ const renderer = localConfig.renderer ? [localConfig.renderer] : [];
13
+ const customCss = localConfig.dashboard?.customCss ?? [];
14
+ const favicon = localConfig.dashboard?.favicon?.inline ? [localConfig.dashboard.favicon.inline] : [];
15
+ const baseDir = options.configFileDir;
16
+ return [...files, ...renderer, ...customCss, ...favicon].map(id => toProductionEntry(isAbsolute(id) ? id : join(baseDir, id)));
17
+ };
18
+ const args = {
19
+ binaries: ['lunaria'],
20
+ config: ['config'],
21
+ };
22
+ const plugin = {
23
+ title,
24
+ enablers,
25
+ isEnabled,
26
+ config,
27
+ resolveConfig,
28
+ args,
29
+ };
30
+ export default plugin;
@@ -0,0 +1,16 @@
1
+ type TrackedFile = {
2
+ location: string;
3
+ };
4
+ type Favicon = {
5
+ inline?: string;
6
+ };
7
+ type Dashboard = {
8
+ customCss?: string[];
9
+ favicon?: Favicon;
10
+ };
11
+ export type LunariaConfig = {
12
+ files: TrackedFile[];
13
+ renderer?: string;
14
+ dashboard?: Dashboard;
15
+ };
16
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -7,7 +7,7 @@ const patterns = [
7
7
  '**/test.{cjs,mjs,js,cts,mts,ts}',
8
8
  '**/test/**/*.{cjs,mjs,js,cts,mts,ts}',
9
9
  ];
10
- const hasNodeTest = (scripts) => scripts && Object.values(scripts).some(script => /(?<=^|\s)node\s(.*)--test/.test(script));
10
+ const hasNodeTest = (scripts) => scripts && Object.values(scripts).some(script => /(?<=^|\s)(node|nub)\s(.*)--test/.test(script));
11
11
  const entry = ['server.js'];
12
12
  const resolve = options => {
13
13
  const entries = entry.map(id => toProductionEntry(id));
@@ -1,3 +1,4 @@
1
+ import { findCallArg, getDefaultImportName, getImportMap, getPropertyValues } from '../../typescript/ast-helpers.js';
1
2
  import { toProductionEntry } from '../../util/input.js';
2
3
  import { hasDependency } from '../../util/plugin.js';
3
4
  import { config } from '../astro/index.js';
@@ -7,7 +8,19 @@ const enablers = ['@astrojs/starlight'];
7
8
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
9
  const resolveFromAST = program => {
9
10
  const componentPaths = getComponentPathsFromSourceFile(program);
10
- return Array.from(componentPaths).map(id => toProductionEntry(id));
11
+ const inputs = Array.from(componentPaths).map(id => toProductionEntry(id));
12
+ const importMap = getImportMap(program);
13
+ const starlightImportName = getDefaultImportName(importMap, '@astrojs/starlight');
14
+ if (starlightImportName) {
15
+ const starlightConfig = findCallArg(program, starlightImportName);
16
+ if (starlightConfig) {
17
+ const customCssPaths = getPropertyValues(starlightConfig, 'customCss');
18
+ for (const id of customCssPaths) {
19
+ inputs.push(toProductionEntry(id));
20
+ }
21
+ }
22
+ }
23
+ return inputs;
11
24
  };
12
25
  const plugin = {
13
26
  title,
@@ -3,7 +3,7 @@ import { resolveConfig } from '../vitest/index.js';
3
3
  import { getBabelInputs, getIndexHtmlEntries } from './helpers.js';
4
4
  import { createImportMetaGlobVisitor } from './visitors/importMetaGlob.js';
5
5
  const title = 'Vite';
6
- const enablers = ['vite', 'vitest'];
6
+ const enablers = ['vite', 'vitest', 'vite-plus'];
7
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
8
  export const config = ['vite.config.{js,mjs,ts,cjs,mts,cts}'];
9
9
  const resolveFromAST = program => getBabelInputs(program);
@@ -7,7 +7,7 @@ import { hasDependency } from '../../util/plugin.js';
7
7
  import { getIndexHtmlEntries } from '../vite/helpers.js';
8
8
  import { getAliasInputs, getEnvSpecifier, getExternalReporters } from './helpers.js';
9
9
  const title = 'Vitest';
10
- const enablers = ['vitest'];
10
+ const enablers = ['vitest', 'vite-plus'];
11
11
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
12
12
  const config = ['vitest.config.{js,mjs,ts,cjs,mts,cts}', 'vitest.{workspace,projects}.{js,mjs,ts,cjs,mts,cts,json}'];
13
13
  const mocks = ['**/__mocks__/**/*.?(c|m)[jt]s?(x)'];
@@ -143,11 +143,11 @@ export const resolveConfig = async (localConfig, options) => {
143
143
  if (cfg.resolve?.alias)
144
144
  addAliases(cfg.resolve.alias);
145
145
  for (const dependency of cfg.resolve?.dedupe ?? [])
146
- inputs.add(toDependency(dependency));
146
+ inputs.add(toDependency(dependency, { optional: true }));
147
147
  for (const dependency of cfg.optimizeDeps?.include ?? []) {
148
148
  const packageName = getOptimizeDepsIncludePackageName(dependency);
149
149
  if (packageName)
150
- inputs.add(toDependency(packageName));
150
+ inputs.add(toDependency(packageName, { optional: true }));
151
151
  }
152
152
  if (cfg.resolve?.extensions) {
153
153
  const customExtensions = cfg.resolve.extensions.filter(ext => ext.startsWith('.') && !DEFAULT_EXTENSIONS.has(ext));
@@ -1,20 +1,23 @@
1
1
  import { hasDependency } from '../../util/plugin.js';
2
2
  import { getInputs } from '../eslint/helpers.js';
3
+ import { getInputsFromFlatConfigAST } from '../eslint/resolveFromAST.js';
3
4
  const title = 'xo';
4
5
  const enablers = ['xo'];
5
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
- const config = ['package.json', '.xo-config', '.xo-config.{js,cjs,json}', 'xo.config.{js,cjs}'];
7
- const entry = ['.xo-config.{js,cjs}', 'xo.config.{js,cjs}'];
8
- const resolveConfig = async (config, options) => {
9
- const inputs = getInputs(config, options);
10
- return [...inputs];
11
- };
7
+ const config = ['package.json', '.xo-config', '.xo-config.{js,cjs,json}', 'xo.config.{js,cjs,mjs,ts,cts,mts}'];
8
+ const entry = ['.xo-config.{js,cjs}', 'xo.config.{js,cjs,mjs,ts,cts,mts}'];
9
+ const isFlatConfig = ({ manifest }) => (manifest.getMajor('xo') ?? 1) >= 1;
10
+ const isLoadConfig = options => !isFlatConfig(options);
11
+ const resolveConfig = (config, options) => getInputs(config, options);
12
+ const resolveFromAST = (program, options) => isFlatConfig(options) ? getInputsFromFlatConfigAST(program) : [];
12
13
  const plugin = {
13
14
  title,
14
15
  enablers,
15
16
  isEnabled,
16
17
  entry,
17
18
  config,
19
+ isLoadConfig,
18
20
  resolveConfig,
21
+ resolveFromAST,
19
22
  };
20
23
  export default plugin;
@@ -16,6 +16,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
16
16
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
17
17
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
18
18
  }, z.core.$strip>]>>;
19
+ 'astro-markdoc': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
20
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
21
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
22
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
23
+ }, z.core.$strip>]>>;
19
24
  'astro-og-canvas': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
20
25
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
21
26
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -256,6 +261,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
256
261
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
257
262
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
258
263
  }, z.core.$strip>]>>;
264
+ lunaria: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
265
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
266
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
267
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
268
+ }, z.core.$strip>]>>;
259
269
  markdownlint: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
260
270
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
261
271
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -807,6 +817,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
807
817
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
808
818
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
809
819
  }, z.core.$strip>]>>;
820
+ 'astro-markdoc': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
821
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
822
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
823
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
824
+ }, z.core.$strip>]>>;
810
825
  'astro-og-canvas': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
811
826
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
812
827
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1047,6 +1062,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1047
1062
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1048
1063
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1049
1064
  }, z.core.$strip>]>>;
1065
+ lunaria: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1066
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1067
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1068
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1069
+ }, z.core.$strip>]>>;
1050
1070
  markdownlint: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1051
1071
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1052
1072
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1612,6 +1632,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1612
1632
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1613
1633
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1614
1634
  }, z.core.$strip>]>>;
1635
+ 'astro-markdoc': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1636
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1637
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1638
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1639
+ }, z.core.$strip>]>>;
1615
1640
  'astro-og-canvas': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1616
1641
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1617
1642
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1852,6 +1877,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1852
1877
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1853
1878
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1854
1879
  }, z.core.$strip>]>>;
1880
+ lunaria: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1881
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1882
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1883
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1884
+ }, z.core.$strip>]>>;
1855
1885
  markdownlint: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1856
1886
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1857
1887
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -21,6 +21,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
21
21
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
22
22
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
23
23
  }, z.core.$strip>]>;
24
+ 'astro-markdoc': z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
25
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
26
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
27
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
28
+ }, z.core.$strip>]>;
24
29
  'astro-og-canvas': z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
25
30
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
26
31
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -261,6 +266,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
261
266
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
262
267
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
263
268
  }, z.core.$strip>]>;
269
+ lunaria: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
270
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
271
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
272
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
273
+ }, z.core.$strip>]>;
264
274
  markdownlint: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
265
275
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
266
276
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -13,6 +13,7 @@ export const pluginsSchema = z.object({
13
13
  angular: pluginSchema,
14
14
  astro: pluginSchema,
15
15
  'astro-db': pluginSchema,
16
+ 'astro-markdoc': pluginSchema,
16
17
  'astro-og-canvas': pluginSchema,
17
18
  ava: pluginSchema,
18
19
  babel: pluginSchema,
@@ -61,6 +62,7 @@ export const pluginsSchema = z.object({
61
62
  lit: pluginSchema,
62
63
  'lockfile-lint': pluginSchema,
63
64
  'lost-pixel': pluginSchema,
65
+ lunaria: pluginSchema,
64
66
  markdownlint: pluginSchema,
65
67
  mdx: pluginSchema,
66
68
  mdxlint: pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | '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' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
- export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-og-canvas', 'ava', 'babel', 'biome', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'eleventy', 'eslint', 'execa', 'expo', 'expressive-code', 'fast', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'markdownlint', 'mdx', 'mdxlint', 'metro', 'mocha', 'moonrepo', 'msw', 'nano-spawn', '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', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'preconstruct', 'prettier', 'prisma', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'travis', 'ts-node', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'vercel', 'vercel-og', 'vike', 'vite', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
1
+ export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | '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' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
+ export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'babel', 'biome', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'eleventy', 'eslint', 'execa', 'expo', 'expressive-code', 'fast', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'mdx', 'mdxlint', 'metro', 'mocha', 'moonrepo', 'msw', 'nano-spawn', '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', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'preconstruct', 'prettier', 'prisma', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'travis', 'ts-node', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'vercel', 'vercel-og', 'vike', 'vite', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
@@ -2,6 +2,7 @@ export const pluginNames = [
2
2
  'angular',
3
3
  'astro',
4
4
  'astro-db',
5
+ 'astro-markdoc',
5
6
  'astro-og-canvas',
6
7
  'ava',
7
8
  'babel',
@@ -50,6 +51,7 @@ export const pluginNames = [
50
51
  'lit',
51
52
  'lockfile-lint',
52
53
  'lost-pixel',
54
+ 'lunaria',
53
55
  'markdownlint',
54
56
  'mdx',
55
57
  'mdxlint',
@@ -58,6 +58,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
58
58
  entry?: string | string[] | undefined;
59
59
  project?: string | string[] | undefined;
60
60
  } | undefined;
61
+ 'astro-markdoc'?: string | boolean | string[] | {
62
+ config?: string | string[] | undefined;
63
+ entry?: string | string[] | undefined;
64
+ project?: string | string[] | undefined;
65
+ } | undefined;
61
66
  'astro-og-canvas'?: string | boolean | string[] | {
62
67
  config?: string | string[] | undefined;
63
68
  entry?: string | string[] | undefined;
@@ -298,6 +303,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
298
303
  entry?: string | string[] | undefined;
299
304
  project?: string | string[] | undefined;
300
305
  } | undefined;
306
+ lunaria?: string | boolean | string[] | {
307
+ config?: string | string[] | undefined;
308
+ entry?: string | string[] | undefined;
309
+ project?: string | string[] | undefined;
310
+ } | undefined;
301
311
  markdownlint?: string | boolean | string[] | {
302
312
  config?: string | string[] | undefined;
303
313
  entry?: string | string[] | undefined;
@@ -857,6 +867,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
857
867
  entry?: string | string[] | undefined;
858
868
  project?: string | string[] | undefined;
859
869
  } | undefined;
870
+ 'astro-markdoc'?: string | boolean | string[] | {
871
+ config?: string | string[] | undefined;
872
+ entry?: string | string[] | undefined;
873
+ project?: string | string[] | undefined;
874
+ } | undefined;
860
875
  'astro-og-canvas'?: string | boolean | string[] | {
861
876
  config?: string | string[] | undefined;
862
877
  entry?: string | string[] | undefined;
@@ -1097,6 +1112,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1097
1112
  entry?: string | string[] | undefined;
1098
1113
  project?: string | string[] | undefined;
1099
1114
  } | undefined;
1115
+ lunaria?: string | boolean | string[] | {
1116
+ config?: string | string[] | undefined;
1117
+ entry?: string | string[] | undefined;
1118
+ project?: string | string[] | undefined;
1119
+ } | undefined;
1100
1120
  markdownlint?: string | boolean | string[] | {
1101
1121
  config?: string | string[] | undefined;
1102
1122
  entry?: string | string[] | undefined;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.21.0";
1
+ export declare const version = "6.23.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '6.21.0';
1
+ export const version = '6.23.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "6.21.0",
3
+ "version": "6.23.0",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "keywords": [
6
6
  "analysis",
package/schema.json CHANGED
@@ -379,6 +379,10 @@
379
379
  "title": "astro-db plugin configuration (https://knip.dev/reference/plugins/astro-db)",
380
380
  "$ref": "#/definitions/plugin"
381
381
  },
382
+ "astro-markdoc": {
383
+ "title": "astro-markdoc plugin configuration (https://knip.dev/reference/plugins/astro-markdoc)",
384
+ "$ref": "#/definitions/plugin"
385
+ },
382
386
  "ava": {
383
387
  "title": "ava plugin configuration (https://knip.dev/reference/plugins/ava)",
384
388
  "$ref": "#/definitions/plugin"
@@ -563,6 +567,10 @@
563
567
  "title": "lost-pixel plugin configuration (https://knip.dev/reference/plugins/lost-pixel)",
564
568
  "$ref": "#/definitions/plugin"
565
569
  },
570
+ "lunaria": {
571
+ "title": "lunaria plugin configuration (https://knip.dev/reference/plugins/lunaria)",
572
+ "$ref": "#/definitions/plugin"
573
+ },
566
574
  "markdownlint": {
567
575
  "title": "markdownlint plugin configuration (https://knip.dev/reference/plugins/markdownlint)",
568
576
  "$ref": "#/definitions/plugin"