Skip to content

Commit

Permalink
Align all tsconfigs and compile vscode-ws-jsonrpc to esm and cjs
Browse files Browse the repository at this point in the history
- Added typesVersions to monaco-languageclient and vscode-ws-jsonrpc, so exports can be properly imported with TS
  • Loading branch information
kaisalmen committed Jun 22, 2022
1 parent 73c4f8e commit 8a69dba
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 143 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ module.exports = {
'dot-notation': 'off',
'@typescript-eslint/dot-notation': ['error']
},
ignorePatterns: ['.eslintrc.js', './packages/examples/browser-lsp/src/serverWorker.ts']
ignorePatterns: [
'.eslintrc.js',
'vite.config.ts',
'packages/examples/browser-lsp/src/serverWorker.ts'
]
};
33 changes: 14 additions & 19 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Sample Server",
"program": "${workspaceRoot}/packages/examples/node/lib/server.js",
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/packages/examples/node/lib/**/*.js"
]
"name": "Launch Sample Server",
"type": "node",
"request": "launch",
"args": ["${workspaceRoot}/packages/examples/node/src/server.ts"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"cwd": "${workspaceRoot}/packages/examples/node",
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "Launch Sample Server (external)",
"program": "${workspaceRoot}/packages/examples/node/lib/server.js",
"args": [
"--external"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/packages/examples/node/lib/**/*.js"
]
"name": "Launch Sample Server (external)",
"type": "node",
"request": "launch",
"args": ["${workspaceRoot}/packages/examples/node/dist/server.js", "--external"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"cwd": "${workspaceRoot}/packages/examples/node",
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "pwa-chrome",
Expand Down
120 changes: 76 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this npm module are documented in this file.

## [2.0.2] - 2022-06-22

* Align tsconfig and use `typesVersions` in **package.json** for proper TypeScript import support (used in node example)

## [2.0.1] - 2022-06-21

* No cjs fragments to export #[388](https://github.com/TypeFox/monaco-languageclient/issues/388)
Expand All @@ -13,6 +17,11 @@ All notable changes to this npm module are documented in this file.
* Integrate eslint with eslint-config-standard #[385](https://github.com/TypeFox/monaco-languageclient/pull/385)
* Add example with client and server both running in the browser #[386](https://github.com/TypeFox/monaco-languageclient/pull/386)

## BREAKING CHANGES

* If you use Webpack or vite for bundling, you have to remove the `vscode` alias entry from the configuration
* If you customized monaco services, then you have to add them

## [1.1.0] - 2022-06-08

* feat(package.json): export monaco-converter #[376](https://github.com/TypeFox/monaco-languageclient/pull/376)
Expand Down
30 changes: 20 additions & 10 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "monaco-languageclient",
"version": "2.0.1",
"version": "2.0.2",
"description": "Monaco Language client implementation",
"author": {
"name": "TypeFox GmbH ",
"url": "http://www.typefox.io"
},
"homepage": "https://github.com/TypeFox/monaco-languageclient/blob/main/packages/client/README.md",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -15,6 +16,7 @@
"url": "https://github.com/TypeFox/monaco-languageclient/issues"
},
"main": "./lib/index.js",
"module": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
Expand All @@ -25,21 +27,29 @@
"types": "./lib/monaco-converter.d.ts",
"default": "./lib/monaco-converter.js"
},
"./cjs/monaco-converter": {
"types": "./dist/cjs/monaco-converter.d.ts",
"default": "./dist/cjs/monaco-converter.js"
},
"./cjs": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
},
"./amd/monaco-converter": {
"types": "./dist/amd/monaco-converter.d.ts",
"default": "./dist/amd/monaco-converter.js"
"./cjs/monaco-converter": {
"types": "./dist/cjs/monaco-converter.d.ts",
"default": "./dist/cjs/monaco-converter.js"
},
"./amd": {
"types": "./dist/amd/index.d.ts",
"default": "./dist/amd/index.js"
},
"./amd/monaco-converter": {
"types": "./dist/amd/monaco-converter.d.ts",
"default": "./dist/amd/monaco-converter.js"
}
},
"typesVersions": {
"*": {
"cjs": [ "dist/cjs/index" ],
"amd": [ "dist/amd/index" ],
"monaco-converter": [ "lib/monaco-converter" ],
"monaco-converter/cjs": [ "dist/cjs/monaco-converter" ]
}
},
"files": [
Expand All @@ -66,11 +76,11 @@
},
"scripts": {
"clean": "npx shx rm -fr lib tsconfig.tsbuildinfo",
"clean:amd": "npx shx rm -fr dist/amd dist/tsconfig.tsbuildinfo",
"clean:cjs": "npx shx rm -fr dist/cjs dist/tsconfig.tsbuildinfo",
"lint": "eslint src --ext .ts",
"compile": "tsc",
"watch": "tsc -w",
"clean:amd": "npx shx rm -fr dist/amd",
"clean:cjs": "npx shx rm -fr dist/cjs",
"build:amd": "npm run clean:amd && tsc --outDir dist/amd --module amd --declarationDir dist/amd --declaration",
"build:cjs": "npm run clean:cjs && tsc --outDir dist/cjs --module commonjs --declarationDir dist/cjs --declaration",
"build": "npm run clean && npm run compile && npm run build:amd && npm run build:cjs"
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export * from './monaco-services';
export * from './monaco-converter';

export {
Disposable, CancellationToken, Event, Emitter
CancellationToken, Event, Emitter
} from 'vscode-jsonrpc/lib/common/api';
export * from 'vscode-languageserver-protocol/lib/common/api';
Loading

0 comments on commit 8a69dba

Please sign in to comment.