monorepo-next 9.4.0 → 9.4.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/package.json +1 -1
- package/src/build-dag.js +5 -5
- package/src/build-dep-graph.js +2 -2
- package/src/build-release-graph.js +1 -1
- package/src/detach.js +1 -1
- package/src/get-workspaces-paths.js +2 -2
package/package.json
CHANGED
package/src/build-dag.js
CHANGED
@@ -32,7 +32,7 @@ function thirdPass({
|
|
32
32
|
let {
|
33
33
|
dependencyType,
|
34
34
|
dependencyRange,
|
35
|
-
} = doesDependOnPackage(_package, currentPackageName)
|
35
|
+
} = doesDependOnPackage(_package, currentPackageName) ?? {};
|
36
36
|
|
37
37
|
if (dependencyType) {
|
38
38
|
let parent = group;
|
@@ -87,13 +87,13 @@ function createPackageNode({
|
|
87
87
|
parent,
|
88
88
|
branch,
|
89
89
|
}) {
|
90
|
-
let _package = workspaceMeta.packages[packageName];
|
90
|
+
let _package = workspaceMeta.packages[packageName] ?? workspaceMeta;
|
91
91
|
|
92
92
|
let node = {
|
93
|
-
isPackage:
|
94
|
-
cwd: _package
|
93
|
+
isPackage: !_package.isPrivate,
|
94
|
+
cwd: _package.cwd,
|
95
95
|
packageName,
|
96
|
-
version: _package
|
96
|
+
version: _package.version,
|
97
97
|
dependents: [],
|
98
98
|
};
|
99
99
|
|
package/src/build-dep-graph.js
CHANGED
@@ -13,7 +13,7 @@ function copyDeps(left, right) {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
function firstPass(workspaceMeta, workspacePackageJson, workspacesPackageJsons) {
|
16
|
-
workspaceMeta.packageName = workspacePackageJson.name
|
16
|
+
workspaceMeta.packageName = workspacePackageJson.name ?? 'Workspace Root';
|
17
17
|
workspaceMeta.version = workspacePackageJson.version;
|
18
18
|
workspaceMeta.isPrivate = true;
|
19
19
|
workspaceMeta.packages = {};
|
@@ -24,7 +24,7 @@ function firstPass(workspaceMeta, workspacePackageJson, workspacesPackageJsons)
|
|
24
24
|
cwd: path.join(workspaceMeta.cwd, workspace),
|
25
25
|
packageName,
|
26
26
|
version: packageJson.version,
|
27
|
-
isPrivate: packageJson.private,
|
27
|
+
isPrivate: packageJson.private ?? false,
|
28
28
|
};
|
29
29
|
copyDeps(workspaceMeta.packages[packageName], packageJson);
|
30
30
|
}
|
@@ -207,7 +207,7 @@ function thirdPass({
|
|
207
207
|
|
208
208
|
let isDevDep = dag.dependencyType === 'devDependencies';
|
209
209
|
let currentReleaseType = current.releaseType;
|
210
|
-
let incomingReleaseType = parent
|
210
|
+
let incomingReleaseType = parent?.releaseType ?? currentReleaseType;
|
211
211
|
|
212
212
|
if (shouldInheritGreaterReleaseType && !isDevDep && isReleaseTypeLessThan(currentReleaseType, incomingReleaseType)) {
|
213
213
|
currentReleaseType = incomingReleaseType;
|
package/src/detach.js
CHANGED
@@ -58,7 +58,7 @@ async function detach({
|
|
58
58
|
let workspaceKey = 'Workspace Root';
|
59
59
|
|
60
60
|
let choices = dag.node.dependents.map(dependent => {
|
61
|
-
return dependent.node.packageName
|
61
|
+
return dependent.node.packageName ?? path.basename(dependent.node.cwd);
|
62
62
|
});
|
63
63
|
|
64
64
|
let { answers } = await inquirer.prompt([{
|
@@ -109,7 +109,7 @@ async function getWorkspacesPaths({
|
|
109
109
|
await fs.readFile(path.join(cwd, 'pnpm-workspace.yaml')),
|
110
110
|
);
|
111
111
|
} else {
|
112
|
-
packagesGlobs = workspaces.packages
|
112
|
+
packagesGlobs = workspaces.packages ?? workspaces;
|
113
113
|
}
|
114
114
|
|
115
115
|
let _2dFilesArray = await Promise.all(packagesGlobs.map(packagesGlob => {
|
@@ -157,7 +157,7 @@ function getWorkspacesPathsSync({
|
|
157
157
|
fs.readFileSync(path.join(cwd, 'pnpm-workspace.yaml')),
|
158
158
|
);
|
159
159
|
} else {
|
160
|
-
packagesGlobs = workspaces.packages
|
160
|
+
packagesGlobs = workspaces.packages ?? workspaces;
|
161
161
|
}
|
162
162
|
|
163
163
|
let _2dFilesArray = packagesGlobs.map(packagesGlob => {
|