knip 5.66.1 → 5.66.2
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/graph/build.js
CHANGED
|
@@ -78,7 +78,8 @@ export async function build({ chief, collector, deputy, factory, isGitIgnored, s
|
|
|
78
78
|
collector.addIgnorePatterns(config.ignore.map(p => join(options.cwd, prependDirToPattern(name, p))));
|
|
79
79
|
collector.addIgnoreFilesPatterns(config.ignoreFiles.map(p => join(options.cwd, prependDirToPattern(name, p))));
|
|
80
80
|
const entrySpecifiersFromManifest = getEntrySpecifiersFromManifest(manifest);
|
|
81
|
-
|
|
81
|
+
const label = 'entry paths from package.json';
|
|
82
|
+
for (const filePath of await toSourceFilePaths(entrySpecifiersFromManifest, dir, extensionGlobStr, label)) {
|
|
82
83
|
inputs.add(toProductionEntry(filePath));
|
|
83
84
|
}
|
|
84
85
|
for (const identifier of entrySpecifiersFromManifest) {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Rsbuild';
|
|
4
4
|
const enablers = ['@rsbuild/core'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['rsbuild*.config.{mjs,ts,js,cjs,mts,cts}'];
|
|
7
7
|
const resolveConfig = async (config) => {
|
|
8
|
-
const
|
|
8
|
+
const entries = new Set();
|
|
9
9
|
const checkSource = (source) => {
|
|
10
10
|
if (source?.entry) {
|
|
11
11
|
for (const entry of Object.values(source.entry)) {
|
|
12
12
|
if (typeof entry === 'string')
|
|
13
|
-
|
|
13
|
+
entries.add(entry);
|
|
14
14
|
else if (Array.isArray(entry))
|
|
15
15
|
for (const e of entry)
|
|
16
|
-
|
|
16
|
+
entries.add(e);
|
|
17
17
|
else {
|
|
18
18
|
if (typeof entry.import === 'string')
|
|
19
|
-
|
|
19
|
+
entries.add(entry.import);
|
|
20
20
|
else if (Array.isArray(entry.import))
|
|
21
21
|
for (const e of entry.import)
|
|
22
|
-
|
|
22
|
+
entries.add(e);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -30,7 +30,7 @@ const resolveConfig = async (config) => {
|
|
|
30
30
|
checkSource(environment.source);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
return Array.from(
|
|
33
|
+
return Array.from(entries).map(input => toProductionEntry(input));
|
|
34
34
|
};
|
|
35
35
|
export default {
|
|
36
36
|
title,
|
|
@@ -2,5 +2,5 @@ import type { CompilerOptions } from 'typescript';
|
|
|
2
2
|
import type { ConfigurationChief, Workspace } from '../ConfigurationChief.js';
|
|
3
3
|
export declare const augmentWorkspace: (workspace: Workspace, dir: string, compilerOptions: CompilerOptions) => void;
|
|
4
4
|
export declare const getToSourcePathHandler: (chief: ConfigurationChief) => (filePath: string) => string | undefined;
|
|
5
|
-
export declare const getToSourcePathsHandler: (chief: ConfigurationChief) => (specifiers: Set<string>, dir: string, extensions
|
|
5
|
+
export declare const getToSourcePathsHandler: (chief: ConfigurationChief) => (specifiers: Set<string>, dir: string, extensions: string | undefined, label: string) => Promise<string[]>;
|
|
6
6
|
export type ToSourceFilePath = ReturnType<typeof getToSourcePathHandler>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_EXTENSIONS } from '../constants.js';
|
|
2
2
|
import { debugLog, debugLogArray } from './debug.js';
|
|
3
3
|
import { isDirectory } from './fs.js';
|
|
4
|
-
import { _glob, _syncGlob } from './glob.js';
|
|
4
|
+
import { _glob, _syncGlob, prependDirToPattern } from './glob.js';
|
|
5
5
|
import { isAbsolute, isInternal, join, toRelative } from './path.js';
|
|
6
6
|
const defaultExtensions = `.{${DEFAULT_EXTENSIONS.map(ext => ext.slice(1)).join(',')}}`;
|
|
7
7
|
const hasTSExt = /(?<!\.d)\.(m|c)?tsx?$/;
|
|
@@ -35,10 +35,10 @@ export const getToSourcePathHandler = (chief) => {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
export const getToSourcePathsHandler = (chief) => {
|
|
38
|
-
return async (specifiers, dir, extensions = defaultExtensions) => {
|
|
38
|
+
return async (specifiers, dir, extensions = defaultExtensions, label) => {
|
|
39
39
|
const patterns = new Set();
|
|
40
40
|
for (const specifier of specifiers) {
|
|
41
|
-
const absSpecifier = isAbsolute(specifier) ? specifier :
|
|
41
|
+
const absSpecifier = isAbsolute(specifier) ? specifier : prependDirToPattern(dir, specifier);
|
|
42
42
|
const ws = chief.findWorkspaceByFilePath(absSpecifier);
|
|
43
43
|
if (ws?.srcDir && ws.outDir && !absSpecifier.startsWith(ws.srcDir) && absSpecifier.startsWith(ws.outDir)) {
|
|
44
44
|
const pattern = absSpecifier.replace(ws.outDir, ws.srcDir).replace(matchExt, extensions);
|
|
@@ -48,7 +48,7 @@ export const getToSourcePathsHandler = (chief) => {
|
|
|
48
48
|
patterns.add(absSpecifier);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
const filePaths = await _glob({ patterns: Array.from(patterns), cwd: dir });
|
|
51
|
+
const filePaths = await _glob({ patterns: Array.from(patterns), cwd: dir, label });
|
|
52
52
|
debugLogArray(toRelative(dir, chief.cwd), 'Source mapping (package.json)', filePaths);
|
|
53
53
|
return filePaths;
|
|
54
54
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.66.
|
|
1
|
+
export declare const version = "5.66.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.66.
|
|
1
|
+
export const version = '5.66.2';
|