@@ -16,7 +16,7 @@ go_library(
1616 name = "file_ops_lib" ,
1717 srcs = [
1818 "json_bridge.go" ,
19- "operations.go" ,
19+ "operations.go" ,
2020 "security.go" ,
2121 "workspace.go" ,
2222 ],
@@ -30,67 +30,59 @@ go_library(
3030go_binary (
3131 name = "file_ops_cli" ,
3232 srcs = ["main.go" ],
33- deps = [ ":file_ops_lib" ] ,
33+ goarch = "amd64" ,
3434 # Build for host platform for testing
3535 goos = "linux" ,
36- goarch = "amd64" ,
36+ deps = [ ":file_ops_lib" ] ,
3737)
3838
3939# TinyGo WebAssembly Component
4040go_wasm_component (
4141 name = "file_ops_component" ,
4242 srcs = [
43+ "json_bridge.go" ,
4344 "main.go" ,
44- "json_bridge.go" ,
4545 "operations.go" ,
4646 "security.go" ,
47- "workspace.go" ,
4847 "wit_bindings.go" ,
48+ "workspace.go" ,
4949 ],
5050 go_mod = "go.mod" ,
51- wit = "//wit:file-operations" ,
52- world = "file-operations-world" ,
5351 optimization = "release" ,
5452 tags = ["manual" ], # Build explicitly for WASM
53+ wit = "//wit:file-operations" ,
54+ world = "file-operations-world" ,
5555)
5656
5757# Test suite
5858go_test (
5959 name = "file_ops_test" ,
6060 srcs = [
61- "operations_test.go" ,
6261 "json_bridge_test.go" ,
62+ "operations_test.go" ,
6363 "security_test.go" ,
6464 "workspace_test.go" ,
6565 ],
66- deps = [
67- ":file_ops_lib" ,
68- "@org_golang_x_testing//fstest" ,
69- ],
7066 data = [
7167 "//testdata:test_configs" ,
7268 "//testdata:test_files" ,
7369 ],
70+ deps = [
71+ ":file_ops_lib" ,
72+ "@org_golang_x_testing//fstest" ,
73+ ],
7474)
7575
7676# Integration tests with WASM component
77- sh_test (
78- name = "integration_test" ,
79- srcs = ["integration_test.sh" ],
80- data = [
81- ":file_ops_component" ,
82- "//testdata:integration_configs" ,
83- ],
84- tags = ["integration" ],
85- )
77+ # Note: sh_test is deprecated, replaced with Go-based integration tests in //testdata:integration_tests
8678
8779# Performance benchmarks
8880go_test (
8981 name = "benchmark_test" ,
90- srcs = ["benchmark_test.go" ],
91- deps = [":file_ops_lib" ],
82+ srcs = ["benchmark_test.go" ],
9283 args = ["-bench=." ],
9384 tags = ["benchmark" ],
85+ deps = [":file_ops_lib" ],
9486)
9587
9688# Generate signing keys for component security
@@ -104,28 +96,28 @@ wasm_keygen(
10496wasm_sign (
10597 name = "file_ops_component_signed" ,
10698 component = ":file_ops_component" ,
107- keys = ":component_signing_keys" ,
10899 detached = False , # Embed signature in component
100+ keys = ":component_signing_keys" ,
109101 tags = ["manual" ],
110102)
111103
112104# Verify component signature
113105wasm_verify (
114106 name = "verify_file_ops_signature" ,
115- signed_component = ":file_ops_component_signed" ,
116107 keys = ":component_signing_keys" ,
108+ signed_component = ":file_ops_component_signed" ,
117109 tags = ["manual" ],
118110)
119111
120112# Create signed OCI image for registry publishing
121113wasm_component_signed_oci_image (
122114 name = "file_ops_oci_signed" ,
115+ package_name = "bazel-file-ops-component-tinygo" ,
123116 component = ":file_ops_component" ,
124- sign_component = True ,
125117 component_signing_keys = ":component_signing_keys" ,
126- registry = "ghcr.io" ,
127118 namespace = "pulseengine" ,
128- package_name = "bazel-file-ops-component-tinygo" ,
119+ registry = "ghcr.io" ,
120+ sign_component = True ,
129121 tags = ["manual" ],
130122)
131123
@@ -137,7 +129,7 @@ alias(
137129)
138130
139131alias (
140- name = "file_ops_tinygo" ,
132+ name = "file_ops_tinygo" ,
141133 actual = ":file_ops_component" ,
142134 visibility = ["//visibility:public" ],
143135)
@@ -153,4 +145,4 @@ alias(
153145 name = "file_ops_signed" ,
154146 actual = ":file_ops_component_signed" ,
155147 visibility = ["//visibility:public" ],
156- )
148+ )
0 commit comments