From 72fc069c6dd976b2e8be6cc8197dbba5b66725ba Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Mon, 15 Nov 2021 18:08:27 +0100 Subject: [PATCH] Enhance contribution instructions For both the project and all exmaples the prerequisites, setup steps, and running instructions have been added. --- CONTRIBUTING.md | 19 ++++++++++-- examples/demo/README.md | 24 +++++++++++++-- examples/minimal-vite/README.md | 3 -- .../monaco-editor-webpack-plugin/README.md | 22 +++++++++++++- examples/vite-example/README.md | 29 +++++++++++++++++++ .../{minimal-vite => vite-example}/index.html | 0 .../{minimal-vite => vite-example}/index.js | 0 .../package.json | 2 +- 8 files changed, 89 insertions(+), 10 deletions(-) delete mode 100644 examples/minimal-vite/README.md create mode 100644 examples/vite-example/README.md rename examples/{minimal-vite => vite-example}/index.html (100%) rename examples/{minimal-vite => vite-example}/index.js (100%) rename examples/{minimal-vite => vite-example}/package.json (89%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1b6e28..e2a885b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,15 @@ # Contributing +## Prerequisites + +The following are required to start working on this project: + +- [Git](https://git-scm.com) +- [NodeJS](https://nodejs.org) 16 or higher +- [npm](https://github.com/npm/cli) 8.1.2 or higher + +## Getting started + To get started with contributing, clone the repository and install its dependencies. ```sh @@ -8,16 +18,19 @@ cd monaco-yaml npm ci ``` +## Building + To build the repository, run: ```sh -npm prepack +npm run prepack ``` +## Running + 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 +npm --workspace demo start ``` diff --git a/examples/demo/README.md b/examples/demo/README.md index 28bdb9f..1c9ecc3 100644 --- a/examples/demo/README.md +++ b/examples/demo/README.md @@ -2,10 +2,30 @@ This demo is deployed to [monaco-yaml.js.org](https://monaco-yaml.js.org). It shows how `monaco-editor` and `monaco-yaml` can be used with -[Webpack 5](https://webpack.js.org/concepts/entry-points). To start it, simply run: +[Webpack 5](https://webpack.js.org/concepts/entry-points). + +## Prerequisites + +- [NodeJS](https://nodejs.org) 16 or higher +- [npm](https://github.com/npm/cli) 8.1.2 or higher + +## Setup + +To run the project locally, clone the repository and set it up: ```sh -npm start +git clone https://github.com/remcohaszing/monaco-yaml +cd monaco-yaml +npm ci +npm run prepack +``` + +## Running + +To start it, simply run: + +```sh +npm --workspace demo start ``` The demo will open in your browser. diff --git a/examples/minimal-vite/README.md b/examples/minimal-vite/README.md deleted file mode 100644 index ff5796c..0000000 --- a/examples/minimal-vite/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Minimal Vite Example - -This minimal example shows how `monaco-yaml` can be used with [Vite](https://vitejs.dev). diff --git a/examples/monaco-editor-webpack-plugin/README.md b/examples/monaco-editor-webpack-plugin/README.md index c0023a7..86d2ced 100644 --- a/examples/monaco-editor-webpack-plugin/README.md +++ b/examples/monaco-editor-webpack-plugin/README.md @@ -7,8 +7,28 @@ Example is based on [link](https://github.com/microsoft/monaco-editor-samples/tree/main/browser-esm-webpack-monaco-plugin). To start it, simply run: +## Prerequisites + +- [NodeJS](https://nodejs.org) 16 or higher +- [npm](https://github.com/npm/cli) 8.1.2 or higher + +## Setup + +To run the project locally, clone the repository and set it up: + ```sh -npm start +git clone https://github.com/remcohaszing/monaco-yaml +cd monaco-yaml +npm ci +npm run prepack +``` + +## Running + +To start it, simply run: + +```sh +npm --workspace monaco-editor-webpack-plugin-example start ``` The demo will open in your browser. diff --git a/examples/vite-example/README.md b/examples/vite-example/README.md new file mode 100644 index 0000000..bd1b48f --- /dev/null +++ b/examples/vite-example/README.md @@ -0,0 +1,29 @@ +# Vite Example + +This minimal example shows how `monaco-yaml` can be used with [Vite](https://vitejs.dev). + +## Prerequisites + +- [NodeJS](https://nodejs.org) 16 or higher +- [npm](https://github.com/npm/cli) 8.1.2 or higher + +## Setup + +To run the project locally, clone the repository and set it up: + +```sh +git clone https://github.com/remcohaszing/monaco-yaml +cd monaco-yaml +npm ci +npm run prepack +``` + +## Running + +To start it, simply run: + +```sh +npm --workspace vite-example start +``` + +The demo will be available on http://localhost:3000. diff --git a/examples/minimal-vite/index.html b/examples/vite-example/index.html similarity index 100% rename from examples/minimal-vite/index.html rename to examples/vite-example/index.html diff --git a/examples/minimal-vite/index.js b/examples/vite-example/index.js similarity index 100% rename from examples/minimal-vite/index.js rename to examples/vite-example/index.js diff --git a/examples/minimal-vite/package.json b/examples/vite-example/package.json similarity index 89% rename from examples/minimal-vite/package.json rename to examples/vite-example/package.json index 5c26c0b..096e7ac 100644 --- a/examples/minimal-vite/package.json +++ b/examples/vite-example/package.json @@ -1,5 +1,5 @@ { - "name": "minimal-vite", + "name": "vite-example", "version": "1.0.0", "private": true, "scripts": {