Skip to content

Commit

Permalink
Use nested directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
wkordalski authored and siku2 committed Mar 23, 2022
1 parent 3051829 commit d9d1a1b
Show file tree
Hide file tree
Showing 19 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/dist-debug/
/dist-prod/
/dist-release/
/node_modules/

package-lock.json
2 changes: 1 addition & 1 deletion build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
8 changes: 4 additions & 4 deletions build/justfile
Original file line number Diff line number Diff line change
@@ -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/*
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"build-prod": "rollup -c",
"build-release": "rollup -c",
"build-debug": "rollup -c --configDebug"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/sys/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions src/workers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
};
}

Expand Down

0 comments on commit d9d1a1b

Please sign in to comment.