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

Update to monaco 0.51 #492

Merged
merged 2 commits into from
Aug 23, 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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"compile-monaco-languages": "NODE_OPTIONS=--max_old_space_size=16384 rollup --config rollup/rollup.monaco.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config-monaco.json`}'",
"clean": "rm -rf dist/",
"compile-rollup-plugins": "rollup --config rollup/rollup.rollup-plugins.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config-plugins.json`, include: [`./rollup/rollup.rollup-plugins.config.ts`, `./rollup/rollup-metadata-plugin.ts`]}'",
"preprepare": "patch-package && ./scripts/install-vscode",
"preprepare": "patch-package && ./scripts/install-vscode && ./scripts/install-monaco-editor",
"lint": "eslint '{src/**/*.ts,rollup/*.ts,*.ts}'",
"generate-types": "./scripts/generate-types",
"update-vscode-dependencies": "node --loader ts-node/esm scripts/update-vscode-dependencies.ts",
Expand All @@ -36,8 +36,8 @@
"commit": "fee1edb8d6d72a0ddff41e5f71a671c23ed924b9"
},
"monaco": {
"ref": "v0.50.0",
"version": "0.50.0"
"ref": "v0.51.0",
"version": "0.51.0"
}
},
"devDependencies": {
Expand Down
35 changes: 35 additions & 0 deletions scripts/install-monaco-editor
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -e

monacoRef=$(cat package.json | jq -r '.config.monaco.ref')

package_json="`pwd`/package.json"
output_directory="`pwd`/monaco-editor"
version_info=$output_directory/version.info

if [[ -e $version_info && $(cat $version_info) == $monacoRef ]]; then
echo "monaco-editor version $monacoRef is already installed. Aborting..."
exit 0
else
echo "monaco-editor version $monacoRef is not available. Installing..."
fi

monaco_build_directory=`mktemp -d`
echo "Downloading monaco-editor languages $monacoRef in $monaco_build_directory..."
rm -rf $output_directory
mkdir -p $output_directory
curl -L --max-redirs 5 https://github.com/Microsoft/monaco-editor/tarball/$monacoRef | tar -xz -C $monaco_build_directory --strip-components=1
monacoVersion=$(cat "$monaco_build_directory/package.json" | jq -r '.["version"]')
cat <<< "$(jq ".config.monaco.version = \"$monacoVersion\"" $package_json)" > $package_json

cd $monaco_build_directory
npm ci

# Copy editor types
npm run build-monaco-editor
cp out/monaco-editor/esm/vs/editor/editor.api.d.ts $output_directory/editor.api.d.ts
cp -R out/monaco-editor/esm/vs/basic-languages $output_directory/basic-languages
cp -R out/monaco-editor/esm/vs/language $output_directory/language

# Cleaning
rm -rf $monaco_build_directory
19 changes: 0 additions & 19 deletions scripts/install-vscode
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,4 @@ rm -rf $loc_output_directory
mkdir -p $loc_output_directory
curl -L --max-redirs 5 https://github.com/microsoft/vscode-loc/archive/refs/heads/main.tar.gz | tar -xz -C $loc_output_directory --strip-components=2 vscode-loc-main/i18n

monaco_build_directory=`mktemp -d`
echo "Downloading monaco-editor languages $monacoRef in $monaco_build_directory..."
rm -rf $monaco_editor_output_directory
mkdir -p $monaco_editor_output_directory
curl -L --max-redirs 5 https://github.com/Microsoft/monaco-editor/tarball/$monacoRef | tar -xz -C $monaco_build_directory --strip-components=1
monacoVersion=$(cat "$monaco_build_directory/package.json" | jq -r '.["version"]')
cat <<< "$(jq ".config.monaco.version = \"$monacoVersion\"" $package_json)" > $package_json

cd $monaco_build_directory
npm ci

# Copy editor types
npm run build-monaco-editor
cp out/monaco-editor/esm/vs/editor/editor.api.d.ts $monaco_editor_output_directory/editor.api.d.ts
cp -R out/monaco-editor/esm/vs/basic-languages $monaco_editor_output_directory/basic-languages
cp -R out/monaco-editor/esm/vs/language $monaco_editor_output_directory/language

# Cleaning
rm -rf $monaco_build_directory
rm -rf $build_directory