knip 5.55.0 → 5.55.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.
@@ -7,6 +7,6 @@ export declare class ConsoleStreamer {
7
7
  private clearLines;
8
8
  private resetLines;
9
9
  private update;
10
- cast(message: string | string[]): void;
10
+ cast(message: string | string[], sub?: string): void;
11
11
  clear(): void;
12
12
  }
@@ -21,13 +21,13 @@ export class ConsoleStreamer {
21
21
  process.stdout.write(`${messages.join('\n')}\n`);
22
22
  this.lines = messages.length;
23
23
  }
24
- cast(message) {
24
+ cast(message, sub) {
25
25
  if (!this.isEnabled)
26
26
  return;
27
27
  if (Array.isArray(message))
28
28
  this.update(message);
29
29
  else
30
- this.update([message]);
30
+ this.update([`${message}${!sub || sub === '.' ? '' : ` (${sub})`}…`]);
31
31
  }
32
32
  clear() {
33
33
  if (!this.isEnabled)
package/dist/constants.js CHANGED
@@ -50,6 +50,7 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
50
50
  'exec',
51
51
  'exit',
52
52
  'expand',
53
+ 'export',
53
54
  'expr',
54
55
  'factor',
55
56
  'false',
@@ -23,7 +23,7 @@ export const analyze = async (options) => {
23
23
  : ignoreExportsUsedInFile));
24
24
  const analyzeGraph = async () => {
25
25
  if (isReportValues || isReportTypes) {
26
- streamer.cast('Connecting the dots...');
26
+ streamer.cast('Connecting the dots');
27
27
  for (const [filePath, file] of graph.entries()) {
28
28
  const exportItems = file.exports;
29
29
  if (!exportItems || exportItems.size === 0)
@@ -29,7 +29,7 @@ export async function build({ cacheLocation, chief, collector, cwd, deputy, fact
29
29
  }
30
30
  for (const workspace of workspaces) {
31
31
  const { name, dir, ancestors, pkgName } = workspace;
32
- streamer.cast(`Analyzing workspace (${name})...`);
32
+ streamer.cast('Analyzing workspace', name);
33
33
  const manifest = chief.getManifestForWorkspace(name);
34
34
  if (!manifest) {
35
35
  continue;
@@ -276,10 +276,10 @@ export async function build({ cacheLocation, chief, collector, cwd, deputy, fact
276
276
  continue;
277
277
  principal.init();
278
278
  if (principal.asyncCompilers.size > 0) {
279
- streamer.cast('Running async compilers...');
279
+ streamer.cast('Running async compilers');
280
280
  await principal.runAsyncCompilers();
281
281
  }
282
- streamer.cast(`Analyzing source files (${toRelative(principal.cwd) || '.'})...`);
282
+ streamer.cast('Analyzing source files', toRelative(principal.cwd));
283
283
  let size = principal.entryPaths.size;
284
284
  let round = 0;
285
285
  do {
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ export const main = async (unresolvedConfiguration) => {
18
18
  const deputy = new DependencyDeputy({ isProduction, isStrict });
19
19
  const factory = new PrincipalFactory();
20
20
  const streamer = new ConsoleStreamer({ isEnabled: isShowProgress });
21
- streamer.cast('Reading workspace configuration(s)...');
21
+ streamer.cast('Reading workspace configuration');
22
22
  await chief.init();
23
23
  const workspaces = chief.getWorkspaces();
24
24
  const report = chief.getIncludedIssueTypes({
@@ -57,8 +57,8 @@ const resolveUseItem = (use) => {
57
57
  return [];
58
58
  };
59
59
  export const findWebpackDependenciesFromConfig = async (config, options) => {
60
- const { cwd } = options;
61
- const passes = typeof config === 'function' ? [false, true] : [false];
60
+ const { cwd, isProduction } = options;
61
+ const passes = typeof config === 'function' ? [false, true] : [isProduction];
62
62
  const inputs = new Set();
63
63
  for (const isProduction of passes) {
64
64
  const mode = isProduction ? 'production' : 'development';
@@ -98,16 +98,16 @@ export const findWebpackDependenciesFromConfig = async (config, options) => {
98
98
  }
99
99
  }
100
100
  for (const entry of entries) {
101
- if (!isInternal(entry)) {
102
- inputs.add(toDependency(entry));
103
- }
104
- else {
101
+ if (isInternal(entry)) {
105
102
  const dir = opts.context ? opts.context : cwd;
106
- const input = opts.mode === 'development'
107
- ? toDeferResolveEntry(entry, { dir })
108
- : toDeferResolveProductionEntry(entry, { dir });
103
+ const input = isProduction
104
+ ? toDeferResolveProductionEntry(entry, { dir })
105
+ : toDeferResolveEntry(entry, { dir });
109
106
  inputs.add(input);
110
107
  }
108
+ else {
109
+ inputs.add(toDeferResolve(entry));
110
+ }
111
111
  }
112
112
  if (opts.resolve?.alias) {
113
113
  const addStar = (value) => (value.endsWith('*') ? value : join(value, '*').replace(/\/\*\*$/, '/*'));
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.55.0";
1
+ export declare const version = "5.55.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.55.0';
1
+ export const version = '5.55.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.55.0",
3
+ "version": "5.55.1",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {