knip 5.34.4 → 5.35.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.
@@ -57,7 +57,6 @@ export declare class ConfigurationChief {
57
57
  private getConfiguredWorkspaceKeys;
58
58
  private getAdditionalWorkspaceNames;
59
59
  private getAvailableWorkspaceNames;
60
- private getAvailableWorkspacePkgNames;
61
60
  private setIncludedWorkspaces;
62
61
  getManifestForWorkspace(name: string): PackageJson | undefined;
63
62
  getIncludedWorkspaces(): Workspace[];
@@ -204,16 +204,6 @@ export class ConfigurationChief {
204
204
  getAvailableWorkspaceNames(names) {
205
205
  return [...names, ...this.additionalWorkspaceNames].filter(name => !picomatch.isMatch(name, this.ignoredWorkspacePatterns));
206
206
  }
207
- getAvailableWorkspacePkgNames(pkgNames) {
208
- const names = new Set();
209
- for (const pkgName of pkgNames) {
210
- if (names.has(pkgName))
211
- throw new ConfigurationError(`Duplicate package name: ${pkgName}`);
212
- if (!picomatch.isMatch(pkgName, this.ignoredWorkspacePatterns))
213
- names.add(pkgName);
214
- }
215
- return names;
216
- }
217
207
  setIncludedWorkspaces() {
218
208
  if (this.workspace) {
219
209
  const dir = resolve(this.workspace);
@@ -2,11 +2,13 @@ import parseArgs from 'minimist';
2
2
  import { compact } from '../util/array.js';
3
3
  import { toBinary, toDeferResolve, toEntry } from '../util/input.js';
4
4
  const spawningBinaries = ['cross-env', 'retry-cli'];
5
+ const endOfCommandBinaries = ['dotenvx'];
5
6
  const positionals = new Set(['babel-node', 'esbuild', 'execa', 'vite-node', 'zx']);
6
7
  export const resolve = (binary, args, { fromArgs }) => {
7
- const parsed = parseArgs(args, { boolean: ['quiet', 'verbose'] });
8
+ const parsed = parseArgs(args, { boolean: ['quiet', 'verbose'], '--': endOfCommandBinaries.includes(binary) });
8
9
  const bin = binary.startsWith('.') ? toEntry(binary) : toBinary(binary);
9
10
  const shiftedArgs = spawningBinaries.includes(binary) ? fromArgs(args) : [];
10
11
  const pos = positionals.has(binary) ? [toDeferResolve(parsed._[0])] : [];
11
- return compact([bin, ...shiftedArgs, ...pos]);
12
+ const newCommand = parsed['--'] && parsed['--'].length > 0 ? fromArgs(parsed['--']) : [];
13
+ return compact([bin, ...shiftedArgs, ...pos, ...newCommand]);
12
14
  };
@@ -52,8 +52,9 @@ export const findWebpackDependenciesFromConfig = async ({ config, cwd }) => {
52
52
  const passes = typeof config === 'function' ? [false, true] : [false];
53
53
  const inputs = new Set();
54
54
  for (const isProduction of passes) {
55
- const env = { production: isProduction };
56
- const argv = { mode: isProduction ? 'production' : 'development' };
55
+ const mode = isProduction ? 'production' : 'development';
56
+ const env = { production: isProduction, mode };
57
+ const argv = { mode };
57
58
  const resolvedConfig = typeof config === 'function' ? await config(env, argv) : config;
58
59
  for (const options of [resolvedConfig].flat()) {
59
60
  const entries = [];
@@ -2,6 +2,7 @@ import type { Configuration } from 'webpack';
2
2
  type Mode = 'none' | 'development' | 'production';
3
3
  export type Env = {
4
4
  production: boolean;
5
+ mode: Mode;
5
6
  };
6
7
  export type Argv = {
7
8
  mode: Mode;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.34.4";
1
+ export declare const version = "5.35.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.34.4';
1
+ export const version = '5.35.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.34.4",
3
+ "version": "5.35.1",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {