Skip to content

Commit 61faede

Browse files
committed
Fix build scripts so a failure returns a nonzero exit code
1 parent c8541a6 commit 61faede

File tree

4 files changed

+72
-60
lines changed

4 files changed

+72
-60
lines changed

.deploy/deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
#!/bin/sh
22

3+
# Switch to the correct branch
34
if [[ -z "${CF_PAGES_BRANCH}" ]]; then
45
git switch master || git switch -c unknown-branch
56
else
67
git switch $CF_PAGES_BRANCH || git switch -c $CF_PAGES_BRANCH
78
fi
89

10+
# Install the latest version of the Rust toolchain
911
echo 🔧 Install Rust
1012
curl https://sh.rustup.rs -sSf | sh -s -- -y
1113
export PATH=$PATH:/opt/buildhome/.cargo/bin
1214
echo rustc version:
1315
rustc --version
1416

17+
# Install the project's Node dependencies through npm
1518
echo 🚧 Install Node dependencies
1619
echo node version:
1720
node --version
@@ -20,9 +23,11 @@ npm --version
2023
cd frontend
2124
npm ci
2225

26+
# Install the cargo-about Rust dependency that's used during the Webpack build process (in `vue.config.js`)
2327
echo 📦 Install cargo-about
2428
cargo install cargo-about
2529

30+
# Build for production
2631
echo 👷 Build Graphite web client
2732
export NODE_ENV=production
2833
npm run build

about.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ accepted = [
1414
]
1515
ignore-build-dependencies = true
1616
ignore-dev-dependencies = true
17-
1817
workarounds = ["ring"]
1918

2019
# https://raw.githubusercontent.com/briansmith/webpki/main/LICENSE

frontend/package.json

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,58 @@
11
{
2-
"name": "graphite-web-frontend",
3-
"private": true,
4-
"description": "Graphite's web app frontend. Planned to be replaced by a native GUI written in Rust in the future.",
5-
"author": "Graphite Authors <[email protected]>",
6-
"scripts": {
7-
"serve": "vue-cli-service serve || echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies?'",
8-
"build": "vue-cli-service build || echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies?'",
9-
"lint": "vue-cli-service lint || echo 'Graphite project had lint errors or otherwise failed. In the latter case, did you remember to `npm install` the dependencies?'",
10-
"lint-no-fix": "vue-cli-service lint --no-fix || echo 'Graphite project had lint errors or otherwise failed. In the latter case, did you remember to `npm install` the dependencies?'",
11-
"start": "vue-cli-service serve",
12-
"tauri:build": "vue-cli-service tauri:build",
13-
"tauri:serve": "vue-cli-service tauri:serve"
14-
},
15-
"dependencies": {
16-
"@tauri-apps/api": "^1.2.0",
17-
"class-transformer": "^0.5.1",
18-
"idb-keyval": "^6.2.0",
19-
"reflect-metadata": "^0.1.13",
20-
"vue": "^3.2.26"
21-
},
22-
"devDependencies": {
23-
"@typescript-eslint/eslint-plugin": "^5.43.0",
24-
"@typescript-eslint/parser": "^5.43.0",
25-
"@vue/cli-plugin-eslint": "^5.0.8",
26-
"@vue/cli-plugin-typescript": "^5.0.8",
27-
"@vue/cli-service": "^5.0.8",
28-
"@vue/compiler-sfc": "^3.2.31",
29-
"@vue/eslint-config-airbnb": "^6.0.0",
30-
"@vue/eslint-config-typescript": "^11.0.2",
31-
"@wasm-tool/wasm-pack-plugin": "^1.6.0",
32-
"eslint": "^8.27.0",
33-
"eslint-config-prettier": "^8.5.0",
34-
"eslint-plugin-import": "^2.26.0",
35-
"eslint-plugin-prettier-vue": "^4.2.0",
36-
"eslint-plugin-vue": "^9.7.0",
37-
"license-checker-webpack-plugin": "^0.2.1",
38-
"prettier": "^2.7.1",
39-
"sass": "^1.56.1",
40-
"sass-loader": "^13.2.0",
41-
"typescript": "^4.9.3",
42-
"vue-cli-plugin-tauri": "~1.0.0",
43-
"vue-loader": "^17.0.1",
44-
"vue-template-compiler": "^2.7.14"
45-
},
46-
"//": "Notes about dependency issues and incompatibilities should be added here when needed.",
47-
"homepage": "https://graphite.rs",
48-
"license": "Apache-2.0",
49-
"optionalDependencies": {
50-
"wasm-pack": "^0.10.3"
51-
},
52-
"repository": {
53-
"type": "git",
54-
"url": "git+https://github.com/GraphiteEditor/Graphite.git"
55-
}
2+
"name": "graphite-web-frontend",
3+
"private": true,
4+
"description": "Graphite's web app frontend. Planned to be replaced by a native GUI written in Rust in the future.",
5+
"author": "Graphite Authors <[email protected]>",
6+
"scripts": {
7+
"start": "npm run serve",
8+
"serve": "vue-cli-service serve || (npm run print-building-help && exit 1)",
9+
"build": "vue-cli-service build || (npm run print-building-help && exit 1)",
10+
"lint": "vue-cli-service lint || (npm run print-linting-help && exit 1)",
11+
"lint-no-fix": "vue-cli-service lint --no-fix || (npm run print-linting-help && exit 1)",
12+
"tauri:build": "vue-cli-service tauri:build",
13+
"tauri:serve": "vue-cli-service tauri:serve",
14+
"print-building-help": "echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies in `/frontend`?'",
15+
"print-linting-help": "echo 'Graphite project had lint errors, or may have otherwise failed. In the latter case, did you remember to `npm install` the dependencies in `/frontend`?'"
16+
},
17+
"dependencies": {
18+
"@tauri-apps/api": "^1.2.0",
19+
"class-transformer": "^0.5.1",
20+
"idb-keyval": "^6.2.0",
21+
"reflect-metadata": "^0.1.13",
22+
"vue": "^3.2.26"
23+
},
24+
"devDependencies": {
25+
"@typescript-eslint/eslint-plugin": "^5.43.0",
26+
"@typescript-eslint/parser": "^5.43.0",
27+
"@vue/cli-plugin-eslint": "^5.0.8",
28+
"@vue/cli-plugin-typescript": "^5.0.8",
29+
"@vue/cli-service": "^5.0.8",
30+
"@vue/compiler-sfc": "^3.2.31",
31+
"@vue/eslint-config-airbnb": "^6.0.0",
32+
"@vue/eslint-config-typescript": "^11.0.2",
33+
"@wasm-tool/wasm-pack-plugin": "^1.6.0",
34+
"eslint": "^8.27.0",
35+
"eslint-config-prettier": "^8.5.0",
36+
"eslint-plugin-import": "^2.26.0",
37+
"eslint-plugin-prettier-vue": "^4.2.0",
38+
"eslint-plugin-vue": "^9.7.0",
39+
"license-checker-webpack-plugin": "^0.2.1",
40+
"prettier": "^2.7.1",
41+
"sass": "^1.56.1",
42+
"sass-loader": "^13.2.0",
43+
"typescript": "^4.9.3",
44+
"vue-cli-plugin-tauri": "~1.0.0",
45+
"vue-loader": "^17.0.1",
46+
"vue-template-compiler": "^2.7.14"
47+
},
48+
"//": "Notes about dependency issues and incompatibilities should be added here when needed.",
49+
"homepage": "https://graphite.rs",
50+
"license": "Apache-2.0",
51+
"optionalDependencies": {
52+
"wasm-pack": "^0.10.3"
53+
},
54+
"repository": {
55+
"type": "git",
56+
"url": "git+https://github.com/GraphiteEditor/Graphite.git"
57+
}
5658
}

frontend/vue.config.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,17 @@ function formatThirdPartyLicenses(jsLicenses) {
8585

8686
if (rustLicenses === undefined) {
8787
// This is probably caused by cargo about not being installed
88-
console.error(`
89-
Could not run \`cargo about\`, which is required to generate license information.
90-
To install cargo-about on your system, you can run:
91-
cargo install cargo-about
92-
License information is required on production builds. Aborting.`);
88+
console.error(
89+
`
90+
Could not run \`cargo about\`, which is required to generate license information.
91+
To install cargo-about on your system, you can run \`cargo install cargo-about\`.
92+
License information is required on production builds. Aborting.
93+
`
94+
.trim()
95+
.split("\n")
96+
.map((line) => line.trim())
97+
.join("\n")
98+
);
9399
process.exit(1);
94100
}
95101
}

0 commit comments

Comments
 (0)