# Valdi Module Setup ## BUILD.bazel — valdi_module() ```python load("//bzl/valdi:valdi_module.bzl", "valdi_module") valdi_module( name = "my_module", # Must match the directory name exactly srcs = glob([ "src/**/*.ts", "src/**/*.tsx", ]) + [ "tsconfig.json", # tsconfig must be listed in srcs ], android_output_target = "release", ios_module_name = "SCCMyModule", # SCC prefix + PascalCase module name ios_output_target = "release", visibility = ["//visibility:public"], deps = [ "//src/valdi_modules/src/valdi/valdi_core", "//src/valdi_modules/src/valdi/valdi_tsx", # Add as needed — see dependency table below ], ) ``` **Common mistakes that cause build failures:** - `name` must equal the Bazel package directory name. The Valdi compiler derives module identity from this — mismatches cause a build error. - `tsconfig.json` must be in `srcs`. It won't be picked up automatically even if it's in the directory. - Missing a dep (e.g. using `HTTPClient` without `valdi_http`) produces a TypeScript path resolution error, not a missing import error — can be confusing. ## tsconfig.json ```json { "extends": "../../../../src/valdi_modules/src/valdi/_configs/base.tsconfig.json" } ``` Adjust the `../../../../` prefix to match how many directories deep your module is from the repo root. The base config sets up `paths` aliases so `'valdi_core/src/...'` imports resolve correctly. ## Dependency Table | You're using | Add this dep | |---|---| | `Component`, `StatefulComponent`, `Style`, providers, `CancelablePromise` | `//src/valdi_modules/src/valdi/valdi_core` | | JSX elements (``, `