Skip to content

Commit

Permalink
Update yaml-language-server (#6)
Browse files Browse the repository at this point in the history
* Update yaml-language-server

The new yaml-language-server contains modern JavaScript that the
umd-compat-loader does not understand.

Instead, load the yaml-language-server types directly from the source
and set all it's dependencies as noParse.

* update generated files

* downgrade to pnpm v7

* fix build

* update build file
  • Loading branch information
AndreasMadsen authored Nov 21, 2023
1 parent 62d2db2 commit 1c06e00
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 217 deletions.
2 changes: 1 addition & 1 deletion github-action/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion github-action/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from '@actions/core';
import * as path from 'path';
import { YamlVersion } from 'yaml-language-server/lib/umd/languageservice/parser/yamlParser07';
import { YamlVersion } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser07';
import { SchemaMapping, validateDirectory } from '../src';

async function run() {
Expand Down
15 changes: 10 additions & 5 deletions github-action/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');

module.exports = {
entry: path.resolve(__dirname, 'index.ts'),
Expand All @@ -11,13 +12,17 @@ module.exports = {
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test:/node_modules[\\|/](prettier|yaml-language-server|vscode-languageserver|vscode-json-languageservice)/,
use: 'umd-compat-loader'
}
}
],
},
plugins: [
new webpack.NormalModuleReplacementPlugin(
/\/umd\//,
function (resource) {
resource.request = resource.request.replace('/umd/', '/esm/');
}
),
],
resolve: {
extensions: [ '.ts', '.js' ],
},
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,17 @@
"ts-jest": "^27.0.5",
"ts-loader": "^9.2.6",
"ts-node": "^10.2.1",
"typescript": "^4.4.3",
"umd-compat-loader": "^2.1.2",
"typescript": "^4.9.5",
"vscode-json-languageservice": "^5.0.0",
"vscode-languageserver-textdocument": "^1.0.8",
"vscode-languageserver-types": "^3.17.3",
"webpack": "^5.53.0",
"webpack-cli": "^4.8.0"
"webpack": "^5.89.0",
"webpack-cli": "^4.10.0"
},
"dependencies": {
"commander": "^8.2.0",
"glob": "^7.1.7",
"vscode-uri": "^3.0.2",
"yaml-language-server": "1.7.0"
"yaml-language-server": "1.14.0"
}
}
Loading

0 comments on commit 1c06e00

Please sign in to comment.