Original commit: 820113e061
This commit is contained in:
Wojciech Daniło 2020-03-05 20:00:47 +01:00 committed by GitHub
parent 7d197fd5cf
commit d2a70667fc
14 changed files with 75 additions and 76 deletions

3
gui/.gitignore vendored
View File

@ -17,6 +17,3 @@ wasm-pack.log
# JavaScript
node_modules
# Markers
.initialized

View File

@ -1 +0,0 @@
lts/*

View File

@ -1,7 +1,7 @@
[workspace]
members = [
"build-utilities",
"build/utilities",
"lib/code-builder",
"lib/core",
"lib/core/embedded-fonts",

View File

@ -1594,25 +1594,25 @@
}
},
"app-builder-bin": {
"version": "3.5.4",
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.5.4.tgz",
"integrity": "sha512-Bta3I+OU64ePwvSdhpYyCj11XcR8VGdlPSINM87LPg0apCbprLu03zvnmnHRw/RvZB2RGAQ93Z8NO3JT3DbXdA=="
"version": "3.5.5",
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.5.5.tgz",
"integrity": "sha512-ZcHzJ9Xl+azPqdKzXZKdRZmkNmbxHHZyl4cbobNf8qMQpoPChpcov8riVrZSbu/0cT/JqJ8LOwJjy1OAwbChaQ=="
},
"app-builder-lib": {
"version": "22.3.6",
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.3.6.tgz",
"integrity": "sha512-9TANMAFL7cFNuRB3cMc1BS5dBQzqY5RVEUD4VMZ0MYhFY/DM9+v2BvfY3Ef+7XSOzirA6p4TljAVz5ydIEdZFw==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.4.0.tgz",
"integrity": "sha512-PcoKR5EDc6hkjNA7RzE0Ery1w1+YOH2VPk9AGQWAvQluj5h6xcURMQilLhQYONNZ3N/beZmiNxPzQF0CBRCnwA==",
"requires": {
"7zip-bin": "~5.0.3",
"@develar/schema-utils": "~2.1.0",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.9",
"builder-util": "22.3.6",
"builder-util": "22.4.0",
"builder-util-runtime": "8.6.1",
"chromium-pickle-js": "^0.2.0",
"debug": "^4.1.1",
"ejs": "^3.0.1",
"electron-publish": "22.3.6",
"electron-publish": "22.4.0",
"fs-extra": "^8.1.0",
"hosted-git-info": "^3.0.4",
"is-ci": "^2.0.0",
@ -1967,11 +1967,11 @@
}
},
"bl": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz",
"integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.0.1.tgz",
"integrity": "sha512-FL/TdvchukRCuWVxT0YMO/7+L5TNeNrVFvRU2IY63aUyv9mpt8splf2NEr6qXtPo5fya5a66YohQKvGNmLrWNA==",
"requires": {
"readable-stream": "^3.0.1"
"readable-stream": "^3.4.0"
},
"dependencies": {
"readable-stream": {
@ -2350,14 +2350,14 @@
"dev": true
},
"builder-util": {
"version": "22.3.6",
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-22.3.6.tgz",
"integrity": "sha512-1fMRRouGzggUcPcy/ZR2NV8KZejwXPYNRD4vr/Ws/KvGQFNMTHA9VFscT7tGfOseQCLaLsa5C2gU5MOAiFx7AA==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-22.4.0.tgz",
"integrity": "sha512-U2mNL9IewgTqfhvNexrm3UFdRrI6Rr48HkH9Z0IO/D86jGrCUVK8UXC8S8AHj1Cfa/VdYrMOxdXr3kajZXJvfg==",
"requires": {
"7zip-bin": "~5.0.3",
"@types/debug": "^4.1.5",
"@types/fs-extra": "^8.1.0",
"app-builder-bin": "3.5.4",
"app-builder-bin": "3.5.5",
"bluebird-lst": "^1.0.9",
"builder-util-runtime": "8.6.1",
"chalk": "^3.0.0",
@ -3961,13 +3961,13 @@
}
},
"dmg-builder": {
"version": "22.3.6",
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.3.6.tgz",
"integrity": "sha512-pUrvvzkSZfaCIXofqNH+YJ0ajgi4DDe/ZjMiL/T1yKrRXK3v7sfmnbSzHY8V/WtimSgzsK1izFg/SBsfwFsZWw==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.4.0.tgz",
"integrity": "sha512-tQvHhI2PZi4mn2CqzLyWohbipwrFJ5Wz97shsnzgje4uvVTnScF5nimoKCfnNIX5pcKL17Ij7f8WpluqeRDBTg==",
"requires": {
"app-builder-lib": "~22.3.6",
"app-builder-lib": "~22.4.0",
"bluebird-lst": "^1.0.9",
"builder-util": "~22.3.6",
"builder-util": "~22.4.0",
"fs-extra": "^8.1.0",
"iconv-lite": "^0.5.1",
"js-yaml": "^3.13.1",
@ -4099,17 +4099,17 @@
}
},
"electron-builder": {
"version": "22.3.6",
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-22.3.6.tgz",
"integrity": "sha512-W1fMEtAT7WOqetwTR2uCesMIqmnr8DHR9ZKYlHMxGxQt0jGaBX/gQHPf6+R8d2SQq2Bup6e1eE0xoeX3ixCfTw==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-22.4.0.tgz",
"integrity": "sha512-6gmXgtkc3DHN+qqTdpFrE340BvzYOLrYQnvVX8Dpz+FLBIj6kg9eH4/MVDrqRjeW8F6DsIZ3jnlM91cWiE5r0g==",
"requires": {
"@types/yargs": "^15.0.4",
"app-builder-lib": "22.3.6",
"app-builder-lib": "22.4.0",
"bluebird-lst": "^1.0.9",
"builder-util": "22.3.6",
"builder-util": "22.4.0",
"builder-util-runtime": "8.6.1",
"chalk": "^3.0.0",
"dmg-builder": "22.3.6",
"dmg-builder": "22.4.0",
"fs-extra": "^8.1.0",
"is-ci": "^2.0.0",
"lazy-val": "^1.0.4",
@ -4281,13 +4281,13 @@
"integrity": "sha512-Z1qA/1oHNowGtSBIcWk0pcLEqYT/j+13xUw/MYOrBUOL4X7VN0i0KCTf5SqyvMPmW5pSPKbo28wkxMxzZ20YnQ=="
},
"electron-publish": {
"version": "22.3.6",
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.3.6.tgz",
"integrity": "sha512-u4PW4ec4rPcdFUVMvL5OrqoYX8WLJHab8DtPkh/oZ2HPzGGX3eWnUvulIIJ4SUnesSYkbUcZd1RDYtfV52Q72w==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.4.0.tgz",
"integrity": "sha512-50p+H/FsgwvOgLP8Oekvar07MR70M+cYROlH3ty5bIq0io6doEVPl+j/Cc8tfN/tygZecBKUCdYJMXjILQPn+A==",
"requires": {
"@types/fs-extra": "^8.1.0",
"bluebird-lst": "^1.0.9",
"builder-util": "~22.3.6",
"builder-util": "~22.4.0",
"builder-util-runtime": "8.6.1",
"chalk": "^3.0.0",
"fs-extra": "^8.1.0",
@ -10768,11 +10768,11 @@
}
},
"tar-stream": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz",
"integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==",
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.1.tgz",
"integrity": "sha512-GZjLk64XcE/58qwIc1ZfXGqTSE4OutPMEkfBE/oh9eJ4x1eMRjYkgrLrav7PzddpvIpSJSGi8FgNNYXdB9Vumg==",
"requires": {
"bl": "^3.0.0",
"bl": "^4.0.1",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",

View File

@ -22,19 +22,17 @@ Usage: run command [options]
Please note that all arguments after '--' will be passed to sub-commands.
Commands:
help Print this help message.
clean Clean all build artifacts.
check Fast check if project builds (only Rust target).
build Build the sources.
dist Build the sources and create distribution packages.
watch Start a file-watch utility and run interactive mode.
help Print this help message.
clean Clean all build artifacts.
check Fast check if project builds (only Rust target).
build Build the sources.
dist Build the sources and create distribution packages.
watch Start a file-watch utility and run interactive mode.
Options:
--help Print this help message
--only-rust Run the Rust target only.
--only-js Run the js target only.
--no-rust Do not run the Rust target.
--no-js Do not run the JavaScript target.
--help Print this help message
--js Run the JavaScript target [true].
--rust Run the Rust target [true].
`
function print_help () {
@ -44,7 +42,7 @@ function print_help () {
function validate_options() {
let args_check = Object.assign({},argv)
for (arg of ['_','--','validation','help','only-rust','only-js','rust','js']) {
for (arg of ['_','--','validation','help','rust','js']) {
delete args_check[arg]
}
@ -72,6 +70,11 @@ async function copy(src,tgt) {
})
}
/// Run the command with the provided args and all args passed to this script after the `--` symbol.
async function run(command,args) {
await cmd.run(command,args.concat(child_argv))
}
// =============
@ -80,14 +83,14 @@ async function copy(src,tgt) {
async function clean_js () {
await cmd.with_cwd('app', async () => {
await cmd.run('npm',['run','clean'].concat(child_argv))
await run('npm',['run','clean'])
})
try { await fs.unlink('.initialized') } catch {}
}
async function clean_rust () {
try { await fs.rmdir('app/generated') } catch {}
// TODO finish
await run('cargo',['clean'])
}
@ -97,7 +100,7 @@ async function clean_rust () {
// =============
async function check_rust() {
await cmd.run('cargo',['check'].concat(child_argv))
await run('cargo',['check'])
}
async function check_js() {}
@ -111,13 +114,13 @@ async function check_js() {}
async function build_js () {
console.log(`Building JS target.`)
await cmd.with_cwd('app', async () => {
await cmd.run('npm',['run','build'].concat(child_argv))
await run('npm',['run','build'])
})
}
async function build_rust () {
console.log(`Building WASM target.`)
await cmd.run('wasm-pack',['build','--target','web','--no-typescript','--out-dir','../../target/web','lib/gui'].concat(child_argv))
await run('wasm-pack',['build','--target','web','--no-typescript','--out-dir','../../target/web','lib/gui'])
await patch_file('target/web/gui.js', js_workaround_patcher)
await fs.rename('target/web/gui_bg.wasm','target/web/gui.wasm')
@ -151,7 +154,7 @@ async function patch_file(path,patcher) {
// ============
async function lint_rust() {
await cmd.run('cargo',['clippy','--','-D','warnings'].concat(child_argv))
await run('cargo',['clippy','--','-D','warnings'])
}
async function lint_js() {}
@ -170,7 +173,7 @@ async function watch_rust () {
async function watch_js () {
await cmd.with_cwd('app', async () => {
await cmd.run('npm',['run','watch'].concat(child_argv))
await run('npm',['run','watch'])
})
}
@ -186,7 +189,7 @@ async function dist_rust () {
async function dist_js () {
await cmd.with_cwd('app', async () => {
await cmd.run('npm',['run','dist'].concat(child_argv))
await run('npm',['run','dist'])
})
}
@ -199,8 +202,8 @@ async function dist_js () {
async function main () {
let command = argv._[0]
let do_rust = ((argv.rust) || (argv.rust == undefined)) && (!argv['only-js'])
let do_js = ((argv.js) || (argv.js == undefined)) && (!argv['only-rust'])
let do_rust = (argv.rust == true) || (argv.rust == undefined)
let do_js = (argv.js == true) || (argv.js == undefined)
if (command == 'clean') {
cmd.section('Cleaning')

View File

@ -6,7 +6,7 @@ use std::path::Path;
/// List of workspace members that should not be tested by wasm-pack test.
/// (e.g. because they do not target wasm at all)
const PACKAGE_BLACKLIST:[&str;2] = [
"build-utilities",
"build/utilities",
"lib/ide/file-manager/mock-server"
];

View File

@ -7,7 +7,7 @@ use std::io::ErrorKind;
/// Types that can yield a reference to std::path::Path.
pub trait PathRef = AsRef<path::Path>;
/// A structure describing a concrete release package on github.
/// A structure describing a concrete release package on GitHub.
pub struct GithubRelease<Str> {
pub project_url : Str,
pub version : Str,
@ -15,9 +15,9 @@ pub struct GithubRelease<Str> {
}
impl<Str> GithubRelease<Str> {
/// Download the release package from github
/// Download the release package from GitHub.
///
/// The project_url should be a project's main page on github.
/// The project_url should be a project's main page on GitHub.
pub fn download(&self, destination_dir:&path::Path) where Str:AsRef<str> {
let url = format!(
"{project}/releases/download/{version}/{filename}",

View File

@ -22,8 +22,7 @@ need the following setup:
changes are known to cause serious issues, thus **we provide support for the latest LTS version only.
Please do not report build issues if you use other versions.** In case you run run MacOS or Linux
the easiest way to setup the proper version is by installing the
[Node Version Manager](https://github.com/nvm-sh/nvm) and running `nvm use` in the root of
this codebase.
[Node Version Manager](https://github.com/nvm-sh/nvm) and running `nvm use --lts`.
<br/>
<br/>

View File

@ -13,5 +13,5 @@ crate-type = ["cdylib", "rlib"]
enso-prelude = { version = "0.1.0", path="../../prelude"}
[build-dependencies]
basegl-build-utilities = { version = "0.1.0", path="../../../build-utilities" }
basegl-build-utilities = { version = "0.1.0", path="../../../build/utilities" }
zip = "0.5"

View File

@ -8,7 +8,7 @@ edition = "2018"
crate-type = ["cdylib", "rlib"]
[dependencies]
wasm-bindgen = { version = "=0.2.58" }
wasm-bindgen = { version = "=0.2.58" }
js-sys = { version = "0.3.30" }
nalgebra = { version = "0.19.0" }
enso-prelude = { version = "0.1.0", path="../../prelude" }
@ -19,4 +19,4 @@ futures = { version = "0.3.1" }
basegl-core-embedded-fonts = { version = "0.1.0", path="../embedded-fonts" }
[build-dependencies]
basegl-build-utilities = { version = "0.1.0", path="../../../build-utilities" }
basegl-build-utilities = { version = "0.1.0", path="../../../build/utilities" }

View File

@ -30,7 +30,7 @@ js-sys = { version = "0.3.35" }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
uuid = { version = "0.8", features = ["serde", "v5"] }
wasm-bindgen = { version = "=0.2.58" }
wasm-bindgen = { version = "=0.2.58" }
wasm-bindgen-test = { version = "0.3.8" }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

View File

@ -26,7 +26,7 @@ wasm-bindgen = { version = "=0.2.58"
wasm-bindgen-test = { version = "0.3.8" }
[build-dependencies]
basegl-build-utilities = { version = "0.1.0", path = "../../../build-utilities" }
basegl-build-utilities = { version = "0.1.0", path = "../../../build/utilities" }
bytes = { version = "0.5.4" }
futures = { version = "0.3.1" }
reqwest = { version = "0.10.1" }

View File

@ -13,7 +13,7 @@ async function init () {
await cmd.check_version('rustc','1.40.0-nightly',{preprocess:(v)=>v.substring(6,20),silent:true})
}
let initialized = fss.existsSync('.initialized')
let initialized = fss.existsSync('target/.initialized')
if (!initialized) {
cmd.section('Initialization')
console.log('Installing build script dependencies.')
@ -22,13 +22,14 @@ async function init () {
})
if(args[0] == 'clean') {
console.log('Skipping full initialization.')
try { await fs.unlink('target/.initialized') } catch {}
} else {
console.log('Installing application dependencies')
await cmd.with_cwd('app', async () => {
await cmd.run('npm',['run','install'])
})
await fs.open('.initialized','w')
await fs.mkdir('target', {recursive:true})
await fs.open('target/.initialized','w')
}
}
}