Skip to content

Commit f00d64c

Browse files
authored
feat: Initial work building out typescript compiling with source maps (#248)
1 parent c326f50 commit f00d64c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3128
-1175
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[workspace]
22
members = [
3-
# "rust/common-builder",
43
# "rust/common-javascript-interpreter",
54
# "rust/common-formula-javascript-interpreter",
65
# "rust/common-graph",
76
# "rust/common-ifc",
87
# "rust/common-integration-tests",
9-
# "rust/common-macros",
10-
# "rust/common-protos",
118
# "rust/common-runtime",
12-
# "rust/common-test-fixtures",
139
# "rust/common-tools",
14-
# "rust/common-tracing",
1510
# "rust/common-wit",
11+
"rust/ct-builder",
1612
"rust/ct-common",
1713
"rust/ct-engine",
1814
"rust/ct-js-vm",
15+
"rust/ct-macros",
16+
"rust/ct-protos",
1917
"rust/ct-runtime",
18+
"rust/ct-test-fixtures",
19+
"rust/ct-tracing",
2020
]
2121

2222
# See: https://github.com/rust-lang/rust/issues/90148#issuecomment-949194352
@@ -26,30 +26,24 @@ resolver = "2"
2626
anyhow = { version = "1" }
2727
async-stream = { version = "0.3" }
2828
async-trait = { version = "0.1" }
29-
#axum = { version = "0.7" }
29+
axum = { version = "0.7" }
3030
blake3 = { version = "1.5" }
3131
boa_engine = { version = "0.19" }
3232
boa_gc = { version = "0.19" }
3333
boa_runtime = { version = "0.19" }
3434
bytes = { version = "1" }
3535
clap = { version = "4.5" }
36-
#common-builder = { path = "./rust/common-builder" }
37-
#common-graph = { path = "./rust/common-graph" }
38-
#common-ifc = { path = "./rust/common-ifc" }
39-
#common-integration-tests = { path = "./rust/common-integration-tests" }
40-
#common-javascript-interpreter = { path = "./rust/common-javasript-interpreter" }
41-
#common-macros = { path = "./rust/common-macros" }
42-
#common-protos = { path = "./rust/common-protos", default-features = false }
43-
#common-runtime = { path = "./rust/common-runtime" }
44-
#common-test-fixtures = { path = "./rust/common-test-fixtures" }
45-
#common-tracing = { path = "./rust/common-tracing" }
46-
#common-wit = { path = "./rust/common-wit" }
36+
ct-builder = { path = "./rust/ct-builder" }
4737
ct-common = { path = "./rust/ct-common" }
38+
ct-macros = { path = "./rust/ct-macros" }
39+
ct-protos = { path = "./rust/ct-protos" }
4840
ct-runtime = { path = "./rust/ct-runtime" }
41+
ct-test-fixtures = { path = "./rust/ct-test-fixtures" }
42+
ct-tracing = { path = "./rust/ct-tracing" }
4943
#criterion = { version = "0.5" }
50-
#darling = { version = "0.20" }
51-
#deno_emit = { version = "0.45" }
52-
#deno_graph = { version = "0.82" } # Keep aligned with `deno_emit`'s version
44+
darling = { version = "0.20" }
45+
deno_emit = { version = "0.46" }
46+
deno_graph = { version = "0.82.3" } # Keep aligned with `deno_emit`'s version
5347
getrandom = { version = "0.2", features = ["js"] }
5448
#http = { version = "1.1" }
5549
#http-body-util = { version = "0.1" }
@@ -59,35 +53,35 @@ js-sys = { version = "0.3" }
5953
#lazy_static = { version = "1" }
6054
#mime_guess = { version = "2" }
6155
once_cell = { version = "1" }
62-
#prost = { version = "0.13" }
63-
#quote = { version = "1" }
56+
prost = { version = "0.13" }
57+
quote = { version = "1" }
6458
rand = { version = "0.8" }
65-
#redb = { version = "2" }
66-
#reqwest = { version = "0.12", default-features = false }
59+
redb = { version = "2" }
60+
reqwest = { version = "0.12", default-features = false }
6761
#rust-embed = { version = "8.4" }
6862
#serde = { version = "1", features = ["derive"] }
6963
#serde_json = { version = "1" }
7064
#sieve-cache = { version = "0.2" }
7165
#strum = { version = "0.26" }
72-
#syn = { version = "2" }
66+
syn = { version = "2" }
7367
tempfile = { version = "3" }
7468
thiserror = { version = "1" }
75-
#tonic = { version = "0.12", default-features = false }
76-
#tonic-build = { version = "0.12", default-features = false, features = [
77-
# "prost",
78-
#] }
69+
tonic = { version = "0.12", default-features = false }
70+
tonic-build = { version = "0.12", default-features = false, features = [
71+
"prost",
72+
] }
7973
#tonic-web = { version = "0.12" }
8074
#tonic-web-wasm-client = { version = "0.6" }
8175
tokio = { version = "1" }
82-
#tower-http = { version = "0.5" }
76+
tower-http = { version = "0.5" }
8377
tracing = { version = "0.1" }
8478
tracing-subscriber = { version = "0.3", features = [
8579
"env-filter",
8680
"tracing-log",
8781
"json",
8882
] }
8983
tracing-web = { version = "0.1" }
90-
#url = { version = "2" }
84+
url = { version = "2" }
9185

9286
# Minimum required wasm-bindgen / wasm-bindgen-test versions
9387
# SEE: https://github.com/rustwasm/wasm-bindgen/issues/4083

proto/builder/builder.proto

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,23 @@ import public "common/common.proto";
55
package builder;
66

77
message BuildComponentRequest {
8-
common.ModuleSource module_source = 1;
9-
common.Target target = 2;
8+
common.ModuleDefinition module_definition = 1;
9+
bool bundle_common_imports = 2;
1010
}
1111

12-
message BuildComponentResponse { string id = 1; }
13-
14-
message ReadComponentRequest { string id = 1; }
12+
message BuildComponentResponse {
13+
string component_id = 1;
14+
}
1515

16-
message ReadComponentResponse { bytes component = 1; }
16+
message ReadComponentRequest { string component_id = 1; }
1717

18-
message BundleSourceCodeRequest {
19-
common.ModuleSource module_source = 1;
20-
common.Target target = 2;
18+
message ReadComponentResponse {
19+
string component = 1;
20+
optional string source_map = 2;
2121
}
2222

23-
message BundleSourceCodeResponse { string bundled_source_code = 1; }
24-
2523
service Builder {
2624
rpc BuildComponent(BuildComponentRequest) returns (BuildComponentResponse) {}
2725

2826
rpc ReadComponent(ReadComponentRequest) returns (ReadComponentResponse) {}
29-
30-
rpc BundleSourceCode(BundleSourceCodeRequest)
31-
returns (BundleSourceCodeResponse) {}
3227
}

proto/common/common.proto

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,9 @@ package common;
44

55
enum ContentType {
66
JAVA_SCRIPT = 0;
7-
PYTHON = 1;
87
}
98

10-
enum Target {
11-
COMMON_FUNCTION = 0;
12-
COMMON_FUNCTION_VM = 1;
13-
COMMON_FORMULA_VM = 2;
14-
}
15-
16-
enum ValueKind {
17-
STRING = 0;
18-
NUMBER = 1;
19-
BOOLEAN = 2;
20-
BUFFER = 3;
21-
}
22-
23-
message LabeledData {
24-
Value value = 1;
25-
string confidentiality = 2;
26-
string integrity = 3;
27-
}
28-
29-
message Value {
30-
oneof variant {
31-
string string = 1;
32-
double number = 2;
33-
bool boolean = 3;
34-
bytes buffer = 4;
35-
}
36-
}
37-
38-
message SourceCode {
9+
message ModuleDefinition {
3910
ContentType content_type = 1;
40-
bytes body = 2;
41-
}
42-
43-
message ModuleBody {
44-
oneof variant {
45-
ModuleSignature module_signature = 1;
46-
ModuleSource module_source = 2;
47-
}
48-
}
49-
50-
message ModuleSignature {
51-
string id = 1;
52-
}
53-
54-
message ModuleSource {
55-
map<string, SourceCode> source_code = 1;
56-
}
11+
string source = 2;
12+
}

rust/common-builder/src/bake/fs.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

rust/common-builder/src/bake/javascript.rs

Lines changed: 0 additions & 92 deletions
This file was deleted.

rust/common-builder/src/bake/mod.rs

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)