From 2ea154af85152b09b35519229627e133ab706f9b Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Mon, 26 Jul 2021 21:48:08 +0200 Subject: [PATCH] Update documentation - Update repository links - Restructure the readme - Add contributing document - Update credits --- .github/workflows/ci.yaml | 2 +- CONTRIBUTING.md | 23 ++++++++++++ README.md | 45 ++++++++++++++++-------- examples/webpack-worker-loader/README.md | 7 ++-- examples/webpack/README.md | 7 ++-- examples/webpack/src/index.js | 2 +- package.json | 7 ++-- 7 files changed, 67 insertions(+), 26 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 79ea0df..507688b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: ci on: pull_request: push: - branches: [master] + branches: [main] tags: ['*'] jobs: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e1b6e28 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing + +To get started with contributing, clone the repository and install its dependencies. + +```sh +git clone https://github.com/remcohaszing/monaco-yaml +cd monaco-yaml +npm ci +``` + +To build the repository, run: + +```sh +npm prepack +``` + +To test it, run one of the +[examples](https://github.com/remcohaszing/monaco-yaml/tree/main/examples). + +```sh +cd examples/webpack-worker-loader +npm start +``` diff --git a/README.md b/README.md index bb35fa5..0d5ae3c 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,22 @@ # Monaco YAML +[![ci workflow](https://github.com/remcohaszing/monaco-yaml/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/monaco-yaml/actions/workflows/ci.yaml) +[![npm version](https://img.shields.io/npm/v/monaco-yaml)](https://www.npmjs.com/package/monaco-yaml) +[![prettier code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io) + YAML language plugin for the Monaco Editor. It provides the following features when editing YAML files: - Code completion, based on JSON schemas or by looking at similar objects in the same file - Hovers, based on JSON schemas - Validation: Syntax errors and schema validation -- Formatting +- Formatting using Prettier - Document Symbols -- Syntax highlighting - Automatically load remote schema files (by enabling DiagnosticsOptions.enableSchemaRequest) Schemas can also be provided by configuration. See -[here](https://github.com/Microsoft/monaco-json/blob/master/index.d.ts) for the API that the JSON -plugin offers to configure the JSON language support. +[here](https://github.com/remcohaszing/monaco-yaml/blob/main/index.d.ts) for the API that the plugin +offers to configure the YAML language support. ## Installation @@ -79,22 +82,36 @@ editor.create(document.createElement('editor'), { }); ``` -Also make sure to register the service worker. See the -[examples](https://github.com/pengx17/monaco-yaml/tree/master/examples) directory for full fledged -examples. +Also make sure to register the service worker. -## Development - -- `git clone https://github.com/pengx17/monaco-yaml` -- `cd monaco-yaml` -- `npm ci` +## Examples A running example: ![demo-image](test-demo.png) +Some usage examples can be found in the +[examples](https://github.com/remcohaszing/monaco-yaml/tree/main/examples) directory. + +## Contributing + +Please see our [contributing guidelines](CONTRIBUTING.md) + ## Credits -- https://github.com/redhat-developer/yaml-language-server +Originally [@kpdecker](https://github.com/kpdecker) forked this repository from +[`monaco-json`](https://github.com/microsoft/monaco-json) by +[@microsoft](https://github.com/microsoft) and rewrote it to work with +[`yaml-language-server`](https://github.com/redhat-developer/yaml-language-server) instead. Later +the repository maintenance was taken over by [@pengx17](https://github.com/pengx17). Eventually the +repository was tranferred to the account of [@remcohaszing](https://github.com/remcohaszing), who is +currently maintaining this repository with the help of [fleon](https://github.com/fleon) and +[@yazaabed](https://github.com/yazaabed). + +The heavy processing is done in +[`yaml-language-server`](https://github.com/redhat-developer/yaml-language-server), best known for +being the backbone for [`vscode-yaml`](https://github.com/redhat-developer/vscode-yaml). This +repository provides a thin layer to add functionality provided by `yaml-language-server` into +`monaco-editor`. ## License -[MIT](https://github.com/pengx17/monaco-yaml/blob/master/LICENSE.md) +[MIT](https://github.com/remcohaszing/monaco-yaml/blob/main/LICENSE.md) diff --git a/examples/webpack-worker-loader/README.md b/examples/webpack-worker-loader/README.md index 67d5101..f98e3e5 100644 --- a/examples/webpack-worker-loader/README.md +++ b/examples/webpack-worker-loader/README.md @@ -1,8 +1,9 @@ -# Usage example with Webpack and worker-loader +# Webpack worker-loader demo -To run: +This demo shows how to use `monaco-editor` and `monaco-yaml` with Webpack 4 and +[`worker-loader`](https://github.com/webpack-contrib/worker-loader). To start it, simply run: -``` +```sh npm start ``` diff --git a/examples/webpack/README.md b/examples/webpack/README.md index c5881b9..c8236b8 100644 --- a/examples/webpack/README.md +++ b/examples/webpack/README.md @@ -1,8 +1,9 @@ -# Demo: Weback + Monaco + Monaco YAML +# Webpack entry points demo -To run: +This demo shows how to use `monaco-editor` and `monaco-yaml` with Webpack 4 +[entry points](https://webpack.js.org/concepts/entry-points). To start it, simply run: -``` +```sh npm start ``` diff --git a/examples/webpack/src/index.js b/examples/webpack/src/index.js index 663c5ac..e35ff7c 100644 --- a/examples/webpack/src/index.js +++ b/examples/webpack/src/index.js @@ -4,7 +4,7 @@ import { editor } from 'monaco-editor/esm/vs/editor/editor.api'; import { setDiagnosticsOptions } from 'monaco-yaml'; // NOTE: This will give you all editor featues. If you would prefer to limit to only the editor -// features you want to use, import them each individually. See this example: (https://github.com/microsoft/monaco-editor-samples/blob/master/browser-esm-webpack-small/index.js#L1-L91) +// features you want to use, import them each individually. See this example: (https://github.com/microsoft/monaco-editor-samples/blob/main/browser-esm-webpack-small/index.js#L1-L91) import 'monaco-editor'; window.MonacoEnvironment = { diff --git a/package.json b/package.json index 6663083..0fd02a2 100644 --- a/package.json +++ b/package.json @@ -22,16 +22,15 @@ ], "author": "Kevin Decker (http://incaseofstairs.com)", "maintainers": [ - "kpdecker", - "pengx17" + "Remco Haszing (https://github.com/remcohaszing)" ], "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/pengx17/monaco-yaml" + "url": "https://github.com/remcohaszing/monaco-yaml" }, "bugs": { - "url": "https://github.com/pengx17/monaco-yaml/issues" + "url": "https://github.com/remcohaszing/monaco-yaml/issues" }, "dependencies": { "@types/json-schema": "^7.0.8",