# Changelog

All notable changes to `@trebired/bundler` will be documented here.

This project follows semantic versioning once published.

## 5.13.4

- Moved to `@trebired/logger` 3.0.0, which stores saved logs in SQLite and runs on Bun on the server. The `@package/logger` range is now `^3.0.0`.
- Moved to `@trebired/logger-adapter` 0.6.0, which depends on `@trebired/logger` 3.0.0.
- Updated the shipped `.trebired/logger/config.ts` `forVersion` to `3.0.0`. The logger checks `forVersion` by major and minor version, so under `@trebired/logger` 3.0 the old `2.7.0` value failed the check and this package's log prefix was dropped.

## 5.13.3

- Changed the verification scripts and examples to print through `@trebired/logger` instead of `console` and `process.stdout`.

## 5.13.2

- Updated the `@trebired/i18n` dependency to `^0.7.0`. The build-time i18n check ran the 0.6 checker, which read a plural message (`{ one, few, many, other }`) as nested keys, so a Czech plural object next to an English string or a two-form English plural failed every build with `bundler-i18n-invalid-folder`. The 0.7 checker treats a plural message as one key and also reports missing plural categories and unknown pipes.

## 5.13.1

- Made `clientOutDir` optional on `BundlerFrontendAppBundlerConfigOptions`, defaulting to `dist`. 5.13.0 added the config surface but the option stayed required, so an application still had to pass the value in code and could not let `.trebired/bundler/config.ts` own it.

## 5.13.0

- Added `build.clientOutDir` to the project config, so an application declares its build output directory in `.trebired/bundler/config.ts` alongside `publicPath` and `outputLayout` instead of hardcoding it in a build script. An explicit `clientOutDir` passed to `applyProjectConfigsToFrontendBundlerOptions()` still wins, so nothing existing changes.

## 5.12.1

- Static asset serving now resolves a directory to its `index.html`. A request for an extension-less path such as `/cs` matched no file and fell through to the SPA fallback, so every prerendered sub-path was served the root document instead of its own.

## 5.12.0

- Added `bootScripts` to the static shell meta. Entries render as inline `<script>` tags at the top of `<head>`, before the title, links and asset tags, so they execute before first paint. Static shells previously had no way to emit the theme and locale boot scripts that have to settle the document before it renders.

## 5.11.2

- Updated the shipped `.trebired/logger/config.ts` `forVersion` to `2.7.0` and the `@trebired/code-discipline` / `@trebired/configs` ranges to `^7.2.0` / `^0.4.0`. The logger config named an older release, so under `@trebired/logger` 2.7 the version check threw and this package's log prefix was dropped.

## 5.11.1

- Fixed favicons disappearing in watch and dev builds. `buildStaticShell()` now generates and emits them itself when the build result carries none, so a caller that assembles a synthetic build result (as a file watcher does after a rebuild clears the out dir) still gets the files and the head links. `buildFrontendApp()` keeps emitting them once up front, and its result is reused when present.

## 5.11.0

- Added favicon emission to `buildFrontendApp()`. It calls `generateFaviconAssets()` on `@trebired/frontend` through the same duck-typed bridge used for static icons, writes the returned files into the client out dir, and reports them on the build result as `favicon`. A frontend without that export degrades to no favicon output rather than failing.
- Added favicon link injection to `buildStaticShell()`. Generated links merge into every route's links rather than the shared `meta`, because per-route meta is a shallow spread and a route supplying its own `links` would otherwise drop them. Links a route already declares for the same `rel` and `href` win.
- Changed the emission order so favicons are written after `copyPublicDir()`, whose `force: true` copy would otherwise overwrite a generated file of the same name.
- Updated the `@trebired/utils` dependency range to `^0.9.1`, which scopes the `forVersion` key-order rule to real config files. Under 0.9.0 the inline project config passed to `applyProjectConfigToFrontendBundlerOptions()` failed that rule.

## 5.10.0

- Changed the `forVersion` check to pass the config object to `resolveForVersion()`, which `@trebired/utils` 0.9.0 requires. A config that does not declare `forVersion` as its first key now fails instead of loading.
- Updated the `@trebired/utils` dependency range to `^0.9.0`.

## 5.9.0

### Fixed

- `watch()` reimplemented entry discovery inline instead of reusing `bundle()`'s
  `resolveBuildDiscovery()`, and never called `withClientRootIgnored()`/`appendClientRootEntry()` —
  the two calls that exclude a `clientRoot`-configured root component from normal discovery and
  synthesize it as its own entry. A `clientRoot`-configured project built correctly once via
  `bundle()`, then silently lost that entry on the very first watch rebuild (both the initial watch
  state and every subsequent `rebuild()` shared the same bug), with no error anywhere — whatever
  read the manifest (`globalClientEntries`, `buildStaticShell()`) just found nothing there. Both
  code paths now share one `resolveFrontendDiscovery()` in `core/discovery-resolve.ts`.

### Added

- `BundlerStaticShellMeta` gained `links`/`metas` arrays, rendered as `<link>`/`<meta>` tags after
  the built-in title/description/asset tags. There was previously no way to emit a favicon,
  `theme-color`, canonical URL, Open Graph tags, or `hreflang` alternates from `buildStaticShell()`
  — every value is escaped per-attribute, so this is not a raw head-string escape hatch.

## 5.8.2

### Changed

- Moved the `@trebired/utils` dependency range from `^0.6.0` to `^0.8.0`, matching the rest of
  the `@trebired` packages. For 0.x versions those two ranges are disjoint (`>=0.6.0 <0.7.0` vs
  `>=0.8.0 <0.9.0`), so any project combining this package with one already on `^0.8.0`
  (`@trebired/frontend`, `@trebired/uploads`, `@trebired/env`, `@trebired/security`) resolved two
  copies of `@trebired/utils` — a hoisted 0.6.x alongside a nested 0.8.x — duplicating code and
  letting app-level imports of `@trebired/utils` silently resolve to a different copy than this
  package used internally. Nothing this package uses changed across those releases; the only
  breaking change in 0.8.0 was the env module moving to `@trebired/env`, which this package does
  not import.

## 5.8.1

### Fixed

- A `clientRoot` app's shell now links its script. `resolveFrontendGlobalClientEntries()` derives the global entry list by pattern-matching `manifest.sources` against `globalClientEntryInclude` relative to `frontendDir`. The synthesized client entry is virtual — its module is the configured root component and it has no on-disk source under `frontendDir` to glob against — so it never matched, the list came back empty, and `buildStaticShell()` emitted HTML with no `<script>` at all. The build reported success and the entry chunk was written, so the failure only showed as a blank page. The synthesized entry is now included by its entry key, which `collectAssetLinks()` resolves like any other.

## 5.8.0

### Added

- `clientRoot` synthesizes the client entry. An app that declares `clientRoot: "src/frontend/app.tsx"` (with optional `rootId`, default `"root"`) no longer writes an `index.client.tsx` of its own: the bundler generates the entry, mounts the named component into the shell's root element, calls `bindFrontendRuntime()` with the icon mode read from the resolved frontend config, and side-effect imports `@trebired/frontend/static-icons` when that mode is `"static"`. None of that was app-specific — every React frontend-only app wrote the identical file, restating the icon mode a third time after the frontend config and the static-icons specs already declared it.
- The file named by `clientRoot` is exempted from discovery's unmatched-source check, and an app whose only entry is the synthesized one no longer trips the empty-entries error.

Hand-written client entries are unaffected; omit `clientRoot` and nothing changes.

## 5.7.0

### Added

- Resolves `@trebired/frontend/static-icons` to a build-time generated module. When the app's frontend config sets `assets.icons.mode: "static"` with `assets.icons.specs`, the bundler asks `@trebired/frontend/config` for the rendered icon cache and serves it as a virtual module, so a consumer no longer has to write a generated TypeScript file into its own `src/` tree and sequence that write ahead of the build. Apps not using static mode, and node-environment builds, are unaffected — the specifier falls through to the package's real no-op module. Requires `@trebired/frontend` 11.5.0 or newer; older versions lack the generator and the plugin falls back to the no-op module.

## 5.6.5

- Fixed frontend asset link stylesheet ordering so package frontend config CSS loads before app global CSS while preserving stable dedupe.

## 5.6.4

- Fixed static asset `Content-Type` headers for fonts, images, manifests, WASM, text, and other common browser assets served by `serveStaticAsset()`, `createStaticAssetMiddleware()`, and `createBunStaticAssetHandler()`. Font files now serve as `font/woff2`, `font/woff`, `font/ttf`, or `font/otf` instead of `application/octet-stream`, avoiding browser rejection when `X-Content-Type-Options: nosniff` is present.

## 5.6.3

- Updated logger, logger-adapter, result, and code-discipline dependency ranges to the current package releases so frontend-only builds do not retain older nested logger installs.

## 5.6.2

- Changed the shared default logger used by `bundle()`, `watch()`, and frontend-app build helpers to use `@trebired/logger` formatting, matching the CLI path.
- Kept package initialization logs on the same default logger so programmatic frontend-only builds do not fall back to raw console output.

## 5.6.1

- Changed the bundler CLI to use `@trebired/logger` by default for build/watch logs when no logger is supplied by config.
- Updated the logger-adapter dependency to pick up idempotent package initialization logging.

## 5.6.0

- Added `buildStaticShell()` for backend-free frontend app shells, including optional per-route static shells with route-specific metadata.
- Added `createBunStaticAssetHandler()` for `Bun.serve({ fetch })` static serving with optional SPA fallback to `index.html`.
- Documented static-SPA frontend app builds, SSG-lite route shells, `browser.external` for public-root vendor asset URLs, and the `publicDir` default resolution under `frontendDir`.

## 5.5.0

- Reduced the static asset cache default budget from 256 MB to 16 MB and gave it real LRU eviction. The previous implementation stopped caching once the budget was reached, so with a large asset set the first files seen would pin the cache and everything else permanently re-read from disk. Entries are now evicted least-recently-used, bounded by both total bytes (`assetCacheMaxBytes`) and entry count (`assetCacheMaxEntries`, default 512). The default comfortably holds a typical built client bundle while no longer reserving memory far in excess of what any real asset set needs.

## 5.4.0

- Added an in-memory static asset cache to `createStaticAssetMiddleware`/`serveStaticAsset`. Previously every asset request performed a `stat` to resolve the file, a further `stat` per precompressed candidate, and a full `readFile` of the asset body, so serving a bundle re-read it from disk on every request. Resolved responses (body plus headers, per negotiated encoding) are now cached, which removes all per-request filesystem syscalls for assets after the first hit. The cache is bounded by total bytes (`assetCacheMaxBytes`, default 256 MB) and can be disabled with `cacheAssetsInMemory: false`. It is skipped entirely in `development` mode so rebuilt assets are still picked up immediately.

## 5.3.4

- Removed dead `config.creator` from `package.json`.
- Updated shared utilities to `@trebired/utils@^0.6.0` and replaced the removed `readPackageIdentity()` with `readPackageJsonUrl()` + `readOrganizationIdentity()` + `packageSlug()`/`joinLogGroup()`. No change to exported metadata values.

## 5.3.2

- Matched generated namespace module union formatting to strict consumer formatting rules.

## 5.3.1

- Fixed generated namespace modules so they are emitted with discipline-clean TypeScript formatting.

## 5.3.0

- Added generic prefix-aware namespace helpers for classes, BEM elements/modifiers, data attributes, selectors, CSS variables, tokens, and event names.
- Added generated namespace module support and the `package-bundler namespace --out <file>` CLI command.
- Added a virtual Sass namespace module that resolves prefixes from the owning app or package bundler config.

## 5.2.0

- Added `createFrontendBundlerRuntimeSession()` so apps can reuse package-owned frontend runtime assembly.
- Added a build-once development runtime strategy for apps that do not want dev watchers.

## 5.1.5

- Updated shared utilities to `@trebired/utils@^0.4.4`.

## 5.1.4

- Updated shared utilities to `@trebired/utils@^0.4.3`.
- Replaced local config, object, time, and package metadata helpers with shared utilities.

## 5.1.3

- Split esbuild, output post-processing, and build-result assembly timing logs for build and watch runs.
- Reduced frontend output-layout startup work by renaming static assets instead of reading and rewriting them.
- Avoided duplicate asset-manifest derivation while writing bundler manifests.
- Skipped output reference rewrite scans when the generated text does not contain a candidate reference.

## 5.1.2

- Shared in-flight i18n folder resolution between concurrent client and SSR frontend-app builds without keeping stale cache after resolution completes.

## 5.1.1

- Built frontend-app related client entry maps from one shared import graph per runtime session instead of walking the graph once per SSR page source.
- Added verification that unrelated SSR pages do not inherit another page's related client entries.

## 5.1.0

- Started frontend-app client and SSR development runtime setup concurrently.
- Added frontend runtime, watch, and build timing logs for context setup, rebuilds, related-client map work, SSR node_modules preparation, SSR module imports, and runtime assembly.
- Cached frontend runtime related-client maps and safe SSR node_modules preparation within a runtime session.
- Updated Code Discipline tooling to `@trebired/code-discipline@^6.1.0` and the shared config package to `@trebired/configs@^0.1.5`.

## 5.0.1

- Updated the shared Trebired config dependency to `@trebired/configs@^0.1.2`.

## 5.0.0

- Renamed public config definers to `defineConfig()` on each config entrypoint.
- Added `@trebired/bundler/config` for `.trebired/bundler/config.ts` project config helpers.
- Added `@trebired/bundler/frontend-app` for frontend-app preset helpers.
- Replaced the Code Discipline preset dependency with `@trebired/configs`.

## 4.6.7

- Expanded `.trebired/bundler/config.ts` to cover frontend-app build defaults, static asset defaults, and i18n options.
- Added frontend-app helpers that merge bundler project config and `.trebired/i18n/config.ts` into build options without app code owning those defaults.

## 4.6.6

- Updated bundler logging to use `@trebired/logger-adapter` group prefixes instead of manually prefixing every log group.
- Fixed frontend-app development runtime so `ensure()` reuses the initial watch rebuild result instead of immediately rebuilding client and SSR watchers again.
- Added i18n summary target and environment metadata for frontend-app client and SSR builds.

## 4.6.5

- Changed colocated i18n local-translator logging to emit one build summary per build/rebuild, including transformed source files, unique i18n folders, language files, languages, and elapsed time.
- Updated Code Discipline tooling to `@trebired/code-discipline@^6.0.11`.

## 4.6.4

- Adopted the external `@trebired/configs` preset and updated Code Discipline tooling to `@trebired/code-discipline@^6.0.9`.
- Adjusted verification fixtures so generated source imports do not look like unresolved imports from the verifier files themselves.

## 4.6.3

- Updated the Code Discipline devDependency and lockfile to public `@trebired/code-discipline@^5.5.2`.
## 4.6.2

- Adopted the shared Trebired Code Discipline preset so package configs only keep repo-specific policy.
- Updated the Code Discipline devDependency and lockfile to public `@trebired/code-discipline@^5.5.1`.

## 4.6.1

- Fixed managed frontend config CSS asset manifests so virtual config styles remain addressable by rule key and their emitted font assets are exposed as SSR font preload tags.
- Added `fontPreloads` to collected/rendered frontend asset links, with preload tags rendered before stylesheets and scripts.
- Updated the package Code Discipline config to the platform-aligned rule set, including formatting, redundant path segment cleanup, removable comment checks, structural blank lines, and dry checks.
- Updated the Code Discipline devDependency and lockfile to the current public `@trebired/code-discipline@^5.3.0`.

## 4.6.0

- Added project config discovery for `.trebired/bundler/config.ts` with optional prefix normalization.
- Added public namespace helpers for class names, data attributes, and CSS variables; missing or false prefixes normalize to unprefixed output.

## 4.5.2

- Updated managed frontend config CSS integration to consume the brand-neutral `@trebired/frontend/config` helper names and neutral virtual rule keys.

## 4.5.1

- Fixed output-layout reference rewriting so public asset URLs are rewritten once, avoiding duplicated paths such as `/assets/assets/...` for bundled Fontsource files.

## 4.5.0

- Generalized frontend config style watching beyond `.trebired/frontend/config.ts`: the managed virtual entry now reports every file the frontend config module declares as a dependency as an esbuild watch input, so editing a design-tokens module the config imports retriggers config CSS compilation.
- Added `dependencies` to `PreparedFrontendConfigStyles` and consolidated config loading into `resolveFrontendConfigStyles()`, shared by the core build/watch paths and the config styles plugin.
- Kept compatibility with `@trebired/frontend` versions that do not report `dependencies`; the config file remains the watched input in that case.

## 4.4.2

- Changed frontend config CSS integration to compile config-derived SCSS in memory through a virtual bundler entry instead of writing `.trebired/frontend/generated/styles.scss` into projects.

## 4.4.1

- Refreshed package dependency ranges and lockfile state with `bun update` after adopting the `.trebired/code-discipline` structure.

## 4.4.0

- Added automatic `@trebired/frontend` config integration for browser builds: bundler discovers `.trebired/frontend/config.ts`, generates `.trebired/frontend/generated/styles.scss`, and includes it as an internal SCSS entry.
- Added config-only build support so projects can emit configured frontend CSS without a hand-authored SCSS entry.
- Added watch-session refresh for managed frontend SCSS, with config file and `.trebired/frontend` directory watch metadata from the SCSS plugin.
- Switched package export resolution for `@trebired/frontend/config` to import-condition-aware package export lookup.
- Updated Code Discipline paths and dependency metadata to the `.trebired/code-discipline` structure.

## 4.3.0

- Added SCSS package export resolution for Sass `@use`, `@forward`, and `@import` directives so packages can expose style modules through `exports` conditions such as `sass` and `style`.
- Added verification coverage for bundled SCSS importing package-owned Sass modules from `node_modules`.

## 4.2.2

- Changed colocated i18n local-translator logging to emit batched count summaries instead of one source path per transformed file.
- Updated Code Discipline configuration to the `imports` rule with dead import removal enabled.
- Updated bundler log group metadata fallback and internal package dependency ranges to the current published sibling releases.

## 4.2.1

- Standardized package metadata (author field, config-driven organization name, dropped the Node engine constraint) and migrated `.code-discipline/config.ts` to `defineCodeDisciplineConfig`.
- Normalized README structure and removed the license footer.

## 4.2.0

- Switched colocated i18n validation to the shared `@trebired/i18n/checker` parser and checker APIs so message-file grammar has one package-owned source of truth.
- Removed bundler-local message parsing while keeping bundler focused on local-translator detection, sibling folder resolution, static language imports, transform output, and watch metadata.
- Accepted static TypeScript message expressions supported by `@trebired/i18n`, including string concatenation across whitespace and comments.
- Prepared Code Discipline generated path metadata before typecheck/build scripts so fresh checkouts work with generated files ignored.

## 4.1.0

- Added frontend app build targets for `all`, `client`, and `ssr` so callers can build either side without local branching wrappers.
- Added runtime SSR `node_modules` preparation, matching the build helper's `none`, `symlink`, and `copy` strategies and refreshing after dev SSR rebuilds.
- Relaxed frontend SSR module-map config inputs so common rule keys, page patterns, exports, and default-export filtering come from package defaults.
- Added auto global client entry discovery for package-owned `js/**/*.client.*` and `js/**/*.client.defer.*` defaults, and included those entries in runtime asset links.
- Added synchronous cached frontend runtime helpers for root/page export resolution and asset links after `ensure()`.
- Made static asset handlers work cleanly with frontend runtime config paths resolved from `rootDir`.
- Expanded frontend app verification coverage for target-specific builds, runtime `node_modules`, partial SSR config defaults, auto global client entries, sync helper behavior, and relative static paths.

## 4.0.0

- Added a generic frontend app preset with default source, public, client-entry, deferred-entry, global-style, ignore, browser, node SSR, output-layout, i18n, and production precompression options.
- Added aggregate module-map export filtering with `requireMatchedModuleExport`, including skipped-source metadata for generated entries and rules.
- Added SSR module-map rule helpers for root modules, matched module maps, index collapsing, map exports, resolver exports, root exports, and optional default exports.
- Added manifest runtime helpers for reading written manifests, extracting asset manifests, resolving aggregate entries, collecting aggregate matched sources, resolving emitted entry files, and normalizing source paths to route/page IDs.
- Added related client entry map, frontend asset link collection, and link/script tag rendering helpers.
- Added a generic frontend build runner for client builds, optional SSR builds, public directory copying, precompression stats, SSR entry output resolution, and optional SSR `node_modules` symlink/copy handling.
- Added a frontend runtime helper for dev/prod manifest state, watch-backed rebuilds, cache-busted SSR ESM imports, SSR root/page export resolution, and page asset links.
- Added framework-neutral and Express-compatible static asset serving helpers with private manifest/map blocking, Brotli/gzip selection, cache headers, and development public directory serving.
- Added `quarantineUnwritableOutputDir()` and frontend app verification coverage for the 4.0 runtime/build/preset behavior.

## 3.7.0

- Added generic frontend entry helpers for `*.client.*` and `*.client.defer.*` discovery patterns without changing discover-rule behavior.
- Added `collectRelatedEntries()` and frontend-related entry collection on top of the existing import graph resolver and tsconfig path support.
- Added generic `outputLayout` support for relocating JS, CSS, assets, and source maps while keeping metafiles, manifests, asset manifests, references, and public paths aligned.
- Added default esbuild file loaders for common static asset extensions, with `loader` overrides still available to callers.
- Added generic Brotli and gzip precompression for selected output assets, plus standalone `precompressAssets()` stats.
- Added aggregate module-map, output layout, precompression, related entry, and frontend convention verification coverage.

## 3.6.1

- Added pack verification for published entrypoints and executable CLI output.
- Ensured the built `trebired-bundler` CLI file is executable after dist preparation.

## 3.6.0

- Added opt-in generic support for `@trebired/i18n` colocated local translators.
- Rewrites `createLocalTranslator(import.meta.url, lang)` to static sibling language imports during browser, node, and neutral esbuild builds.
- Added build-time validation for missing supported language files, unsupported language files, key mismatches, and invalid language default exports.
- Added configurable i18n languages, fallback language, folder name, and language-file extensions without generated registries or checked-in source artifacts.
- Added verification coverage for browser and node local translator builds, invalid colocated folders, and the existing non-i18n build path.

## 3.5.1

- Added package-owned organization metadata and derived bundler log groups from `package.json`.
- Removed the stale spec test script now that committed spec files are banned by Code Discipline.
- Updated internal package dependency ranges to the current sibling package releases.

## 3.5.0

- Added SCSS hash-alias coverage for Code Discipline alias-map shards and generated tsconfig fallback paths.
- Kept package-import SCSS alias behavior covered while adding nested `@forward "#alias"` verification.

## 3.4.3

- Removed dead test scripts and stale test commands from publish workflows and maintainer docs.

## 3.4.2

- Removed package test suites and banned committed `*.spec.ts`/`*.spec.tsx` files through Code Discipline.
- Added Code Discipline enforcement for hardcoded `trebired` strings outside package metadata.
- Migrated Code Discipline to `.code-discipline/config.ts` with alias-map sync output.
- Updated package-generated artifact ignores and internal package dependency ranges.

## 3.4.1

- Migrated the repository to Code Discipline 4.7 using `.code-discipline/config.ts`, alias-map output, and Git-backed generated-file ignores.
- Switched build output alias rewriting to read `.code-discipline/imports/*.json` instead of `package.json#imports`.

## 3.4.0

- Added package `imports` map resolution for SCSS `@use` and `@forward` hash aliases while preserving normal Sass relative imports, load paths, packages, and CSS asset URLs.
- Kept the SCSS resolver wired through the shared esbuild plugin path so browser and node-targeted builds compile aliases the same way.

## 3.1.2

- Moved package-owned bundler logging under the `trebired.bundler` group root, including build, watch, and initialization groups.

## 3.1.1

- Added `@trebired/result` as the internal bundler outcome surface for build-time backend coordination instead of maintaining package-local result shims.
- Enforced the current `@trebired/code-discipline` policy across the touched result integration and supporting spec structure while keeping the public bundler API unchanged.

## 3.1.0

- Added discover-rule `aggregate` support for internal generated entry modules without bringing back public `entries` or `virtualEntries`.
- Added the first built-in aggregate kind, `module-map`, for synthesizing one stable entry from discovered modules and an optional root module.
- Added aggregate metadata to runtime asset manifests and rule metadata so generated entries can be resolved without any temp source path.
- Added `collectAssetLinks(..., { from: "ruleKey" })` for resolving emitted assets directly from discover rule keys.
- Enforced the package `tb.code-discipline.ts` policy across source, tests, and examples, including synced import aliases and normalized `tsconfig` path metadata.
- Kept the public bundler API and runtime behavior unchanged while bringing the codebase into the current Trebired discipline layout.

## 3.0.0

- Rebuilt `@trebired/bundler` around discover-only configuration and removed public manual `entries`.
- Removed public `virtualEntries`; grouped bundle entry modules are now internal implementation detail only.
- Removed package-owned build `mode` profiles in favor of explicit `minify`, `stripComments`, `sourcemap`, and related esbuild-like flags.
- Replaced top-level discover include/exclude behavior with ordered discover `rules` using `entry`, `bundle`, and `ignore` strategies.
- Added per-rule `maxBundleSize` for grouped bundles, still defaulting to `50mb`.
- Kept grouped bundle filenames package-owned under the `bundle-...` naming scheme.
- Added source ownership metadata to build results and watch hooks so runtime code can resolve source file -> owning entry key.
- Redesigned the runtime asset manifest around `entries`, `sources`, `entryOutputs`, `outputs`, and `rules`, including grouped bundle membership and ignored-source tracking.
- Made `.client.*` and `.defer.*` entries fail when they import JS or TS files owned by grouped bundle rules.

## 2.0.0

- Changed `discover` to group discovered `.js` and `.ts` files into auto-named script bundles by default.
- Changed `discover` to group discovered `.css` and `.scss` files into auto-named style bundles by default.
- Added `discover.maxBundleSize` with a default of `50mb`, splitting grouped discovered bundles only when the full group exceeds the limit.
- Kept discovered `.jsx` and `.tsx` files as normal per-file entries.
- Made grouped discovered builds fail when one grouped source file is larger than the configured max bundle size.

## 1.6.0

- Added `buildAssetManifest()` for a runtime-friendly asset manifest keyed by logical entries and source paths.
- Added `collectAssetLinks()` for collecting emitted scripts, styles, and other assets without app-specific HTML generation.
- Added `walkImportGraph()` for generic source dependency walking with relative import and tsconfig `paths` resolution.
- Exposed `assetManifest` on `bundle()` and `watch()` build results and included the same structure in the written bundler manifest.

## 1.5.0

- Removed the `obfuscate` option and all package-owned obfuscation behavior, including hashed artifact naming, property mangling, and static class-token rewriting.
- Kept `extreme` mode as the strongest compacting profile while making its output naming and class strings stay stable and readable.
- Removed the leftover indirect esbuild `platform` key shim and now pass the normalized `environment` value directly.

## 1.4.0

- Fixed `extreme` mode class obfuscation so emitted JS, TS, JSX, and TSX class usage stays aligned with obfuscated CSS output across bound identifiers, class-bearing object props, helper aliases, template literals, and HTML fragments.
- Renamed the public esbuild target option from `platform` to `environment` in the package API and docs.

## 1.3.0

- Grouped package-owned logs under stable `bundler.*` scopes so Trebired logger output composes cleanly.
- Added duplicate entry-path pruning with warning logs when the same source file is bundled more than once.
- Fixed `extreme` mode class obfuscation for helper aliases, template literals with expressions, `setAttribute("class", ...)`, and HTML/template string assembly.

## 1.2.0

- Added `mode` with `debug`, `compact`, and `extreme` build profiles.
- Brought back `obfuscate` for hashed output names and optional esbuild property mangling.
- Added coordinated static class-name rewriting so CSS, JS, TS, JSX, and TSX use the same obfuscated class tokens.
- Made `extreme` mode enable the strongest package-owned compacting defaults.

## 1.1.0

- Made minification enabled by default for bundled JS and CSS output.
- Added `stripComments` so builds can drop preserved legal comments when source annotations are off.

## 1.0.0

- Changed inline source annotations from `@trebired/source:` to neutral `source:` comments.
- Added `virtualEntries` for in-memory generated entry modules.
- Added `deriveManifest()` for stable entry-centric asset graph derivation from esbuild metafiles.
- Added watch lifecycle hooks through `onRebuilt()` and `onEntrySetChanged()`.
- Aligned written manifest output with the same derived manifest graph used by runtime helpers.

## 0.2.0

- Added built-in entry discovery so the package can walk source directories and generate entry lists itself.
- Added source-tree watching for discovered entries, including new and removed matching files during watch mode.
- Added optional manifest writing that records resolved entries and generated outputs.
- Made `entries` optional when `discover` is configured.

## 0.1.0

- Added the `bundle()` and `watch()` APIs for fast esbuild-backed bundling.
- Added JS, TS, JSX, TSX, CSS, and SCSS support with `sass-embedded`.
- Added CLI commands for `build` and `watch` config-driven runs.
- Added inline `@trebired/source` annotation comments for bundled JS and CSS output.
- Added `@trebired/logger-adapter` logging support, publish-ready package metadata, tests, and docs.

- Standardized package metadata ordering and contributing guidance around the Trebired writing style.
