@pnpm/workspace.root-finder 1100.0.0 → 1100.0.2
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/README.md +3 -3
- package/lib/index.js +2 -2
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# @pnpm/
|
|
1
|
+
# @pnpm/workspace.root-finder
|
|
2
2
|
|
|
3
3
|
> Finds the root of a pnpm workspace
|
|
4
4
|
|
|
5
|
-
[](https://npmx.dev/package/@pnpm/workspace.root-finder)
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
pnpm add @pnpm/
|
|
10
|
+
pnpm add @pnpm/workspace.root-finder
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## License
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { PnpmError } from '@pnpm/error';
|
|
4
|
-
import
|
|
4
|
+
import * as find from 'empathic/find';
|
|
5
5
|
const WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR';
|
|
6
6
|
const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
7
7
|
const INVALID_WORKSPACE_MANIFEST_FILENAME = [
|
|
@@ -17,7 +17,7 @@ export async function findWorkspaceDir(cwd) {
|
|
|
17
17
|
const workspaceManifestDirEnvVar = process.env[WORKSPACE_DIR_ENV_VAR] ?? process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
18
18
|
const workspaceManifestLocation = workspaceManifestDirEnvVar
|
|
19
19
|
? path.join(workspaceManifestDirEnvVar, WORKSPACE_MANIFEST_FILENAME)
|
|
20
|
-
:
|
|
20
|
+
: find.any([WORKSPACE_MANIFEST_FILENAME, ...INVALID_WORKSPACE_MANIFEST_FILENAME], { cwd: await getRealPath(cwd) });
|
|
21
21
|
if (workspaceManifestLocation && path.basename(workspaceManifestLocation) !== WORKSPACE_MANIFEST_FILENAME) {
|
|
22
22
|
throw new PnpmError('BAD_WORKSPACE_MANIFEST_NAME', `The workspace manifest file should be named "pnpm-workspace.yaml". File found: ${workspaceManifestLocation}`);
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/workspace.root-finder",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.2",
|
|
4
4
|
"description": "Finds the root of a pnpm workspace",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
],
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"funding": "https://opencollective.com/pnpm",
|
|
11
|
-
"repository":
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/pnpm/pnpm/tree/main/workspace/root-finder"
|
|
14
|
+
},
|
|
12
15
|
"homepage": "https://github.com/pnpm/pnpm/tree/main/workspace/root-finder#readme",
|
|
13
16
|
"bugs": {
|
|
14
17
|
"url": "https://github.com/pnpm/pnpm/issues"
|
|
@@ -24,11 +27,12 @@
|
|
|
24
27
|
"!*.map"
|
|
25
28
|
],
|
|
26
29
|
"dependencies": {
|
|
27
|
-
"
|
|
30
|
+
"empathic": "^2.0.0",
|
|
28
31
|
"@pnpm/error": "1100.0.0"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"@
|
|
34
|
+
"@jest/globals": "30.4.1",
|
|
35
|
+
"@pnpm/workspace.root-finder": "1100.0.2"
|
|
32
36
|
},
|
|
33
37
|
"engines": {
|
|
34
38
|
"node": ">=22.13"
|