From d9d1a1ba9e7f5c77394a34fdd6a8b7b4960ff647 Mon Sep 17 00:00:00 2001 From: Wojciech Kordalski Date: Wed, 23 Mar 2022 11:12:13 +0100 Subject: [PATCH] Use nested directory structure --- build/.gitignore | 2 +- build/README.md | 2 +- build/justfile | 8 ++++---- build/package.json | 2 +- build/rollup.config.js | 2 +- {js-debug => js/debug}/css.worker.js | 0 {js-debug => js/debug}/editor.js | 0 {js-debug => js/debug}/editor.worker.js | 0 {js-debug => js/debug}/html.worker.js | 0 {js-debug => js/debug}/json.worker.js | 0 {js-prod => js/release}/css.worker.js | 0 {js-prod => js/release}/editor.js | 0 {js-prod => js/release}/editor.worker.js | 0 {js-prod => js/release}/html.worker.js | 0 {js-prod => js/release}/json.worker.js | 0 justfile | 8 ++++---- src/sys/editor.rs | 4 ++-- src/sys/mod.rs | 4 ++-- src/workers/mod.rs | 4 ++-- 19 files changed, 18 insertions(+), 18 deletions(-) rename {js-debug => js/debug}/css.worker.js (100%) rename {js-debug => js/debug}/editor.js (100%) rename {js-debug => js/debug}/editor.worker.js (100%) rename {js-debug => js/debug}/html.worker.js (100%) rename {js-debug => js/debug}/json.worker.js (100%) rename {js-prod => js/release}/css.worker.js (100%) rename {js-prod => js/release}/editor.js (100%) rename {js-prod => js/release}/editor.worker.js (100%) rename {js-prod => js/release}/html.worker.js (100%) rename {js-prod => js/release}/json.worker.js (100%) diff --git a/build/.gitignore b/build/.gitignore index 1c0a1ef..8d60c1c 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -1,5 +1,5 @@ /dist-debug/ -/dist-prod/ +/dist-release/ /node_modules/ package-lock.json diff --git a/build/README.md b/build/README.md index 51ebc27..e3c3832 100644 --- a/build/README.md +++ b/build/README.md @@ -18,5 +18,5 @@ just install just build ``` -> **NOTE:** This will output the files to the `dist-debug/` and `dist-prod/` directories. +> **NOTE:** This will output the files to the `dist-debug/` and `dist-release/` directories. > Use `just build_js` in the root directory to update the files used by the library. diff --git a/build/justfile b/build/justfile index b1d7daa..e592608 100644 --- a/build/justfile +++ b/build/justfile @@ -1,9 +1,9 @@ # Build the Monaco Javascript files -@build: build-debug build-prod +@build: build-debug build-release -@build-prod: - -rm dist-prod/* - npm run build-prod +@build-release: + -rm dist-release/* + npm run build-release @build-debug: -rm dist-debug/* diff --git a/build/package.json b/build/package.json index c54ce5e..895f5bf 100644 --- a/build/package.json +++ b/build/package.json @@ -1,6 +1,6 @@ { "scripts": { - "build-prod": "rollup -c", + "build-release": "rollup -c", "build-debug": "rollup -c --configDebug" }, "dependencies": { diff --git a/build/rollup.config.js b/build/rollup.config.js index 2f116c7..37c5c56 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -20,7 +20,7 @@ const workers = [ export default args => { const commonPlugins = args.configDebug ? [nodeResolve()] : [nodeResolve(), terser()]; - const dist = args.configDebug ? "dist-debug" : "dist-prod"; + const dist = args.configDebug ? "dist-debug" : "dist-release"; const workerConfigs = workers.map((worker) => ({ input: `monaco-editor/esm/vs/${worker.input}`, diff --git a/js-debug/css.worker.js b/js/debug/css.worker.js similarity index 100% rename from js-debug/css.worker.js rename to js/debug/css.worker.js diff --git a/js-debug/editor.js b/js/debug/editor.js similarity index 100% rename from js-debug/editor.js rename to js/debug/editor.js diff --git a/js-debug/editor.worker.js b/js/debug/editor.worker.js similarity index 100% rename from js-debug/editor.worker.js rename to js/debug/editor.worker.js diff --git a/js-debug/html.worker.js b/js/debug/html.worker.js similarity index 100% rename from js-debug/html.worker.js rename to js/debug/html.worker.js diff --git a/js-debug/json.worker.js b/js/debug/json.worker.js similarity index 100% rename from js-debug/json.worker.js rename to js/debug/json.worker.js diff --git a/js-prod/css.worker.js b/js/release/css.worker.js similarity index 100% rename from js-prod/css.worker.js rename to js/release/css.worker.js diff --git a/js-prod/editor.js b/js/release/editor.js similarity index 100% rename from js-prod/editor.js rename to js/release/editor.js diff --git a/js-prod/editor.worker.js b/js/release/editor.worker.js similarity index 100% rename from js-prod/editor.worker.js rename to js/release/editor.worker.js diff --git a/js-prod/html.worker.js b/js/release/html.worker.js similarity index 100% rename from js-prod/html.worker.js rename to js/release/html.worker.js diff --git a/js-prod/json.worker.js b/js/release/json.worker.js similarity index 100% rename from js-prod/json.worker.js rename to js/release/json.worker.js diff --git a/justfile b/justfile index e14bb69..ed8df9e 100644 --- a/justfile +++ b/justfile @@ -19,7 +19,7 @@ doc *args: # Build the Javascript code @build_js: just build/build - -rm js-debug/* - -rm js-prod/* - cp build/dist-debug/*.js js-debug - cp build/dist-prod/*.js js-prod + -rm js/debug/* + -rm js/release/* + cp build/dist-debug/*.js js/debug + cp build/dist-release/*.js js/release diff --git a/src/sys/editor.rs b/src/sys/editor.rs index c50f599..a1eb9ea 100644 --- a/src/sys/editor.rs +++ b/src/sys/editor.rs @@ -53,8 +53,8 @@ impl_default_empty_obj![ // DANGER: Generated code ahead. Keep out! -#[cfg_attr(debug_assertions, wasm_bindgen(module = "/js-debug/editor.js"))] -#[cfg_attr(not(debug_assertions), wasm_bindgen(module = "/js-prod/editor.js"))] +#[cfg_attr(debug_assertions, wasm_bindgen(module = "/js/debug/editor.js"))] +#[cfg_attr(not(debug_assertions), wasm_bindgen(module = "/js/release/editor.js"))] extern "C" { /// Create a new editor under `domElement`. /// `domElement` should be empty (not contain other dom nodes). diff --git a/src/sys/mod.rs b/src/sys/mod.rs index 64b1a47..714cdc2 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -18,8 +18,8 @@ impl Default for Environment { // You're entering generated land, tread with care. -#[cfg_attr(debug_assertions, wasm_bindgen(module = "/js-debug/editor.js"))] -#[cfg_attr(not(debug_assertions), wasm_bindgen(module = "/js-prod/editor.js"))] +#[cfg_attr(debug_assertions, wasm_bindgen(module = "/js/debug/editor.js"))] +#[cfg_attr(not(debug_assertions), wasm_bindgen(module = "/js/release/editor.js"))] extern "C" { /// A helper that allows to emit and listen to typed events #[derive(Debug)] diff --git a/src/workers/mod.rs b/src/workers/mod.rs index 2d3cdde..6671f9f 100644 --- a/src/workers/mod.rs +++ b/src/workers/mod.rs @@ -9,14 +9,14 @@ use web_sys::{Blob, Url, Worker}; #[cfg(debug_assertions)] macro_rules! include_worker { ($name: literal) => { - include_str!(concat!("../../js-debug/", $name)) + include_str!(concat!("../../js/debug/", $name)) }; } #[cfg(not(debug_assertions))] macro_rules! include_worker { ($name: literal) => { - include_str!(concat!("../../js-prod/", $name)) + include_str!(concat!("../../js/release/", $name)) }; }