no-js is the public build-time entrypoint for consuming apps.
The supported app-facing tools are:
go tool no-jsMain generation entrypoint for routes, assets, checks, and bundle-config loading.go tool templgenCompanion tool only for extra.templpackages outsideweb/routes.
Do not add lower-level repository generators such as approutegen,
staticassetsgen, templcssgen, or i18nkeygen to consuming app toolchains.
They are implementation helpers for this repository, not the app CLI contract.
go tool no-js gen [routes|assets|check] [-root .] [-config path]If you omit the mode, gen runs both route generation and asset generation.
Every mode first validates the strict web/routes and web/components app
shape. Think of routes as the generation step that writes Go code, and
assets as the asset step that writes bundled, fingerprinted runtime files.
go tool no-js gen -root .Run the normal generation loop.go tool no-js gen routes -root .Generate Go route handlers, resolver contracts, built-in i18n output, source-adjacent Client Asset helpers, and the templ CSS registry. This does not write final browser CSS or JavaScript bundles.go tool no-js gen assets -root .Build route-level Client Asset bundles, include explicit global files fromweb/assets, fingerprint the output, and write the manifest.go tool no-js gen check -root .Run route generation, asset generation, then fail ifgit diff --exit-codeis not clean.
-rootApplication root directory. Default:.-configExplicit bundle-config path. If omitted,no-jsloadsno-js.bundle.yamlfrom the app root when the file exists.
go tool no-js gen routes -root . writes:
web/generated/*web/resolvers/generated.go- built-in i18n output when
web/i18n/messagesexists *.css_gen.goand*.{js,ts,tsx,mjs,mts}_gen.gobeside discovered Client Asset sources- templ CSS registry output unless
assets.templ_cssis false
go tool no-js gen assets -root . writes:
- generated Client Asset stylesheets, module entries, and shared script chunks
- explicit global
web/assetsfiles under the configured assets-build directory - the static asset manifest, by default
web/assets-build/manifest.json
Client Asset scripts are bundled with esbuild and can use JavaScript or
TypeScript imports. web/assets files are path-managed: CSS may bundle relative
CSS imports, while JavaScript is minified as a standalone file. All esbuild
paths use assets.browser_targets from bundle config.
See Asset Pipeline Reference for the compile, bundle, and fingerprint split.
Generate everything from the app root:
go tool no-js gen -root .Check generated output in CI:
go tool no-js gen check -root .Use an explicit config file:
go tool no-js gen -root . -config ./config/no-js.bundle.yamlDisable templ css extraction when you want templ to keep inline CSS registration:
version: 1
assets:
templ_css: falsego tool no-js gen assets -root .go tool no-js handles web/routes and the generated route output. If your app
has extra .templ files under web/components, web/view, or other
app-owned packages, use the companion templgen tool as a second step.
Add it to go.mod:
tool (
github.com/RevoTale/no-js/cmd/no-js
github.com/RevoTale/no-js/cmd/templgen
)Run it:
go tool templgen -base . -path web/components -path web/view -path web/generatedSupported templgen flags:
-baseBase path used for relative filenames in generated output. Default:.-pathDirectory to scan for.templfiles. Repeatable.-fileSingle.templfile to compile. Repeatable.
Keep go tool no-js as the main entrypoint. Add templgen only for extra
templ packages outside web/routes.