rename web/ to admin/, along with the web-named build and cli identifiers
This commit is contained in:
+13
-13
@@ -22,9 +22,9 @@
|
||||
//! the assembled notices — says which artifacts the file speaks for.
|
||||
//!
|
||||
//! One question is out of reach here and lives in `gates.yml` instead: which
|
||||
//! packages actually contribute a module to `web/dist`. Answering it means
|
||||
//! packages actually contribute a module to `admin/dist`. Answering it means
|
||||
//! running the bundler. The frontend gate does that, compares the result with
|
||||
//! the `[npm packages bundled into web/dist]` section, and this file checks the
|
||||
//! the `[npm packages bundled into admin/dist]` section, and this file checks the
|
||||
//! inventory against that same section.
|
||||
//!
|
||||
//! Everything is embedded at compile time through the `licenses_files` module:
|
||||
@@ -35,27 +35,27 @@ const builtin = @import("builtin");
|
||||
const licenses = @import("licenses_files");
|
||||
|
||||
/// The npm packages that are `devDependencies` in the lockfile but whose own
|
||||
/// output ends up in `web/dist`, and so in the binary. None of them runs in the
|
||||
/// output ends up in `admin/dist`, and so in the binary. None of them runs in the
|
||||
/// browser; their emitted bytes do.
|
||||
///
|
||||
/// The set was settled by building `web/` with `--sourcemap` and reading two
|
||||
/// The set was settled by building `admin/` with `--sourcemap` and reading two
|
||||
/// things off the result: the sourcemap `sources` lists, which name the
|
||||
/// packages whose modules were bundled, and the regions of each chunk that no
|
||||
/// sourcemap segment maps back to a source file, which are the bytes the
|
||||
/// toolchain injected on its own. Tailwind is here for its generated
|
||||
/// stylesheet; vite for `vite/preload-helper` and `vite/modulepreload-polyfill`;
|
||||
/// rolldown for the CommonJS interop helpers it prepends to any chunk pulling in
|
||||
/// a CommonJS module. Every other devDependency left `web/dist` untouched.
|
||||
/// a CommonJS module. Every other devDependency left `admin/dist` untouched.
|
||||
/// Anything added here must also be inventoried.
|
||||
const npm_generators = [_][]const u8{ "rolldown", "vite" };
|
||||
|
||||
/// Packages of the recorded runtime closure that put no byte in `web/dist`, so
|
||||
/// Packages of the recorded runtime closure that put no byte in `admin/dist`, so
|
||||
/// the inventory names them in a note rather than carrying their licence. The
|
||||
/// note has to exist: each name below must still appear in
|
||||
/// `licenses/inventory.zon`.
|
||||
///
|
||||
/// This list is a claim about the build, and the build is what settles it: a
|
||||
/// name here that turns up in the recorded `web/dist` bundle fails, so a
|
||||
/// name here that turns up in the recorded `admin/dist` bundle fails, so a
|
||||
/// package that starts shipping cannot stay on this list quietly.
|
||||
const npm_not_shipped = [_][]const u8{
|
||||
"cookie-es",
|
||||
@@ -135,7 +135,7 @@ const ZigDependencyVersion = struct {
|
||||
/// on 2026-08-12, and `licenses/react-aria-apache-2.0.txt` carries the text
|
||||
/// Section 4 asks for.
|
||||
///
|
||||
/// Packages that put no byte in `web/dist` are here too. They redistribute
|
||||
/// Packages that put no byte in `admin/dist` are here too. They redistribute
|
||||
/// nothing today, so their licence carries no obligation today — but "not
|
||||
/// shipped" is a claim about the build that a future build can falsify, and
|
||||
/// recording the licence now means the answer is already reviewed when it does.
|
||||
@@ -197,7 +197,7 @@ const zig_section = "[build.zig.zon dependencies]";
|
||||
const npm_section = "[npm runtime closure]";
|
||||
const generator_section = "[npm build-time generators whose output ships]";
|
||||
const base_image_section = "[container base image]";
|
||||
const bundled_section = "[npm packages bundled into web/dist]";
|
||||
const bundled_section = "[npm packages bundled into admin/dist]";
|
||||
|
||||
/// The shape `tools/dist_stage.zig` parses when it assembles
|
||||
/// THIRD-PARTY-NOTICES. Parsing `licenses/inventory.zon` into it here is itself
|
||||
@@ -619,7 +619,7 @@ test "the licence texts that must be reproduced in full are unmodified" {
|
||||
// the recorded list honest against the build; this keeps the inventory honest
|
||||
// against the recorded list. Neither works alone: the gate cannot say what the
|
||||
// inventory covers, and this test cannot run rollup.
|
||||
test "every package bundled into web/dist is inventoried" {
|
||||
test "every package bundled into admin/dist is inventoried" {
|
||||
const gpa = std.testing.allocator;
|
||||
const entries = try parseInventory(gpa);
|
||||
defer std.zon.parse.free(gpa, entries);
|
||||
@@ -632,7 +632,7 @@ test "every package bundled into web/dist is inventoried" {
|
||||
|
||||
if (isNotShipped(name)) {
|
||||
std.debug.print(
|
||||
"npm package '{s}' is in the recorded web/dist bundle but npm_not_shipped still" ++
|
||||
"npm package '{s}' is in the recorded admin/dist bundle but npm_not_shipped still" ++
|
||||
" claims it ships nothing. It does now: inventory it and take it out of that" ++
|
||||
" list.\n",
|
||||
.{name},
|
||||
@@ -642,7 +642,7 @@ test "every package bundled into web/dist is inventoried" {
|
||||
|
||||
if (!inventoryNamesPackage(entries, name)) {
|
||||
std.debug.print(
|
||||
"npm package '{s}' is bundled into web/dist but no licenses/inventory.zon entry" ++
|
||||
"npm package '{s}' is bundled into admin/dist but no licenses/inventory.zon entry" ++
|
||||
" names it\n",
|
||||
.{name},
|
||||
);
|
||||
@@ -1078,7 +1078,7 @@ fn skipWhitespace(text: []const u8, from: usize) usize {
|
||||
|
||||
const NpmSet = enum { runtime, generators };
|
||||
|
||||
/// `name version licence` for every package in `web/package-lock.json` that is
|
||||
/// `name version licence` for every package in `admin/package-lock.json` that is
|
||||
/// not marked `dev`, or for the build-time generators, sorted by name. The
|
||||
/// non-dev set is a superset of what the bundler emits — it cannot run rollup —
|
||||
/// so a new runtime dependency always trips the guard even when tree-shaking
|
||||
|
||||
Reference in New Issue
Block a user