Skip to content

Commit dfe021b

Browse files
alan-agius4dgp1130
authored andcommitted
build: remove build-schema script
This commit migrates the schema generation process to utilize Bazel's tagging system instead of a custom build script. - The `scripts/build-schema.mts` script has been removed. - A new `build-schema` script has been added to `package.json` that executes `bazel build` for targets tagged with "schema". - The CI/PR workflows (`.github/workflows/ci.yml` and `pr.yml`) have been updated to use this new `pnpm run build-schema` command. - The `ng_cli_schema_generator.bzl` and `ts_json_schema.bzl` rules have been updated to include the "schema" tag, allowing them to be picked up by the new build process.
1 parent 38743d9 commit dfe021b

File tree

6 files changed

+5
-74
lines changed

6 files changed

+5
-74
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: pnpm install --frozen-lockfile
2929
- name: Generate JSON schema types
3030
# Schema types are required to correctly lint the TypeScript code
31-
run: pnpm admin build-schema
31+
run: pnpm run build-schema
3232
- name: Run ESLint
3333
run: pnpm lint --cache-strategy content
3434
- name: Validate NgBot Configuration

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: pnpm install --frozen-lockfile
4747
- name: Generate JSON schema types
4848
# Schema types are required to correctly lint the TypeScript code
49-
run: pnpm admin build-schema
49+
run: pnpm run build-schema
5050
- name: Run ESLint
5151
run: pnpm lint --cache-strategy content
5252
- name: Validate NgBot Configuration

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"bazel": "bazelisk",
1616
"test": "bazel test //packages/...",
1717
"build": "pnpm -s admin build",
18+
"build-schema": "bazel build //... --build_tag_filters schema --symlink_prefix dist-schema/",
1819
"lint": "eslint --cache --max-warnings=0 \"**/*.@(ts|mts|cts)\"",
1920
"templates": "pnpm -s admin templates",
2021
"validate": "pnpm -s admin validate",

scripts/build-schema.mts

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

tools/ng_cli_schema_generator.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ def cli_json_schema(name, src, out, data = []):
44
js_run_binary(
55
name = name,
66
outs = [out],
7+
tags = ["schema"],
78
srcs = [src] + data,
89
tool = "//tools:ng_cli_schema",
910
progress_message = "Generating CLI interface from %s" % src,

tools/ts_json_schema.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def ts_json_schema(name, src, data = []):
1212
name = name + ".interface",
1313
outs = [out],
1414
srcs = [src] + data,
15+
tags = ["schema"],
1516
tool = "//tools:quicktype_runner",
1617
progress_message = "Generating TS interface for %s" % src,
1718
mnemonic = "TsJsonSchema",

0 commit comments

Comments
 (0)