knip 6.28.0 → 6.29.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/compilers/compilers.d.ts +1 -0
- package/dist/compilers/compilers.js +10 -0
- package/dist/compilers/index.js +2 -0
- package/dist/compilers/tsrx.d.ts +5 -0
- package/dist/compilers/tsrx.js +3 -0
- package/dist/util/Performance.js +1 -1
- package/dist/util/glob-core.js +6 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ export declare const styleExtractor: RegExp;
|
|
|
6
6
|
export declare const blockCommentMatcher: RegExp;
|
|
7
7
|
export declare const lineCommentMatcher: RegExp;
|
|
8
8
|
export declare const importMatcher: RegExp;
|
|
9
|
+
export declare const collectImports: CompilerSync;
|
|
9
10
|
export declare const importsWithinScripts: CompilerSync;
|
|
10
11
|
export declare const scriptBodies: CompilerSync;
|
|
11
12
|
export declare const getStyleLang: (attrs: string) => string | undefined;
|
|
@@ -6,6 +6,16 @@ const langAttrMatcher = /\blang\s*=\s*["']([^"']+)["']/i;
|
|
|
6
6
|
export const blockCommentMatcher = /\/\*[\s\S]*?\*\//g;
|
|
7
7
|
export const lineCommentMatcher = /^[ \t]*\/\/.*$/gm;
|
|
8
8
|
export const importMatcher = /import(?:\s*\(\s*['"][^'"]+['"][^)]*\)|(?!\s*\()[^'"]+['"][^'"]+['"])/g;
|
|
9
|
+
export const collectImports = text => {
|
|
10
|
+
if (!text.includes('import'))
|
|
11
|
+
return '';
|
|
12
|
+
const imports = [];
|
|
13
|
+
importMatcher.lastIndex = 0;
|
|
14
|
+
let match;
|
|
15
|
+
while ((match = importMatcher.exec(text)))
|
|
16
|
+
imports.push(match[0]);
|
|
17
|
+
return imports.join('\n');
|
|
18
|
+
};
|
|
9
19
|
export const importsWithinScripts = (text) => {
|
|
10
20
|
const scripts = [];
|
|
11
21
|
scriptExtractor.lastIndex = 0;
|
package/dist/compilers/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import LESS from './less.js';
|
|
|
2
2
|
import MDX from './mdx.js';
|
|
3
3
|
import SCSS from './scss.js';
|
|
4
4
|
import STYLUS from './stylus.js';
|
|
5
|
+
import TSRX from './tsrx.js';
|
|
5
6
|
const isAsyncCompiler = (fn) => (fn ? fn.constructor.name === 'AsyncFunction' : false);
|
|
6
7
|
export const normalizeCompilerExtension = (ext) => ext.replace(/^\.*/, '.');
|
|
7
8
|
export const partitionCompilers = (rawLocalConfig) => {
|
|
@@ -33,6 +34,7 @@ const compilers = [
|
|
|
33
34
|
{ extensions: ['.sass', '.scss'], ...SCSS },
|
|
34
35
|
{ extensions: ['.less'], ...LESS },
|
|
35
36
|
{ extensions: ['.styl', '.stylus'], ...STYLUS },
|
|
37
|
+
{ extensions: ['.tsrx'], ...TSRX },
|
|
36
38
|
];
|
|
37
39
|
export const getIncludedCompilers = (syncCompilers, asyncCompilers, dependencies, onReferencedDependency) => {
|
|
38
40
|
for (const { extensions, dependencies: compilerDependencies, compiler } of compilers) {
|
package/dist/util/Performance.js
CHANGED
|
@@ -9,7 +9,7 @@ const { values } = parseArgs({
|
|
|
9
9
|
'performance-fn': { type: 'string', multiple: true },
|
|
10
10
|
memory: { type: 'boolean' },
|
|
11
11
|
'memory-realtime': { type: 'boolean' },
|
|
12
|
-
duration: { type: 'boolean' },
|
|
12
|
+
duration: { type: 'boolean', short: 'u' },
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
const timerifyOnlyFnName = values['performance-fn'];
|
package/dist/util/glob-core.js
CHANGED
|
@@ -258,7 +258,12 @@ export async function glob(_patterns, options) {
|
|
|
258
258
|
cachedGlobIgnores.set(options.dir, compact(_ignore));
|
|
259
259
|
}
|
|
260
260
|
const ignorePatterns = (cachedIgnores ?? _ignore).concat(negatedPatterns.map(pattern => pattern.slice(1)));
|
|
261
|
-
const { dir, label, ...fgOptions } = {
|
|
261
|
+
const { dir, label, ...fgOptions } = {
|
|
262
|
+
...options,
|
|
263
|
+
ignore: ignorePatterns,
|
|
264
|
+
expandDirectories: false,
|
|
265
|
+
followSymbolicLinks: false,
|
|
266
|
+
};
|
|
262
267
|
const paths = await tinyGlob(patterns, fgOptions);
|
|
263
268
|
debugLogObject(relative(options.cwd, dir), label ? `Finding ${label}` : 'Finding paths', () => ({
|
|
264
269
|
patterns,
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.
|
|
1
|
+
export declare const version = "6.29.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '6.
|
|
1
|
+
export const version = '6.29.0';
|