From 539330136d84891d005e2d0d539932a05644ba54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20B=C3=A4umer?= Date: Tue, 2 Jul 2024 15:07:47 +0200 Subject: [PATCH] Move to latest compiler, NodeJS 20.9.0, es2022 and exports statements. (#1502) * WIP * More version updates * More code cleanup * Convert client to export property * Fix imports * Get test oto work again * Update Readme.md * Revert timeout --- .tsconfigrc.js | 18 +++--- README.md | 4 ++ build/bin/runBrowserTests.js | 63 ++++++++++--------- build/bin/webpack.js | 2 +- client-node-tests/package.json | 10 +-- client-node-tests/src/converter.test.ts | 14 ++--- client-node-tests/src/index.ts | 2 +- client-node-tests/src/integration.test.ts | 2 +- client-node-tests/src/tsconfig.json | 8 +-- client-node-tests/src/tsconfig.publish.json | 8 +-- client-node-tests/src/tsconfig.watch.json | 8 +-- client-node-tests/src/workspaceFolder.test.ts | 6 +- client/browser.d.ts | 6 -- client/browser.js | 7 --- client/node.cmd | 5 -- client/node.d.ts | 6 -- client/node.js | 7 --- client/package.json | 31 ++++++--- client/src/browser/tsconfig.json | 8 +-- client/src/browser/tsconfig.publish.json | 8 +-- client/src/browser/tsconfig.watch.json | 8 +-- client/src/common/notebook.ts | 4 +- client/src/common/tsconfig.json | 8 +-- client/src/common/tsconfig.publish.json | 8 +-- client/src/common/tsconfig.watch.json | 8 +-- client/src/node/tsconfig.json | 8 +-- client/src/node/tsconfig.publish.json | 8 +-- client/src/node/tsconfig.watch.json | 8 +-- jsonrpc/browser.d.ts | 6 -- jsonrpc/browser.js | 7 --- jsonrpc/node.cmd | 5 -- jsonrpc/node.d.ts | 6 -- jsonrpc/node.js | 7 --- jsonrpc/package.json | 27 +++++--- jsonrpc/src/browser/test/tsconfig.json | 8 +-- .../src/browser/test/tsconfig.publish.json | 8 +-- jsonrpc/src/browser/test/tsconfig.watch.json | 8 +-- jsonrpc/src/browser/tsconfig.json | 8 +-- jsonrpc/src/browser/tsconfig.publish.json | 8 +-- jsonrpc/src/browser/tsconfig.watch.json | 8 +-- jsonrpc/src/common/connection.ts | 1 + jsonrpc/src/common/test/general.test.ts | 2 +- jsonrpc/src/common/test/tsconfig.json | 8 +-- jsonrpc/src/common/test/tsconfig.publish.json | 8 +-- jsonrpc/src/common/test/tsconfig.watch.json | 8 +-- jsonrpc/src/common/tsconfig.json | 8 +-- jsonrpc/src/common/tsconfig.publish.json | 8 +-- jsonrpc/src/common/tsconfig.watch.json | 8 +-- jsonrpc/src/node/test/connection.test.ts | 29 ++++----- jsonrpc/src/node/test/tsconfig.json | 8 +-- jsonrpc/src/node/test/tsconfig.publish.json | 8 +-- jsonrpc/src/node/test/tsconfig.watch.json | 8 +-- jsonrpc/src/node/tsconfig.json | 8 +-- jsonrpc/src/node/tsconfig.publish.json | 8 +-- jsonrpc/src/node/tsconfig.watch.json | 8 +-- jsonrpc/tsconfig.tsbuildinfo | 1 + package-lock.json | 24 +++++-- package.json | 4 +- protocol/browser.d.ts | 6 -- protocol/browser.js | 7 --- protocol/node.cmd | 5 -- protocol/node.d.ts | 6 -- protocol/node.js | 7 --- protocol/package.json | 27 +++++--- protocol/src/browser/test/tsconfig.json | 8 +-- .../src/browser/test/tsconfig.publish.json | 8 +-- protocol/src/browser/test/tsconfig.watch.json | 8 +-- protocol/src/browser/tsconfig.json | 8 +-- protocol/src/browser/tsconfig.publish.json | 8 +-- protocol/src/browser/tsconfig.watch.json | 8 +-- protocol/src/common/protocol.ts | 4 +- protocol/src/common/tsconfig.json | 8 +-- protocol/src/common/tsconfig.publish.json | 8 +-- protocol/src/common/tsconfig.watch.json | 8 +-- protocol/src/node/test/tsconfig.json | 8 +-- protocol/src/node/test/tsconfig.publish.json | 8 +-- protocol/src/node/test/tsconfig.watch.json | 8 +-- protocol/src/node/tsconfig.json | 8 +-- protocol/src/node/tsconfig.publish.json | 8 +-- protocol/src/node/tsconfig.watch.json | 8 +-- server/browser.d.ts | 6 -- server/browser.js | 7 --- server/node.cmd | 5 -- server/node.d.ts | 6 -- server/node.js | 7 --- server/package.json | 27 +++++--- server/src/browser/tsconfig.json | 8 +-- server/src/browser/tsconfig.publish.json | 8 +-- server/src/browser/tsconfig.watch.json | 8 +-- server/src/common/api.ts | 2 +- server/src/common/tsconfig.json | 8 +-- server/src/common/tsconfig.publish.json | 8 +-- server/src/common/tsconfig.watch.json | 8 +-- server/src/node/main.ts | 3 +- server/src/node/test/tsconfig.json | 8 +-- server/src/node/test/tsconfig.publish.json | 8 +-- server/src/node/test/tsconfig.watch.json | 8 +-- server/src/node/tsconfig.json | 8 +-- server/src/node/tsconfig.publish.json | 8 +-- server/src/node/tsconfig.watch.json | 8 +-- textDocument/package.json | 12 ++-- tools/package.json | 9 ++- tools/tsconfig.json | 8 +-- tools/tsconfig.watch.json | 8 +-- tsconfig-gen/package.json | 18 +++--- tsconfig-gen/tsconfig.json | 8 +-- tsconfig-gen/tsconfig.publish.json | 8 +-- tsconfig-gen/tsconfig.watch.json | 8 +-- types/package.json | 14 ++--- 109 files changed, 461 insertions(+), 519 deletions(-) delete mode 100644 client/browser.d.ts delete mode 100644 client/browser.js delete mode 100644 client/node.cmd delete mode 100644 client/node.d.ts delete mode 100644 client/node.js delete mode 100644 jsonrpc/browser.d.ts delete mode 100644 jsonrpc/browser.js delete mode 100644 jsonrpc/node.cmd delete mode 100644 jsonrpc/node.d.ts delete mode 100644 jsonrpc/node.js create mode 100644 jsonrpc/tsconfig.tsbuildinfo delete mode 100644 protocol/browser.d.ts delete mode 100644 protocol/browser.js delete mode 100644 protocol/node.cmd delete mode 100644 protocol/node.d.ts delete mode 100644 protocol/node.js delete mode 100644 server/browser.d.ts delete mode 100644 server/browser.js delete mode 100644 server/node.cmd delete mode 100644 server/node.d.ts delete mode 100644 server/node.js diff --git a/.tsconfigrc.js b/.tsconfigrc.js index 02544e17..cde71b6f 100644 --- a/.tsconfigrc.js +++ b/.tsconfigrc.js @@ -36,8 +36,8 @@ const general = { * rely on webpack to package everything correctly. */ compilerOptions: { - module: 'commonjs', - moduleResolution: 'node' + module: 'node16', + moduleResolution: 'node16' } }; @@ -367,8 +367,8 @@ const compileCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, { declarationMap: true, noUnusedLocals: true, noUnusedParameters: true, - target: 'es2020', - lib: [ 'es2020' ], + target: 'es2022', + lib: [ 'es2022' ], }); /** @type ProjectOptions */ @@ -386,8 +386,8 @@ const watchCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, { noUnusedLocals: false, noUnusedParameters: false, assumeChangesOnlyAffectDirectDependencies: true, - target: 'es2020', - lib: [ 'es2020' ], + target: 'es2022', + lib: [ 'es2022' ], }); /** @type ProjectOptions */ @@ -404,8 +404,8 @@ const publishCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, { declarationMap: false, noUnusedLocals: true, noUnusedParameters: true, - target: 'es2020', - lib: [ 'es2020' ] + target: 'es2022', + lib: [ 'es2022' ] }); @@ -425,6 +425,7 @@ const umdCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, { noUnusedParameters: true, target: 'es5', module: 'umd', + moduleResolution: 'node', lib: [ 'es2015' ], }); @@ -471,6 +472,7 @@ const esmPublishCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, sourceMap: false, target: 'es6', module: 'es6', + moduleResolution: 'node', lib: [ 'es2015' ] }); diff --git a/README.md b/README.md index 4b61c785..3de6cf89 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ After cloning the repository, run `npm install` to install dependencies and `npm ## Next (10.0.0-next.* Client and 10.0.0-next.* Server) +- Upgraded to newer libraries, compilers and package.json exports rules: + - Compiler upgraded to `5.5.x`. + - Libs now depend on NodeJS `20.9.0` and `es2022`. + - `vscode-jsonrpc`, `vscode-languageserver-protocol`, `vscode-languageclient` and `vscode-languageserver` now use the `exports` property instead of having a `main` and `typings` property. This might need adoption in tsconfig.json files around the `module` and `moduleResolution`. The LSP libraries currently use `node16` for both values. - added proposed CodeActionKind.RefactorMove - snippet support in Workspace edits - support to control the parallelism of the dispatch requests and notification. This is a breaking change since it allows notification handlers to return a promise to control this. diff --git a/build/bin/runBrowserTests.js b/build/bin/runBrowserTests.js index 438f244b..8bda5553 100644 --- a/build/bin/runBrowserTests.js +++ b/build/bin/runBrowserTests.js @@ -77,37 +77,42 @@ async function runTests(location) { } }); server.listen(8080, '127.0.0.1', async () => { - let failCount = 0; - const browser = await playwright['chromium'].launch({ headless: true, devtools: false }); - const context = await browser.newContext(); - const page = await context.newPage(); - const emitter = new events.EventEmitter(); - emitter.on('fail', () => { - failCount++; - }); - emitter.on('end', async () => { - process.exitCode = failCount === 0 ? 0 : 1; - await browser.close(); - server.close((err) => { - if (err) { - reject(err); - } else { - resolve(); - } + try { + let failCount = 0; + const browser = await playwright['chromium'].launch({ headless: true, devtools: false }); + const context = await browser.newContext(); + const page = await context.newPage(); + // page.setDefaultTimeout(1000000); + const emitter = new events.EventEmitter(); + emitter.on('fail', () => { + failCount++; + }); + emitter.on('end', async () => { + process.exitCode = failCount === 0 ? 0 : 1; + await browser.close(); + server.close((err) => { + if (err) { + reject(err); + } else { + resolve(); + } + }); + }); + const echoRunner = new EchoRunner(emitter, 'Chromium'); + if (process.platform === 'win32') { + new mocha.reporters.List(echoRunner); + } else { + new mocha.reporters.Spec(echoRunner); + } + await page.exposeFunction('mocha_report', (type, data1, data2) => { + emitter.emit(type, data1, data2); }); - }); - const echoRunner = new EchoRunner(emitter, 'Chromium'); - if (process.platform === 'win32') { - new mocha.reporters.List(echoRunner); - } else { - new mocha.reporters.Spec(echoRunner); - } - await page.exposeFunction('mocha_report', (type, data1, data2) => { - emitter.emit(type, data1, data2); - }); - const target = new url.URL(location); - page.goto(target.href); + const target = new url.URL(location); + page.goto(target.href); + } catch (error) { + console.error(error); + } }); }); } diff --git a/build/bin/webpack.js b/build/bin/webpack.js index 877069b7..dfe636ea 100644 --- a/build/bin/webpack.js +++ b/build/bin/webpack.js @@ -3,4 +3,4 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -require('../../node_modules/webpack/bin/webpack.js') \ No newline at end of file +require('../../node_modules/webpack/bin/webpack.js'); \ No newline at end of file diff --git a/client-node-tests/package.json b/client-node-tests/package.json index 3f1d96a7..d433ecaa 100644 --- a/client-node-tests/package.json +++ b/client-node-tests/package.json @@ -17,14 +17,14 @@ "main": "./extension.js", "contributes": {}, "scripts": { - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib", - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", + "clean": "rimraf lib", + "compile": "tsc -b ./tsconfig.json", + "watch": "tsc -b ./tsconfig.watch.json -w", + "lint": "eslint --ext ts src", "test": "node ../build/bin/symlink-tests.js && node lib/runTests.js", "all": "npm run clean && npm run compile && npm run lint && npm run test", "symlink:publish": "node ../build/bin/symlink-client-tests-publish.js", - "compile:publish": "node ../build/bin/tsc -b ./tsconfig.publish.json", + "compile:publish": "tsc -b ./tsconfig.publish.json", "test:publish": "node lib/runTests.js", "all:publish": "git clean -xfd . && npm install && npm run symlink:publish && npm run compile:publish && npm run test:publish" }, diff --git a/client-node-tests/src/converter.test.ts b/client-node-tests/src/converter.test.ts index c04c065d..411386d1 100644 --- a/client-node-tests/src/converter.test.ts +++ b/client-node-tests/src/converter.test.ts @@ -6,13 +6,13 @@ import { strictEqual, deepEqual, ok } from 'assert'; import * as proto from 'vscode-languageclient'; -import * as codeConverter from 'vscode-languageclient/lib/common/codeConverter'; -import * as protocolConverter from 'vscode-languageclient/lib/common/protocolConverter'; -import ProtocolCompletionItem from 'vscode-languageclient/lib/common/protocolCompletionItem'; -import ProtocolInlayHint from 'vscode-languageclient/lib/common/protocolInlayHint'; -import { DiagnosticCode, ProtocolDiagnostic } from 'vscode-languageclient/lib/common/protocolDiagnostic'; -import * as Is from 'vscode-languageclient/lib/common/utils/is'; -import * as async from 'vscode-languageclient/lib/common/utils/async'; +import * as codeConverter from 'vscode-languageclient/$test/common/codeConverter'; +import * as protocolConverter from 'vscode-languageclient/$test/common/protocolConverter'; +import ProtocolCompletionItem from 'vscode-languageclient/$test/common/protocolCompletionItem'; +import ProtocolInlayHint from 'vscode-languageclient/$test/common/protocolInlayHint'; +import { DiagnosticCode, ProtocolDiagnostic } from 'vscode-languageclient/$test/common/protocolDiagnostic'; +import * as Is from 'vscode-languageclient/$test/common/utils/is'; +import * as async from 'vscode-languageclient/$test/common/utils/async'; import * as vscode from 'vscode'; diff --git a/client-node-tests/src/index.ts b/client-node-tests/src/index.ts index 5bbfa290..2ee5cf71 100644 --- a/client-node-tests/src/index.ts +++ b/client-node-tests/src/index.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import * as Mocha from 'mocha'; +import Mocha from 'mocha'; import { glob } from 'glob'; export function run(testsRoot: string, cb: (error: any, failures?: number) => void): void { diff --git a/client-node-tests/src/integration.test.ts b/client-node-tests/src/integration.test.ts index 4395f418..4d8fb984 100644 --- a/client-node-tests/src/integration.test.ts +++ b/client-node-tests/src/integration.test.ts @@ -10,7 +10,7 @@ import * as vscode from 'vscode'; import * as lsclient from 'vscode-languageclient/node'; import * as proto from 'vscode-languageserver-protocol'; import { MemoryFileSystemProvider } from './memoryFileSystemProvider'; -import { vsdiag, DiagnosticProviderMiddleware } from 'vscode-languageclient/lib/common/diagnostic'; +import { vsdiag, DiagnosticProviderMiddleware } from 'vscode-languageclient'; namespace GotNotifiedRequest { export const method: 'testing/gotNotified' = 'testing/gotNotified'; diff --git a/client-node-tests/src/tsconfig.json b/client-node-tests/src/tsconfig.json index 7fb35b87..e83c040d 100644 --- a/client-node-tests/src/tsconfig.json +++ b/client-node-tests/src/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node", @@ -9,7 +9,7 @@ "mocha" ], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -22,7 +22,7 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../lib", "tsBuildInfoFile": "../lib/compile.tsbuildInfo", "incremental": true diff --git a/client-node-tests/src/tsconfig.publish.json b/client-node-tests/src/tsconfig.publish.json index b78fe329..7daf5833 100644 --- a/client-node-tests/src/tsconfig.publish.json +++ b/client-node-tests/src/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node", @@ -9,7 +9,7 @@ "mocha" ], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -22,7 +22,7 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../lib", "tsBuildInfoFile": "../lib/publish.tsbuildInfo", "incremental": true diff --git a/client-node-tests/src/tsconfig.watch.json b/client-node-tests/src/tsconfig.watch.json index a4fa704c..9db12185 100644 --- a/client-node-tests/src/tsconfig.watch.json +++ b/client-node-tests/src/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node", @@ -9,7 +9,7 @@ "mocha" ], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -23,7 +23,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "outDir": "../lib", "tsBuildInfoFile": "../lib/watch.tsbuildInfo", "incremental": true diff --git a/client-node-tests/src/workspaceFolder.test.ts b/client-node-tests/src/workspaceFolder.test.ts index 4977c367..cf3ececb 100644 --- a/client-node-tests/src/workspaceFolder.test.ts +++ b/client-node-tests/src/workspaceFolder.test.ts @@ -1,10 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; import * as assert from 'assert'; import * as vscode from 'vscode'; import * as sinon from 'sinon'; -import { WorkspaceFoldersFeature } from 'vscode-languageclient/lib/common/workspaceFolder'; +import { WorkspaceFoldersFeature } from 'vscode-languageclient/$test/common/workspaceFolder'; import { BaseLanguageClient, MessageTransports, DidChangeWorkspaceFoldersParams, Disposable } from 'vscode-languageclient'; import * as proto from 'vscode-languageclient'; diff --git a/client/browser.d.ts b/client/browser.d.ts deleted file mode 100644 index e628f1b5..00000000 --- a/client/browser.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/browser/main'; \ No newline at end of file diff --git a/client/browser.js b/client/browser.js deleted file mode 100644 index f5caebf0..00000000 --- a/client/browser.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/browser/main'); \ No newline at end of file diff --git a/client/node.cmd b/client/node.cmd deleted file mode 100644 index d3282c03..00000000 --- a/client/node.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -REM This file is necessary to ensure that under Windows we don't -REM run the node.js file in the Windows Script Host when using -REM node in packakge.json scripts. See also PATHEXT setting -node.exe %* \ No newline at end of file diff --git a/client/node.d.ts b/client/node.d.ts deleted file mode 100644 index b4c4fcd7..00000000 --- a/client/node.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/node/main'; \ No newline at end of file diff --git a/client/node.js b/client/node.js deleted file mode 100644 index 388e3197..00000000 --- a/client/node.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/node/main'); \ No newline at end of file diff --git a/client/package.json b/client/package.json index 469e37da..63f6e49d 100644 --- a/client/package.json +++ b/client/package.json @@ -16,11 +16,24 @@ "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" }, "enabledApiProposals": [], - "main": "./lib/node/main.js", - "browser": { - "./lib/node/main.js": "./lib/browser/main.js" + "exports": { + ".": { + "types": "./lib/common/api.d.ts", + "default": "./lib/common/api.js" + }, + "./node": { + "types": "./lib/node/main.d.ts", + "node": "./lib/node/main.js" + }, + "./browser": { + "types": "./lib/browser/main.d.ts", + "browser": "./lib/browser/main.js" + }, + "./$test/common/*": { + "types": "./lib/common/*.d.ts", + "node": "./lib/common/*.js" + } }, - "typings": "./lib/common/api.d.ts", "devDependencies": { "@types/minimatch": "^5.1.2", "@types/semver": "^7.5.8", @@ -35,14 +48,14 @@ "scripts": { "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", "prepack": "npm run all:publish", - "compile": "node ../build/bin/tsc -b ./tsconfig.json && shx cp src/node/terminateProcess.sh lib/node/terminateProcess.sh", + "compile": "tsc -b ./tsconfig.json && shx cp src/node/terminateProcess.sh lib/node/terminateProcess.sh", "compile:clean": "git clean -xfd . && npm install && npm run clean && npm run compile", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", + "watch": "tsc -b ./tsconfig.watch.json -w", + "lint": "eslint --ext ts src", "test": "cd ../client-node-tests && npm test && cd ../client", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib", + "clean": "rimraf lib", "all": "npm run clean && npm run compile && npm run lint && npm test", - "compile:publish": "node ../build/bin/tsc -b ./tsconfig.publish.json && shx cp src/node/terminateProcess.sh lib/node/terminateProcess.sh", + "compile:publish": "tsc -b ./tsconfig.publish.json && shx cp src/node/terminateProcess.sh lib/node/terminateProcess.sh", "all:publish": "git clean -xfd . && npm install && npm run updateVSCodeVersion && npm run compile:publish && npm run lint && cd ../client-node-tests && npm run all:publish && cd ..", "preversion": "npm test", "updateVSCodeVersion": "node ./bin/updateVSCode.js" diff --git a/client/src/browser/tsconfig.json b/client/src/browser/tsconfig.json index d3379d14..700b8542 100644 --- a/client/src/browser/tsconfig.json +++ b/client/src/browser/tsconfig.json @@ -3,11 +3,11 @@ "types": [ "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -20,7 +20,7 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", "incremental": true diff --git a/client/src/browser/tsconfig.publish.json b/client/src/browser/tsconfig.publish.json index eaaf4feb..0541b838 100644 --- a/client/src/browser/tsconfig.publish.json +++ b/client/src/browser/tsconfig.publish.json @@ -3,11 +3,11 @@ "types": [ "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -20,7 +20,7 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", "incremental": true diff --git a/client/src/browser/tsconfig.watch.json b/client/src/browser/tsconfig.watch.json index a02cc608..705e1b29 100644 --- a/client/src/browser/tsconfig.watch.json +++ b/client/src/browser/tsconfig.watch.json @@ -3,11 +3,11 @@ "types": [ "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -21,7 +21,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", "incremental": true diff --git a/client/src/common/notebook.ts b/client/src/common/notebook.ts index 51b4b952..81888e13 100644 --- a/client/src/common/notebook.ts +++ b/client/src/common/notebook.ts @@ -8,7 +8,8 @@ import * as minimatch from 'minimatch'; import * as proto from 'vscode-languageserver-protocol'; import { - StaticRegistrationOptions, NotebookDocumentFilter, TextDocumentItem, NotebookCellTextDocumentFilter, LSPAny + StaticRegistrationOptions, NotebookDocumentFilter, TextDocumentItem, NotebookCellTextDocumentFilter, LSPAny, + NotebookDocumentFilterWithCells, NotebookDocumentFilterWithNotebook } from 'vscode-languageserver-protocol'; import * as UUID from './utils/uuid'; @@ -17,7 +18,6 @@ import * as Is from './utils/is'; import * as _c2p from './codeConverter'; import * as _p2c from './protocolConverter'; import { DynamicFeature, FeatureClient, RegistrationData, FeatureState } from './features'; -import { NotebookDocumentFilterWithCells, NotebookDocumentFilterWithNotebook } from 'vscode-languageserver-protocol/lib/common/protocol.notebook'; function ensure(target: T, key: K): T[K] { diff --git a/client/src/common/tsconfig.json b/client/src/common/tsconfig.json index 788ec0d9..9cc6a62d 100644 --- a/client/src/common/tsconfig.json +++ b/client/src/common/tsconfig.json @@ -3,8 +3,8 @@ "types": [ "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -16,9 +16,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", diff --git a/client/src/common/tsconfig.publish.json b/client/src/common/tsconfig.publish.json index e20e0f22..5556bf25 100644 --- a/client/src/common/tsconfig.publish.json +++ b/client/src/common/tsconfig.publish.json @@ -3,8 +3,8 @@ "types": [ "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -16,9 +16,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", diff --git a/client/src/common/tsconfig.watch.json b/client/src/common/tsconfig.watch.json index b6513bc7..9c33a2aa 100644 --- a/client/src/common/tsconfig.watch.json +++ b/client/src/common/tsconfig.watch.json @@ -3,8 +3,8 @@ "types": [ "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", diff --git a/client/src/node/tsconfig.json b/client/src/node/tsconfig.json index 0258664d..ea4f7c6c 100644 --- a/client/src/node/tsconfig.json +++ b/client/src/node/tsconfig.json @@ -4,8 +4,8 @@ "node", "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", diff --git a/client/src/node/tsconfig.publish.json b/client/src/node/tsconfig.publish.json index 475e8463..ec50a2bb 100644 --- a/client/src/node/tsconfig.publish.json +++ b/client/src/node/tsconfig.publish.json @@ -4,8 +4,8 @@ "node", "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", diff --git a/client/src/node/tsconfig.watch.json b/client/src/node/tsconfig.watch.json index 868d27d6..a50721ac 100644 --- a/client/src/node/tsconfig.watch.json +++ b/client/src/node/tsconfig.watch.json @@ -4,8 +4,8 @@ "node", "vscode" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -18,9 +18,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", diff --git a/jsonrpc/browser.d.ts b/jsonrpc/browser.d.ts deleted file mode 100644 index e628f1b5..00000000 --- a/jsonrpc/browser.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/browser/main'; \ No newline at end of file diff --git a/jsonrpc/browser.js b/jsonrpc/browser.js deleted file mode 100644 index f5caebf0..00000000 --- a/jsonrpc/browser.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/browser/main'); \ No newline at end of file diff --git a/jsonrpc/node.cmd b/jsonrpc/node.cmd deleted file mode 100644 index d3282c03..00000000 --- a/jsonrpc/node.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -REM This file is necessary to ensure that under Windows we don't -REM run the node.js file in the Windows Script Host when using -REM node in packakge.json scripts. See also PATHEXT setting -node.exe %* \ No newline at end of file diff --git a/jsonrpc/node.d.ts b/jsonrpc/node.d.ts deleted file mode 100644 index b4c4fcd7..00000000 --- a/jsonrpc/node.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/node/main'; \ No newline at end of file diff --git a/jsonrpc/node.js b/jsonrpc/node.js deleted file mode 100644 index 388e3197..00000000 --- a/jsonrpc/node.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/node/main'); \ No newline at end of file diff --git a/jsonrpc/package.json b/jsonrpc/package.json index 04bcfff1..3505fed2 100644 --- a/jsonrpc/package.json +++ b/jsonrpc/package.json @@ -15,11 +15,20 @@ "engines": { "node": ">=14.0.0" }, - "main": "./lib/node/main.js", - "browser": { - "./lib/node/main.js": "./lib/browser/main.js" + "exports": { + ".": { + "types": "./lib/common/api.d.ts", + "default": "./lib/common/api.js" + }, + "./node": { + "types": "./lib/node/main.d.ts", + "node": "./lib/node/main.js" + }, + "./browser": { + "types": "./lib/browser/main.d.ts", + "browser": "./lib/browser/main.js" + } }, - "typings": "./lib/common/api.d.ts", "devDependencies": { "@types/msgpack-lite": "^0.1.10", "msgpack-lite": "^0.1.26" @@ -28,10 +37,10 @@ "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", "prepack": "npm run all:publish", "preversion": "npm test", - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib && node ../node_modules/rimraf/dist/esm/bin.mjs dist", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", + "compile": "tsc -b ./tsconfig.json", + "watch": "tsc -b ./tsconfig.watch.json -w", + "clean": "rimraf lib && rimraf dist", + "lint": "eslint --ext ts src", "test": "npm run test:node && npm run test:browser", "test:node": "node ../node_modules/mocha/bin/_mocha", "test:browser": "npm run webpack:test:silent && node ../build/bin/runBrowserTests.js http://127.0.0.1:8080/jsonrpc/src/browser/test/", @@ -39,7 +48,7 @@ "webpack:test": "node ../build/bin/webpack --mode none --config ./src/browser/test/webpack.config.js", "webpack:test:silent": "node ../build/bin/webpack --no-stats --mode none --config ./src/browser/test/webpack.config.js", "all": "npm run clean && npm run compile && npm run lint && npm run test", - "compile:publish": "node ../build/bin/tsc -b ./tsconfig.publish.json", + "compile:publish": "tsc -b ./tsconfig.publish.json", "all:publish": "git clean -xfd . && npm install && npm run compile:publish && npm run lint && npm run test" } } diff --git a/jsonrpc/src/browser/test/tsconfig.json b/jsonrpc/src/browser/test/tsconfig.json index 1aa54189..535e99a3 100644 --- a/jsonrpc/src/browser/test/tsconfig.json +++ b/jsonrpc/src/browser/test/tsconfig.json @@ -3,11 +3,11 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -20,7 +20,7 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../../lib/browser/test", "tsBuildInfoFile": "../../../lib/browser/test/compile.tsbuildInfo", "incremental": true diff --git a/jsonrpc/src/browser/test/tsconfig.publish.json b/jsonrpc/src/browser/test/tsconfig.publish.json index 22788b0c..a061b6ec 100644 --- a/jsonrpc/src/browser/test/tsconfig.publish.json +++ b/jsonrpc/src/browser/test/tsconfig.publish.json @@ -3,11 +3,11 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -20,7 +20,7 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../../lib/browser/test", "tsBuildInfoFile": "../../../lib/browser/test/publish.tsbuildInfo", "incremental": true diff --git a/jsonrpc/src/browser/test/tsconfig.watch.json b/jsonrpc/src/browser/test/tsconfig.watch.json index 839228c2..406f877f 100644 --- a/jsonrpc/src/browser/test/tsconfig.watch.json +++ b/jsonrpc/src/browser/test/tsconfig.watch.json @@ -3,11 +3,11 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -21,7 +21,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "outDir": "../../../lib/browser/test", "tsBuildInfoFile": "../../../lib/browser/test/watch.tsbuildInfo", "incremental": true diff --git a/jsonrpc/src/browser/tsconfig.json b/jsonrpc/src/browser/tsconfig.json index 2c723865..8b7875d3 100644 --- a/jsonrpc/src/browser/tsconfig.json +++ b/jsonrpc/src/browser/tsconfig.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -18,7 +18,7 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", "incremental": true, diff --git a/jsonrpc/src/browser/tsconfig.publish.json b/jsonrpc/src/browser/tsconfig.publish.json index 7f9c4ebd..840360da 100644 --- a/jsonrpc/src/browser/tsconfig.publish.json +++ b/jsonrpc/src/browser/tsconfig.publish.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -18,7 +18,7 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", "incremental": true, diff --git a/jsonrpc/src/browser/tsconfig.watch.json b/jsonrpc/src/browser/tsconfig.watch.json index 7d501668..422b0832 100644 --- a/jsonrpc/src/browser/tsconfig.watch.json +++ b/jsonrpc/src/browser/tsconfig.watch.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -19,7 +19,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", "incremental": true, diff --git a/jsonrpc/src/common/connection.ts b/jsonrpc/src/common/connection.ts index f095ff0e..2d099a6e 100644 --- a/jsonrpc/src/common/connection.ts +++ b/jsonrpc/src/common/connection.ts @@ -2,6 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ +/// import RAL from './ral'; import * as Is from './is'; diff --git a/jsonrpc/src/common/test/general.test.ts b/jsonrpc/src/common/test/general.test.ts index ed168b51..f7658f60 100644 --- a/jsonrpc/src/common/test/general.test.ts +++ b/jsonrpc/src/common/test/general.test.ts @@ -4,7 +4,7 @@ * ------------------------------------------------------------------------------------------ */ 'use strict'; -import * as assert from 'assert'; +import assert from 'assert'; import { Trace } from '../api'; suite('General Tests', () => { diff --git a/jsonrpc/src/common/test/tsconfig.json b/jsonrpc/src/common/test/tsconfig.json index bd7f8a8a..014ee90b 100644 --- a/jsonrpc/src/common/test/tsconfig.json +++ b/jsonrpc/src/common/test/tsconfig.json @@ -3,8 +3,8 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -16,9 +16,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/common/test", "tsBuildInfoFile": "../../../lib/common/test/compile.tsbuildInfo", diff --git a/jsonrpc/src/common/test/tsconfig.publish.json b/jsonrpc/src/common/test/tsconfig.publish.json index 38b6bc04..b06f7b55 100644 --- a/jsonrpc/src/common/test/tsconfig.publish.json +++ b/jsonrpc/src/common/test/tsconfig.publish.json @@ -3,8 +3,8 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -16,9 +16,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/common/test", "tsBuildInfoFile": "../../../lib/common/test/publish.tsbuildInfo", diff --git a/jsonrpc/src/common/test/tsconfig.watch.json b/jsonrpc/src/common/test/tsconfig.watch.json index 67f5d537..b02cc59d 100644 --- a/jsonrpc/src/common/test/tsconfig.watch.json +++ b/jsonrpc/src/common/test/tsconfig.watch.json @@ -3,8 +3,8 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/common/test", "tsBuildInfoFile": "../../../lib/common/test/watch.tsbuildInfo", diff --git a/jsonrpc/src/common/tsconfig.json b/jsonrpc/src/common/tsconfig.json index 9315a718..8a2afb9f 100644 --- a/jsonrpc/src/common/tsconfig.json +++ b/jsonrpc/src/common/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -14,9 +14,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", diff --git a/jsonrpc/src/common/tsconfig.publish.json b/jsonrpc/src/common/tsconfig.publish.json index 9f0ae4b6..e603fef8 100644 --- a/jsonrpc/src/common/tsconfig.publish.json +++ b/jsonrpc/src/common/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -14,9 +14,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", diff --git a/jsonrpc/src/common/tsconfig.watch.json b/jsonrpc/src/common/tsconfig.watch.json index df019070..6b1eb733 100644 --- a/jsonrpc/src/common/tsconfig.watch.json +++ b/jsonrpc/src/common/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -15,9 +15,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", diff --git a/jsonrpc/src/node/test/connection.test.ts b/jsonrpc/src/node/test/connection.test.ts index 42e07165..1f19ce9e 100644 --- a/jsonrpc/src/node/test/connection.test.ts +++ b/jsonrpc/src/node/test/connection.test.ts @@ -320,7 +320,7 @@ suite('Connection', () => { client.listen(); client.sendRequest(type, '').then(_result => { - assert(false); + assert.ok(false); }, () => { done(); }); @@ -335,7 +335,7 @@ suite('Connection', () => { client.dispose(); try { void client.sendNotification(testNotification); - assert(false); + assert.ok(false); } catch (error) { done(); } @@ -349,7 +349,7 @@ suite('Connection', () => { client.listen(); try { client.listen(); - assert(false); + assert.ok(false); } catch (error) { done(); } @@ -405,7 +405,7 @@ suite('Connection', () => { assert.strictEqual(result, 60); done(); }, () => { - assert(false); + assert.ok(false); done(); }); }); @@ -431,7 +431,7 @@ suite('Connection', () => { assert.strictEqual(result, 60); done(); }, () => { - assert(false); + assert.ok(false); done(); }); }); @@ -443,7 +443,7 @@ suite('Connection', () => { const server = hostConnection.createMessageConnection(duplexStream2, duplexStream1, hostConnection.NullLogger); server.onRequest(type, (p1) => { - assert(Array.isArray(p1)); + assert.ok(Array.isArray(p1)); assert.strictEqual(p1[0], 10); assert.strictEqual(p1[1], 20); assert.strictEqual(p1[2], 30); @@ -458,8 +458,7 @@ suite('Connection', () => { assert.strictEqual(result, 60); done(); }, () => { - assert(false); - done(); + assert.ok(false); }); }); @@ -470,7 +469,7 @@ suite('Connection', () => { const server = hostConnection.createMessageConnection(duplexStream2, duplexStream1, hostConnection.NullLogger); server.onNotification(type, (p1) => { - assert(Array.isArray(p1)); + assert.ok(Array.isArray(p1)); assert.strictEqual(p1[0], 10); assert.strictEqual(p1[1], 20); assert.strictEqual(p1[2], 30); @@ -503,8 +502,7 @@ suite('Connection', () => { assert.strictEqual(result, 60); done(); }, () => { - assert(false); - done(); + assert.ok(false); }); }); @@ -526,8 +524,7 @@ suite('Connection', () => { assert.strictEqual(result, 10); done(); }, () => { - assert(false); - done(); + assert.ok(false); }); }); @@ -551,8 +548,7 @@ suite('Connection', () => { assert.strictEqual(result, 60); done(); }, () => { - assert(false); - done(); + assert.ok(false); }); }); @@ -576,8 +572,7 @@ suite('Connection', () => { assert.strictEqual(result, 30); done(); }, () => { - assert(false); - done(); + assert.ok(false); }); }); diff --git a/jsonrpc/src/node/test/tsconfig.json b/jsonrpc/src/node/test/tsconfig.json index b501f80c..940b02d9 100644 --- a/jsonrpc/src/node/test/tsconfig.json +++ b/jsonrpc/src/node/test/tsconfig.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/compile.tsbuildInfo", diff --git a/jsonrpc/src/node/test/tsconfig.publish.json b/jsonrpc/src/node/test/tsconfig.publish.json index 210c2c2e..338e6d79 100644 --- a/jsonrpc/src/node/test/tsconfig.publish.json +++ b/jsonrpc/src/node/test/tsconfig.publish.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/publish.tsbuildInfo", diff --git a/jsonrpc/src/node/test/tsconfig.watch.json b/jsonrpc/src/node/test/tsconfig.watch.json index 45378dcf..00f9d441 100644 --- a/jsonrpc/src/node/test/tsconfig.watch.json +++ b/jsonrpc/src/node/test/tsconfig.watch.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -18,9 +18,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/watch.tsbuildInfo", diff --git a/jsonrpc/src/node/tsconfig.json b/jsonrpc/src/node/tsconfig.json index 244f03c2..9a0f2638 100644 --- a/jsonrpc/src/node/tsconfig.json +++ b/jsonrpc/src/node/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", diff --git a/jsonrpc/src/node/tsconfig.publish.json b/jsonrpc/src/node/tsconfig.publish.json index 534b7fdf..bb45efb9 100644 --- a/jsonrpc/src/node/tsconfig.publish.json +++ b/jsonrpc/src/node/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", diff --git a/jsonrpc/src/node/tsconfig.watch.json b/jsonrpc/src/node/tsconfig.watch.json index ffb35694..25659d42 100644 --- a/jsonrpc/src/node/tsconfig.watch.json +++ b/jsonrpc/src/node/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -17,9 +17,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", diff --git a/jsonrpc/tsconfig.tsbuildinfo b/jsonrpc/tsconfig.tsbuildinfo new file mode 100644 index 00000000..1b4a3a5c --- /dev/null +++ b/jsonrpc/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":[],"fileInfos":[],"root":[],"options":{"composite":true}},"version":"5.5.2"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e1a94e5c..00d23e69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "devDependencies": { "@types/assert": "^1.5.8", "@types/mocha": "^10.0.3", - "@types/node": "16.11.43", + "@types/node": "20.9.0", "@typescript-eslint/eslint-plugin": "^6.9.0", "@typescript-eslint/parser": "^6.9.0", "assert": "^2.1.0", @@ -26,7 +26,7 @@ "shx": "^0.3.4", "source-map-support": "^0.5.21", "ts-json-schema-generator": "^1.4.0", - "typescript": "^5.4.5", + "typescript": "5.4.5", "webpack": "^5.89.0", "webpack-cli": "^5.1.4" } @@ -382,10 +382,14 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.11.43", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.43.tgz", - "integrity": "sha512-GqWykok+3uocgfAJM8imbozrqLnPyTrpFlrryURQlw1EesPUCx5XxTiucWDSFF9/NUEXDuD4bnvHm8xfVGWTpQ==", - "dev": true + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/semver": { "version": "7.5.4", @@ -4605,6 +4609,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4613,6 +4618,13 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, "node_modules/union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", diff --git a/package.json b/package.json index d5904a91..cab0d196 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "devDependencies": { "@types/assert": "^1.5.8", "@types/mocha": "^10.0.3", - "@types/node": "16.11.43", + "@types/node": "20.9.0", "@typescript-eslint/eslint-plugin": "^6.9.0", "@typescript-eslint/parser": "^6.9.0", "assert": "^2.1.0", @@ -28,7 +28,7 @@ "shx": "^0.3.4", "source-map-support": "^0.5.21", "ts-json-schema-generator": "^1.4.0", - "typescript": "^5.4.5", + "typescript": "5.4.5", "webpack": "^5.89.0", "webpack-cli": "^5.1.4", "node-polyfill-webpack-plugin": "^2.0.1" diff --git a/protocol/browser.d.ts b/protocol/browser.d.ts deleted file mode 100644 index e628f1b5..00000000 --- a/protocol/browser.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/browser/main'; \ No newline at end of file diff --git a/protocol/browser.js b/protocol/browser.js deleted file mode 100644 index f5caebf0..00000000 --- a/protocol/browser.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/browser/main'); \ No newline at end of file diff --git a/protocol/node.cmd b/protocol/node.cmd deleted file mode 100644 index d3282c03..00000000 --- a/protocol/node.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -REM This file is necessary to ensure that under Windows we don't -REM run the node.js file in the Windows Script Host when using -REM node in packakge.json scripts. See also PATHEXT setting -node.exe %* \ No newline at end of file diff --git a/protocol/node.d.ts b/protocol/node.d.ts deleted file mode 100644 index b4c4fcd7..00000000 --- a/protocol/node.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/node/main'; \ No newline at end of file diff --git a/protocol/node.js b/protocol/node.js deleted file mode 100644 index 388e3197..00000000 --- a/protocol/node.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/node/main'); \ No newline at end of file diff --git a/protocol/package.json b/protocol/package.json index 86fa96c7..ec5f721e 100644 --- a/protocol/package.json +++ b/protocol/package.json @@ -12,11 +12,20 @@ "bugs": { "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" }, - "main": "./lib/node/main.js", - "browser": { - "./lib/node/main.js": "./lib/browser/main.js" + "exports": { + ".": { + "types": "./lib/common/api.d.ts", + "default": "./lib/common/api.js" + }, + "./node": { + "types": "./lib/node/main.d.ts", + "node": "./lib/node/main.js" + }, + "./browser": { + "types": "./lib/browser/main.d.ts", + "node": "./lib/browser/main.js" + } }, - "typings": "./lib/common/api.d.ts", "dependencies": { "vscode-jsonrpc": "9.0.0-next.4", "vscode-languageserver-types": "3.17.6-next.4" @@ -26,10 +35,10 @@ "prepack": "npm run all:publish", "postpublish": "node ../build/npm/post-publish.js", "preversion": "npm test", - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib && node ../node_modules/rimraf/dist/esm/bin.mjs dist", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", + "compile": "tsc -b ./tsconfig.json", + "watch": "tsc -b ./tsconfig.watch.json -w", + "clean": "rimraf lib && rimraf dist", + "lint": "eslint --ext ts src", "test": "npm run test:node && npm run test:browser", "test:node": "node ../node_modules/mocha/bin/_mocha", "test:browser": "npm run webpack:test:silent && node ../build/bin/runBrowserTests.js http://127.0.0.1:8080/protocol/src/browser/test/", @@ -39,7 +48,7 @@ "generate:metaModel": "node ../tools/lib/generator-main.js -p ./src/common/tsconfig.json > ./metaModel.json", "generate:metaModelSchema": "ts-json-schema-generator --tsconfig ../tools/tsconfig.json --path ../tools/src/metaModel.ts > ./metaModel.schema.json", "all": "npm run clean && npm run compile && npm run lint && npm run test && npm run compile:metaModelTool && npm run generate:metaModel && npm run generate:metaModelSchema", - "compile:publish": "node ../build/bin/tsc -b ./tsconfig.publish.json", + "compile:publish": "tsc -b ./tsconfig.publish.json", "all:publish": "git clean -xfd . && npm install && npm run compile:publish && npm run lint && npm run test && npm run compile:metaModelTool && npm run generate:metaModel && npm run generate:metaModelSchema" } } diff --git a/protocol/src/browser/test/tsconfig.json b/protocol/src/browser/test/tsconfig.json index 1aa54189..535e99a3 100644 --- a/protocol/src/browser/test/tsconfig.json +++ b/protocol/src/browser/test/tsconfig.json @@ -3,11 +3,11 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -20,7 +20,7 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../../lib/browser/test", "tsBuildInfoFile": "../../../lib/browser/test/compile.tsbuildInfo", "incremental": true diff --git a/protocol/src/browser/test/tsconfig.publish.json b/protocol/src/browser/test/tsconfig.publish.json index 22788b0c..a061b6ec 100644 --- a/protocol/src/browser/test/tsconfig.publish.json +++ b/protocol/src/browser/test/tsconfig.publish.json @@ -3,11 +3,11 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -20,7 +20,7 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../../lib/browser/test", "tsBuildInfoFile": "../../../lib/browser/test/publish.tsbuildInfo", "incremental": true diff --git a/protocol/src/browser/test/tsconfig.watch.json b/protocol/src/browser/test/tsconfig.watch.json index 839228c2..406f877f 100644 --- a/protocol/src/browser/test/tsconfig.watch.json +++ b/protocol/src/browser/test/tsconfig.watch.json @@ -3,11 +3,11 @@ "types": [ "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -21,7 +21,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "outDir": "../../../lib/browser/test", "tsBuildInfoFile": "../../../lib/browser/test/watch.tsbuildInfo", "incremental": true diff --git a/protocol/src/browser/tsconfig.json b/protocol/src/browser/tsconfig.json index 2c723865..8b7875d3 100644 --- a/protocol/src/browser/tsconfig.json +++ b/protocol/src/browser/tsconfig.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -18,7 +18,7 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", "incremental": true, diff --git a/protocol/src/browser/tsconfig.publish.json b/protocol/src/browser/tsconfig.publish.json index 7f9c4ebd..840360da 100644 --- a/protocol/src/browser/tsconfig.publish.json +++ b/protocol/src/browser/tsconfig.publish.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -18,7 +18,7 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", "incremental": true, diff --git a/protocol/src/browser/tsconfig.watch.json b/protocol/src/browser/tsconfig.watch.json index 7d501668..422b0832 100644 --- a/protocol/src/browser/tsconfig.watch.json +++ b/protocol/src/browser/tsconfig.watch.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -19,7 +19,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", "incremental": true, diff --git a/protocol/src/common/protocol.ts b/protocol/src/common/protocol.ts index d3a84652..1abb8743 100644 --- a/protocol/src/common/protocol.ts +++ b/protocol/src/common/protocol.ts @@ -118,7 +118,7 @@ import { VersionedNotebookDocumentIdentifier, NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions, NotebookDocumentSyncRegistrationType, DidOpenNotebookDocumentParams, DidOpenNotebookDocumentNotification, NotebookCellArrayChange, NotebookDocumentChangeEvent, DidChangeNotebookDocumentParams, DidChangeNotebookDocumentNotification, DidSaveNotebookDocumentParams, DidSaveNotebookDocumentNotification, DidCloseNotebookDocumentParams, - DidCloseNotebookDocumentNotification + DidCloseNotebookDocumentNotification, NotebookDocumentFilterWithCells, NotebookDocumentFilterWithNotebook } from './protocol.notebook'; import { InlineCompletionClientCapabilities, InlineCompletionOptions, InlineCompletionParams, InlineCompletionRegistrationOptions, InlineCompletionRequest } from './protocol.inlineCompletion'; @@ -4204,7 +4204,7 @@ export { VersionedNotebookDocumentIdentifier, NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions, NotebookDocumentSyncRegistrationType, DidOpenNotebookDocumentParams, DidOpenNotebookDocumentNotification, NotebookCellArrayChange, NotebookDocumentChangeEvent, DidChangeNotebookDocumentParams, DidChangeNotebookDocumentNotification, DidSaveNotebookDocumentParams, DidSaveNotebookDocumentNotification, DidCloseNotebookDocumentParams, - DidCloseNotebookDocumentNotification, + DidCloseNotebookDocumentNotification, NotebookDocumentFilterWithCells, NotebookDocumentFilterWithNotebook, // Inline Completions InlineCompletionClientCapabilities, InlineCompletionOptions, InlineCompletionParams, InlineCompletionRegistrationOptions, InlineCompletionRequest, }; diff --git a/protocol/src/common/tsconfig.json b/protocol/src/common/tsconfig.json index b265037d..72b4efbe 100644 --- a/protocol/src/common/tsconfig.json +++ b/protocol/src/common/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -14,9 +14,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", diff --git a/protocol/src/common/tsconfig.publish.json b/protocol/src/common/tsconfig.publish.json index cc1d5a42..2e9ab6df 100644 --- a/protocol/src/common/tsconfig.publish.json +++ b/protocol/src/common/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -14,9 +14,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", diff --git a/protocol/src/common/tsconfig.watch.json b/protocol/src/common/tsconfig.watch.json index 2eaf54c8..01a97b48 100644 --- a/protocol/src/common/tsconfig.watch.json +++ b/protocol/src/common/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -15,9 +15,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", diff --git a/protocol/src/node/test/tsconfig.json b/protocol/src/node/test/tsconfig.json index b501f80c..940b02d9 100644 --- a/protocol/src/node/test/tsconfig.json +++ b/protocol/src/node/test/tsconfig.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/compile.tsbuildInfo", diff --git a/protocol/src/node/test/tsconfig.publish.json b/protocol/src/node/test/tsconfig.publish.json index 210c2c2e..338e6d79 100644 --- a/protocol/src/node/test/tsconfig.publish.json +++ b/protocol/src/node/test/tsconfig.publish.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/publish.tsbuildInfo", diff --git a/protocol/src/node/test/tsconfig.watch.json b/protocol/src/node/test/tsconfig.watch.json index 45378dcf..00f9d441 100644 --- a/protocol/src/node/test/tsconfig.watch.json +++ b/protocol/src/node/test/tsconfig.watch.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -18,9 +18,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/watch.tsbuildInfo", diff --git a/protocol/src/node/tsconfig.json b/protocol/src/node/tsconfig.json index 244f03c2..9a0f2638 100644 --- a/protocol/src/node/tsconfig.json +++ b/protocol/src/node/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", diff --git a/protocol/src/node/tsconfig.publish.json b/protocol/src/node/tsconfig.publish.json index 534b7fdf..bb45efb9 100644 --- a/protocol/src/node/tsconfig.publish.json +++ b/protocol/src/node/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", diff --git a/protocol/src/node/tsconfig.watch.json b/protocol/src/node/tsconfig.watch.json index ffb35694..25659d42 100644 --- a/protocol/src/node/tsconfig.watch.json +++ b/protocol/src/node/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -17,9 +17,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", diff --git a/server/browser.d.ts b/server/browser.d.ts deleted file mode 100644 index e628f1b5..00000000 --- a/server/browser.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/browser/main'; \ No newline at end of file diff --git a/server/browser.js b/server/browser.js deleted file mode 100644 index f5caebf0..00000000 --- a/server/browser.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/browser/main'); \ No newline at end of file diff --git a/server/node.cmd b/server/node.cmd deleted file mode 100644 index d3282c03..00000000 --- a/server/node.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -REM This file is necessary to ensure that under Windows we don't -REM run the node.js file in the Windows Script Host when using -REM node in packakge.json scripts. See also PATHEXT setting -node.exe %* \ No newline at end of file diff --git a/server/node.d.ts b/server/node.d.ts deleted file mode 100644 index b4c4fcd7..00000000 --- a/server/node.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ - -export * from './lib/node/main'; \ No newline at end of file diff --git a/server/node.js b/server/node.js deleted file mode 100644 index 388e3197..00000000 --- a/server/node.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ----------------------------------------------------------------------------------------- */ -'use strict'; - -module.exports = require('./lib/node/main'); \ No newline at end of file diff --git a/server/package.json b/server/package.json index 4da98e70..a8fce886 100644 --- a/server/package.json +++ b/server/package.json @@ -12,11 +12,20 @@ "bugs": { "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" }, - "main": "./lib/node/main.js", - "browser": { - "./lib/node/main.js": "./lib/browser/main.js" + "exports": { + ".": { + "types": "./lib/common/api.d.ts", + "default": "./lib/common/api.js" + }, + "./node": { + "types": "./lib/node/main.d.ts", + "node": "./lib/node/main.js" + }, + "./browser": { + "types": "./lib/browser/main.d.ts", + "browser": "./lib/browser/main.js" + } }, - "typings": "./lib/common/api.d.ts", "bin": { "installServerIntoExtension": "./bin/installServerIntoExtension" }, @@ -29,13 +38,13 @@ "scripts": { "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", "prepack": "npm run all:publish", - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", + "compile": "tsc -b ./tsconfig.json", + "watch": "tsc -b ./tsconfig.watch.json -w", + "clean": "rimraf lib", + "lint": "eslint --ext ts src", "test": "node ../node_modules/mocha/bin/_mocha", "all": "npm run clean && npm run compile && npm run lint && npm test", - "compile:publish": "node ../build/bin/tsc -b ./tsconfig.publish.json", + "compile:publish": "tsc -b ./tsconfig.publish.json", "all:publish": "git clean -xfd . && npm install && npm run compile:publish && npm run lint && npm test", "preversion": "npm test" } diff --git a/server/src/browser/tsconfig.json b/server/src/browser/tsconfig.json index 781e204e..2894c7d5 100644 --- a/server/src/browser/tsconfig.json +++ b/server/src/browser/tsconfig.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -18,7 +18,7 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", "incremental": true diff --git a/server/src/browser/tsconfig.publish.json b/server/src/browser/tsconfig.publish.json index 40a35671..57b10a2c 100644 --- a/server/src/browser/tsconfig.publish.json +++ b/server/src/browser/tsconfig.publish.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -18,7 +18,7 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", "incremental": true diff --git a/server/src/browser/tsconfig.watch.json b/server/src/browser/tsconfig.watch.json index 25eea702..2cf47eae 100644 --- a/server/src/browser/tsconfig.watch.json +++ b/server/src/browser/tsconfig.watch.json @@ -1,11 +1,11 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "lib": [ - "es2020", + "es2022", "webworker" ], "strict": true, @@ -19,7 +19,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "outDir": "../../lib/browser", "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", "incremental": true diff --git a/server/src/common/api.ts b/server/src/common/api.ts index 690b0c29..ddb01e24 100644 --- a/server/src/common/api.ts +++ b/server/src/common/api.ts @@ -9,7 +9,7 @@ import type { WorkDoneProgressReporter, WorkDoneProgressServerReporter, ResultPr import * as ic from './inlineCompletion.proposed'; -export * from 'vscode-languageserver-protocol/'; +export * from 'vscode-languageserver-protocol'; export { WorkDoneProgressReporter, WorkDoneProgressServerReporter, ResultProgressReporter }; export { SemanticTokensBuilder }; import { TextDocuments, TextDocumentsConfiguration, TextDocumentChangeEvent, TextDocumentWillSaveEvent } from './textDocuments'; diff --git a/server/src/common/tsconfig.json b/server/src/common/tsconfig.json index b265037d..72b4efbe 100644 --- a/server/src/common/tsconfig.json +++ b/server/src/common/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -14,9 +14,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", diff --git a/server/src/common/tsconfig.publish.json b/server/src/common/tsconfig.publish.json index cc1d5a42..2e9ab6df 100644 --- a/server/src/common/tsconfig.publish.json +++ b/server/src/common/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -14,9 +14,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", diff --git a/server/src/common/tsconfig.watch.json b/server/src/common/tsconfig.watch.json index 2eaf54c8..01a97b48 100644 --- a/server/src/common/tsconfig.watch.json +++ b/server/src/common/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [], "strict": true, @@ -15,9 +15,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/common", "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", diff --git a/server/src/node/main.ts b/server/src/node/main.ts index fcc78354..72d4b242 100644 --- a/server/src/node/main.ts +++ b/server/src/node/main.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ -/// +/// import { inspect } from 'node:util'; @@ -307,7 +307,6 @@ function patchConsole(logger: Logger): undefined { }; console.dir = function dir(arg, options){ - // @ts-expect-error https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66626 logger.log(inspect(arg, options)); }; diff --git a/server/src/node/test/tsconfig.json b/server/src/node/test/tsconfig.json index b501f80c..940b02d9 100644 --- a/server/src/node/test/tsconfig.json +++ b/server/src/node/test/tsconfig.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/compile.tsbuildInfo", diff --git a/server/src/node/test/tsconfig.publish.json b/server/src/node/test/tsconfig.publish.json index 210c2c2e..338e6d79 100644 --- a/server/src/node/test/tsconfig.publish.json +++ b/server/src/node/test/tsconfig.publish.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -17,9 +17,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/publish.tsbuildInfo", diff --git a/server/src/node/test/tsconfig.watch.json b/server/src/node/test/tsconfig.watch.json index 45378dcf..00f9d441 100644 --- a/server/src/node/test/tsconfig.watch.json +++ b/server/src/node/test/tsconfig.watch.json @@ -4,8 +4,8 @@ "node", "mocha" ], - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "strict": true, "noImplicitAny": true, @@ -18,9 +18,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../../lib/node/test", "tsBuildInfoFile": "../../../lib/node/test/watch.tsbuildInfo", diff --git a/server/src/node/tsconfig.json b/server/src/node/tsconfig.json index 244f03c2..9a0f2638 100644 --- a/server/src/node/tsconfig.json +++ b/server/src/node/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", diff --git a/server/src/node/tsconfig.publish.json b/server/src/node/tsconfig.publish.json index 534b7fdf..bb45efb9 100644 --- a/server/src/node/tsconfig.publish.json +++ b/server/src/node/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", diff --git a/server/src/node/tsconfig.watch.json b/server/src/node/tsconfig.watch.json index ffb35694..25659d42 100644 --- a/server/src/node/tsconfig.watch.json +++ b/server/src/node/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": ".", "types": [ "node" @@ -17,9 +17,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "../../lib/node", "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", diff --git a/textDocument/package.json b/textDocument/package.json index 509f7ee6..60769f3c 100644 --- a/textDocument/package.json +++ b/textDocument/package.json @@ -25,14 +25,14 @@ "scripts": { "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", "prepack": "npm run all:publish", - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", + "compile": "tsc -b ./tsconfig.json", + "clean": "rimraf lib", + "watch": "tsc -b ./tsconfig.watch.json -w", + "lint": "eslint --ext ts src", "test": "node ../node_modules/mocha/bin/_mocha", "all": "npm run clean && npm run compile && npm run lint && npm run test", - "compile:esm": "node ../build/bin/tsc -b ./tsconfig.esm.publish.json && node ../build/bin/fix-esm", - "compile:umd": "node ../build/bin/tsc -b ./tsconfig.umd.publish.json", + "compile:esm": "tsc -b ./tsconfig.esm.publish.json && node ../build/bin/fix-esm", + "compile:umd": "tsc -b ./tsconfig.umd.publish.json", "all:publish": "git clean -xfd . && npm install && npm run compile:esm && npm run compile:umd && npm run lint && npm run test", "preversion": "npm test" } diff --git a/tools/package.json b/tools/package.json index 46026860..e3472879 100644 --- a/tools/package.json +++ b/tools/package.json @@ -13,11 +13,10 @@ "bugs": { "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" }, - "main": "./lib/main.js", "scripts": { - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "watch": "node ../build/bin/tsc -b ./tsconfig-watch.json -w", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib && node ../node_modules/rimraf/dist/esm/bin.mjs dist", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src" + "compile": "tsc -b ./tsconfig.json", + "watch": "tsc -b ./tsconfig-watch.json -w", + "clean": "rimraf lib && rimraf dist", + "lint": "eslint --ext ts src" } } \ No newline at end of file diff --git a/tools/tsconfig.json b/tools/tsconfig.json index 49f12c2d..eb936c42 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": "./src", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "./lib", "tsBuildInfoFile": "lib/compile.tsbuildInfo", diff --git a/tools/tsconfig.watch.json b/tools/tsconfig.watch.json index d28d50b7..bf90447a 100644 --- a/tools/tsconfig.watch.json +++ b/tools/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": "./src", "types": [ "node" @@ -17,9 +17,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "./lib", "tsBuildInfoFile": "lib/watch.tsbuildInfo", diff --git a/tsconfig-gen/package.json b/tsconfig-gen/package.json index efce47f2..43f77f75 100644 --- a/tsconfig-gen/package.json +++ b/tsconfig-gen/package.json @@ -12,8 +12,12 @@ "bugs": { "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" }, - "main": "./lib/main.js", - "typings": "./lib/main.d.ts", + "exports": { + ".": { + "default": "./lib/main.js", + "types": "./lib/main.d.ts" + } + }, "bin": { "tsconfig-gen": "./bin/tsconfig-gen" }, @@ -26,12 +30,12 @@ "scripts": { "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", "prepack": "git clean -xfd . && npm install && npm run all", - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", + "compile": "tsc -b ./tsconfig.json", + "clean": "rimraf lib", + "watch": "tsc -b ./tsconfig.watch.json -w", + "lint": "eslint --ext ts src", "all": "npm run compile && npm run lint", - "compile:publish": "node ../build/bin/tsc -b ./tsconfig.publish.json", + "compile:publish": "tsc -b ./tsconfig.publish.json", "all:publish": "git clean -xfd . && npm install && npm run compile:publish && npm run lint" } } diff --git a/tsconfig-gen/tsconfig.json b/tsconfig-gen/tsconfig.json index 49f12c2d..eb936c42 100644 --- a/tsconfig-gen/tsconfig.json +++ b/tsconfig-gen/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": "./src", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": true, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "./lib", "tsBuildInfoFile": "lib/compile.tsbuildInfo", diff --git a/tsconfig-gen/tsconfig.publish.json b/tsconfig-gen/tsconfig.publish.json index cbb08526..262933ff 100644 --- a/tsconfig-gen/tsconfig.publish.json +++ b/tsconfig-gen/tsconfig.publish.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": "./src", "types": [ "node" @@ -16,9 +16,9 @@ "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "./lib", "tsBuildInfoFile": "lib/publish.tsbuildInfo", diff --git a/tsconfig-gen/tsconfig.watch.json b/tsconfig-gen/tsconfig.watch.json index d28d50b7..bf90447a 100644 --- a/tsconfig-gen/tsconfig.watch.json +++ b/tsconfig-gen/tsconfig.watch.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "rootDir": "./src", "types": [ "node" @@ -17,9 +17,9 @@ "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, - "target": "es2020", + "target": "es2022", "lib": [ - "es2020" + "es2022" ], "outDir": "./lib", "tsBuildInfoFile": "lib/watch.tsbuildInfo", diff --git a/types/package.json b/types/package.json index 007d11b7..441b97b8 100644 --- a/types/package.json +++ b/types/package.json @@ -25,14 +25,14 @@ "scripts": { "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", "prepack": "npm run all:publish", - "compile": "node ../build/bin/tsc -b ./tsconfig.json", - "clean": "node ../node_modules/rimraf/dist/esm/bin.mjs lib", - "watch": "node ../build/bin/tsc -b ./tsconfig.watch.json -w", - "lint": "node ../node_modules/eslint/bin/eslint.js --ext ts src", - "test": "node ../node_modules/mocha/bin/_mocha", + "compile": "tsc -b ./tsconfig.json", + "clean": "rimraf lib", + "watch": "tsc -b ./tsconfig.watch.json -w", + "lint": "eslint --ext ts src", + "test": "mocha", "all": "npm run clean && npm run compile && npm run lint && npm run test", - "compile:esm": "node ../build/bin/tsc -b ./tsconfig.esm.publish.json && node ../build/bin/fix-esm", - "compile:umd": "node ../build/bin/tsc -b ./tsconfig.umd.publish.json", + "compile:esm": "tsc -b ./tsconfig.esm.publish.json && node ../build/bin/fix-esm", + "compile:umd": "tsc -b ./tsconfig.umd.publish.json", "all:publish": "git clean -xfd . && npm install && npm run compile:esm && npm run compile:umd && npm run lint && npm run test", "preversion": "npm test" }