Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed publishing to npm failing because of peerDependencies #528

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-paths-for-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

name: CI
name: Check paths for windows

on:
push:
Expand Down
6 changes: 4 additions & 2 deletions tools/scripts/monaco-editor/delete-vscode-peer-dependency.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0-only

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

// Executing this script: node path/to/delete-vscode-peer-dependency.mjs {projectName}
const [, , projectName] = process.argv;
Expand All @@ -22,6 +22,8 @@ const packageJson = parsePackageJson();

Since this package is a peer dependency of `monaco-languageclient` anyways, we can simply remove the entry for `vscode` to fix the problem.
*/
delete packageJson.peerDependencies.vscode;
if (packageJson.peerDependencies) {
delete packageJson.peerDependencies.vscode;
}

writePackageJson(packageJson);
6 changes: 4 additions & 2 deletions tools/scripts/monaco-editor/relax-react-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0-only

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

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

// 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.
packageJson.peerDependencies.react = '>= 17';
if (packageJson.peerDependencies) {
packageJson.peerDependencies.react = '>= 17';
}

writePackageJson(packageJson);
Loading