Skip to content

Commit 4b9cdbe

Browse files
authored
minor dev improvements (#21)
* minor dev improvements: install rust-analyser with toolchain ensure that genadl.ts has exit status 1 on failure so that the subsequent ts builds don't run unnecessarily. * use a custom error for adl compilation to control whethere tracebacks are shown
1 parent bc3ded9 commit 4b9cdbe

File tree

4 files changed

+41
-15
lines changed

4 files changed

+41
-15
lines changed

deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"lock": "./deno/deno.lock",
33
"tasks" : {
4-
"genadl" : "deno run --check=all --allow-all deno/genadl.ts && cd ts && pnpm install",
4+
"genadl" : "deno run --quiet --check=all --allow-all deno/genadl.ts && cd ts && pnpm install",
55
"build-server-image": "cd rust/server && docker build --tag protoapp-server:latest .",
66
"build-ui-image": "cd ts/ui && docker build --file Dockerfile --tag protoapp-ui:latest .."
77
},
88
"imports": {
99
"@adllang/local-setup": "jsr:@adllang/local-setup@^0.16.0",
1010
"@adllang/adl-runtime": "jsr:@adllang/adl-runtime@^0.1.0",
11-
"@adllang/adlc-tools": "jsr:@adllang/adlc-tools@^0.1.4",
11+
"@adllang/adlc-tools": "jsr:@adllang/adlc-tools@^0.1.5",
1212
"@mesqueeb/case-anything": "jsr:@mesqueeb/case-anything@^3.1.0",
1313
"@std/path": "jsr:@std/path@^1.0.8",
1414
"mustache_ts": "https://deno.land/x/mustache_ts@v0.4.1.1/mustache.ts"

deno/deno.lock

Lines changed: 27 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/genadl.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from "@std/path";
2-
import { genRust, genTypescript } from "@adllang/adlc-tools";
2+
import { AdlcError, genRust, genTypescript } from "@adllang/adlc-tools";
33

44
import { genAdlTsPackage } from "./gen-adl-ts-package.ts";
55
import { genCreateSqlSchema } from "./gen-sqlschema.ts";
@@ -93,6 +93,13 @@ export function getRepoRoot(): string {
9393
return path.dirname(path.dirname(modulepath));
9494
}
9595

96-
main().catch((err) => {
97-
console.error("error in main", err);
98-
});
96+
try {
97+
await main();
98+
} catch (e: unknown) {
99+
if (e instanceof AdlcError && e.showTraceback === false) {
100+
console.error(e.message);
101+
} else {
102+
console.error(e);
103+
}
104+
Deno.exit(1);
105+
}

rust/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
channel = "1.85.1"
3-
components = ["clippy", "rustfmt"]
3+
components = ["clippy", "rustfmt", "rust-analyzer"]

0 commit comments

Comments
 (0)