Skip to content

Commit

Permalink
Remove AMD and CJS build, but keep monaco-converter(/cjs)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisalmen committed Jun 22, 2022
1 parent 8a69dba commit 31bd60b
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 136 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Or you use a fresh dev environment in [Gitpod](https://www.gitpod.io) which is a

### Scripts Overview

The main [package.json](./package.json) contains script entries applicable to the whole workspace like `clean` amd `compile`, but it also has entries for launching script from the packages (lib and examples).
The main [package.json](./package.json) contains script entries applicable to the whole workspace like `clean` and `compile`, but it also has entries for launching script from the packages (lib and examples).

For example if you want to rebuild the library you can do it in different ways. From CLI run one of:
```bash
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"npm": "8.11.0"
},
"scripts": {
"clean": "npm run clean --workspaces && npm run clean:amd --workspace packages/client && npm run webpack:clean --workspace packages/examples/client",
"clean": "npm run clean --workspaces && npm run webpack:clean --workspace packages/examples/client",
"compile": "npm run compile --workspaces",
"lint": "npm run lint --workspaces",
"dev": "vite --debug --force",
Expand Down
224 changes: 117 additions & 107 deletions packages/client/CHANGELOG.md

Large diffs are not rendered by default.

23 changes: 3 additions & 20 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,18 @@
"types": "./lib/monaco-converter.d.ts",
"default": "./lib/monaco-converter.js"
},
"./cjs": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.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": [
"dist/amd",
"dist/cjs",
"lib",
"src",
Expand All @@ -76,13 +61,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",
"clean:cjs": "npx shx rm -fr dist",
"lint": "eslint src --ext .ts",
"compile": "tsc",
"watch": "tsc -w",
"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"
"build:cjs": "npm run clean:cjs && tsc -p ./tsconfig.cjs.json",
"build": "npm run clean && npm run compile && npm run build:cjs"
}
}
18 changes: 18 additions & 0 deletions packages/client/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist/cjs",
"declarationDir": "dist/cjs",
"noUnusedParameters": false,
"module": "CommonJS"
},
"include": [
"src/monaco-converter.ts",
],
"exclude": [
"dist",
"lib",
"node_modules"
]
}
18 changes: 15 additions & 3 deletions packages/vscode-ws-jsonrpc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@

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

## 1.x.x BREAKING CHANGES

The default export now provides esm code. If you require CommonJS modules you can use the additional exports.
The npm packages exports the following:

- `vscode-ws-jsonrpc`
- `vscode-ws-jsonrpc/server`
- `vscode-ws-jsonrpc/socket`
- `vscode-ws-jsonrpc/cjs`
- `vscode-ws-jsonrpc/cjs/server`
- `vscode-ws-jsonrpc/cjs/socket`

## [1.0.1] - 2022-06-22

* Library ships as src, esm and cjs builds. Use `typesVersions` in **package.json** for proper TypeScript import support
- Library ships as src, esm and cjs builds. Use `typesVersions` in **package.json** for proper TypeScript import support

## [1.0.0] - 2022-06-21

* Merged npm packages `@codingame/monaco-jsonrpc` and `vscode-ws-jsonrpc` into this package.
* Integrate eslint with eslint-config-standard #[385](https://github.com/TypeFox/monaco-languageclient/pull/385)
- Merged npm packages `@codingame/monaco-jsonrpc` and `vscode-ws-jsonrpc` into this package.
- Integrate eslint with eslint-config-standard #[385](https://github.com/TypeFox/monaco-languageclient/pull/385)

There was no CHANGELOG available in the previous repositories.
4 changes: 2 additions & 2 deletions packages/vscode-ws-jsonrpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
},
"scripts": {
"clean": "npx shx rm -fr lib tsconfig.tsbuildinfo",
"clean:cjs": "npx shx rm -fr dist/cjs dist/tsconfig.tsbuildinfo",
"clean:cjs": "npx shx rm -fr dist",
"lint": "eslint src --ext .ts",
"compile": "tsc",
"watch": "tsc -w",
"build:cjs": "npm run clean:cjs && tsc --outDir dist/cjs --module commonjs --declarationDir dist/cjs --declaration",
"build:cjs": "npm run clean:cjs && tsc -p ./tsconfig.cjs.json",
"build": "npm run clean && npm run compile && npm run build:cjs"
}
}
17 changes: 17 additions & 0 deletions packages/vscode-ws-jsonrpc/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist/cjs",
"declarationDir": "dist/cjs",
"module": "CommonJS"
},
"include": [
"src/**/*.ts",
],
"exclude": [
"dist",
"lib",
"node_modules"
]
}

0 comments on commit 31bd60b

Please sign in to comment.