Repository navigation
Migrate to ES Module-only builds - #1358
Draft
shin19991207 wants to merge 7 commits into
Draft
shin19991207 wants to merge 7 commits into
shin19991207 wants to merge 7 commits into
Conversation
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Migrate to ES Module-only builds and simplify its build, test, and coverage tooling:
out/server, including TypeScript declarationsnode:testrunnerts-nodewithtscto compile tests before running them with Node’s built-in test runnernycwithc8nycadds counters to code but its default setup intercepts files loaded through CommonJSrequire(). Native ESM import uses a different loading mechanism, so that setup does not automatically measure those modules. Usingnycwith ESM requires instrumenting the code before running tests.c8reads coverage collected by Node’s JavaScript engine and works with native ESM without adding counters or an extra instrumentation step; therefore, switching to it.sinon,sinon-chai, and their typings with Node’s built-inmock.fn()andmock.method()--enable-source-mapsvscode-languageserverto 10.1.2,vscode-languageserver-typesto 3.18.4, and adapt code to the new APIs. The newer types package lets webpack select its ESM build even when CommonJS dependencies load it throughrequire(), making ESM selection consistent across the bundles.npm run buildincludes ESLintBreaking changes
out/server/srcare ESM; this directory previously contained CommonJS output. Consumers and build tools expecting CommonJS files must adapt their configuration.lib/esmandlib/umdoutputs are removed. Consumers using these paths must switch to the corresponding files underout/server/src.yaml-language-server/out/server/src/webworker/yamlServerMain.jsWhat issues does this PR fix or reference?
Fixes #1199
Is it tested? How?