1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//! Pure-Rust, buildless toolchain for **ES modules and Web Components** — no Node,
//! no bundler.
//!
//! It revives the unbundled, native-ESM workflow (vendor each npm package into a
//! `web_modules/` tree + an import map, à la Snowpack) and pairs it with an
//! on-the-fly transform dev server (à la `@web/dev-server`), implemented entirely
//! in Rust on top of [`npm-utils`](https://docs.rs/npm-utils), [oxc] and
//! [`grass`](https://docs.rs/grass). It is **not** a bundler: it emits native ES
//! modules and leaves bare-specifier resolution to the browser's import map.
//!
//! # Modules
//!
//! **Core** (always on):
//! - [`vendor`] — resolve, download and extract npm packages into a `web_modules/`
//! tree (via `npm-utils`) and accumulate the import map.
//! - [`importmap`] — a deterministic import-map composer (build, merge fragments,
//! render the `<script type="importmap">`).
//!
//! **Processors** (`processors`, feature-gated, applied to your source/assets):
//! - [`typescript`] *(feature `typescript`)* — TypeScript / modern JS → browser JS via
//! oxc, with legacy decorators configured for Lit.
//! - [`scss`] *(feature `scss`)* — SCSS → CSS via grass.
//! - [`minify`] *(feature `minify`)* — JS minification via oxc_minifier.
//! - [`dts`] *(`dts`)* — `.d.ts` emission · [`i18n`] *(`i18n`)* — XLIFF merge ·
//! [`icons`] *(`icons`)* — favicons from a PNG.
//!
//! **Toolchain** (build + serve):
//! - [`build`] — vendor + transform + render into an output dir.
//! - `bundle` *(feature `bundle`)* — bundle an app plus its `node_modules/` (CommonJS and all)
//! into one browser ESM file via rolldown, for React-class packages that ship only CommonJS.
//! - [`templates`] *(feature `tera`)* — HTML templating (importmap injection).
//! - [`server`] / [`dev`] *(features `axum` / `dev`)* — serve embedded, or compile on
//! the fly with file-watching + live-reload.
//!
//! [oxc]: https://oxc.rs
pub use ;
// Always-on core, grouped under `core/`: vendoring, import maps, the mount model,
// TypeScript `tsconfig` generation and static-file copying. Re-exported here so callers
// use `web_modules::vendor` etc. — the `core` module itself is private.
pub use Mount;
pub use ;
/// Feature-gated source/asset processors, each re-exported at the crate root (e.g.
/// `web_modules::scss`). Grouped to separate "what we apply to your source" from the
/// vendor/import-map core and the build/serve toolchain.
pub use dts;
pub use i18n;
pub use icons;
pub use minify;
pub use scss;
pub use typescript;
// Build-time toolchain, grouped under `build/`: the `build` pipeline plus the emit
// helpers `bundle` / `compress` / `templates`, each re-exported at its historical crate
// root path. The `build` module exists whenever any of its members' features is enabled.
pub use bundle;
pub use compress;
pub use templates;
/// Re-export of [`npm_utils`] (the vendoring + transitive `node_modules` install engine) under the
/// `bundle` feature, so the CommonJS→ESM pipeline is a single dependency: install with
/// `web_modules::npm_utils::install::node_modules`, then [`bundle::bundle`].
pub use npm_utils;
// Runtime serving, grouped under `serve/`: the axum `Frontend` router and the dev server,
// over a shared (private) `serving` containment boundary. Re-exported at historical paths.
pub use dev;
pub use server;
pub use ;
/// Re-export of the `include_dir` crate for the [`include_dir::Dir`] type. Use the
/// `include_dir` crate **directly** for the `include_dir!` macro — it emits
/// `include_dir::`-qualified paths that don't resolve through a re-export.
pub use include_dir;