@virmator/deps 14.32.0 → 14.32.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/deps.d.ts CHANGED
@@ -6,6 +6,13 @@ export declare function getUnusedPackageDirPaths({ cwdPackagePath, monoRepoPacka
6
6
  monoRepoRootPath: string;
7
7
  packageType: PackageType;
8
8
  }>): string[];
9
+ /** @category Internal */
10
+ export declare function buildNcuCommand({ configPath, cwd, monoRepoPackages, monoRepoRootPath, }: Readonly<{
11
+ configPath: string;
12
+ cwd: string;
13
+ monoRepoPackages: ReadonlyArray<Readonly<MonoRepoPackage>>;
14
+ monoRepoRootPath: string;
15
+ }>): string;
9
16
  /** A virmator plugin for checking package TS dependencies. */
10
17
  export declare const virmatorDepsPlugin: Readonly<Readonly<{
11
18
  name: string;
package/dist/deps.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { check } from '@augment-vir/assert';
2
2
  import { awaitedBlockingMap, RuntimeEnv } from '@augment-vir/common';
3
3
  import { toPosixPath } from '@augment-vir/node';
4
- import { copyConfigFile, defineVirmatorPlugin, JsModuleType, NpmDepType, PackageType, VirmatorNoTraceError, withCompiledTsFile, withImportedTsFile, } from '@virmator/core';
4
+ import { copyConfigFile, defineVirmatorPlugin, JsModuleType, NpmDepType, PackageType, VirmatorNoTraceError, withCompiledTsFile, } from '@virmator/core';
5
5
  import mri from 'mri';
6
- import { rm } from 'node:fs/promises';
6
+ import { appendFile, rm } from 'node:fs/promises';
7
7
  import { join, relative } from 'node:path';
8
8
  import { findUnusedPackageDependencies } from './find-unused-package-dependencies.js';
9
9
  import { listRegenNodeModulesDirs } from './regen-node-modules.js';
@@ -32,6 +32,20 @@ export function getUnusedPackageDirPaths({ cwdPackagePath, monoRepoPackages, mon
32
32
  ]
33
33
  : [cwdPackagePath];
34
34
  }
35
+ /** @category Internal */
36
+ export function buildNcuCommand({ configPath, cwd, monoRepoPackages, monoRepoRootPath, }) {
37
+ return [
38
+ 'npx',
39
+ 'npm-check-updates',
40
+ '--configFileName',
41
+ toPosixPath(relative(cwd, configPath)),
42
+ '--cwd',
43
+ toPosixPath(relative(cwd, monoRepoRootPath)) || '.',
44
+ '--format',
45
+ 'no-group',
46
+ ...(monoRepoPackages.length ? ['--workspaces'] : []),
47
+ ].join(' ');
48
+ }
35
49
  /** A virmator plugin for checking package TS dependencies. */
36
50
  export const virmatorDepsPlugin = defineVirmatorPlugin(import.meta.dirname, {
37
51
  name: 'Deps',
@@ -317,22 +331,17 @@ export const virmatorDepsPlugin = defineVirmatorPlugin(import.meta.dirname, {
317
331
  config: configs.deps.subCommands.upgrade.configs.ncu,
318
332
  log,
319
333
  });
320
- await withImportedTsFile({
334
+ await withCompiledTsFile({
321
335
  inputPath: join(monoRepoRootPath, configs.deps.subCommands.upgrade.configs.ncu.copyToPath),
322
- outputPath: join(cwdPackagePath, 'node_modules', '.virmator', 'dep-cruiser.config.mjs'),
323
- }, JsModuleType.Esm, async (configFile) => {
324
- const config = configFile.ncuConfig;
325
- /** C8 incorrectly thinks these imports are uncovered branches. */
326
- /* node:coverage ignore next */
327
- const ncu = await import('npm-check-updates');
328
- await ncu.run({
329
- ...config,
330
- cwd: monoRepoRootPath,
331
- workspaces: !!monoRepoPackages.length,
332
- format: [],
333
- }, {
334
- cli: true,
335
- });
336
+ outputPath: join(cwdPackagePath, 'node_modules', '.virmator', 'ncu.config.mjs'),
337
+ }, JsModuleType.Esm, async (configPath) => {
338
+ await appendFile(configPath, '\nconst {filter, ...ncuConfigWithoutFilter} = ncuConfig;\nexport default filter?.length ? ncuConfig : ncuConfigWithoutFilter;\n');
339
+ await runShellCommand(buildNcuCommand({
340
+ configPath,
341
+ cwd,
342
+ monoRepoPackages,
343
+ monoRepoRootPath,
344
+ }));
336
345
  });
337
346
  }
338
347
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virmator/deps",
3
- "version": "14.32.0",
3
+ "version": "14.32.1",
4
4
  "description": "Default TS deps plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -34,22 +34,22 @@
34
34
  "test:update": "npm test update"
35
35
  },
36
36
  "dependencies": {
37
- "@augment-vir/assert": "^32.2.2",
38
- "@augment-vir/common": "^32.2.2",
39
- "@augment-vir/node": "^32.2.2",
37
+ "@augment-vir/assert": "^32.2.3",
38
+ "@augment-vir/common": "^32.2.3",
39
+ "@augment-vir/node": "^32.2.3",
40
40
  "@npm/types": "^2.1.0",
41
- "@virmator/core": "^14.32.0",
42
- "date-vir": "^9.1.0",
41
+ "@virmator/core": "^14.32.1",
42
+ "date-vir": "^9.1.1",
43
43
  "mri": "^1.2.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@augment-vir/test": "^32.2.2",
46
+ "@augment-vir/test": "^32.2.3",
47
47
  "@types/node": "^26.2.0",
48
48
  "c8": "^12.0.0",
49
49
  "dependency-cruiser": "^18.2.0",
50
50
  "esbuild": "^0.28.2",
51
51
  "istanbul-smart-text-reporter": "^1.1.5",
52
- "npm-check-updates": "^23.0.2"
52
+ "npm-check-updates": "^23.1.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "dependency-cruiser": ">=18",