knip 6.45.0 → 6.45.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/plugins/panda-css/index.js +5 -0
- package/dist/plugins/webdriver-io/index.js +22 -17
- package/dist/plugins/webdriver-io/types.d.ts +3 -2
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/typescript/ast-nodes.js +47 -1
- package/dist/util/get-included-issue-types.js +1 -0
- package/dist/util/regex.js +10 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -8,11 +8,16 @@ const resolveConfig = config => {
|
|
|
8
8
|
const presets = (config.presets ?? []).filter((preset) => typeof preset === 'string');
|
|
9
9
|
return [...presets.map(id => toDeferResolve(id)), toDependency('postcss')];
|
|
10
10
|
};
|
|
11
|
+
const args = {
|
|
12
|
+
binaries: ['panda', 'pandacss'],
|
|
13
|
+
config: true,
|
|
14
|
+
};
|
|
11
15
|
const plugin = {
|
|
12
16
|
title,
|
|
13
17
|
enablers,
|
|
14
18
|
isEnabled,
|
|
15
19
|
config,
|
|
16
20
|
resolveConfig,
|
|
21
|
+
args,
|
|
17
22
|
};
|
|
18
23
|
export default plugin;
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { isAbsolute } from '../../util/path.js';
|
|
2
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
|
+
import { resolvePackageManifestPath } from '../../util/resolve.js';
|
|
3
5
|
const title = 'WebdriverIO';
|
|
4
6
|
const enablers = ['@wdio/cli'];
|
|
5
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
8
|
const config = ['wdio.conf.{js,cjs,mjs,ts,cts,mts}'];
|
|
7
|
-
const
|
|
9
|
+
const getNames = (plugins = []) => plugins.flatMap(plugin => {
|
|
10
|
+
const name = Array.isArray(plugin) ? plugin[0] : plugin;
|
|
11
|
+
return typeof name === 'string' && !name.startsWith('file://') && !isAbsolute(name) ? [name] : [];
|
|
12
|
+
});
|
|
13
|
+
const toPluginDependency = (name, type, dir) => {
|
|
14
|
+
if (name.startsWith('@'))
|
|
15
|
+
return toDependency(name);
|
|
16
|
+
const scoped = `@wdio/${name.toLowerCase()}-${type}`;
|
|
17
|
+
const community = `wdio-${name.toLowerCase()}-${type}`;
|
|
18
|
+
const isCommunity = !resolvePackageManifestPath(scoped, dir) && resolvePackageManifestPath(community, dir);
|
|
19
|
+
return toDependency(isCommunity ? community : scoped);
|
|
20
|
+
};
|
|
21
|
+
const resolveConfig = async (config, options) => {
|
|
8
22
|
const cfg = config?.config;
|
|
9
23
|
if (!cfg)
|
|
10
24
|
return [];
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (typeof reporter === 'string')
|
|
19
|
-
return [reporter];
|
|
20
|
-
if (Array.isArray(reporter) && typeof reporter[0] === 'string')
|
|
21
|
-
return [reporter[0]];
|
|
22
|
-
return [];
|
|
23
|
-
})
|
|
24
|
-
.map(reporter => `@wdio/${reporter}-reporter`)
|
|
25
|
-
: [];
|
|
26
|
-
return [...frameworks, ...runners, ...reporters].map(id => toDependency(id));
|
|
25
|
+
const toInputs = (plugins, type) => getNames(plugins).map(name => toPluginDependency(name, type, options.configFileDir));
|
|
26
|
+
return [
|
|
27
|
+
...toInputs([cfg.framework], 'framework'),
|
|
28
|
+
...toInputs([cfg.runner ?? 'local'], 'runner'),
|
|
29
|
+
...toInputs(cfg.reporters, 'reporter'),
|
|
30
|
+
...toInputs(cfg.services, 'service'),
|
|
31
|
+
];
|
|
27
32
|
};
|
|
28
33
|
const plugin = {
|
|
29
34
|
title,
|
package/dist/session/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { createOptions, type MainOptions } from '../util/create-options.ts';
|
|
|
9
9
|
export { buildFileDescriptor, type FileDescriptorOptions } from './file-descriptor.ts';
|
|
10
10
|
export { buildPackageJsonDescriptor, type PackageJsonFile } from './package-json-descriptor.ts';
|
|
11
11
|
export { createSession, type Session } from './session.ts';
|
|
12
|
+
export { version } from '../version.ts';
|
|
12
13
|
export type { ContentionDetails, ContentionKind, ContentionOrigin, ContentionSite, Export, File, SourceLocation, } from './types.ts';
|
package/dist/session/index.js
CHANGED
|
@@ -5,3 +5,4 @@ export { createOptions } from '../util/create-options.js';
|
|
|
5
5
|
export { buildFileDescriptor } from './file-descriptor.js';
|
|
6
6
|
export { buildPackageJsonDescriptor } from './package-json-descriptor.js';
|
|
7
7
|
export { createSession } from './session.js';
|
|
8
|
+
export { version } from '../version.js';
|
|
@@ -491,7 +491,7 @@ export const collectAugmentationRefs = (node) => {
|
|
|
491
491
|
export function extractEnumMembers(decl, options, lineStarts, getJSDocTags) {
|
|
492
492
|
if (!decl.body?.members)
|
|
493
493
|
return [];
|
|
494
|
-
|
|
494
|
+
const members = decl.body.members.map((member) => {
|
|
495
495
|
const name = member.id.type === 'Identifier'
|
|
496
496
|
? member.id.name
|
|
497
497
|
: member.id.type === 'Literal'
|
|
@@ -517,4 +517,50 @@ export function extractEnumMembers(decl, options, lineStarts, getJSDocTags) {
|
|
|
517
517
|
flags: 0,
|
|
518
518
|
};
|
|
519
519
|
});
|
|
520
|
+
markEnumMemberRefs(decl.body.members, members);
|
|
521
|
+
return members;
|
|
520
522
|
}
|
|
523
|
+
const markEnumMemberRefs = (enumMembers, members) => {
|
|
524
|
+
let byIdentifier;
|
|
525
|
+
const visit = (node) => {
|
|
526
|
+
const type = node?.type;
|
|
527
|
+
if (!type)
|
|
528
|
+
return;
|
|
529
|
+
if (type === 'Identifier') {
|
|
530
|
+
const member = byIdentifier?.get(node.name);
|
|
531
|
+
if (member)
|
|
532
|
+
member.hasRefsInFile = true;
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (type === 'MemberExpression' && !node.computed) {
|
|
536
|
+
visit(node.object);
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
const keys = visitorKeys[type];
|
|
540
|
+
if (!keys)
|
|
541
|
+
return;
|
|
542
|
+
for (const key of keys) {
|
|
543
|
+
const val = node[key];
|
|
544
|
+
if (!val)
|
|
545
|
+
continue;
|
|
546
|
+
if (Array.isArray(val)) {
|
|
547
|
+
for (const item of val)
|
|
548
|
+
if (item)
|
|
549
|
+
visit(item);
|
|
550
|
+
}
|
|
551
|
+
else
|
|
552
|
+
visit(val);
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
for (const member of enumMembers) {
|
|
556
|
+
const initializer = member.initializer;
|
|
557
|
+
if (!initializer || initializer.type === 'Literal')
|
|
558
|
+
continue;
|
|
559
|
+
if (!byIdentifier) {
|
|
560
|
+
byIdentifier = new Map();
|
|
561
|
+
for (const m of members)
|
|
562
|
+
byIdentifier.set(m.identifier, m);
|
|
563
|
+
}
|
|
564
|
+
visit(initializer);
|
|
565
|
+
}
|
|
566
|
+
};
|
package/dist/util/regex.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
const isRegexLikeMatch = /[*+\\(|{^$]/;
|
|
2
2
|
const isRegexLike = (value) => isRegexLikeMatch.test(value);
|
|
3
|
-
export const toRegexOrString = (value) =>
|
|
3
|
+
export const toRegexOrString = (value) => {
|
|
4
|
+
if (typeof value !== 'string' || !isRegexLike(value))
|
|
5
|
+
return value;
|
|
6
|
+
try {
|
|
7
|
+
return new RegExp(value);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
4
13
|
export const findMatch = (haystack, needle) => haystack.find(n => (typeof n === 'string' ? n === needle : n.test(needle)));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.45.
|
|
1
|
+
export declare const version = "6.45.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '6.45.
|
|
1
|
+
export const version = '6.45.1';
|