refactor: merge @pnpm/fs.find-packages into @pnpm/workspace.projects-reader (#11021)

* refactor: merge @pnpm/fs.find-packages into @pnpm/workspace.projects-reader

The find-packages package had only one production consumer (projects-reader).
Inlining it removes a separate published package with minimal value as a
standalone utility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: sort devDependencies and add tsconfig reference for meta-updater

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove circular tsconfig reference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: exclude circular tsconfig reference in meta-updater

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: move getConfig from cli/utils to pnpm CLI package

getConfig and installConfigDepsAndLoadHooks were the only functions in
cli/utils that pulled in heavy deps (env-installer, store.connection-manager,
hooks.pnpmfile, default-reporter). Moving them to the pnpm CLI package
(their only consumer) dramatically reduces the dependency weight of
cli/utils, breaking the circular tsconfig reference chain that previously
required fs.find-packages to be a separate package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: sort imports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zoltan Kochan
2026-03-19 01:45:24 +01:00
committed by GitHub
parent 4d2afef9be
commit 0b33718dbe
38 changed files with 42 additions and 575 deletions

View File

@@ -126,7 +126,6 @@
"@pnpm/engine.runtime.node-resolver": major
"@pnpm/installing.linking.hoist": major
"@pnpm/deps.peer-range": major
"@pnpm/fs.find-packages": major
"@pnpm/fs.hard-link-dir": major
"@pnpm/installing.deps-installer": major
"@pnpm/store.cafs-types": major

View File

@@ -113,7 +113,6 @@
"@pnpm/engine.runtime.node-resolver": major
"@pnpm/installing.linking.hoist": major
"@pnpm/deps.peer-range": major
"@pnpm/fs.find-packages": major
"@pnpm/fs.hard-link-dir": major
"@pnpm/installing.deps-installer": major
"@pnpm/store.cafs-types": major

View File

@@ -24,24 +24,17 @@
"!*.map"
],
"scripts": {
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"src/**/*.ts\"",
"prepublishOnly": "pnpm run compile",
"compile": "tsgo --build && pnpm run lint --fix",
"test": "pnpm run compile && pnpm run _test",
"_test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest"
"test": "pnpm run compile"
},
"dependencies": {
"@pnpm/cli.default-reporter": "workspace:*",
"@pnpm/cli.meta": "workspace:*",
"@pnpm/config.package-is-installable": "workspace:*",
"@pnpm/config.reader": "workspace:*",
"@pnpm/error": "workspace:*",
"@pnpm/hooks.pnpmfile": "workspace:*",
"@pnpm/installing.env-installer": "workspace:*",
"@pnpm/pkg-manifest.utils": "workspace:*",
"@pnpm/store.connection-manager": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"chalk": "catalog:",
"load-json-file": "catalog:"
@@ -50,11 +43,8 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/cli.utils": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@types/ramda": "catalog:"
"@pnpm/logger": "workspace:*"
},
"engines": {
"node": ">=22.13"

View File

@@ -1,6 +1,5 @@
import { packageManager } from '@pnpm/cli.meta'
export { calcPnpmfilePathsOfPluginDeps, getConfig, installConfigDepsAndLoadHooks } from './getConfig.js'
export * from './packageIsInstallable.js'
export * from './readDepNameCompletions.js'
export * from './readProjectManifest.js'

View File

@@ -1,18 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": false,
"outDir": "../node_modules/.test.lib",
"rootDir": "..",
"isolatedModules": true
},
"include": [
"**/*.ts",
"../../../__typings__/**/*.d.ts"
],
"references": [
{
"path": ".."
}
]
}

View File

@@ -9,15 +9,9 @@
"../../__typings__/**/*.d.ts"
],
"references": [
{
"path": "../../__utils__/prepare"
},
{
"path": "../../config/package-is-installable"
},
{
"path": "../../config/reader"
},
{
"path": "../../core/error"
},
@@ -27,24 +21,12 @@
{
"path": "../../core/types"
},
{
"path": "../../hooks/pnpmfile"
},
{
"path": "../../installing/env-installer"
},
{
"path": "../../pkg-manifest/utils"
},
{
"path": "../../store/connection-manager"
},
{
"path": "../../workspace/project-manifest-reader"
},
{
"path": "../default-reporter"
},
{
"path": "../meta"
}

View File

@@ -1,296 +0,0 @@
# @pnpm/fs.find-packages
## 1000.0.17
### Patch Changes
- Updated dependencies [7c1382f]
- Updated dependencies [dee39ec]
- @pnpm/types@1000.9.0
- @pnpm/read-project-manifest@1001.1.4
## 1000.0.16
### Patch Changes
- @pnpm/read-project-manifest@1001.1.3
## 1000.0.15
### Patch Changes
- @pnpm/read-project-manifest@1001.1.2
## 1000.0.14
### Patch Changes
- Updated dependencies [e792927]
- @pnpm/types@1000.8.0
- @pnpm/read-project-manifest@1001.1.1
## 1000.0.13
### Patch Changes
- Updated dependencies [d1edf73]
- Updated dependencies [86b33e9]
- @pnpm/read-project-manifest@1001.1.0
## 1000.0.12
### Patch Changes
- Updated dependencies [1a07b8f]
- Updated dependencies [1a07b8f]
- Updated dependencies [1a07b8f]
- @pnpm/types@1000.7.0
- @pnpm/read-project-manifest@1001.0.0
## 1000.0.11
### Patch Changes
- c00360b: Update `@pnpm/util.lex-comparator` to v3.0.2.
- Updated dependencies [5ec7255]
- @pnpm/types@1000.6.0
- @pnpm/read-project-manifest@1000.0.11
## 1000.0.10
### Patch Changes
- Updated dependencies [5b73df1]
- @pnpm/types@1000.5.0
- @pnpm/read-project-manifest@1000.0.10
## 1000.0.9
### Patch Changes
- c85aaf8: Do not hang indefinitely, when there is a glob that starts with `!/` in `pnpm-workspace.yaml`. This fixes a regression introduced by [#9169](https://github.com/pnpm/pnpm/pull/9169).
- Updated dependencies [750ae7d]
- @pnpm/types@1000.4.0
- @pnpm/read-project-manifest@1000.0.9
## 1000.0.8
### Patch Changes
- Updated dependencies [5f7be64]
- Updated dependencies [5f7be64]
- @pnpm/types@1000.3.0
- @pnpm/read-project-manifest@1000.0.8
## 1000.0.7
### Patch Changes
- b8b0c68: `fast-glob` replace with `tinyglobby` to reduce the size of the pnpm CLI dependencies [#9169](https://github.com/pnpm/pnpm/pull/9169).
- Updated dependencies [a5e4965]
- @pnpm/types@1000.2.1
- @pnpm/read-project-manifest@1000.0.7
## 1000.0.6
### Patch Changes
- Updated dependencies [8fcc221]
- @pnpm/types@1000.2.0
- @pnpm/read-project-manifest@1000.0.6
## 1000.0.5
### Patch Changes
- Updated dependencies [1e229d7]
- @pnpm/read-project-manifest@1000.0.5
## 1000.0.4
### Patch Changes
- Updated dependencies [b562deb]
- @pnpm/types@1000.1.1
- @pnpm/read-project-manifest@1000.0.4
## 1000.0.3
### Patch Changes
- Updated dependencies [e050221]
- @pnpm/read-project-manifest@1000.0.3
## 1000.0.2
### Patch Changes
- Updated dependencies [9591a18]
- @pnpm/types@1000.1.0
- @pnpm/read-project-manifest@1000.0.2
## 1000.0.1
### Patch Changes
- @pnpm/read-project-manifest@1000.0.1
## 4.0.6
### Patch Changes
- @pnpm/read-project-manifest@6.0.10
## 4.0.5
### Patch Changes
- @pnpm/read-project-manifest@6.0.9
## 4.0.4
### Patch Changes
- Updated dependencies [d500d9f]
- @pnpm/types@12.2.0
- @pnpm/read-project-manifest@6.0.8
## 4.0.3
### Patch Changes
- Updated dependencies [7ee59a1]
- @pnpm/types@12.1.0
- @pnpm/read-project-manifest@6.0.7
## 4.0.2
### Patch Changes
- Updated dependencies [cb006df]
- @pnpm/types@12.0.0
- @pnpm/read-project-manifest@6.0.6
## 4.0.1
### Patch Changes
- Updated dependencies [0ef168b]
- @pnpm/types@11.1.0
- @pnpm/read-project-manifest@6.0.5
## 4.0.0
### Major Changes
- dd00eeb: Renamed dir to rootDir in the Project object.
### Patch Changes
- Updated dependencies [dd00eeb]
- Updated dependencies
- @pnpm/types@11.0.0
- @pnpm/read-project-manifest@6.0.4
## 3.0.3
### Patch Changes
- 13e55b2: If install is performed on a subset of workspace projects, always create an up-to-date lockfile first. So, a partial install can be performed only on a fully resolved (non-partial) lockfile [#8165](https://github.com/pnpm/pnpm/issues/8165).
- Updated dependencies [13e55b2]
- @pnpm/types@10.1.1
- @pnpm/read-project-manifest@6.0.3
## 3.0.2
### Patch Changes
- Updated dependencies [45f4262]
- @pnpm/types@10.1.0
- @pnpm/read-project-manifest@6.0.2
## 3.0.1
### Patch Changes
- @pnpm/read-project-manifest@6.0.1
## 3.0.0
### Major Changes
- 43cdd87: Node.js v16 support dropped. Use at least Node.js v18.12.
### Patch Changes
- Updated dependencies [7733f3a]
- Updated dependencies [43cdd87]
- Updated dependencies [730929e]
- @pnpm/types@10.0.0
- @pnpm/read-project-manifest@6.0.0
## 2.0.10
### Patch Changes
- Updated dependencies [4d34684f1]
- @pnpm/types@9.4.2
- @pnpm/read-project-manifest@5.0.10
## 2.0.9
### Patch Changes
- Updated dependencies
- @pnpm/types@9.4.1
- @pnpm/read-project-manifest@5.0.9
## 2.0.8
### Patch Changes
- Updated dependencies [43ce9e4a6]
- @pnpm/types@9.4.0
- @pnpm/read-project-manifest@5.0.8
## 2.0.7
### Patch Changes
- Updated dependencies [d774a3196]
- @pnpm/types@9.3.0
- @pnpm/read-project-manifest@5.0.7
## 2.0.6
### Patch Changes
- @pnpm/read-project-manifest@5.0.6
## 2.0.5
### Patch Changes
- e9aa6f682: Apply fixes from @typescript-eslint v6 for nullish coalescing and optional chains. No behavior changes are expected with this change.
- @pnpm/read-project-manifest@5.0.5
## 2.0.4
### Patch Changes
- Updated dependencies [aa2ae8fe2]
- @pnpm/types@9.2.0
- @pnpm/read-project-manifest@5.0.4
## 2.0.3
### Patch Changes
- Updated dependencies [b4892acc5]
- @pnpm/read-project-manifest@5.0.3
## 2.0.2
### Patch Changes
- @pnpm/read-project-manifest@5.0.2

View File

@@ -1,51 +0,0 @@
# @pnpm/fs.find-packages
> Find all packages inside a directory
<!--@shields('npm')-->
[![npm version](https://img.shields.io/npm/v/@pnpm/fs.find-packages.svg)](https://www.npmjs.com/package/@pnpm/fs.find-packages)
<!--/@-->
## Installation
```sh
pnpm add @pnpm/fs.find-packages
```
## Usage
```js
const path = require('path')
const findPkgs = require('@pnpm/fs.find-packages')
findPkgs(path.join(import.meta.dirname, 'test', 'fixture'))
.then(pkgs => console.log(pkgs))
.catch(err => console.error(err))
//> [ { path: '/home/zkochan/src/find-packages/test/fixture/pkg',
// manifest: { name: 'foo', version: '1.0.0' },
// writeProjectManifest: [AsyncFunction] } ]
```
## API
### `findPackages(dir, [opts])`
#### `dir`
The directory in which to search for packages.
#### `opts`
Parameters normally passed to [glob](https://www.npmjs.com/package/glob)
#### `opts.patterns`
Array of globs to use as package locations. For example: `['packages/**', 'utils/**']`.
#### `opts.ignore`
Patterns to ignore when searching for packages. By default: `**/node_modules/**`, `**/bower_components/**`, `**/test/**`, `**/tests/**`.
## License
MIT © [Zoltan Kochan](https://www.kochan.io)

View File

@@ -1,6 +0,0 @@
const path = require('path')
const findPkgs = require('@pnpm/fs.find-packages')
findPkgs(path.join(import.meta.dirname, 'test/fixtures/one-pkg'))
.then(pkgs => console.log(pkgs))
.catch(err => console.error(err))

View File

@@ -1,52 +0,0 @@
{
"name": "@pnpm/fs.find-packages",
"version": "1000.0.17",
"description": "Find all packages inside a directory",
"keywords": [
"pnpm",
"pnpm11",
"find",
"package"
],
"license": "MIT",
"funding": "https://opencollective.com/pnpm",
"repository": "https://github.com/pnpm/pnpm/tree/main/fs/find-packages",
"homepage": "https://github.com/pnpm/pnpm/tree/main/fs/find-packages#readme",
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": "./lib/index.js"
},
"files": [
"lib",
"!*.map"
],
"scripts": {
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
"_test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest",
"test": "pnpm run compile && pnpm run _test",
"prepublishOnly": "pnpm run compile",
"compile": "tsgo --build && pnpm run lint --fix"
},
"dependencies": {
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"p-filter": "catalog:",
"tinyglobby": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/fs.find-packages": "workspace:*"
},
"engines": {
"node": ">=22.13"
},
"jest": {
"preset": "@pnpm/jest-config"
}
}

View File

@@ -1,18 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": false,
"outDir": "../node_modules/.test.lib",
"rootDir": "..",
"isolatedModules": true
},
"include": [
"**/*.ts",
"../../../__typings__/**/*.d.ts"
],
"references": [
{
"path": ".."
}
]
}

View File

@@ -1,19 +0,0 @@
{
"extends": "@pnpm/tsconfig",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"include": [
"src/**/*.ts",
"../../__typings__/**/*.d.ts"
],
"references": [
{
"path": "../../core/types"
},
{
"path": "../../workspace/project-manifest-reader"
}
]
}

View File

@@ -1,8 +0,0 @@
{
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../__typings__/**/*.d.ts"
]
}

73
pnpm-lock.yaml generated
View File

@@ -2181,39 +2181,21 @@ importers:
cli/utils:
dependencies:
'@pnpm/cli.default-reporter':
specifier: workspace:*
version: link:../default-reporter
'@pnpm/cli.meta':
specifier: workspace:*
version: link:../meta
'@pnpm/config.package-is-installable':
specifier: workspace:*
version: link:../../config/package-is-installable
'@pnpm/config.reader':
specifier: workspace:*
version: link:../../config/reader
'@pnpm/error':
specifier: workspace:*
version: link:../../core/error
'@pnpm/hooks.pnpmfile':
specifier: workspace:*
version: link:../../hooks/pnpmfile
'@pnpm/installing.env-installer':
specifier: workspace:*
version: link:../../installing/env-installer
'@pnpm/pkg-manifest.utils':
specifier: workspace:*
version: link:../../pkg-manifest/utils
'@pnpm/store.connection-manager':
specifier: workspace:*
version: link:../../store/connection-manager
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 3.0.2
'@pnpm/workspace.project-manifest-reader':
specifier: workspace:*
version: link:../../workspace/project-manifest-reader
@@ -2224,21 +2206,12 @@ importers:
specifier: 'catalog:'
version: 7.0.1
devDependencies:
'@jest/globals':
specifier: 'catalog:'
version: 30.0.5
'@pnpm/cli.utils':
specifier: workspace:*
version: 'link:'
'@pnpm/logger':
specifier: workspace:*
version: link:../../core/logger
'@pnpm/prepare':
specifier: workspace:*
version: link:../../__utils__/prepare
'@types/ramda':
specifier: 'catalog:'
version: 0.29.12
config/commands:
dependencies:
@@ -4372,31 +4345,6 @@ importers:
specifier: workspace:*
version: 'link:'
fs/find-packages:
dependencies:
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 3.0.2
'@pnpm/workspace.project-manifest-reader':
specifier: workspace:*
version: link:../../workspace/project-manifest-reader
p-filter:
specifier: 'catalog:'
version: 4.1.0
tinyglobby:
specifier: 'catalog:'
version: 0.2.15
devDependencies:
'@jest/globals':
specifier: 'catalog:'
version: 30.0.5
'@pnpm/fs.find-packages':
specifier: workspace:*
version: 'link:'
fs/graceful-fs:
dependencies:
graceful-fs:
@@ -7193,6 +7141,9 @@ importers:
'@pnpm/fs.msgpack-file':
specifier: workspace:*
version: link:../fs/msgpack-file
'@pnpm/hooks.pnpmfile':
specifier: workspace:*
version: link:../hooks/pnpmfile
'@pnpm/installing.client':
specifier: workspace:*
version: link:../installing/client
@@ -8997,15 +8948,21 @@ importers:
'@pnpm/constants':
specifier: workspace:*
version: link:../../core/constants
'@pnpm/fs.find-packages':
specifier: workspace:*
version: link:../../fs/find-packages
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 3.0.2
'@pnpm/workspace.project-manifest-reader':
specifier: workspace:*
version: link:../project-manifest-reader
p-filter:
specifier: 'catalog:'
version: 4.1.0
tinyglobby:
specifier: 'catalog:'
version: 0.2.15
devDependencies:
'@jest/globals':
specifier: 'catalog:'
@@ -9148,15 +9105,15 @@ importers:
specifier: 'catalog:'
version: 2.8.2
devDependencies:
'@pnpm/fs.find-packages':
specifier: workspace:*
version: link:../../fs/find-packages
'@pnpm/prepare':
specifier: workspace:*
version: link:../../__utils__/prepare
'@pnpm/prepare-temp-dir':
specifier: workspace:*
version: link:../../__utils__/prepare-temp-dir
'@pnpm/workspace.projects-reader':
specifier: workspace:*
version: link:../projects-reader
'@pnpm/workspace.workspace-manifest-writer':
specifier: workspace:*
version: 'link:'

View File

@@ -85,6 +85,7 @@
"@pnpm/cli.command": "workspace:*",
"@pnpm/cli.common-cli-options-help": "workspace:*",
"@pnpm/config.reader": "workspace:*",
"@pnpm/hooks.pnpmfile": "workspace:*",
"@pnpm/installing.env-installer": "workspace:*",
"@pnpm/config.version-policy": "workspace:*",
"@pnpm/constants": "workspace:*",

View File

@@ -11,7 +11,6 @@ import { stripVTControlCharacters as stripAnsi } from 'node:util'
import { isExecutedByCorepack, packageManager } from '@pnpm/cli.meta'
import type { ParsedCliArgs } from '@pnpm/cli.parse-cli-args'
import { getConfig, installConfigDepsAndLoadHooks } from '@pnpm/cli.utils'
import type { Config } from '@pnpm/config.reader'
import { executionTimeLogger, scopeLogger } from '@pnpm/core-loggers'
import { PnpmError } from '@pnpm/error'
@@ -27,6 +26,7 @@ import semver from 'semver'
import { checkForUpdates } from './checkForUpdates.js'
import { pnpmCmds, rcOptionsTypes, skipPackageManagerCheckForCommand } from './cmd/index.js'
import { formatUnknownOptionsError } from './formatError.js'
import { getConfig, installConfigDepsAndLoadHooks } from './getConfig.js'
import { parseCliArgs } from './parseCliArgs.js'
import { initReporter, type ReporterType } from './reporter/index.js'
import { switchCliVersion } from './switchCliVersion.js'

View File

@@ -3,9 +3,10 @@ import fs from 'node:fs'
import path from 'node:path'
import { jest } from '@jest/globals'
import { calcPnpmfilePathsOfPluginDeps, getConfig } from '@pnpm/cli.utils'
import { prepare } from '@pnpm/prepare'
import { calcPnpmfilePathsOfPluginDeps, getConfig } from '../src/getConfig.js'
beforeEach(() => {
jest.spyOn(console, 'warn')
})

View File

@@ -101,6 +101,9 @@
{
"path": "../fs/msgpack-file"
},
{
"path": "../hooks/pnpmfile"
},
{
"path": "../installing/client"
},

View File

@@ -33,9 +33,11 @@
"dependencies": {
"@pnpm/cli.utils": "workspace:*",
"@pnpm/constants": "workspace:*",
"@pnpm/fs.find-packages": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:"
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"p-filter": "catalog:",
"tinyglobby": "catalog:"
},
"peerDependencies": {
"@pnpm/logger": "catalog:"

View File

@@ -15,13 +15,13 @@ const DEFAULT_IGNORE = [
'**/tests/**',
]
export interface Options {
export interface FindPackagesOptions {
ignore?: string[]
includeRoot?: boolean
patterns?: string[]
}
export async function findPackages (root: string, opts?: Options): Promise<Project[]> {
export async function findPackages (root: string, opts?: FindPackagesOptions): Promise<Project[]> {
opts = opts ?? {}
const globOpts = { ...opts, cwd: root, expandDirectories: false }
globOpts.ignore = opts.ignore ?? DEFAULT_IGNORE

View File

@@ -1,9 +1,11 @@
import { packageIsInstallable } from '@pnpm/cli.utils'
import { findPackages } from '@pnpm/fs.find-packages'
import { logger } from '@pnpm/logger'
import type { Project, ProjectManifest, SupportedArchitectures } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { findPackages } from './findPackages.js'
export { findPackages, type FindPackagesOptions } from './findPackages.js'
export type { Project }
export interface FindWorkspaceProjectsOpts {

View File

@@ -1,7 +1,7 @@
/// <reference path="../../../__typings__/index.d.ts"/>
import path from 'node:path'
import { findPackages } from '@pnpm/fs.find-packages'
import { findPackages } from '@pnpm/workspace.projects-reader'
function compare (a: string | undefined, b: string | undefined) {
if (a == null) return 1
@@ -9,7 +9,7 @@ function compare (a: string | undefined, b: string | undefined) {
return a.localeCompare(b)
}
const fixtures = path.join(import.meta.dirname, 'fixtures')
const fixtures = path.join(import.meta.dirname, 'findPackages-fixtures')
test('finds package', async () => {
const root = path.join(fixtures, 'one-pkg')

View File

@@ -22,7 +22,7 @@
"path": "../../core/types"
},
{
"path": "../../fs/find-packages"
"path": "../project-manifest-reader"
},
{
"path": "../workspace-manifest-reader"

View File

@@ -43,9 +43,9 @@
"yaml": "catalog:"
},
"devDependencies": {
"@pnpm/fs.find-packages": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/prepare-temp-dir": "workspace:*",
"@pnpm/workspace.projects-reader": "workspace:*",
"@pnpm/workspace.workspace-manifest-writer": "workspace:*",
"@types/ramda": "catalog:",
"@types/write-file-atomic": "catalog:",

View File

@@ -2,9 +2,9 @@ import fs from 'node:fs'
import path from 'node:path'
import { WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants'
import { findPackages } from '@pnpm/fs.find-packages'
import { prepare } from '@pnpm/prepare'
import { tempDir } from '@pnpm/prepare-temp-dir'
import { findPackages } from '@pnpm/workspace.projects-reader'
import { updateWorkspaceManifest } from '@pnpm/workspace.workspace-manifest-writer'
import { readYamlFileSync } from 'read-yaml-file'
import { writeYamlFileSync } from 'write-yaml-file'

View File

@@ -24,9 +24,6 @@
{
"path": "../../core/types"
},
{
"path": "../../fs/find-packages"
},
{
"path": "../../lockfile/types"
},
@@ -36,6 +33,9 @@
{
"path": "../../yaml/document-sync"
},
{
"path": "../projects-reader"
},
{
"path": "../workspace-manifest-reader"
}