knip 5.86.0 → 5.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigurationChief.d.ts +18 -0
- package/dist/DependencyDeputy.js +11 -1
- package/dist/binaries/bash-parser.js +3 -3
- package/dist/binaries/resolvers/find.js +19 -0
- package/dist/binaries/{package-manager → resolvers}/index.d.ts +1 -0
- package/dist/binaries/{package-manager → resolvers}/index.js +2 -0
- package/dist/binaries/{package-manager → resolvers}/pnpm.js +1 -0
- package/dist/binaries/resolvers/yarn.d.ts +2 -0
- package/dist/compilers/index.d.ts +30 -0
- package/dist/graph/analyze.js +2 -0
- package/dist/graph/build.js +3 -1
- package/dist/plugins/babel/index.js +3 -0
- package/dist/plugins/changesets/index.js +8 -1
- package/dist/plugins/changesets/types.d.ts +1 -0
- package/dist/plugins/docusaurus/index.js +15 -0
- package/dist/plugins/docusaurus/types.d.ts +16 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.js +6 -0
- package/dist/plugins/nuxt/index.js +6 -3
- package/dist/plugins/nx/index.js +10 -8
- package/dist/plugins/nx/types.d.ts +1 -0
- package/dist/plugins/openapi-ts/index.js +0 -9
- package/dist/plugins/oxfmt/index.d.ts +3 -0
- package/dist/plugins/oxfmt/index.js +16 -0
- package/dist/plugins/oxlint/index.js +1 -1
- package/dist/plugins/raycast/index.d.ts +3 -0
- package/dist/plugins/raycast/index.js +25 -0
- package/dist/plugins/raycast/types.d.ts +10 -0
- package/dist/plugins/sanity/index.d.ts +3 -0
- package/dist/plugins/sanity/index.js +12 -0
- package/dist/schema/configuration.d.ts +45 -0
- package/dist/schema/plugins.d.ts +15 -0
- package/dist/schema/plugins.js +3 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +3 -0
- package/dist/typescript/resolve-module-names.js +2 -2
- package/dist/util/Performance.d.ts +3 -5
- package/dist/util/Performance.js +35 -18
- package/dist/util/create-input-handler.js +2 -2
- package/dist/util/create-options.d.ts +30 -0
- package/dist/util/glob-core.js +34 -9
- package/dist/util/modules.d.ts +1 -1
- package/dist/util/modules.js +16 -6
- package/dist/util/path.js +1 -1
- package/dist/util/resolve.d.ts +2 -3
- package/dist/util/resolve.js +4 -3
- package/dist/util/watch.js +4 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schema.json +8 -0
- package/dist/plugins/openapi-ts/types.d.ts +0 -8
- /package/dist/binaries/{package-manager → resolvers}/bun.d.ts +0 -0
- /package/dist/binaries/{package-manager → resolvers}/bun.js +0 -0
- /package/dist/binaries/{package-manager → resolvers}/bunx.d.ts +0 -0
- /package/dist/binaries/{package-manager → resolvers}/bunx.js +0 -0
- /package/dist/binaries/{package-manager/npm.d.ts → resolvers/find.d.ts} +0 -0
- /package/dist/binaries/{package-manager/npx.d.ts → resolvers/npm.d.ts} +0 -0
- /package/dist/binaries/{package-manager → resolvers}/npm.js +0 -0
- /package/dist/binaries/{package-manager/pnpm.d.ts → resolvers/npx.d.ts} +0 -0
- /package/dist/binaries/{package-manager → resolvers}/npx.js +0 -0
- /package/dist/binaries/{package-manager/yarn.d.ts → resolvers/pnpm.d.ts} +0 -0
- /package/dist/binaries/{package-manager → resolvers}/pnpx.d.ts +0 -0
- /package/dist/binaries/{package-manager → resolvers}/pnpx.js +0 -0
- /package/dist/binaries/{package-manager → resolvers}/yarn.js +0 -0
- /package/dist/plugins/{openapi-ts → raycast}/types.js +0 -0
|
@@ -411,6 +411,11 @@ export declare class ConfigurationChief {
|
|
|
411
411
|
entry?: string | string[] | undefined;
|
|
412
412
|
project?: string | string[] | undefined;
|
|
413
413
|
} | undefined;
|
|
414
|
+
oxfmt?: string | boolean | string[] | {
|
|
415
|
+
config?: string | string[] | undefined;
|
|
416
|
+
entry?: string | string[] | undefined;
|
|
417
|
+
project?: string | string[] | undefined;
|
|
418
|
+
} | undefined;
|
|
414
419
|
oxlint?: string | boolean | string[] | {
|
|
415
420
|
config?: string | string[] | undefined;
|
|
416
421
|
entry?: string | string[] | undefined;
|
|
@@ -481,6 +486,11 @@ export declare class ConfigurationChief {
|
|
|
481
486
|
entry?: string | string[] | undefined;
|
|
482
487
|
project?: string | string[] | undefined;
|
|
483
488
|
} | undefined;
|
|
489
|
+
raycast?: string | boolean | string[] | {
|
|
490
|
+
config?: string | string[] | undefined;
|
|
491
|
+
entry?: string | string[] | undefined;
|
|
492
|
+
project?: string | string[] | undefined;
|
|
493
|
+
} | undefined;
|
|
484
494
|
'react-cosmos'?: string | boolean | string[] | {
|
|
485
495
|
config?: string | string[] | undefined;
|
|
486
496
|
entry?: string | string[] | undefined;
|
|
@@ -541,6 +551,11 @@ export declare class ConfigurationChief {
|
|
|
541
551
|
entry?: string | string[] | undefined;
|
|
542
552
|
project?: string | string[] | undefined;
|
|
543
553
|
} | undefined;
|
|
554
|
+
sanity?: string | boolean | string[] | {
|
|
555
|
+
config?: string | string[] | undefined;
|
|
556
|
+
entry?: string | string[] | undefined;
|
|
557
|
+
project?: string | string[] | undefined;
|
|
558
|
+
} | undefined;
|
|
544
559
|
'semantic-release'?: string | boolean | string[] | {
|
|
545
560
|
config?: string | string[] | undefined;
|
|
546
561
|
entry?: string | string[] | undefined;
|
|
@@ -837,6 +852,7 @@ export declare class ConfigurationChief {
|
|
|
837
852
|
nyc?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
838
853
|
oclif?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
839
854
|
"openapi-ts"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
855
|
+
oxfmt?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
840
856
|
oxlint?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
841
857
|
parcel?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
842
858
|
payload?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
@@ -850,6 +866,7 @@ export declare class ConfigurationChief {
|
|
|
850
866
|
prettier?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
851
867
|
prisma?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
852
868
|
qwik?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
869
|
+
raycast?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
853
870
|
"react-cosmos"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
854
871
|
"react-native"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
855
872
|
"react-router"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
@@ -862,6 +879,7 @@ export declare class ConfigurationChief {
|
|
|
862
879
|
rslib?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
863
880
|
rspack?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
864
881
|
rstest?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
882
|
+
sanity?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
865
883
|
"semantic-release"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
866
884
|
sentry?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
867
885
|
"simple-git-hooks"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
package/dist/DependencyDeputy.js
CHANGED
|
@@ -224,13 +224,18 @@ export class DependencyDeputy {
|
|
|
224
224
|
const position = peeker.getLocation('dependencies', symbol);
|
|
225
225
|
dependencyIssues.push({ type: 'dependencies', workspace, filePath, symbol, fixes: [], ...position });
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
const manifest = this._manifests.get(workspace);
|
|
228
|
+
for (const symbol of this.getDevDependencies(workspace)) {
|
|
229
|
+
if (!manifest.dependencies.includes(symbol) && !isNotReferencedDependency(symbol))
|
|
230
|
+
continue;
|
|
228
231
|
const position = peeker.getLocation('devDependencies', symbol);
|
|
229
232
|
devDependencyIssues.push({ type: 'devDependencies', filePath, workspace, symbol, fixes: [], ...position });
|
|
230
233
|
}
|
|
231
234
|
for (const symbol of this.getOptionalPeerDependencies(workspace)) {
|
|
232
235
|
if (!isReferencedDependency(symbol))
|
|
233
236
|
continue;
|
|
237
|
+
if (manifest.dependencies.includes(symbol) || manifest.devDependencies.includes(symbol))
|
|
238
|
+
continue;
|
|
234
239
|
const pos = peeker.getLocation('optionalPeerDependencies', symbol);
|
|
235
240
|
optionalPeerDependencyIssues.push({
|
|
236
241
|
type: 'optionalPeerDependencies',
|
|
@@ -253,6 +258,11 @@ export class DependencyDeputy {
|
|
|
253
258
|
if (!packageName)
|
|
254
259
|
continue;
|
|
255
260
|
if (IGNORED_DEPENDENCIES.has(packageName)) {
|
|
261
|
+
if (type === 'devDependencies') {
|
|
262
|
+
const manifest = this.getWorkspaceManifest(issue.workspace);
|
|
263
|
+
if (manifest?.dependencies.includes(packageName))
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
256
266
|
delete issueSet[issueKey];
|
|
257
267
|
counters[type]--;
|
|
258
268
|
}
|
|
@@ -6,7 +6,7 @@ import { extractBinary, isValidBinary } from "../util/modules.js";
|
|
|
6
6
|
import { relative } from "../util/path.js";
|
|
7
7
|
import { truncate } from "../util/string.js";
|
|
8
8
|
import { resolve as fallbackResolve } from "./fallback.js";
|
|
9
|
-
import
|
|
9
|
+
import KnownResolvers from "./resolvers/index.js";
|
|
10
10
|
import { resolve as resolverFromPlugins } from "./plugins.js";
|
|
11
11
|
import { parseNodeArgs } from "./util.js";
|
|
12
12
|
const spawningBinaries = ['cross-env', 'retry-cli'];
|
|
@@ -79,8 +79,8 @@ export const getDependenciesFromScript = (script, options) => {
|
|
|
79
79
|
.filter(args => args.require)
|
|
80
80
|
.flatMap(arg => arg.require)
|
|
81
81
|
.map(id => toDeferResolve(id));
|
|
82
|
-
if (binary in
|
|
83
|
-
const resolver =
|
|
82
|
+
if (binary in KnownResolvers) {
|
|
83
|
+
const resolver = KnownResolvers[binary];
|
|
84
84
|
return resolver(binary, args, { ...options, fromArgs });
|
|
85
85
|
}
|
|
86
86
|
if (pluginArgsMap.has(binary)) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { toBinary } from "../../util/input.js";
|
|
2
|
+
const execFlags = new Set(['-exec', '-execdir']);
|
|
3
|
+
const execTerminators = new Set([';', '\\;', '+']);
|
|
4
|
+
export const resolve = (binary, args, { fromArgs }) => {
|
|
5
|
+
const execIdx = args.findIndex(a => execFlags.has(a));
|
|
6
|
+
if (execIdx >= 0) {
|
|
7
|
+
const cmdWords = [];
|
|
8
|
+
for (let i = execIdx + 1; i < args.length; i++) {
|
|
9
|
+
const v = args[i];
|
|
10
|
+
if (execTerminators.has(v))
|
|
11
|
+
break;
|
|
12
|
+
if (v !== '{}')
|
|
13
|
+
cmdWords.push(v);
|
|
14
|
+
}
|
|
15
|
+
if (cmdWords.length > 0)
|
|
16
|
+
return [toBinary(binary), ...fromArgs(cmdWords)];
|
|
17
|
+
}
|
|
18
|
+
return [toBinary(binary)];
|
|
19
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
bun: import("../../types/config.ts").BinaryResolver;
|
|
3
3
|
bunx: import("../../types/config.ts").BinaryResolver;
|
|
4
|
+
find: import("../../types/config.ts").BinaryResolver;
|
|
4
5
|
npm: import("../../types/config.ts").BinaryResolver;
|
|
5
6
|
npx: import("../../types/config.ts").BinaryResolver;
|
|
6
7
|
pnpm: import("../../types/config.ts").BinaryResolver;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as bun from "./bun.js";
|
|
2
2
|
import * as bunx from "./bunx.js";
|
|
3
|
+
import * as find from "./find.js";
|
|
3
4
|
import * as npm from "./npm.js";
|
|
4
5
|
import * as npx from "./npx.js";
|
|
5
6
|
import * as pnpm from "./pnpm.js";
|
|
@@ -8,6 +9,7 @@ import * as yarn from "./yarn.js";
|
|
|
8
9
|
export default {
|
|
9
10
|
bun: bun.resolve,
|
|
10
11
|
bunx: bunx.resolve,
|
|
12
|
+
find: find.resolve,
|
|
11
13
|
npm: npm.resolve,
|
|
12
14
|
npx: npx.resolve,
|
|
13
15
|
pnpm: pnpm.resolve,
|
|
@@ -360,6 +360,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
360
360
|
entry?: string | string[] | undefined;
|
|
361
361
|
project?: string | string[] | undefined;
|
|
362
362
|
} | undefined;
|
|
363
|
+
oxfmt?: string | boolean | string[] | {
|
|
364
|
+
config?: string | string[] | undefined;
|
|
365
|
+
entry?: string | string[] | undefined;
|
|
366
|
+
project?: string | string[] | undefined;
|
|
367
|
+
} | undefined;
|
|
363
368
|
oxlint?: string | boolean | string[] | {
|
|
364
369
|
config?: string | string[] | undefined;
|
|
365
370
|
entry?: string | string[] | undefined;
|
|
@@ -430,6 +435,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
430
435
|
entry?: string | string[] | undefined;
|
|
431
436
|
project?: string | string[] | undefined;
|
|
432
437
|
} | undefined;
|
|
438
|
+
raycast?: string | boolean | string[] | {
|
|
439
|
+
config?: string | string[] | undefined;
|
|
440
|
+
entry?: string | string[] | undefined;
|
|
441
|
+
project?: string | string[] | undefined;
|
|
442
|
+
} | undefined;
|
|
433
443
|
'react-cosmos'?: string | boolean | string[] | {
|
|
434
444
|
config?: string | string[] | undefined;
|
|
435
445
|
entry?: string | string[] | undefined;
|
|
@@ -490,6 +500,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
490
500
|
entry?: string | string[] | undefined;
|
|
491
501
|
project?: string | string[] | undefined;
|
|
492
502
|
} | undefined;
|
|
503
|
+
sanity?: string | boolean | string[] | {
|
|
504
|
+
config?: string | string[] | undefined;
|
|
505
|
+
entry?: string | string[] | undefined;
|
|
506
|
+
project?: string | string[] | undefined;
|
|
507
|
+
} | undefined;
|
|
493
508
|
'semantic-release'?: string | boolean | string[] | {
|
|
494
509
|
config?: string | string[] | undefined;
|
|
495
510
|
entry?: string | string[] | undefined;
|
|
@@ -1051,6 +1066,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1051
1066
|
entry?: string | string[] | undefined;
|
|
1052
1067
|
project?: string | string[] | undefined;
|
|
1053
1068
|
} | undefined;
|
|
1069
|
+
oxfmt?: string | boolean | string[] | {
|
|
1070
|
+
config?: string | string[] | undefined;
|
|
1071
|
+
entry?: string | string[] | undefined;
|
|
1072
|
+
project?: string | string[] | undefined;
|
|
1073
|
+
} | undefined;
|
|
1054
1074
|
oxlint?: string | boolean | string[] | {
|
|
1055
1075
|
config?: string | string[] | undefined;
|
|
1056
1076
|
entry?: string | string[] | undefined;
|
|
@@ -1121,6 +1141,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1121
1141
|
entry?: string | string[] | undefined;
|
|
1122
1142
|
project?: string | string[] | undefined;
|
|
1123
1143
|
} | undefined;
|
|
1144
|
+
raycast?: string | boolean | string[] | {
|
|
1145
|
+
config?: string | string[] | undefined;
|
|
1146
|
+
entry?: string | string[] | undefined;
|
|
1147
|
+
project?: string | string[] | undefined;
|
|
1148
|
+
} | undefined;
|
|
1124
1149
|
'react-cosmos'?: string | boolean | string[] | {
|
|
1125
1150
|
config?: string | string[] | undefined;
|
|
1126
1151
|
entry?: string | string[] | undefined;
|
|
@@ -1181,6 +1206,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1181
1206
|
entry?: string | string[] | undefined;
|
|
1182
1207
|
project?: string | string[] | undefined;
|
|
1183
1208
|
} | undefined;
|
|
1209
|
+
sanity?: string | boolean | string[] | {
|
|
1210
|
+
config?: string | string[] | undefined;
|
|
1211
|
+
entry?: string | string[] | undefined;
|
|
1212
|
+
project?: string | string[] | undefined;
|
|
1213
|
+
} | undefined;
|
|
1184
1214
|
'semantic-release'?: string | boolean | string[] | {
|
|
1185
1215
|
config?: string | string[] | undefined;
|
|
1186
1216
|
entry?: string | string[] | undefined;
|
package/dist/graph/analyze.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createGraphExplorer } from "../graph-explorer/explorer.js";
|
|
|
2
2
|
import { getIssueType, hasStrictlyEnumReferences } from "../graph-explorer/utils.js";
|
|
3
3
|
import traceReporter from "../reporters/trace.js";
|
|
4
4
|
import { getPackageNameFromModuleSpecifier } from "../util/modules.js";
|
|
5
|
+
import { perfObserver } from "../util/Performance.js";
|
|
5
6
|
import { findMatch } from "../util/regex.js";
|
|
6
7
|
import { getShouldIgnoreHandler, getShouldIgnoreTagHandler } from "../util/tag.js";
|
|
7
8
|
export const analyze = async ({ analyzedFiles, counselor, chief, collector, deputy, entryPaths, factory, graph, streamer, unreferencedFiles, options, }) => {
|
|
@@ -245,6 +246,7 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
|
|
|
245
246
|
collector.addConfigurationHint(hint);
|
|
246
247
|
};
|
|
247
248
|
await analyzeGraph();
|
|
249
|
+
perfObserver.addMemoryMark('analyze');
|
|
248
250
|
if (options.isTrace) {
|
|
249
251
|
traceReporter({ graph, explorer, options, workspaceFilePathFilter: chief.workspaceFilePathFilter });
|
|
250
252
|
}
|
package/dist/graph/build.js
CHANGED
|
@@ -371,6 +371,7 @@ export async function build({ chief, collector, counselor, deputy, factory, isGi
|
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
|
+
perfObserver.addMemoryMark('init');
|
|
374
375
|
for (let i = 0; i < principals.length; ++i) {
|
|
375
376
|
const principal = principals[i];
|
|
376
377
|
if (!principal)
|
|
@@ -400,7 +401,7 @@ export async function build({ chief, collector, counselor, deputy, factory, isGi
|
|
|
400
401
|
factory.deletePrincipal(principal, options.cwd);
|
|
401
402
|
principals[i] = undefined;
|
|
402
403
|
}
|
|
403
|
-
perfObserver.addMemoryMark(factory.getPrincipalCount());
|
|
404
|
+
perfObserver.addMemoryMark(`P${factory.getPrincipalCount()}`);
|
|
404
405
|
}
|
|
405
406
|
if (!options.isWatch && !options.isSession && options.isSkipLibs && !options.isIsolateWorkspaces) {
|
|
406
407
|
for (const principal of principals) {
|
|
@@ -409,6 +410,7 @@ export async function build({ chief, collector, counselor, deputy, factory, isGi
|
|
|
409
410
|
}
|
|
410
411
|
principals.length = 0;
|
|
411
412
|
}
|
|
413
|
+
perfObserver.addMemoryMark('build');
|
|
412
414
|
if (externalRefsFromInputs) {
|
|
413
415
|
for (const [filePath, refs] of externalRefsFromInputs) {
|
|
414
416
|
if (!graph.has(filePath))
|
|
@@ -15,6 +15,9 @@ export const getDependenciesFromConfig = (config) => {
|
|
|
15
15
|
return compact([
|
|
16
16
|
...presets.map(id => toDeferResolve(id)),
|
|
17
17
|
...plugins.map(id => toDeferResolve(id)),
|
|
18
|
+
...(plugins.includes('@babel/plugin-transform-runtime')
|
|
19
|
+
? [toDeferResolve('@babel/runtime', { optional: true })]
|
|
20
|
+
: []),
|
|
18
21
|
...nested,
|
|
19
22
|
...overrides,
|
|
20
23
|
]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toDependency } from "../../util/input.js";
|
|
2
|
+
import { getPackageNameFromFilePath } from "../../util/modules.js";
|
|
2
3
|
import { hasDependency } from "../../util/plugin.js";
|
|
3
4
|
const title = 'Changesets';
|
|
4
5
|
const enablers = ['@changesets/cli'];
|
|
@@ -6,11 +7,17 @@ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
|
6
7
|
const isRootOnly = true;
|
|
7
8
|
const config = ['.changeset/config.json'];
|
|
8
9
|
const resolveConfig = config => {
|
|
9
|
-
|
|
10
|
+
const inputs = (Array.isArray(config.changelog)
|
|
10
11
|
? [config.changelog[0]]
|
|
11
12
|
: typeof config.changelog === 'string'
|
|
12
13
|
? [config.changelog]
|
|
13
14
|
: []).map(id => toDependency(id));
|
|
15
|
+
if (config.$schema?.includes('node_modules/')) {
|
|
16
|
+
const packageName = getPackageNameFromFilePath(config.$schema);
|
|
17
|
+
if (packageName)
|
|
18
|
+
inputs.push(toDependency(packageName));
|
|
19
|
+
}
|
|
20
|
+
return inputs;
|
|
14
21
|
};
|
|
15
22
|
const plugin = {
|
|
16
23
|
title,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toAlias, toDependency, toEntry, toIgnore, toProductionEntry } from "../../util/input.js";
|
|
2
|
+
import { join } from "../../util/path.js";
|
|
2
3
|
import { hasDependency } from "../../util/plugin.js";
|
|
3
4
|
import { CORE_CLIENT_API, resolveConfigItems } from "./helpers.js";
|
|
4
5
|
const title = 'Docusaurus';
|
|
@@ -7,22 +8,36 @@ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
|
7
8
|
const config = ['docusaurus.config.{js,mjs,ts}'];
|
|
8
9
|
const production = ['src/pages/**/*.{js,ts,jsx,tsx}', '{blog,docs}/**/*.mdx', 'versioned_docs/**/*.{mdx,jsx,tsx}'];
|
|
9
10
|
const entry = ['babel.config.{js,cjs,mjs,cts}'];
|
|
11
|
+
const resolveStaticAssets = (items, cwd) => {
|
|
12
|
+
const entries = [];
|
|
13
|
+
for (const item of items ?? []) {
|
|
14
|
+
const value = typeof item === 'string' ? item : (item.src ?? item.href);
|
|
15
|
+
if (typeof value === 'string' && !value.includes('://'))
|
|
16
|
+
entries.push(toProductionEntry(join(cwd, 'static', value)));
|
|
17
|
+
}
|
|
18
|
+
return entries;
|
|
19
|
+
};
|
|
10
20
|
const resolveConfig = async (config, options) => {
|
|
11
21
|
const themes = await resolveConfigItems(config.themes ?? [], 'theme', options);
|
|
12
22
|
const plugins = await resolveConfigItems(config.plugins ?? [], 'plugin', options);
|
|
13
23
|
const presets = await resolveConfigItems(config.presets ?? [], 'preset', options);
|
|
14
24
|
const hasClassicTheme = options.manifest.dependencies?.['@docusaurus/theme-classic'] ||
|
|
15
25
|
options.manifest.dependencies?.['@docusaurus/preset-classic'];
|
|
26
|
+
const scripts = resolveStaticAssets(config.scripts ?? [], options.cwd);
|
|
27
|
+
const stylesheets = resolveStaticAssets(config.stylesheets ?? [], options.cwd);
|
|
16
28
|
return [
|
|
17
29
|
toAlias('@site/*', './*'),
|
|
18
30
|
toDependency('@docusaurus/module-type-aliases', { optional: true }),
|
|
19
31
|
...(hasClassicTheme ? [toIgnore('(@theme|@theme-init|@theme-original)/*', 'dependencies')] : []),
|
|
20
32
|
toIgnore(`@docusaurus/(${CORE_CLIENT_API.join('|')})`, 'dependencies'),
|
|
33
|
+
...(config.future?.experimental_faster ? [toDependency('@docusaurus/faster')] : []),
|
|
21
34
|
...production.map(id => toProductionEntry(id)),
|
|
22
35
|
...entry.map(id => toEntry(id)),
|
|
23
36
|
...themes,
|
|
24
37
|
...plugins,
|
|
25
38
|
...presets,
|
|
39
|
+
...scripts,
|
|
40
|
+
...stylesheets,
|
|
26
41
|
];
|
|
27
42
|
};
|
|
28
43
|
const plugin = {
|
|
@@ -30,11 +30,27 @@ type PluginConfig = string | [string, PluginOptions] | false | null | {
|
|
|
30
30
|
type PresetConfig = string | [string, PresetOptions] | false | null;
|
|
31
31
|
type Config = PresetConfig | PluginConfig;
|
|
32
32
|
export type ConfigItem = Config | (() => Config);
|
|
33
|
+
type ScriptTag = {
|
|
34
|
+
src: string;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
type StylesheetLink = {
|
|
38
|
+
href: string;
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
};
|
|
33
41
|
export type DocusaurusConfig = {
|
|
34
42
|
title: string;
|
|
35
43
|
url: string;
|
|
36
44
|
themes?: PluginConfig[];
|
|
37
45
|
plugins?: PluginConfig[];
|
|
38
46
|
presets: PresetConfig[];
|
|
47
|
+
scripts?: (string | ScriptTag)[];
|
|
48
|
+
stylesheets?: (string | StylesheetLink)[];
|
|
49
|
+
future?: {
|
|
50
|
+
experimental_faster?: boolean | {
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
};
|
|
39
55
|
};
|
|
40
56
|
export {};
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export declare const Plugins: {
|
|
|
75
75
|
nyc: import("../types/config.ts").Plugin;
|
|
76
76
|
oclif: import("../types/config.ts").Plugin;
|
|
77
77
|
'openapi-ts': import("../types/config.ts").Plugin;
|
|
78
|
+
oxfmt: import("../types/config.ts").Plugin;
|
|
78
79
|
oxlint: import("../types/config.ts").Plugin;
|
|
79
80
|
parcel: import("../types/config.ts").Plugin;
|
|
80
81
|
payload: import("../types/config.ts").Plugin;
|
|
@@ -89,6 +90,7 @@ export declare const Plugins: {
|
|
|
89
90
|
prettier: import("../types/config.ts").Plugin;
|
|
90
91
|
prisma: import("../types/config.ts").Plugin;
|
|
91
92
|
qwik: import("../types/config.ts").Plugin;
|
|
93
|
+
raycast: import("../types/config.ts").Plugin;
|
|
92
94
|
'react-cosmos': import("../types/config.ts").Plugin;
|
|
93
95
|
'react-native': import("../types/config.ts").Plugin;
|
|
94
96
|
'react-router': import("../types/config.ts").Plugin;
|
|
@@ -101,6 +103,7 @@ export declare const Plugins: {
|
|
|
101
103
|
rslib: import("../types/config.ts").Plugin;
|
|
102
104
|
rspack: import("../types/config.ts").Plugin;
|
|
103
105
|
rstest: import("../types/config.ts").Plugin;
|
|
106
|
+
sanity: import("../types/config.ts").Plugin;
|
|
104
107
|
'semantic-release': import("../types/config.ts").Plugin;
|
|
105
108
|
sentry: import("../types/config.ts").Plugin;
|
|
106
109
|
'simple-git-hooks': import("../types/config.ts").Plugin;
|
package/dist/plugins/index.js
CHANGED
|
@@ -69,6 +69,7 @@ import { default as nx } from "./nx/index.js";
|
|
|
69
69
|
import { default as nyc } from "./nyc/index.js";
|
|
70
70
|
import { default as oclif } from "./oclif/index.js";
|
|
71
71
|
import { default as openapiTs } from "./openapi-ts/index.js";
|
|
72
|
+
import { default as oxfmt } from "./oxfmt/index.js";
|
|
72
73
|
import { default as oxlint } from "./oxlint/index.js";
|
|
73
74
|
import { default as parcel } from "./parcel/index.js";
|
|
74
75
|
import { default as payload } from "./payload/index.js";
|
|
@@ -83,6 +84,7 @@ import { default as preconstruct } from "./preconstruct/index.js";
|
|
|
83
84
|
import { default as prettier } from "./prettier/index.js";
|
|
84
85
|
import { default as prisma } from "./prisma/index.js";
|
|
85
86
|
import { default as qwik } from "./qwik/index.js";
|
|
87
|
+
import { default as raycast } from "./raycast/index.js";
|
|
86
88
|
import { default as reactCosmos } from "./react-cosmos/index.js";
|
|
87
89
|
import { default as reactNative } from "./react-native/index.js";
|
|
88
90
|
import { default as reactRouter } from "./react-router/index.js";
|
|
@@ -95,6 +97,7 @@ import { default as rsbuild } from "./rsbuild/index.js";
|
|
|
95
97
|
import { default as rslib } from "./rslib/index.js";
|
|
96
98
|
import { default as rspack } from "./rspack/index.js";
|
|
97
99
|
import { default as rstest } from "./rstest/index.js";
|
|
100
|
+
import { default as sanity } from "./sanity/index.js";
|
|
98
101
|
import { default as semanticRelease } from "./semantic-release/index.js";
|
|
99
102
|
import { default as sentry } from "./sentry/index.js";
|
|
100
103
|
import { default as simpleGitHooks } from "./simple-git-hooks/index.js";
|
|
@@ -208,6 +211,7 @@ export const Plugins = {
|
|
|
208
211
|
nyc,
|
|
209
212
|
oclif,
|
|
210
213
|
'openapi-ts': openapiTs,
|
|
214
|
+
oxfmt,
|
|
211
215
|
oxlint,
|
|
212
216
|
parcel,
|
|
213
217
|
payload,
|
|
@@ -222,6 +226,7 @@ export const Plugins = {
|
|
|
222
226
|
prettier,
|
|
223
227
|
prisma,
|
|
224
228
|
qwik,
|
|
229
|
+
raycast,
|
|
225
230
|
'react-cosmos': reactCosmos,
|
|
226
231
|
'react-native': reactNative,
|
|
227
232
|
'react-router': reactRouter,
|
|
@@ -234,6 +239,7 @@ export const Plugins = {
|
|
|
234
239
|
rslib,
|
|
235
240
|
rspack,
|
|
236
241
|
rstest,
|
|
242
|
+
sanity,
|
|
237
243
|
'semantic-release': semanticRelease,
|
|
238
244
|
sentry,
|
|
239
245
|
'simple-git-hooks': simpleGitHooks,
|
|
@@ -162,9 +162,12 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
162
162
|
}
|
|
163
163
|
for (const ext of localConfig.extends ?? []) {
|
|
164
164
|
const resolved = resolveAlias(ext, srcDir, cwd);
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
const configs = _syncGlob({ cwd: resolved, patterns: config });
|
|
166
|
+
if (configs.length > 0)
|
|
167
|
+
for (const cfg of configs)
|
|
168
|
+
inputs.push(toConfig('nuxt', join(resolved, cfg)));
|
|
169
|
+
else
|
|
170
|
+
inputs.push(toDependency(ext));
|
|
168
171
|
}
|
|
169
172
|
for (const layerConfig of findLayerConfigs(cwd)) {
|
|
170
173
|
inputs.push(toConfig('nuxt', layerConfig));
|
package/dist/plugins/nx/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { compact } from "../../util/array.js";
|
|
2
2
|
import { toConfig, toDependency } from "../../util/input.js";
|
|
3
|
+
import { join } from "../../util/path.js";
|
|
3
4
|
import { hasDependency } from "../../util/plugin.js";
|
|
4
5
|
const title = 'Nx';
|
|
5
6
|
const enablers = ['nx', /^@nrwl\//, /^@nx\//];
|
|
@@ -34,18 +35,19 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
34
35
|
.map(target => target?.executor)
|
|
35
36
|
.filter(executor => executor && !executor.startsWith('.'))
|
|
36
37
|
.map(executor => executor?.split(':')[0]);
|
|
37
|
-
const
|
|
38
|
+
const inputs = targets
|
|
38
39
|
.filter(target => target.executor === 'nx:run-commands' || target.command)
|
|
39
40
|
.flatMap(target => {
|
|
41
|
+
let commands = [];
|
|
40
42
|
if (target.command)
|
|
41
|
-
|
|
42
|
-
if (target.options?.command)
|
|
43
|
-
|
|
44
|
-
if (target.options?.commands)
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
commands = [target.command];
|
|
44
|
+
else if (target.options?.command)
|
|
45
|
+
commands = [target.options.command];
|
|
46
|
+
else if (target.options?.commands)
|
|
47
|
+
commands = target.options.commands.map(commandConfig => typeof commandConfig === 'string' ? commandConfig : commandConfig.command);
|
|
48
|
+
const cwd = target.options?.cwd ? join(options.cwd, target.options.cwd) : undefined;
|
|
49
|
+
return options.getInputsFromScripts(commands, { cwd });
|
|
47
50
|
});
|
|
48
|
-
const inputs = options.getInputsFromScripts(scripts);
|
|
49
51
|
const configInputs = targets.flatMap(target => {
|
|
50
52
|
const opts = target.options;
|
|
51
53
|
if (!opts)
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { toDependency } from "../../util/input.js";
|
|
2
1
|
import { hasDependency } from "../../util/plugin.js";
|
|
3
2
|
import { toC12config } from "../../util/plugin-config.js";
|
|
4
3
|
const title = 'openapi-ts';
|
|
5
4
|
const enablers = ['@hey-api/openapi-ts'];
|
|
6
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
6
|
const config = ['package.json', ...toC12config('openapi-ts')];
|
|
8
|
-
const resolveConfig = config => {
|
|
9
|
-
const configs = Array.isArray(config) ? config : [config];
|
|
10
|
-
return configs.flatMap(config => (config.plugins ?? [])
|
|
11
|
-
.map(plugin => (typeof plugin === 'string' ? plugin : plugin.name))
|
|
12
|
-
.filter((name) => typeof name === 'string')
|
|
13
|
-
.map(id => toDependency(id)));
|
|
14
|
-
};
|
|
15
7
|
const plugin = {
|
|
16
8
|
title,
|
|
17
9
|
enablers,
|
|
18
10
|
isEnabled,
|
|
19
11
|
config,
|
|
20
|
-
resolveConfig,
|
|
21
12
|
};
|
|
22
13
|
export default plugin;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { hasDependency } from "../../util/plugin.js";
|
|
2
|
+
const title = 'Oxfmt';
|
|
3
|
+
const enablers = ['oxfmt'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = ['.oxfmtrc.json', '.oxfmtrc.jsonc', 'oxfmt.config.ts'];
|
|
6
|
+
const args = {
|
|
7
|
+
config: true,
|
|
8
|
+
};
|
|
9
|
+
const plugin = {
|
|
10
|
+
title,
|
|
11
|
+
enablers,
|
|
12
|
+
isEnabled,
|
|
13
|
+
config,
|
|
14
|
+
args,
|
|
15
|
+
};
|
|
16
|
+
export default plugin;
|
|
@@ -2,7 +2,7 @@ import { hasDependency } from "../../util/plugin.js";
|
|
|
2
2
|
const title = 'Oxlint';
|
|
3
3
|
const enablers = ['oxlint'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const config = ['.oxlintrc.json'];
|
|
5
|
+
const config = ['.oxlintrc.json', 'oxlint.config.ts'];
|
|
6
6
|
const args = {
|
|
7
7
|
config: true,
|
|
8
8
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { compact } from "../../util/array.js";
|
|
2
|
+
import { toProductionEntry } from "../../util/input.js";
|
|
3
|
+
import { hasDependency } from "../../util/plugin.js";
|
|
4
|
+
const title = 'Raycast';
|
|
5
|
+
const enablers = ['@raycast/api'];
|
|
6
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
+
const config = ['package.json'];
|
|
8
|
+
const packageJsonPath = (manifest) => manifest;
|
|
9
|
+
const mapEntries = (items, directory) => {
|
|
10
|
+
const names = compact((items ?? []).map(item => (typeof item.name === 'string' ? item.name : undefined)));
|
|
11
|
+
return names.map(name => toProductionEntry(`${directory}${name}.{js,jsx,ts,tsx}`));
|
|
12
|
+
};
|
|
13
|
+
const resolveConfig = async (manifest) => [
|
|
14
|
+
...mapEntries(manifest.commands, 'src/'),
|
|
15
|
+
...mapEntries(manifest.tools, 'src/tools/'),
|
|
16
|
+
];
|
|
17
|
+
const plugin = {
|
|
18
|
+
title,
|
|
19
|
+
enablers,
|
|
20
|
+
isEnabled,
|
|
21
|
+
config,
|
|
22
|
+
packageJsonPath,
|
|
23
|
+
resolveConfig,
|
|
24
|
+
};
|
|
25
|
+
export default plugin;
|