monorepo-next 8.4.0 → 8.4.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/package.json +1 -2
- package/src/get-workspaces-paths.js +9 -16
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "monorepo-next",
|
3
|
-
"version": "8.4.
|
3
|
+
"version": "8.4.1",
|
4
4
|
"description": "Detach monorepo packages from normal linking",
|
5
5
|
"bin": {
|
6
6
|
"next": "bin/next.js"
|
@@ -62,7 +62,6 @@
|
|
62
62
|
"conventional-recommended-bump": "6.1.0",
|
63
63
|
"debug": "^4.3.1",
|
64
64
|
"execa": "^5.0.0",
|
65
|
-
"glob": "^8.0.0",
|
66
65
|
"inquirer": "^8.0.0",
|
67
66
|
"minimatch": "^5.0.0",
|
68
67
|
"npm-packlist": "^5.0.0",
|
@@ -1,8 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
const execa = require('execa');
|
4
|
-
const { promisify } = require('util');
|
5
|
-
const glob = promisify(require('glob'));
|
6
4
|
const path = require('path');
|
7
5
|
const readJson = require('./json').read;
|
8
6
|
|
@@ -13,27 +11,22 @@ async function getWorkspacesPaths({
|
|
13
11
|
|
14
12
|
let { workspaces } = workspacePackageJson;
|
15
13
|
|
16
|
-
let _1dFilesArray;
|
17
|
-
|
18
14
|
if (!workspaces) {
|
19
|
-
|
15
|
+
workspaces = (await execa('pnpm', ['recursive', 'exec', '--', 'node', '-e', 'console.log(process.cwd())'], { cwd: workspaceCwd })).stdout
|
20
16
|
.split(/\r?\n/)
|
21
17
|
.map(workspace => path.relative(workspaceCwd, workspace));
|
22
|
-
|
23
18
|
} else {
|
24
|
-
let
|
25
|
-
|
26
|
-
let _2dFilesArray = await Promise.all(packagesGlobs.map(packagesGlob => {
|
27
|
-
return glob(packagesGlob, {
|
19
|
+
let jsonString = (
|
20
|
+
await execa('yarn', ['--silent', 'workspaces', 'info'], {
|
28
21
|
cwd: workspaceCwd,
|
29
|
-
})
|
30
|
-
|
22
|
+
})
|
23
|
+
).stdout;
|
24
|
+
|
25
|
+
let workspacesJson = JSON.parse(jsonString);
|
31
26
|
|
32
|
-
|
27
|
+
workspaces = Object.values(workspacesJson).map(({ location }) => location);
|
33
28
|
}
|
34
|
-
|
35
|
-
workspaces = [...new Set(_1dFilesArray)];
|
36
|
-
|
29
|
+
|
37
30
|
return workspaces;
|
38
31
|
}
|
39
32
|
|