mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00
Switch to build script (#121)
* Switch to build script * temp: export the result of the types build * changelog * Get output result * Remove debug code * Fix warning visibility * Move the web build between the rust steps. * Add debugging again * Close file, and await promises * drop the dumb cat
This commit is contained in:
parent
f452cc7ed2
commit
4388930a15
1
changelog.d/111.bugfix
Normal file
1
changelog.d/111.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix an issue introduced in #111 that would cause the build to fail in CI.
|
@ -12,6 +12,7 @@
|
||||
}
|
||||
|
||||
.warning {
|
||||
color: black;
|
||||
border: 2px solid #dda02f;
|
||||
border-left-width: 2px;
|
||||
border-left-width: 5px;
|
||||
|
@ -20,7 +20,7 @@
|
||||
"build:app:fix-defs": "ts-node scripts/definitions-fixer.ts src/libRs.d.ts",
|
||||
"build:docs": "ts-node scripts/build-metrics-docs.ts > docs/metrics.md && mdbook build",
|
||||
"dev:web": "snowpack dev",
|
||||
"build": "yarn run build:web && yarn run build:app:rs && yarn run build:app:fix-defs && yarn run build:app",
|
||||
"build": "scripts/build-app.sh",
|
||||
"prepare": "yarn build",
|
||||
"start": "node --require source-map-support/register lib/App/BridgeApp.js",
|
||||
"start:app": "node --require source-map-support/register lib/App/BridgeApp.js",
|
||||
|
13
scripts/build-app.sh
Executable file
13
scripts/build-app.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit when any command fails
|
||||
set -e
|
||||
|
||||
echo "Building web"
|
||||
yarn run build:web
|
||||
echo "Building Rust layer"
|
||||
yarn run build:app:rs
|
||||
echo "Running rust-typescript definitions fix"
|
||||
yarn run build:app:fix-defs
|
||||
echo "Building Typescript layer"
|
||||
yarn run build:app
|
@ -4,13 +4,15 @@ import { promises as fs } from "fs";
|
||||
|
||||
async function processDefFile() {
|
||||
const path = process.argv[process.argv.length-1];
|
||||
|
||||
// Read the whole file in to prevent us writing over ourselves.
|
||||
const file = await fs.readFile(path, "utf-8");
|
||||
const out = await fs.open(path, 'w');
|
||||
for (const line of file.split('\n')) {
|
||||
const match = / {2}(\w+\.[\w.-]+):/g.exec(line);
|
||||
out.write((match ? line.replace(match[1], `"${match[1]}"`) : line) + "\n");
|
||||
await out.write((match ? line.replace(match[1], `"${match[1]}"`) : line) + "\n");
|
||||
}
|
||||
await out.close();
|
||||
}
|
||||
|
||||
processDefFile().catch((ex) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user