Skip to content

Commit 07e3adb

Browse files
authored
Fixed publishing to npm failing because of peerDependencies (#528)
* ci: 💚 Fixed publishing to npm failing because of peerDependencies * ci: 📝 Fixed wrong name for workflow run
1 parent 9755f74 commit 07e3adb

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/check-paths-for-windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: AGPL-3.0-only
44

5-
name: CI
5+
name: Check paths for windows
66

77
on:
88
push:

tools/scripts/monaco-editor/delete-vscode-peer-dependency.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: AGPL-3.0-only
44

5-
import {getOutputPath, parsePackageJson, writePackageJson} from "../shared-util.mjs";
5+
import { getOutputPath, parsePackageJson, writePackageJson } from "../shared-util.mjs";
66

77
// Executing this script: node path/to/delete-vscode-peer-dependency.mjs {projectName}
88
const [, , projectName] = process.argv;
@@ -22,6 +22,8 @@ const packageJson = parsePackageJson();
2222
2323
Since this package is a peer dependency of `monaco-languageclient` anyways, we can simply remove the entry for `vscode` to fix the problem.
2424
*/
25-
delete packageJson.peerDependencies.vscode;
25+
if (packageJson.peerDependencies) {
26+
delete packageJson.peerDependencies.vscode;
27+
}
2628

2729
writePackageJson(packageJson);

tools/scripts/monaco-editor/relax-react-version.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: AGPL-3.0-only
44

5-
import {getOutputPath, parsePackageJson, writePackageJson} from "../shared-util.mjs";
5+
import { getOutputPath, parsePackageJson, writePackageJson } from "../shared-util.mjs";
66

77
// Executing this script: node path/to/relax-react-version.mjs {projectName}
88
const [, , projectName] = process.argv;
@@ -11,6 +11,8 @@ process.chdir(getOutputPath(projectName));
1111
const packageJson = parsePackageJson();
1212

1313
// By default, this value is set to the exact React version we are using. This makes it hard to use the package in environments where a different React version is present.
14-
packageJson.peerDependencies.react = '>= 17';
14+
if (packageJson.peerDependencies) {
15+
packageJson.peerDependencies.react = '>= 17';
16+
}
1517

1618
writePackageJson(packageJson);

0 commit comments

Comments
 (0)