build: generate example routes - #809
Merged
Merged
Conversation
spike-rabbit
force-pushed
the
build/generate-routes
branch
from
August 19, 2026 11:26
0588aa7 to
ab8183f
Compare
spike-rabbit
force-pushed
the
build/generate-routes
branch
2 times, most recently
from
August 19, 2026 13:18
79a4f4f to
9d04154
Compare
spike-rabbit
changed the base branch from
main
to
refactor/rename-large-data-set-example
August 19, 2026 13:22
spike-rabbit
force-pushed
the
build/generate-routes
branch
2 times, most recently
from
August 19, 2026 13:37
54d28d8 to
4296232
Compare
There was a problem hiding this comment.
Pull request overview
Introduces a custom Angular builder that auto-discovers example components and generates both the application route configuration and the web-components loader map, wiring this into the build/CI pipeline to prevent generated files from going stale.
Changes:
- Added
@ngx-datatable/example-routes-builder(workspace package) to scansrc/app/**/**.component.tsexamples and generatesrc/app/app.routes.ts+src/app/app.web-components.ts. - Updated app + web-components entrypoints to consume the generated route/loader outputs.
- Added CI verification step (
npm run build:routes && git diff --exit-code) to ensure generated files are up-to-date.
Reviewed changes
Copilot reviewed 72 out of 73 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/example-routes-builder/tsconfig.json | TS config for compiling the custom Angular builder to ESM output. |
| tools/example-routes-builder/package.json | Declares the builder workspace package and its builder manifest entrypoint. |
| tools/example-routes-builder/example-routes-builder.schema.json | Builder options schema (sourceRoot + output file paths). |
| tools/example-routes-builder/example-routes-builder.mts | Builder implementation: example discovery + TS AST codegen + Prettier formatting. |
| tools/example-routes-builder/builders.json | Registers the builder implementation and schema for Angular CLI. |
| src/main.web-components.ts | Switch-based loader replaced with generated exampleLoaders map lookup. |
| src/main.ts | Switched routing import from removed manual routing module to generated routes file. |
| src/app/app.web-components.ts | New generated map of example name -> dynamic import loader for web-components build. |
| src/app/app.routes.ts | New generated Angular Routes array for examples. |
| src/app/app.component.ts | Title now read from activated component’s static exampleTitle; keeps reading route data for dark/sourcePath. |
| src/app/app.component.html | Router outlet activation now passes $event component instance into routeActivate. |
| src/app/app-routing.module.ts | Removed manual route list (replaced by generated app.routes.ts). |
| src/app/basic/bootstrap-theme.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/context-menu.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/css-classes.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/dark-theme.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/disabled.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/dynamic-row-height.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/empty-template.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/filtering.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/fixed-row-height.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/fluid-row-height.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/footer-template.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/full-screen.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/hidden-on-load.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/horz-vert-scrolling.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/inline-editing.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/large-data-set.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/live-data.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/multiple-tables.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/responsive.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/row-detail.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/row-grouping.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/rxjs.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/basic/vert-dynamic-scrolling.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/columns/column-pinning.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/columns/column-reorder.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/columns/column-toggling.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/columns/fixed-column.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/columns/flex-column.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/columns/force-column.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/drag-drop/drag-drop.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/paging/client-side-paging.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/paging/scrolling-no-virtual.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/paging/scrolling-server-side.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/paging/server-side-paging.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/paging/virtual-server-side.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/cell-selection.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/checkbox-selection.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/custom-checkbox-selection.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/disable-selection-callback.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/multi-click-and-checkbox-selection.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/multi-click-row-selection.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/multi-row-selection.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/selection/single-row-selection.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/sorting/client-side-sorting.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/sorting/comparator.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/sorting/default-sort.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/sorting/server-side-sorting.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/summary/custom-template-summary.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/summary/inline-html-summary.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/summary/server-side-paging-summary.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/summary/simple-summary.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/summary/summary-row-actions.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/templates/inline-template.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/templates/template-ref.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/tree/client-side-tree.component.ts | Adds static exampleTitle for route/title generation. |
| src/app/tree/full-screen-tree.component.ts | Adds static exampleTitle for route/title generation. |
| package.json | Adds build:routes script and workspace declaration for the builder package. |
| package-lock.json | Updates lockfile for workspace linking of the builder package. |
| angular.json | Adds build-routes target using the new builder. |
| .prettierignore | Ignores generated route/loader files for Prettier CLI runs. |
| .github/workflows/test_and_deploy.yml | Adds CI step to verify generated outputs match tracked files. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
spike-rabbit
force-pushed
the
build/generate-routes
branch
2 times, most recently
from
August 20, 2026 06:35
9a970f6 to
69e2c25
Compare
Base automatically changed from
refactor/rename-large-data-set-example
to
main
August 25, 2026 20:07
fh1ch
force-pushed
the
build/generate-routes
branch
from
August 25, 2026 20:07
69e2c25 to
a37588e
Compare
9 tasks
fh1ch
approved these changes
Aug 25, 2026
fh1ch
left a comment
Member
There was a problem hiding this comment.
@spike-rabbit no findings, let's see how well this works.
LGTM 👍
fh1ch
force-pushed
the
build/generate-routes
branch
from
August 25, 2026 20:58
a37588e to
fa3d9d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Example routes and web-component loaders are maintained manually, so new examples require changes in multiple source files. Generated route files can also become stale without detection in CI.
What is the new behavior?
An Angular builder discovers example components and generates both the application routes and web-component loaders through
npm run build:routes. The build pipeline runs this command and fails if it changes tracked files.Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: