From 3f9b0c55733b6d233d54f8638b0e9718bfd45f44 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 7 Dec 2021 12:25:29 +0100 Subject: [PATCH] Splits CONTRIBUTING into CONTRIBUTING and MAINTAINING. --- CONTRIBUTING.md | 79 +++++-------------------------------------------- MAINTAINING.md | 70 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 72 deletions(-) create mode 100644 MAINTAINING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a20df0b4..8e4ad373 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,6 @@ -# Contributing & Maintaining +# Contributing + +Checkout [MAINTAINING.md](./MAINTAINING.md) for common maintaining tasks. ## A brief explanation on the source code structure @@ -11,22 +13,15 @@ This repository contains source code only for Monaco Editor Languages, the core ## Contributing a new tokenizer / a new language -- create `$/src/basic-languages/myLang/myLang.contribution.ts` -- create `$/src/basic-languages/myLang/myLang.ts` -- create `$/src/basic-languages/myLang/myLang.test.ts` +- create `$/src/basic-languages/{myLang}/{myLang}.contribution.ts` +- create `$/src/basic-languages/{myLang}/{myLang}.ts` +- create `$/src/basic-languages/{myLang}/{myLang}.test.ts` - edit `$/src/basic-languages/monaco.contribution.ts` and register your new language ```js -import './myLang/myLang.contribution'; +import './{myLang}/{myLang}.contribution'; ``` -## Updating TypeScript - -- change typescript's version in `package.json`. -- execute `npm install .` -- execute `npm run import-typescript` -- adopt new APIs - ## Running the editor from source You need to have all the build setup of VS Code to be able to build the Monaco Editor. @@ -104,63 +99,3 @@ Open [http://localhost:8080/monaco-editor/test/manual/?editor=src](http://localh # open http://localhost:8080/monaco-editor-website/ ``` - -## Shipping a new monaco-editor npm module - -#### 0. - -- make sure you have `https://github.com/microsoft/vscode-loc` checked out next to the `vscode` folder. - -#### 1. Ship a new `monaco-editor-core` npm module - -- bump version in `/src/vscode/build/monaco/package.json` -- **[important]** push all local changes to the remote to get a good public commit id. -- generate npm package `/src/vscode> yarn gulp editor-distro` -- publish npm package `/src/vscode/out-monaco-editor-core> npm publish` - -#### 2. Adopt new `monaco-editor-core` version - -- edit `/src/monaco-editor/package.json` and update the version of [`monaco-editor-core`](https://www.npmjs.com/package/monaco-editor-core) - -```sh -# fetch latest deps -/src/monaco-editor> npm install . -``` - -#### 4. Generate and try out the local release - -- run the editor smoketest via CI or [manually](#running-the-editor-tests). - -#### 5. Update release note. - -- API Changes / Breaking Changes / New and noteworthy -- Thank you ([use this tool](https://vscode-tools.azurewebsites.net/)) - -#### 6. Publish - -- `/src/monaco-editor> npm version minor` -- `/src/monaco-editor> npm run release` -- `/src/monaco-editor/release> npm publish` -- `/src/monaco-editor> git push origin v0.50.0` - -#### 7. Update Website - -- `/src/monaco-editor> npm run website` - -#### 8. Publish new webpack plugin - -- **TBD** -- https://github.com/microsoft/monaco-editor/tree/main/webpack-plugin -- `npm install .` -- `npm run import-editor` -- if there are no changes generated after the script: - - update the peer dependency in `package.json` and use the `||` format e.g. `"monaco-editor": "0.27.x || 0.28.x"` - - update the version matrix in the README.md and add the new editor version to the plugin's current major version - - use `npm version minor` - - publish using `npm publish` -- if there are any changes generated after the script: - - update the peer dependency in `package.json` e.g. `"monaco-editor": "0.29.x"` - - update the version matrix in the README.md and add a new row with the new major version - - use `npm version major` - - publish using `npm publish` -- remember to push tags upstream diff --git a/MAINTAINING.md b/MAINTAINING.md new file mode 100644 index 00000000..04bcffb5 --- /dev/null +++ b/MAINTAINING.md @@ -0,0 +1,70 @@ +# Maintaining + +(For maintainers) + +## Updating TypeScript + +- change typescript's version in `package.json`. +- execute `npm install .` +- execute `npm run import-typescript` +- adopt new APIs + +## Shipping a new monaco-editor npm module + +#### 0. + +- make sure you have `https://github.com/microsoft/vscode-loc` checked out next to the `vscode` folder. + +#### 1. Ship a new `monaco-editor-core` npm module + +- bump version in `/src/vscode/build/monaco/package.json` +- **[important]** push all local changes to the remote to get a good public commit id. +- generate npm package `/src/vscode> yarn gulp editor-distro` +- publish npm package `/src/vscode/out-monaco-editor-core> npm publish` + +#### 2. Adopt new `monaco-editor-core` version + +- edit `/src/monaco-editor/package.json` and update the version of [`monaco-editor-core`](https://www.npmjs.com/package/monaco-editor-core) + +```sh +# fetch latest deps +/src/monaco-editor> npm install . +``` + +#### 4. Generate and try out the local release + +- run the editor smoketest via CI or [manually](#running-the-editor-tests). + +#### 5. Update release note. + +- API Changes / Breaking Changes / New and noteworthy +- Thank you ([use this tool](https://vscode-tools.azurewebsites.net/)) + +#### 6. Publish + +- `/src/monaco-editor> npm version minor` +- `/src/monaco-editor> npm run release` +- `/src/monaco-editor/release> npm publish` +- `/src/monaco-editor> git push origin v0.50.0` + +#### 7. Update Website + +- `/src/monaco-editor> npm run website` + +#### 8. Publish new webpack plugin + +- **TBD** +- https://github.com/microsoft/monaco-editor/tree/main/webpack-plugin +- `npm install .` +- `npm run import-editor` +- if there are no changes generated after the script: + - update the peer dependency in `package.json` and use the `||` format e.g. `"monaco-editor": "0.27.x || 0.28.x"` + - update the version matrix in the README.md and add the new editor version to the plugin's current major version + - use `npm version minor` + - publish using `npm publish` +- if there are any changes generated after the script: + - update the peer dependency in `package.json` e.g. `"monaco-editor": "0.29.x"` + - update the version matrix in the README.md and add a new row with the new major version + - use `npm version major` + - publish using `npm publish` +- remember to push tags upstream