From 8e37c124f1450260d7b7381b29f7ddbd32c9ab83 Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Fri, 4 Oct 2024 14:47:59 +0200 Subject: [PATCH] Remove outdated scripts --- libs/monaco-editor/project.json | 2 +- .../copy-language-configuration.mjs | 6 ++-- .../delete-vscode-peer-dependency.mjs | 29 ------------------- .../monaco-editor/relax-react-version.mjs | 18 ------------ 4 files changed, 4 insertions(+), 51 deletions(-) delete mode 100644 tools/scripts/monaco-editor/delete-vscode-peer-dependency.mjs delete mode 100644 tools/scripts/monaco-editor/relax-react-version.mjs diff --git a/libs/monaco-editor/project.json b/libs/monaco-editor/project.json index 07c5964f1..442ca7e1b 100644 --- a/libs/monaco-editor/project.json +++ b/libs/monaco-editor/project.json @@ -3,13 +3,13 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "libs/monaco-editor/src", "projectType": "library", - "tags": [], "targets": { "lint": { "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] }, "build": { + "dependsOn": ["^build", "generate"], "executor": "@nx/rollup:rollup", "outputs": ["{options.outputPath}"], "options": { diff --git a/tools/scripts/monaco-editor/copy-language-configuration.mjs b/tools/scripts/monaco-editor/copy-language-configuration.mjs index 056fe2ee5..4c38be2b3 100644 --- a/tools/scripts/monaco-editor/copy-language-configuration.mjs +++ b/tools/scripts/monaco-editor/copy-language-configuration.mjs @@ -7,18 +7,18 @@ import { join } from 'node:path'; import { getSourcePath } from '../shared-util.mjs'; -const tmVscode = join( +const confVscode = join( getSourcePath('vs-code-extension'), '..', 'assets', 'language-configuration.json', ); -const tmMonaco = join( +const confMonaco = join( getSourcePath('monaco-editor'), 'lib', 'generated', 'language-configuration.json', ); -await copyFile(tmVscode, tmMonaco); +await copyFile(confVscode, confMonaco); diff --git a/tools/scripts/monaco-editor/delete-vscode-peer-dependency.mjs b/tools/scripts/monaco-editor/delete-vscode-peer-dependency.mjs deleted file mode 100644 index 1ecb838ce..000000000 --- a/tools/scripts/monaco-editor/delete-vscode-peer-dependency.mjs +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg -// -// SPDX-License-Identifier: AGPL-3.0-only - -import { getOutputPath, parsePackageJson, writePackageJson } from "../shared-util.mjs"; - -// Executing this script: node path/to/delete-vscode-peer-dependency.mjs {projectName} -const [, , projectName] = process.argv; -process.chdir(getOutputPath(projectName)); - -const packageJson = parsePackageJson(); - -/* - In our editor, we perform imports from a package called "vscode". - This is however not the true name of the package. - The actual name of the package is `@codingame/monaco-vscode-api`. - `monaco-languageclient` renames this package (for whatever reason), see - https://github.com/TypeFox/monaco-languageclient/blob/c5511b19e95e237c3f95a0fc0588769263f3ba40/packages/client/package.json#L56 - - This is a problem for our bundler, because it seems unable to detect that the package has been renamed. - Thus, it creates an entry in `package.json`, saying that our library depends on `vscode` instead of `@codingame/monaco-vscode-api`. - - Since this package is a peer dependency of `monaco-languageclient` anyways, we can simply remove the entry for `vscode` to fix the problem. -*/ -if (packageJson.peerDependencies) { - delete packageJson.peerDependencies.vscode; -} - -writePackageJson(packageJson); \ No newline at end of file diff --git a/tools/scripts/monaco-editor/relax-react-version.mjs b/tools/scripts/monaco-editor/relax-react-version.mjs deleted file mode 100644 index b84a17665..000000000 --- a/tools/scripts/monaco-editor/relax-react-version.mjs +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg -// -// SPDX-License-Identifier: AGPL-3.0-only - -import { getOutputPath, parsePackageJson, writePackageJson } from "../shared-util.mjs"; - -// Executing this script: node path/to/relax-react-version.mjs {projectName} -const [, , projectName] = process.argv; -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. -if (packageJson.peerDependencies) { - packageJson.peerDependencies.react = '>= 17'; -} - -writePackageJson(packageJson); \ No newline at end of file