knip 5.53.0 → 5.54.1
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/dist/IssueFixer.d.ts +1 -1
- package/dist/IssueFixer.js +13 -3
- package/dist/PrincipalFactory.js +3 -17
- package/dist/ProjectPrincipal.d.ts +2 -2
- package/dist/ProjectPrincipal.js +14 -3
- package/dist/WorkspaceWorker.d.ts +0 -1
- package/dist/WorkspaceWorker.js +4 -19
- package/dist/cli.js +2 -1
- package/dist/graph/build.js +8 -5
- package/dist/index.js +15 -4
- package/dist/plugins/ava/index.d.ts +1 -2
- package/dist/plugins/ava/index.js +2 -7
- package/dist/plugins/bun/index.d.ts +2 -2
- package/dist/plugins/bun/index.js +2 -2
- package/dist/plugins/cucumber/index.d.ts +1 -2
- package/dist/plugins/cucumber/index.js +2 -5
- package/dist/plugins/cypress/index.d.ts +1 -2
- package/dist/plugins/cypress/index.js +6 -9
- package/dist/plugins/cypress/types.d.ts +8 -0
- package/dist/plugins/eleventy/helpers.d.ts +10 -2
- package/dist/plugins/eleventy/index.d.ts +3 -6
- package/dist/plugins/eleventy/index.js +11 -16
- package/dist/plugins/eleventy/types.d.ts +9 -7
- package/dist/plugins/expo/index.d.ts +2 -5
- package/dist/plugins/expo/index.js +4 -6
- package/dist/plugins/github-action/index.d.ts +2 -2
- package/dist/plugins/github-action/index.js +2 -2
- package/dist/plugins/index.d.ts +14 -28
- package/dist/plugins/jest/index.d.ts +1 -2
- package/dist/plugins/jest/index.js +4 -12
- package/dist/plugins/karma/index.d.ts +1 -3
- package/dist/plugins/karma/index.js +0 -10
- package/dist/plugins/ladle/index.d.ts +1 -2
- package/dist/plugins/ladle/index.js +4 -7
- package/dist/plugins/metro/index.d.ts +2 -3
- package/dist/plugins/metro/index.js +17 -14
- package/dist/plugins/mocha/index.d.ts +1 -2
- package/dist/plugins/mocha/index.js +2 -6
- package/dist/plugins/msw/index.d.ts +2 -2
- package/dist/plugins/msw/index.js +2 -2
- package/dist/plugins/netlify/index.d.ts +1 -2
- package/dist/plugins/netlify/index.js +4 -7
- package/dist/plugins/node/index.d.ts +2 -2
- package/dist/plugins/node/index.js +2 -2
- package/dist/plugins/nuxt/index.d.ts +2 -2
- package/dist/plugins/nuxt/index.js +2 -2
- package/dist/plugins/playwright/index.d.ts +1 -3
- package/dist/plugins/playwright/index.js +5 -7
- package/dist/plugins/playwright-ct/index.d.ts +0 -1
- package/dist/plugins/playwright-ct/index.js +1 -2
- package/dist/plugins/postcss/index.js +3 -1
- package/dist/plugins/preconstruct/index.d.ts +1 -1
- package/dist/plugins/preconstruct/index.js +2 -2
- package/dist/plugins/react-cosmos/index.d.ts +1 -2
- package/dist/plugins/react-cosmos/index.js +4 -6
- package/dist/plugins/react-router/index.d.ts +2 -2
- package/dist/plugins/react-router/index.js +2 -2
- package/dist/plugins/relay/index.d.ts +2 -2
- package/dist/plugins/relay/index.js +2 -2
- package/dist/plugins/rspack/index.js +2 -3
- package/dist/plugins/size-limit/index.d.ts +2 -1
- package/dist/plugins/size-limit/index.js +10 -0
- package/dist/plugins/storybook/index.d.ts +1 -2
- package/dist/plugins/storybook/index.js +2 -5
- package/dist/plugins/svelte/index.d.ts +2 -1
- package/dist/plugins/svelte/index.js +7 -0
- package/dist/plugins/vite/index.d.ts +0 -1
- package/dist/plugins/vite/index.js +1 -2
- package/dist/plugins/vitest/index.d.ts +1 -3
- package/dist/plugins/vitest/index.js +38 -24
- package/dist/plugins/vitest/types.d.ts +12 -0
- package/dist/plugins/vue/index.js +2 -5
- package/dist/plugins/webpack/index.d.ts +1 -5
- package/dist/plugins/webpack/index.js +36 -17
- package/dist/plugins/wrangler/index.d.ts +2 -2
- package/dist/plugins/wrangler/index.js +2 -2
- package/dist/plugins.js +1 -1
- package/dist/schema/configuration.d.ts +8 -8
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/config.d.ts +0 -2
- package/dist/types/project.d.ts +0 -1
- package/dist/util/cli-arguments.d.ts +2 -1
- package/dist/util/cli-arguments.js +2 -0
- package/dist/util/glob-core.d.ts +5 -6
- package/dist/util/glob-core.js +30 -31
- package/dist/util/input.d.ts +7 -1
- package/dist/util/input.js +7 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -3
|
@@ -7,8 +7,7 @@ const enablers = ['expo'];
|
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
8
|
const config = ['app.json', 'app.config.{ts,js}'];
|
|
9
9
|
const production = ['app/**/*.{js,jsx,ts,tsx}', 'src/app/**/*.{js,jsx,ts,tsx}'];
|
|
10
|
-
|
|
11
|
-
const resolveEntryPaths = async (localConfig, options) => {
|
|
10
|
+
const resolveConfig = async (localConfig, options) => {
|
|
12
11
|
const { manifest } = options;
|
|
13
12
|
const config = getConfig(localConfig, options);
|
|
14
13
|
if (manifest.main === 'expo-router/entry') {
|
|
@@ -21,16 +20,15 @@ const resolveEntryPaths = async (localConfig, options) => {
|
|
|
21
20
|
patterns = [join(options.root, '**/*.{js,jsx,ts,tsx}')];
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
|
-
return patterns.map(entry => toProductionEntry(entry));
|
|
23
|
+
return patterns.map(entry => toProductionEntry(entry)).concat(await getDependencies(localConfig, options));
|
|
25
24
|
}
|
|
26
|
-
return production.map(entry => toProductionEntry(entry));
|
|
25
|
+
return production.map(entry => toProductionEntry(entry)).concat(await getDependencies(localConfig, options));
|
|
27
26
|
};
|
|
28
|
-
const resolveConfig = async (expoConfig, options) => getDependencies(expoConfig, options);
|
|
29
27
|
export default {
|
|
30
28
|
title,
|
|
31
29
|
enablers,
|
|
32
30
|
isEnabled,
|
|
33
31
|
config,
|
|
34
|
-
|
|
32
|
+
production,
|
|
35
33
|
resolveConfig,
|
|
36
34
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
enablers: string[];
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
config: string[];
|
|
7
|
-
|
|
7
|
+
resolveConfig: ResolveConfig;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -7,7 +7,7 @@ const enablers = ['@actions/core'];
|
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
8
|
const config = ['action.{yml,yaml}'];
|
|
9
9
|
const isAssumeArtifact = (specifier) => /^(dist|build)\//.test(specifier);
|
|
10
|
-
const
|
|
10
|
+
const resolveConfig = async (config, options) => {
|
|
11
11
|
const inputs = [];
|
|
12
12
|
const filePaths = getActionDependencies(config, options);
|
|
13
13
|
for (const filePath of new Set(filePaths)) {
|
|
@@ -24,5 +24,5 @@ export default {
|
|
|
24
24
|
enablers,
|
|
25
25
|
isEnabled,
|
|
26
26
|
config,
|
|
27
|
-
|
|
27
|
+
resolveConfig,
|
|
28
28
|
};
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export declare const Plugins: {
|
|
|
21
21
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
22
22
|
config: string[];
|
|
23
23
|
entry: string[];
|
|
24
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./ava/types.js").AvaConfig>;
|
|
25
24
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./ava/types.js").AvaConfig>;
|
|
26
25
|
};
|
|
27
26
|
babel: {
|
|
@@ -37,7 +36,7 @@ export declare const Plugins: {
|
|
|
37
36
|
isEnabled: () => boolean;
|
|
38
37
|
config: string[];
|
|
39
38
|
packageJsonPath: (id: import("../types/package-json.js").PackageJson) => import("../types/package-json.js").PackageJson;
|
|
40
|
-
|
|
39
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("../types/package-json.js").PackageJson>;
|
|
41
40
|
};
|
|
42
41
|
c8: {
|
|
43
42
|
title: string;
|
|
@@ -97,7 +96,6 @@ export declare const Plugins: {
|
|
|
97
96
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
98
97
|
config: string[];
|
|
99
98
|
entry: string[];
|
|
100
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./cucumber/types.js").CucumberConfig>;
|
|
101
99
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./cucumber/types.js").CucumberConfig>;
|
|
102
100
|
};
|
|
103
101
|
cypress: {
|
|
@@ -106,7 +104,6 @@ export declare const Plugins: {
|
|
|
106
104
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
107
105
|
config: string[];
|
|
108
106
|
entry: string[];
|
|
109
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths;
|
|
110
107
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./cypress/types.js").CypressConfig>;
|
|
111
108
|
};
|
|
112
109
|
'dependency-cruiser': {
|
|
@@ -138,8 +135,7 @@ export declare const Plugins: {
|
|
|
138
135
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
139
136
|
config: string[];
|
|
140
137
|
production: string[];
|
|
141
|
-
|
|
142
|
-
resolveConfig: import("../types/config.js").ResolveConfig<Partial<import("./eleventy/types.js").EleventyConfig> | ((arg: import("./eleventy/helpers.js").DummyEleventyConfig) => Promise<Partial<import("./eleventy/types.js").EleventyConfig>>)>;
|
|
138
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./eleventy/types.js").EleventyConfigOrFn>;
|
|
143
139
|
};
|
|
144
140
|
eslint: {
|
|
145
141
|
title: string;
|
|
@@ -155,7 +151,7 @@ export declare const Plugins: {
|
|
|
155
151
|
enablers: string[];
|
|
156
152
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
157
153
|
config: string[];
|
|
158
|
-
|
|
154
|
+
production: string[];
|
|
159
155
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./expo/types.js").ExpoConfig>;
|
|
160
156
|
};
|
|
161
157
|
gatsby: {
|
|
@@ -171,7 +167,7 @@ export declare const Plugins: {
|
|
|
171
167
|
enablers: string[];
|
|
172
168
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
173
169
|
config: string[];
|
|
174
|
-
|
|
170
|
+
resolveConfig: import("../types/config.js").ResolveConfig;
|
|
175
171
|
};
|
|
176
172
|
'github-actions': {
|
|
177
173
|
title: string;
|
|
@@ -224,7 +220,6 @@ export declare const Plugins: {
|
|
|
224
220
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
225
221
|
config: string[];
|
|
226
222
|
entry: string[];
|
|
227
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./jest/types.js").JestConfig>;
|
|
228
223
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./jest/types.js").JestConfig>;
|
|
229
224
|
args: {
|
|
230
225
|
config: boolean;
|
|
@@ -235,9 +230,7 @@ export declare const Plugins: {
|
|
|
235
230
|
enablers: string[];
|
|
236
231
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
237
232
|
config: string[];
|
|
238
|
-
entry: string[];
|
|
239
233
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./karma/helpers.js").ConfigFile>;
|
|
240
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./karma/helpers.js").ConfigFile>;
|
|
241
234
|
};
|
|
242
235
|
ladle: {
|
|
243
236
|
title: string;
|
|
@@ -246,7 +239,6 @@ export declare const Plugins: {
|
|
|
246
239
|
config: string[];
|
|
247
240
|
entry: string[];
|
|
248
241
|
project: string[];
|
|
249
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./ladle/types.js").LadleConfig>;
|
|
250
242
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./ladle/types.js").LadleConfig>;
|
|
251
243
|
};
|
|
252
244
|
lefthook: {
|
|
@@ -295,7 +287,7 @@ export declare const Plugins: {
|
|
|
295
287
|
enablers: string[];
|
|
296
288
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
297
289
|
config: string[];
|
|
298
|
-
|
|
290
|
+
production: string[];
|
|
299
291
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./metro/types.js").MetroConfig>;
|
|
300
292
|
};
|
|
301
293
|
mocha: {
|
|
@@ -305,7 +297,6 @@ export declare const Plugins: {
|
|
|
305
297
|
config: string[];
|
|
306
298
|
entry: string[];
|
|
307
299
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./mocha/types.js").MochaConfig>;
|
|
308
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./mocha/types.js").MochaConfig>;
|
|
309
300
|
args: {
|
|
310
301
|
nodeImportArgs: boolean;
|
|
311
302
|
};
|
|
@@ -324,7 +315,7 @@ export declare const Plugins: {
|
|
|
324
315
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
325
316
|
config: string[];
|
|
326
317
|
entry: string[];
|
|
327
|
-
|
|
318
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./msw/types.js").MSWConfig>;
|
|
328
319
|
};
|
|
329
320
|
'nano-staged': {
|
|
330
321
|
title: string;
|
|
@@ -346,7 +337,6 @@ export declare const Plugins: {
|
|
|
346
337
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
347
338
|
config: string[];
|
|
348
339
|
production: string[];
|
|
349
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./netlify/types.js").NetlifyConfig>;
|
|
350
340
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./netlify/types.js").NetlifyConfig>;
|
|
351
341
|
};
|
|
352
342
|
next: {
|
|
@@ -362,7 +352,7 @@ export declare const Plugins: {
|
|
|
362
352
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
363
353
|
packageJsonPath: (id: import("../types/package-json.js").PackageJson) => import("../types/package-json.js").PackageJson;
|
|
364
354
|
config: string[];
|
|
365
|
-
|
|
355
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("../types/package-json.js").PackageJson>;
|
|
366
356
|
args: {
|
|
367
357
|
positional: boolean;
|
|
368
358
|
nodeImportArgs: boolean;
|
|
@@ -393,7 +383,7 @@ export declare const Plugins: {
|
|
|
393
383
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
394
384
|
config: string[];
|
|
395
385
|
production: string[];
|
|
396
|
-
|
|
386
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./nuxt/types.js").NuxtConfig>;
|
|
397
387
|
};
|
|
398
388
|
nx: {
|
|
399
389
|
title: string;
|
|
@@ -436,7 +426,6 @@ export declare const Plugins: {
|
|
|
436
426
|
config: string[];
|
|
437
427
|
entry: string[];
|
|
438
428
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./playwright/types.js").PlaywrightTestConfig>;
|
|
439
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./playwright/types.js").PlaywrightTestConfig>;
|
|
440
429
|
args: {
|
|
441
430
|
binaries: string[];
|
|
442
431
|
positional: boolean;
|
|
@@ -450,7 +439,6 @@ export declare const Plugins: {
|
|
|
450
439
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
451
440
|
config: string[];
|
|
452
441
|
entry: string[];
|
|
453
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./playwright/types.js").PlaywrightTestConfig>;
|
|
454
442
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./playwright/types.js").PlaywrightTestConfig>;
|
|
455
443
|
};
|
|
456
444
|
'playwright-test': {
|
|
@@ -482,7 +470,7 @@ export declare const Plugins: {
|
|
|
482
470
|
enablers: string[];
|
|
483
471
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
484
472
|
config: string[];
|
|
485
|
-
|
|
473
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./preconstruct/types.js").PreconstructConfig>;
|
|
486
474
|
};
|
|
487
475
|
prettier: {
|
|
488
476
|
title: string;
|
|
@@ -498,21 +486,20 @@ export declare const Plugins: {
|
|
|
498
486
|
config: string[];
|
|
499
487
|
entry: string[];
|
|
500
488
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./react-cosmos/types.js").ReactCosmosConfig>;
|
|
501
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./react-cosmos/types.js").ReactCosmosConfig>;
|
|
502
489
|
};
|
|
503
490
|
'react-router': {
|
|
504
491
|
title: string;
|
|
505
492
|
enablers: string[];
|
|
506
493
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
507
494
|
config: string[];
|
|
508
|
-
|
|
495
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./react-router/types.js").PluginConfig>;
|
|
509
496
|
};
|
|
510
497
|
relay: {
|
|
511
498
|
title: string;
|
|
512
499
|
enablers: string[];
|
|
513
500
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
514
501
|
config: string[];
|
|
515
|
-
|
|
502
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./relay/types.js").RelayConfig>;
|
|
516
503
|
args: {
|
|
517
504
|
binaries: string[];
|
|
518
505
|
args: (args: string[]) => string[];
|
|
@@ -589,6 +576,7 @@ export declare const Plugins: {
|
|
|
589
576
|
enablers: string[];
|
|
590
577
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
591
578
|
config: string[];
|
|
579
|
+
resolve: import("../types/config.js").Resolve;
|
|
592
580
|
};
|
|
593
581
|
sst: {
|
|
594
582
|
title: string;
|
|
@@ -611,7 +599,6 @@ export declare const Plugins: {
|
|
|
611
599
|
config: string[];
|
|
612
600
|
entry: string[];
|
|
613
601
|
project: string[];
|
|
614
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./storybook/types.js").StorybookConfig>;
|
|
615
602
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./storybook/types.js").StorybookConfig>;
|
|
616
603
|
};
|
|
617
604
|
stryker: {
|
|
@@ -634,6 +621,7 @@ export declare const Plugins: {
|
|
|
634
621
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
635
622
|
entry: string[];
|
|
636
623
|
production: string[];
|
|
624
|
+
resolve: import("../types/config.js").Resolve;
|
|
637
625
|
};
|
|
638
626
|
svgo: {
|
|
639
627
|
title: string;
|
|
@@ -751,7 +739,6 @@ export declare const Plugins: {
|
|
|
751
739
|
enablers: string[];
|
|
752
740
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
753
741
|
config: string[];
|
|
754
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./vitest/types.js").ViteConfigOrFn | import("./vitest/types.js").VitestWorkspaceConfig>;
|
|
755
742
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./vitest/types.js").ViteConfigOrFn | import("./vitest/types.js").VitestWorkspaceConfig>;
|
|
756
743
|
};
|
|
757
744
|
vitest: {
|
|
@@ -760,7 +747,6 @@ export declare const Plugins: {
|
|
|
760
747
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
761
748
|
config: string[];
|
|
762
749
|
entry: string[];
|
|
763
|
-
resolveEntryPaths: import("../types/config.js").ResolveEntryPaths<import("./vitest/types.js").ViteConfigOrFn | import("./vitest/types.js").VitestWorkspaceConfig>;
|
|
764
750
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./vitest/types.js").ViteConfigOrFn | import("./vitest/types.js").VitestWorkspaceConfig>;
|
|
765
751
|
args: {
|
|
766
752
|
config: boolean;
|
|
@@ -803,7 +789,7 @@ export declare const Plugins: {
|
|
|
803
789
|
enablers: string[];
|
|
804
790
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
805
791
|
config: string[];
|
|
806
|
-
|
|
792
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./wrangler/types.js").WranglerConfig>;
|
|
807
793
|
};
|
|
808
794
|
xo: {
|
|
809
795
|
title: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { JestConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -6,7 +6,6 @@ declare const _default: {
|
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
9
|
-
resolveEntryPaths: ResolveEntryPaths<JestConfig>;
|
|
10
9
|
resolveConfig: ResolveConfig<JestConfig>;
|
|
11
10
|
args: {
|
|
12
11
|
config: boolean;
|
|
@@ -74,16 +74,6 @@ const resolveDependencies = async (config, options) => {
|
|
|
74
74
|
...globalTeardown,
|
|
75
75
|
].map(id => (typeof id === 'string' ? toDeferResolve(id) : id));
|
|
76
76
|
};
|
|
77
|
-
const resolveEntryPaths = async (localConfig, options) => {
|
|
78
|
-
const { configFileDir } = options;
|
|
79
|
-
if (typeof localConfig === 'function')
|
|
80
|
-
localConfig = await localConfig();
|
|
81
|
-
const rootDir = localConfig.rootDir ?? configFileDir;
|
|
82
|
-
const replaceRootDir = (name) => name.replace(/<rootDir>/, rootDir);
|
|
83
|
-
if (localConfig.testMatch)
|
|
84
|
-
return localConfig.testMatch.map(replaceRootDir).map(id => toEntry(id));
|
|
85
|
-
return entry.map(id => toEntry(id));
|
|
86
|
-
};
|
|
87
77
|
const resolveConfig = async (localConfig, options) => {
|
|
88
78
|
const { configFileDir } = options;
|
|
89
79
|
if (typeof localConfig === 'function')
|
|
@@ -91,11 +81,14 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
91
81
|
const rootDir = localConfig.rootDir ?? configFileDir;
|
|
92
82
|
const replaceRootDir = (name) => name.replace(/<rootDir>/, rootDir);
|
|
93
83
|
const inputs = await resolveDependencies(localConfig, options);
|
|
84
|
+
const entries = localConfig.testMatch
|
|
85
|
+
? localConfig.testMatch.map(replaceRootDir).map(id => toEntry(id))
|
|
86
|
+
: entry.map(id => toEntry(id));
|
|
94
87
|
const result = inputs.map(dependency => {
|
|
95
88
|
dependency.specifier = replaceRootDir(dependency.specifier);
|
|
96
89
|
return dependency;
|
|
97
90
|
});
|
|
98
|
-
return result;
|
|
91
|
+
return entries.concat(result);
|
|
99
92
|
};
|
|
100
93
|
const args = {
|
|
101
94
|
config: true,
|
|
@@ -106,7 +99,6 @@ export default {
|
|
|
106
99
|
isEnabled,
|
|
107
100
|
config,
|
|
108
101
|
entry,
|
|
109
|
-
resolveEntryPaths,
|
|
110
102
|
resolveConfig,
|
|
111
103
|
args,
|
|
112
104
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import { type ConfigFile } from './helpers.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
|
-
entry: string[];
|
|
9
8
|
resolveConfig: ResolveConfig<ConfigFile>;
|
|
10
|
-
resolveEntryPaths: ResolveEntryPaths<ConfigFile>;
|
|
11
9
|
};
|
|
12
10
|
export default _default;
|
|
@@ -6,7 +6,6 @@ const title = 'Karma';
|
|
|
6
6
|
const enablers = ['karma'];
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
8
|
const config = configFiles;
|
|
9
|
-
const entry = [];
|
|
10
9
|
const resolveConfig = async (localConfig, options) => {
|
|
11
10
|
const inputs = new Set();
|
|
12
11
|
const config = loadConfig(localConfig);
|
|
@@ -16,13 +15,6 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
16
15
|
inputsFromFrameworks(config.frameworks).forEach(inputs.add, inputs);
|
|
17
16
|
}
|
|
18
17
|
inputsFromPlugins(config.plugins, options.manifest.devDependencies).forEach(inputs.add, inputs);
|
|
19
|
-
return Array.from(inputs);
|
|
20
|
-
};
|
|
21
|
-
const resolveEntryPaths = (localConfig, options) => {
|
|
22
|
-
const inputs = new Set();
|
|
23
|
-
const config = loadConfig(localConfig);
|
|
24
|
-
if (!config)
|
|
25
|
-
return [];
|
|
26
18
|
const basePath = config.basePath ?? '';
|
|
27
19
|
if (config.files) {
|
|
28
20
|
for (const fileOrPatternObj of config.files) {
|
|
@@ -42,7 +34,5 @@ export default {
|
|
|
42
34
|
enablers,
|
|
43
35
|
isEnabled,
|
|
44
36
|
config,
|
|
45
|
-
entry,
|
|
46
37
|
resolveConfig,
|
|
47
|
-
resolveEntryPaths,
|
|
48
38
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { LadleConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -7,7 +7,6 @@ declare const _default: {
|
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
9
9
|
project: string[];
|
|
10
|
-
resolveEntryPaths: ResolveEntryPaths<LadleConfig>;
|
|
11
10
|
resolveConfig: ResolveConfig<LadleConfig>;
|
|
12
11
|
};
|
|
13
12
|
export default _default;
|
|
@@ -10,19 +10,17 @@ const stories = ['src/**/*.stories.{js,jsx,ts,tsx,mdx}'];
|
|
|
10
10
|
const restEntry = ['.ladle/components.{js,jsx,ts,tsx}'];
|
|
11
11
|
const entry = [...restEntry, ...stories];
|
|
12
12
|
const project = ['.ladle/**/*.{js,jsx,ts,tsx}'];
|
|
13
|
-
const
|
|
13
|
+
const resolveConfig = async (localConfig, options) => {
|
|
14
14
|
const localStories = typeof localConfig.stories === 'string' ? [localConfig.stories] : localConfig.stories;
|
|
15
15
|
const viteConfig = localConfig.viteConfig ? [toAbsolute(localConfig.viteConfig, options.cwd)] : [];
|
|
16
16
|
const patterns = [...restEntry, ...(localStories ?? stories), ...viteConfig];
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
const resolveConfig = async (localConfig, options) => {
|
|
17
|
+
const entries = patterns.map(id => toEntry(id));
|
|
20
18
|
if (localConfig.viteConfig) {
|
|
21
19
|
const viteConfigPath = toAbsolute(localConfig.viteConfig, options.cwd);
|
|
22
20
|
const viteConfig = await load(viteConfigPath);
|
|
23
|
-
return resolveVitestConfig(viteConfig, options);
|
|
21
|
+
return entries.concat(await resolveVitestConfig(viteConfig, options));
|
|
24
22
|
}
|
|
25
|
-
return
|
|
23
|
+
return entries;
|
|
26
24
|
};
|
|
27
25
|
export default {
|
|
28
26
|
title,
|
|
@@ -31,6 +29,5 @@ export default {
|
|
|
31
29
|
config,
|
|
32
30
|
entry,
|
|
33
31
|
project,
|
|
34
|
-
resolveEntryPaths,
|
|
35
32
|
resolveConfig,
|
|
36
33
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { MetroConfig } from './types.js';
|
|
3
3
|
export declare const docs: {
|
|
4
4
|
note: string;
|
|
5
|
-
production: string[];
|
|
6
5
|
};
|
|
7
6
|
declare const _default: {
|
|
8
7
|
title: string;
|
|
9
8
|
enablers: string[];
|
|
10
9
|
isEnabled: IsPluginEnabled;
|
|
11
10
|
config: string[];
|
|
12
|
-
|
|
11
|
+
production: string[];
|
|
13
12
|
resolveConfig: ResolveConfig<MetroConfig>;
|
|
14
13
|
};
|
|
15
14
|
export default _default;
|
|
@@ -10,20 +10,23 @@ const DEFAULT_PLATFORMS = ['ios', 'android', 'windows', 'web'];
|
|
|
10
10
|
const PLATFORMS = [...DEFAULT_PLATFORMS, 'native', 'default'];
|
|
11
11
|
const DEFAULT_EXTENSIONS = ['js', 'jsx', 'json', 'ts', 'tsx'];
|
|
12
12
|
const production = [`src/**/*.{${PLATFORMS.join(',')}}.{${DEFAULT_EXTENSIONS.join(',')}}`];
|
|
13
|
-
const resolveEntryPaths = async (config) => {
|
|
14
|
-
const platformEntryPatterns = compact(PLATFORMS.concat(config.resolver?.platforms ?? []));
|
|
15
|
-
const sourceExts = config.resolver?.sourceExts ?? DEFAULT_EXTENSIONS;
|
|
16
|
-
const pattern = `src/**/*.{${platformEntryPatterns.join(',')}}.{${sourceExts.join(',')}}`;
|
|
17
|
-
if (!config.projectRoot)
|
|
18
|
-
return [toProductionEntry(pattern)];
|
|
19
|
-
const entryFilePattern = 'index.{js,jsx,ts,tsx}';
|
|
20
|
-
const entryFilePath = join(config.projectRoot, entryFilePattern);
|
|
21
|
-
const entryFilePaths = join(config.projectRoot, pattern);
|
|
22
|
-
return [toProductionEntry(entryFilePath), toProductionEntry(entryFilePaths)];
|
|
23
|
-
};
|
|
24
13
|
const resolveConfig = async (config) => {
|
|
25
14
|
const { transformerPath, transformer } = config;
|
|
15
|
+
const i = new Set();
|
|
26
16
|
const inputs = [];
|
|
17
|
+
const platformEntryPatterns = compact(PLATFORMS.concat(config.resolver?.platforms ?? []));
|
|
18
|
+
const sourceExts = config.resolver?.sourceExts ?? DEFAULT_EXTENSIONS;
|
|
19
|
+
const pattern = `src/**/*.{${platformEntryPatterns.join(',')}}.{${sourceExts.join(',')}}`;
|
|
20
|
+
if (!config.projectRoot) {
|
|
21
|
+
i.add(toProductionEntry(pattern));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const entryFilePattern = 'index.{js,jsx,ts,tsx}';
|
|
25
|
+
const entryFilePath = join(config.projectRoot, entryFilePattern);
|
|
26
|
+
const entryFilePaths = join(config.projectRoot, pattern);
|
|
27
|
+
i.add(toProductionEntry(entryFilePath));
|
|
28
|
+
i.add(toProductionEntry(entryFilePaths));
|
|
29
|
+
}
|
|
27
30
|
if (transformerPath)
|
|
28
31
|
inputs.push(transformerPath);
|
|
29
32
|
if (transformer?.assetPlugins)
|
|
@@ -32,16 +35,16 @@ const resolveConfig = async (config) => {
|
|
|
32
35
|
inputs.push(transformer.minifierPath);
|
|
33
36
|
if (transformer?.babelTransformerPath)
|
|
34
37
|
inputs.push(transformer.babelTransformerPath);
|
|
35
|
-
return [...inputs].map(toDeferResolve);
|
|
38
|
+
return Array.from(i).concat([...inputs].map(toDeferResolve));
|
|
36
39
|
};
|
|
37
40
|
const note = `False positives for platform-specific unused files?
|
|
38
41
|
Override the default \`entry\` patterns to match platforms and extensions.`;
|
|
39
|
-
export const docs = { note
|
|
42
|
+
export const docs = { note };
|
|
40
43
|
export default {
|
|
41
44
|
title,
|
|
42
45
|
enablers,
|
|
43
46
|
isEnabled,
|
|
44
47
|
config,
|
|
45
|
-
|
|
48
|
+
production,
|
|
46
49
|
resolveConfig,
|
|
47
50
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { MochaConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -7,7 +7,6 @@ declare const _default: {
|
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
9
9
|
resolveConfig: ResolveConfig<MochaConfig>;
|
|
10
|
-
resolveEntryPaths: ResolveEntryPaths<MochaConfig>;
|
|
11
10
|
args: {
|
|
12
11
|
nodeImportArgs: boolean;
|
|
13
12
|
};
|
|
@@ -5,13 +5,10 @@ const enablers = ['mocha'];
|
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['.mocharc.{js,cjs,json,jsonc,yml,yaml}', 'package.json'];
|
|
7
7
|
const entry = ['**/test/*.{js,cjs,mjs}'];
|
|
8
|
-
const resolveEntryPaths = localConfig => {
|
|
9
|
-
const entryPatterns = localConfig.spec ? [localConfig.spec].flat() : [];
|
|
10
|
-
return [...entryPatterns].map(id => toEntry(id));
|
|
11
|
-
};
|
|
12
8
|
const resolveConfig = localConfig => {
|
|
9
|
+
const entryPatterns = localConfig.spec ? [localConfig.spec].flat() : entry;
|
|
13
10
|
const require = localConfig.require ? [localConfig.require].flat() : [];
|
|
14
|
-
return [...require].map(id => toEntry(id));
|
|
11
|
+
return [...entryPatterns, ...require].map(id => toEntry(id));
|
|
15
12
|
};
|
|
16
13
|
const args = {
|
|
17
14
|
nodeImportArgs: true,
|
|
@@ -23,6 +20,5 @@ export default {
|
|
|
23
20
|
config,
|
|
24
21
|
entry,
|
|
25
22
|
resolveConfig,
|
|
26
|
-
resolveEntryPaths,
|
|
27
23
|
args,
|
|
28
24
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { MSWConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -6,6 +6,6 @@ declare const _default: {
|
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
9
|
-
|
|
9
|
+
resolveConfig: ResolveConfig<MSWConfig>;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -6,7 +6,7 @@ const enablers = ['msw'];
|
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
7
|
const config = ['package.json'];
|
|
8
8
|
const entry = ['mockServiceWorker.js'];
|
|
9
|
-
const
|
|
9
|
+
const resolveConfig = async (localConfig) => {
|
|
10
10
|
const workerDirectory = localConfig?.workerDirectory;
|
|
11
11
|
const dir = workerDirectory ? [workerDirectory].flat()[0] : '.';
|
|
12
12
|
return entry.map(pattern => toEntry(join(dir, pattern)));
|
|
@@ -17,5 +17,5 @@ export default {
|
|
|
17
17
|
isEnabled,
|
|
18
18
|
config,
|
|
19
19
|
entry,
|
|
20
|
-
|
|
20
|
+
resolveConfig,
|
|
21
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { NetlifyConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -6,7 +6,6 @@ declare const _default: {
|
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
production: string[];
|
|
9
|
-
resolveEntryPaths: ResolveEntryPaths<NetlifyConfig>;
|
|
10
9
|
resolveConfig: ResolveConfig<NetlifyConfig>;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
|
@@ -9,19 +9,17 @@ const config = ['netlify.toml'];
|
|
|
9
9
|
const NETLIFY_FUNCTIONS_DIR = 'netlify/functions';
|
|
10
10
|
const NETLIFY_FUNCTIONS_EXTS = 'js,mjs,cjs,ts,mts,cts';
|
|
11
11
|
const production = [`${NETLIFY_FUNCTIONS_DIR}/**/*.{${NETLIFY_FUNCTIONS_EXTS}}`];
|
|
12
|
-
const
|
|
12
|
+
const resolveConfig = async (localConfig) => {
|
|
13
13
|
return [
|
|
14
14
|
...extractFunctionsConfigProperty(localConfig.functions || {}, 'included_files'),
|
|
15
15
|
join(localConfig.functions?.directory ?? NETLIFY_FUNCTIONS_DIR, `**/*.{${NETLIFY_FUNCTIONS_EXTS}}`),
|
|
16
16
|
]
|
|
17
17
|
.filter(file => !file.startsWith('!'))
|
|
18
|
-
.map(id => toProductionEntry(id))
|
|
19
|
-
|
|
20
|
-
const resolveConfig = async (localConfig) => {
|
|
21
|
-
return [
|
|
18
|
+
.map(id => toProductionEntry(id))
|
|
19
|
+
.concat([
|
|
22
20
|
...(localConfig?.plugins?.map(plugin => plugin.package) ?? []).map(id => toDependency(id)),
|
|
23
21
|
...extractFunctionsConfigProperty(localConfig.functions || {}, 'external_node_modules').map(id => toDependency(id)),
|
|
24
|
-
];
|
|
22
|
+
]);
|
|
25
23
|
};
|
|
26
24
|
export default {
|
|
27
25
|
title,
|
|
@@ -29,6 +27,5 @@ export default {
|
|
|
29
27
|
isEnabled,
|
|
30
28
|
config,
|
|
31
29
|
production,
|
|
32
|
-
resolveEntryPaths,
|
|
33
30
|
resolveConfig,
|
|
34
31
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { PackageJson } from '../../types/package-json.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
packageJsonPath: (id: PackageJson) => PackageJson;
|
|
7
7
|
config: string[];
|
|
8
|
-
|
|
8
|
+
resolveConfig: ResolveConfig<PackageJson>;
|
|
9
9
|
args: {
|
|
10
10
|
positional: boolean;
|
|
11
11
|
nodeImportArgs: boolean;
|