@ai.all/ds 0.0.0-stage → 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ALL.md ADDED
@@ -0,0 +1,32 @@
1
+ # DS — Agent Rules
2
+
3
+ > DS is an experimental static-output optimization engine in the AI.ALL ecosystem. Read this file before changing code or documentation.
4
+
5
+ ## Product boundary
6
+
7
+ - Frameworks own rendering, route discovery, bundling, content hashing and framework-specific minification.
8
+ - DS can run a configured static generator, optimize its generated HTML, optionally inline document-matched CSS, write gzip/Brotli sidecars and report output sizes.
9
+ - Never rewrite hashed JavaScript or CSS after the bundler emits it.
10
+ - Critical CSS is opt-in and must target explicit generated HTML paths. Preserve the source stylesheet and test the rendered result.
11
+ - Beasties matches selectors against the generated document; it does not measure a browser viewport. Do not describe this mode as viewport-accurate above-the-fold extraction.
12
+ - The package is a beta. Do not claim a stable API or publish without maintainer approval.
13
+
14
+ ## Engineering rules
15
+
16
+ - Code, comments, identifiers, technical documentation and commit messages are in English.
17
+ - Prefer small, explicit changes and preserve existing user configuration.
18
+ - Validate all configuration before writing generated output. Errors must be actionable and non-zero.
19
+ - Execute generator commands as argument arrays without a shell.
20
+ - Add tests and a changelog entry for every user-visible behavior change.
21
+ - Run `npm run verify` before declaring work complete.
22
+ - Do not commit or push unless the owner explicitly asks.
23
+
24
+ ## Entry points
25
+
26
+ - [README.md](README.md): installation, commands and configuration.
27
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md): package modules and data flow.
28
+ - [docs/STATIC-SITES.md](docs/STATIC-SITES.md): static generation and post-processing.
29
+ - [docs/CRITICAL-CSS.md](docs/CRITICAL-CSS.md): supported CSS inlining modes and limits.
30
+ - [docs/CONFIG.md](docs/CONFIG.md): every config key, defaults and errors.
31
+ - [docs/INTEGRATION.md](docs/INTEGRATION.md): DS7, UI, Nuxt module options and the Node API.
32
+ - [docs/DELIVERY.md](docs/DELIVERY.md): serving pre-compressed files.
package/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ All notable changes to DS are recorded here. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [0.1.0-beta.1] - 2026-12-03
8
+
9
+ ### Added
10
+ - `docs/CONFIG.md`: every config key with type and default, what HTML minification changes, common errors.
11
+ - `docs/INTEGRATION.md`: use from DS7, UI and Nuxt sites, Nuxt module options, Node API signatures and return values.
12
+ - `docs/DELIVERY.md`: serving the `.br` and `.gz` sidecars with nginx, Caddy and CDNs.
13
+
14
+ ### Changed
15
+ - Docs list 0.1.0-beta.0 as published on npm `next`.
16
+
17
+ ## [0.1.0-beta.0] - 2026-12-03
18
+
19
+ ### Added
20
+ - A beta CLI to initialize a static build config, run a configured generator, optimize generated HTML, and analyze output sizes.
21
+ - An optional Nuxt 4 module that enables framework minification and Nitro compression defaults without replacing explicit project settings.
22
+ - Opt-in, route-scoped document-matched critical CSS processing that preserves source stylesheets.
23
+ - Optional gzip and Brotli sidecars for compressible static assets.
24
+ - A Node API at `@ai.all/ds` (config loading, generator run, optimization, size report) so DS7 and UI can reuse the pipeline without spawning the CLI.
25
+
26
+ ### Safety
27
+ - Keep framework rendering and hashed JS/CSS optimization in the framework's build tool.
28
+ - Keep HTML minification and critical CSS disabled or narrowly scoped until the generated output has been checked.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Igor Orlov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,185 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/ai-all-ai/ds/main/brand/ai-all.svg" width="190" alt="AI.ALL" />
3
+ <p><img src="https://raw.githubusercontent.com/ai-all-ai/ds/main/brand/ds.svg" width="56" alt="" /></p>
4
+ <h1>DS</h1>
5
+ <p><strong>Static-site build and delivery optimization.</strong><br />Framework-owned rendering and bundling, with opt-in output processing.</p>
6
+ <p>
7
+ <a href="https://www.npmjs.com/package/@ai.all/ds?activeTab=versions"><img src="https://img.shields.io/npm/v/@ai.all/ds/next?label=npm%20next" alt="npm next" /></a>
8
+ <a href="https://img.shields.io/node/v/@ai.all/ds"><img src="https://img.shields.io/node/v/@ai.all/ds?label=Node.js" alt="Node.js version" /></a>
9
+ <a href="https://github.com/ai-all-ai/ds/actions/workflows/ci.yml"><img src="https://github.com/ai-all-ai/ds/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI status" /></a>
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT license" /></a>
11
+ </p>
12
+ </div>
2
13
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
14
+ ```bash
15
+ npm install --save-dev @ai.all/ds@next
16
+ npx ds init
17
+ ```
18
+
19
+ **Status:** Experimental beta on the npm `next` tag. The CLI, API and config may change before 1.0.
20
+
21
+ ## Documentation map
22
+
23
+ | If you need to | Start with |
24
+ | ---------------------------------------------- | --------------------------------------------------- |
25
+ | Configure and use the CLI | [Quick start](#quick-start) · [Commands](#commands) |
26
+ | Look up every config key and error | [Configuration](docs/CONFIG.md) |
27
+ | Use DS from DS7, UI or a Nuxt site | [Integration and Node API](docs/INTEGRATION.md) |
28
+ | Serve the `.br` and `.gz` files | [Delivery](docs/DELIVERY.md) |
29
+ | Prepare or publish a beta release | [Release process](docs/RELEASE.md) |
30
+ | Choose a generator and output flow | [Static sites](docs/STATIC-SITES.md) |
31
+ | Configure critical CSS safely | [Critical CSS](docs/CRITICAL-CSS.md) |
32
+ | Understand the package design | [Architecture](docs/ARCHITECTURE.md) |
33
+ | See the package's standards and limits | [Agent rules](ALL.md) |
34
+ | Understand product ownership and compatibility | [AI.ALL ecosystem](docs/ECOSYSTEM.md) |
35
+
36
+ ## AI.ALL ecosystem
37
+
38
+ <!-- ecosystem:begin -->
39
+ ### Product boundaries
40
+
41
+ | Product | npm `latest` | npm `next` | GitHub release | Responsibility |
42
+ | --- | --- | --- | --- | --- |
43
+ | [AI.ALL](https://github.com/ai-all-ai/aiall) ([`@ai.all/aiall`](https://www.npmjs.com/package/@ai.all/aiall)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/aiall?label=latest)](https://www.npmjs.com/package/@ai.all/aiall) | [![npm next](https://img.shields.io/npm/v/@ai.all/aiall/next?label=next)](https://www.npmjs.com/package/@ai.all/aiall?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/aiall?include_prereleases&label=release)](https://github.com/ai-all-ai/aiall/releases) | AI agent instructions, pack routing, entrypoint synchronization, and ecosystem registry. |
44
+ | [DS7](https://github.com/ai-all-ai/ds7) ([`@ai.all/ds7`](https://www.npmjs.com/package/@ai.all/ds7)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/ds7?label=latest)](https://www.npmjs.com/package/@ai.all/ds7) | [![npm next](https://img.shields.io/npm/v/@ai.all/ds7/next?label=next)](https://www.npmjs.com/package/@ai.all/ds7?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ds7?include_prereleases&label=release)](https://github.com/ai-all-ai/ds7/releases) | Framework-independent web standards, architecture guidance, templates, and quality checks. |
45
+ | [UI](https://github.com/ai-all-ai/ui) ([`@ai.all/ui`](https://www.npmjs.com/package/@ai.all/ui)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/ui?label=latest)](https://www.npmjs.com/package/@ai.all/ui) | [![npm next](https://img.shields.io/npm/v/@ai.all/ui/next?label=next)](https://www.npmjs.com/package/@ai.all/ui?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ui?include_prereleases&label=release)](https://github.com/ai-all-ai/ui/releases) | Vue components, design tokens, a living Brandbook, developer tools, and the Media Engine. |
46
+ | [DS](https://github.com/ai-all-ai/ds) ([`@ai.all/ds`](https://www.npmjs.com/package/@ai.all/ds)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/ds?label=latest)](https://www.npmjs.com/package/@ai.all/ds) | [![npm next](https://img.shields.io/npm/v/@ai.all/ds/next?label=next)](https://www.npmjs.com/package/@ai.all/ds?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ds?include_prereleases&label=release)](https://github.com/ai-all-ai/ds/releases) | Static build orchestration, safe HTML optimization, optional document-matched CSS inlining, compression and size reporting, as a CLI, a Node API and a Nuxt module. |
47
+
48
+ See [ecosystem boundaries, dependencies, compatibility and verified versions](docs/ECOSYSTEM.md).
49
+ <!-- ecosystem:end -->
50
+
51
+ ## Overview
52
+
53
+ DS orchestrates a static build and applies carefully scoped processing to its generated output. It does not replace the framework: Nuxt, Vite, Astro or another generator remains responsible for rendering, route discovery, bundling and content hashes.
54
+
55
+ - **Static generation:** run the configured framework generator and process its output directory.
56
+ - **JavaScript and CSS:** leave bundling and minification to the framework before asset filenames are hashed.
57
+ - **HTML minification:** opt in only after checking hydration and rendered text.
58
+ - **Critical CSS:** opt in for explicit generated HTML paths. The beta matches selectors against document markup; it does not calculate viewport-specific above-the-fold CSS.
59
+ - **Compression:** write gzip and Brotli sidecars for a static server or CDN configured to serve them.
60
+ - **Analysis:** report raw, gzip and Brotli output sizes.
61
+
62
+ ## Requirements
63
+
64
+ - Node.js 20.19 or newer.
65
+ - A static generator that writes an output directory.
66
+ - A static server or CDN configured to negotiate and serve `.gz` and `.br` sidecars when using pre-compression ([Delivery](docs/DELIVERY.md)).
67
+
68
+ ## Install
69
+
70
+ <!-- install:begin -->
71
+ Requires Node.js 20.19 or newer. Run the commands in the root folder of your project.
72
+
73
+ **macOS** (Terminal):
74
+
75
+ ```bash
76
+ brew install node # once, only if Node.js is missing
77
+ npm install --save-dev @ai.all/ds@next
78
+ npx ds init
79
+ ```
80
+
81
+ **Windows** (PowerShell):
82
+
83
+ ```powershell
84
+ winget install OpenJS.NodeJS.LTS # once, only if Node.js is missing; then open a new window
85
+ npm install --save-dev @ai.all/ds@next
86
+ npx ds init
87
+ ```
88
+
89
+ If PowerShell says that running scripts is disabled, run `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once, or type `npm.cmd` and `npx.cmd` instead of `npm` and `npx`.
90
+
91
+ On macOS the `ds` command is also available outside a project through Homebrew: `brew install ai-all-ai/tap/ds`.
92
+ <!-- install:end -->
93
+
94
+ ## Quick start
95
+
96
+ Install the beta from npm, then initialize the consumer project:
97
+
98
+ ```bash
99
+ npm install --save-dev @ai.all/ds@next
100
+ npx ds init
101
+ ```
102
+
103
+ The starter config runs `npm run generate` into `.output/public`. DS adds `generate:optimized` only when the project already has a `generate` script.
104
+
105
+ For a Nuxt 4 project, register the optional module:
106
+
107
+ ```ts
108
+ export default defineNuxtConfig({
109
+ modules: ['@ai.all/ds/nuxt'],
110
+ });
111
+ ```
112
+
113
+ The module enables production Vite JavaScript/CSS minification and Nitro gzip/Brotli defaults only when the project has not set those options explicitly. The active framework build owns bundle generation and filenames. Options (`ds: { minify, compression }`) and how to switch them off: [Integration](docs/INTEGRATION.md#nuxt-module-options).
114
+
115
+ Run the optimized build when the script is available:
116
+
117
+ ```bash
118
+ npm run generate:optimized
119
+ ```
120
+
121
+ For Astro or another static generator, set `generator.command` and `generator.outputDir` in `ds.config.json`, then run `ds build`. For example:
122
+
123
+ ```json
124
+ {
125
+ "generator": {
126
+ "command": ["npm", "run", "build"],
127
+ "outputDir": "dist"
128
+ }
129
+ }
130
+ ```
131
+
132
+ To process existing output instead, run the generator followed by:
133
+
134
+ ```bash
135
+ npx ds optimize
136
+ npx ds analyze
137
+ ```
138
+
139
+ ## Commands
140
+
141
+ | Command | Purpose |
142
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
143
+ | `ds init` | Create the starter config and add an optimized generation script when the project has a `generate` script. |
144
+ | `ds build` | Run the configured static generator and optimize its output. |
145
+ | `ds optimize [--dir <path>]` | Optimize an existing output directory. |
146
+ | `ds analyze [--dir <path>] [--json]` | Report raw, gzip and Brotli sizes. |
147
+
148
+ ## Node API
149
+
150
+ Other tools, such as DS7 and UI, can call DS directly instead of spawning the CLI:
151
+
152
+ ```js
153
+ import { loadConfig, resolveOutputDirectory, optimizeOutput, formatReport } from '@ai.all/ds';
154
+
155
+ const config = await loadConfig(process.cwd());
156
+ const dir = await resolveOutputDirectory(process.cwd(), config.generator.outputDir);
157
+ const result = await optimizeOutput(dir, config.optimization);
158
+ console.log(formatReport(result.report, config.generator.outputDir));
159
+ ```
160
+
161
+ The root export also provides `DEFAULT_CONFIG`, `validateConfig`, `runGenerator`, `analyzeOutput` and `applyProductionDefaults`. Signatures and return values: [Node API](docs/INTEGRATION.md#node-api).
162
+
163
+ Generator commands are configured as an executable and argument array; DS does not run them through a shell. Output directories must stay inside the project root.
164
+
165
+ ## Optimization defaults and limits
166
+
167
+ - Nuxt's `nuxt generate` prerenders pages into `.output/public`; explicit dynamic routes belong in Nuxt's `nitro.prerender.routes`.
168
+ - DS does not post-process hashed JavaScript or CSS, avoiding stale hashes, source-map issues and framework-manifest mismatches.
169
+ - HTML minification and critical CSS are disabled by default.
170
+ - Critical CSS requires explicit generated `.html` paths. Beasties matches CSS selectors against the document, not a browser viewport. The source stylesheet remains unchanged, so matching rules may be transferred both inline and externally.
171
+ - Gzip and Brotli sidecars are enabled by default for compressible files. The web server or CDN must negotiate and serve them.
172
+
173
+ See [static generation](docs/STATIC-SITES.md) and [critical CSS](docs/CRITICAL-CSS.md) before enabling post-processing.
174
+
175
+ ## Release
176
+
177
+ Versioning, release steps and rules: [docs/RELEASE.md](docs/RELEASE.md). The change history is in [CHANGELOG.md](CHANGELOG.md). `0.1.0-beta.0` is the first pre-release, on the npm `next` tag; its CLI, API and config may change before a stable release.
178
+
179
+ ## Contributing and security
180
+
181
+ See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).
182
+
183
+ ## License
184
+
185
+ MIT. See [LICENSE](LICENSE).
package/bin/ds.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { main } from '../src/cli.mjs';
4
+
5
+ main(process.argv.slice(2)).catch((error) => {
6
+ console.error(`ds: ${error.message}`);
7
+ if (process.env.DS_DEBUG) console.error(error.stack);
8
+ process.exitCode = 1;
9
+ });
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 128" role="img" aria-labelledby="title">
2
+ <title id="title">AI.ALL</title>
3
+ <style>text { fill: #17191c; } @media (prefers-color-scheme: dark) { text { fill: #f5f6f7; } }</style>
4
+ <text x="8" y="96" font-family="Inter, Arial, sans-serif" font-size="96" font-weight="750" letter-spacing="-5">AI<tspan fill="#e2a900">.</tspan>ALL</text>
5
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-labelledby="title">
2
+ <title id="title">AI.ALL instruction network</title>
3
+ <style>path, circle { stroke: #17191c; } @media (prefers-color-scheme: dark) { path, circle { stroke: #f5f6f7; } }</style>
4
+ <g fill="none" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round">
5
+ <path d="M15 32h34M32 15v34M20 20l24 24M44 20 20 44" />
6
+ <circle cx="15" cy="32" r="4" fill="#e2a900" />
7
+ <circle cx="49" cy="32" r="4" fill="#e2a900" />
8
+ <circle cx="32" cy="15" r="4" fill="#e2a900" />
9
+ <circle cx="32" cy="49" r="4" fill="#e2a900" />
10
+ </g>
11
+ </svg>
package/brand/ds.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-labelledby="title">
2
+ <title id="title">DS static build optimization</title>
3
+ <style>path, rect { stroke: #17191c; } @media (prefers-color-scheme: dark) { path, rect { stroke: #f5f6f7; } }</style>
4
+ <g fill="none" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round">
5
+ <rect x="9" y="12" width="31" height="40" rx="5" />
6
+ <path d="M17 23h15M17 32h11M17 41h15M40 32h12M46 26l6 6-6 6" />
7
+ </g>
8
+ <circle cx="51" cy="32" r="3.5" fill="#e2a900" />
9
+ </svg>
package/brand/ds7.svg ADDED
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-labelledby="title">
2
+ <title id="title">DS7 standards and quality gates</title>
3
+ <style>path, rect { stroke: #17191c; } @media (prefers-color-scheme: dark) { path, rect { stroke: #f5f6f7; } }</style>
4
+ <g fill="none" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round">
5
+ <rect x="10" y="10" width="44" height="44" rx="8" />
6
+ <path d="M20 23h12M20 32h8M20 41h12M39 22l3 3 6-7M35 41l4 4 9-10" />
7
+ </g>
8
+ <circle cx="49" cy="22" r="3" fill="#e2a900" />
9
+ <circle cx="49" cy="40" r="3" fill="#e2a900" />
10
+ </svg>
package/brand/ui.svg ADDED
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-labelledby="title">
2
+ <title id="title">UI components and design tokens</title>
3
+ <style>path, rect { stroke: #17191c; } @media (prefers-color-scheme: dark) { path, rect { stroke: #f5f6f7; } }</style>
4
+ <g fill="none" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round">
5
+ <rect x="9" y="10" width="30" height="36" rx="5" />
6
+ <rect x="25" y="18" width="30" height="36" rx="5" />
7
+ <path d="M16 19h15M16 27h10M32 29h15M32 37h15M32 45h9" />
8
+ </g>
9
+ <circle cx="48" cy="46" r="3.5" fill="#e2a900" />
10
+ </svg>
@@ -0,0 +1,38 @@
1
+ # Architecture
2
+
3
+ DS is a static-output pipeline, not a rendering framework. The configured framework or generator remains responsible for route discovery, rendering, asset bundling, content hashes and JavaScript/CSS minification.
4
+
5
+ ## Data flow
6
+
7
+ ```text
8
+ configured static generator
9
+ -> generated output directory
10
+ -> optional route-scoped HTML/CSS optimization
11
+ -> gzip and Brotli sidecars
12
+ -> size report
13
+ ```
14
+
15
+ ## Modules
16
+
17
+ | File | Responsibility |
18
+ | --- | --- |
19
+ | `src/config.mjs` | Load, validate and resolve `ds.config.json`. |
20
+ | `src/build.mjs` | Run the configured generator as an argument array without a shell. |
21
+ | `src/nuxt-options.mjs` | Apply non-overriding production minification and compression defaults. |
22
+ | `src/optimize.mjs` | Process generated HTML, optionally apply Beasties, and refresh compression sidecars. |
23
+ | `src/report.mjs` | Measure raw, gzip and Brotli sizes for output assets. |
24
+ | `src/cli.mjs` | Expose `init`, `build`, `optimize` and `analyze`. |
25
+ | `src/index.mjs` | Expose the Node API at `@ai.all/ds` for DS7, UI and other tools. |
26
+ | `nuxt/module.mjs` | Expose the optional Nuxt 4 integration at `@ai.all/ds/nuxt`. |
27
+
28
+ The optimizer does not rewrite hashed JavaScript or CSS. Compression sidecars are generated from the final contents, including HTML changed by optimization.
29
+
30
+ ## Configuration and paths
31
+
32
+ Every key and its default: [CONFIG.md](CONFIG.md). Consumers and the Node API: [INTEGRATION.md](INTEGRATION.md).
33
+
34
+ `ds.config.json` belongs to the project root. Output paths must resolve to a directory inside that root; the project root itself and paths that escape it are rejected. The generator is an executable plus arguments, never a shell command string.
35
+
36
+ ## Beta boundary
37
+
38
+ The current beta targets pre-rendered static files. It does not own SSR response hooks, hydration, image transcoding, route discovery, CSS class mangling or viewport-based critical CSS extraction.
package/docs/CONFIG.md ADDED
@@ -0,0 +1,50 @@
1
+ # Configuration
2
+
3
+ `ds init` writes `ds.config.json` in the project root. Every key is validated before any file is written; an unknown key, a wrong type or a missing value stops the command with a non-zero exit. Keys left out take the defaults below. The JSON Schema is [`ds.config.schema.json`](../ds.config.schema.json).
4
+
5
+ ```json
6
+ {
7
+ "$schema": "https://raw.githubusercontent.com/ai-all-ai/ds/main/ds.config.schema.json",
8
+ "schemaVersion": 1,
9
+ "generator": {
10
+ "command": ["npm", "run", "generate"],
11
+ "outputDir": ".output/public"
12
+ },
13
+ "optimization": {
14
+ "html": { "minify": false },
15
+ "criticalCss": { "enabled": false, "routes": [], "allowRules": [], "preload": "body" },
16
+ "compression": { "gzip": true, "brotli": true }
17
+ }
18
+ }
19
+ ```
20
+
21
+ | Key | Type | Default | Meaning |
22
+ | --- | --- | --- | --- |
23
+ | `schemaVersion` | `1` | `1` | Config format version. Required. |
24
+ | `generator.command` | string array | `["npm", "run", "generate"]` | Executable and arguments that `ds build` runs. Never passed through a shell. |
25
+ | `generator.outputDir` | string | `.output/public` | Generated site, relative to the project root. Must resolve inside the project, also through symbolic links. |
26
+ | `optimization.html.minify` | boolean | `false` | Minify generated HTML (see below). |
27
+ | `optimization.criticalCss.enabled` | boolean | `false` | Inline document-matched CSS with Beasties. Needs at least one route. |
28
+ | `optimization.criticalCss.routes` | string array | `[]` | Exact `.html` paths relative to `outputDir`, for example `index.html`, `es/index.html`. No `..`, no absolute paths; every path must exist in the output. |
29
+ | `optimization.criticalCss.allowRules` | string array | `[]` | Selectors to keep although they are absent from the prerendered markup (states added by JavaScript). |
30
+ | `optimization.criticalCss.preload` | `"body"` or `false` | `"body"` | How the remaining stylesheets load. `false` keeps the original render-blocking links. |
31
+ | `optimization.compression.gzip` | boolean | `true` | Write `.gz` next to every compressible file. |
32
+ | `optimization.compression.brotli` | boolean | `true` | Write `.br` next to every compressible file. |
33
+
34
+ Compressible files: `.html`, `.htm`, `.css`, `.js`, `.mjs`, `.cjs`, `.json`, `.map`, `.svg`, `.txt`, `.wasm`, `.webmanifest`, `.xml`. Gzip uses level 9, Brotli quality 11. When a compressor is switched off, existing sidecars of an HTML file that DS changed are still refreshed, so no stale `.gz` or `.br` is left behind.
35
+
36
+ ## What HTML minification changes
37
+
38
+ It is conservative on purpose: whitespace is collapsed but one space is kept where the browser would render one (`conservativeCollapse`), comments are kept (frameworks use them as hydration markers), optional tags are kept, and inline `<style>` and `<script>` are not touched, because the framework has already minified them. Check hydration and rendered text after switching it on.
39
+
40
+ ## Common errors
41
+
42
+ | Message | Fix |
43
+ | --- | --- |
44
+ | `Configuration not found … Run "ds init" first.` | Run `npx ds init`, or pass `--config <file>`. |
45
+ | `The output directory must be a child of the project directory.` | Point `generator.outputDir` (or `--dir`) at a folder inside the project, not the project root. |
46
+ | `Output path is not a directory` / `ENOENT` | Run the generator first, or check `outputDir`. |
47
+ | `Critical CSS route does not exist in the output: …` | Fix the path in `criticalCss.routes`; it is relative to `outputDir` and ends in `.html`. |
48
+ | `List at least one path in optimization.criticalCss.routes …` | Add a route or set `criticalCss.enabled` to `false`. |
49
+ | `Generator failed with exit code N.` | The framework build failed; its own output above the message says why. |
50
+ | `Unknown … option: …` | Remove or correct the key; DS rejects unknown keys so typos do not pass silently. |
@@ -0,0 +1,36 @@
1
+ # Critical CSS
2
+
3
+ Critical CSS can reduce render-blocking work, but extracting too little causes unstyled content and extracting too much increases HTML size. The DS beta therefore leaves it off by default and requires exact generated HTML paths.
4
+
5
+ ## Supported mode
6
+
7
+ DS uses Beasties to match CSS selectors against the full generated HTML document. This is a static, document-used CSS set; it does **not** render a browser viewport or know which content is above the fold. Beasties can limit matching to elements marked `data-beasties-container`, but that is still an explicit document boundary, not a viewport measurement.
8
+
9
+ The source stylesheet is preserved (`pruneSource: false`) so its content hash and framework references remain valid. This means matched rules can be present in both the inline critical block and the full external stylesheet; total transferred bytes may increase even when first paint improves. Remaining stylesheets use the `body` preload strategy by default, which avoids injecting inline event handlers or scripts. Set `preload` to `false` to keep stylesheet links in their original render-blocking behavior.
10
+
11
+ ```json
12
+ {
13
+ "optimization": {
14
+ "criticalCss": {
15
+ "enabled": true,
16
+ "routes": ["index.html", "es/index.html"],
17
+ "allowRules": [".dialog[data-open]", ".menu.-expanded"],
18
+ "preload": "body"
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ `routes` are exact paths relative to the generated output directory. Empty routes, missing files and paths outside the output are errors. `allowRules` retains selectors that are applied later by JavaScript but are absent from prerendered markup.
25
+
26
+ ## Viewport-accurate extraction
27
+
28
+ For CSS that must be measured at actual mobile and desktop viewport sizes, use a browser-rendered extractor such as `critical` with Playwright and configure multiple dimensions. That strategy has a browser installation/runtime cost and is not part of this beta. Do not treat Beasties document matching as equivalent.
29
+
30
+ ## Verification before enabling
31
+
32
+ 1. Enable one route or one page group in a branch.
33
+ 2. Compare the page before and after at the target phone, tablet and desktop widths; include open menus, dialogs and other runtime states.
34
+ 3. Check keyboard, no-JavaScript and strict Content Security Policy behavior.
35
+ 4. Measure render-blocking requests and real-device First Contentful Paint.
36
+ 5. Keep the change only if the page remains correct and the measured result improves.
@@ -0,0 +1,43 @@
1
+ # Serving pre-compressed files
2
+
3
+ DS writes `index.html.br` and `index.html.gz` next to `index.html`. The sidecars only help if the web server or CDN sends them to browsers that accept them, with the right headers.
4
+
5
+ Requirements for the server:
6
+
7
+ - Pick `.br` when the request has `Accept-Encoding: br`, otherwise `.gz` for `gzip`, otherwise the original file.
8
+ - Send `Content-Encoding: br` or `gzip`, the original `Content-Type` (not `application/gzip`) and `Vary: Accept-Encoding`.
9
+ - Do not compress the same response again on the fly.
10
+
11
+ ## nginx
12
+
13
+ Needs `ngx_brotli` for `.br`; `gzip_static` is built in.
14
+
15
+ ```nginx
16
+ gzip_static on;
17
+ brotli_static on; # ngx_brotli
18
+ gzip_vary on;
19
+ ```
20
+
21
+ ## Caddy
22
+
23
+ ```caddy
24
+ file_server {
25
+ precompressed br gzip
26
+ }
27
+ ```
28
+
29
+ ## CDN and object storage
30
+
31
+ Managed hosts such as Netlify, Cloudflare Pages and Vercel usually compress responses themselves; check whether yours serves the sidecars, and switch `compression` off if it does not, to save build time. S3 or similar storage behind a CDN needs one object per encoding with `Content-Encoding` set at upload.
32
+
33
+ ## DS7 templates
34
+
35
+ DS7 ships tested configurations for both servers, with cache headers per file type and security headers: `templates/nginx.conf` and `templates/Caddyfile` in [`@ai.all/ds7`](https://github.com/ai-all-ai/ds7), explained in its `03-performance-web-vitals/DELIVERY-AND-CACHING.md`. `ds7 audit perf` reports compressible files without a `.br` or `.gz` variant.
36
+
37
+ ## Check
38
+
39
+ ```bash
40
+ curl -sI -H 'Accept-Encoding: br' https://example.com/ | grep -i -E 'content-encoding|vary|content-type'
41
+ ```
42
+
43
+ The answer should contain `content-encoding: br`, `vary: Accept-Encoding` and `content-type: text/html`.
@@ -0,0 +1,48 @@
1
+ # DS and the AI.ALL ecosystem
2
+
3
+ <!-- Generated from src/ecosystem.json by scripts/sync-ecosystem.mjs. -->
4
+
5
+ **Registry snapshot checked:** 2026-12-03<br>
6
+ **Canonical registry:** [AI.ALL ecosystem guide](https://github.com/ai-all-ai/aiall/blob/main/docs/ECOSYSTEM.md)
7
+
8
+ This generated summary describes current package boundaries. The AI.ALL guide is the single source for the full dependency matrix, version sources and coordinated release order.
9
+
10
+ ## Products
11
+
12
+ | Product | npm `latest` | npm `next` | GitHub release | Responsibility |
13
+ | --- | --- | --- | --- | --- |
14
+ | [AI.ALL](https://github.com/ai-all-ai/aiall) ([`@ai.all/aiall`](https://www.npmjs.com/package/@ai.all/aiall)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/aiall?label=latest)](https://www.npmjs.com/package/@ai.all/aiall) | [![npm next](https://img.shields.io/npm/v/@ai.all/aiall/next?label=next)](https://www.npmjs.com/package/@ai.all/aiall?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/aiall?include_prereleases&label=release)](https://github.com/ai-all-ai/aiall/releases) | AI agent instructions, pack routing, entrypoint synchronization, and ecosystem registry. |
15
+ | [DS7](https://github.com/ai-all-ai/ds7) ([`@ai.all/ds7`](https://www.npmjs.com/package/@ai.all/ds7)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/ds7?label=latest)](https://www.npmjs.com/package/@ai.all/ds7) | [![npm next](https://img.shields.io/npm/v/@ai.all/ds7/next?label=next)](https://www.npmjs.com/package/@ai.all/ds7?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ds7?include_prereleases&label=release)](https://github.com/ai-all-ai/ds7/releases) | Framework-independent web standards, architecture guidance, templates, and quality checks. |
16
+ | [UI](https://github.com/ai-all-ai/ui) ([`@ai.all/ui`](https://www.npmjs.com/package/@ai.all/ui)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/ui?label=latest)](https://www.npmjs.com/package/@ai.all/ui) | [![npm next](https://img.shields.io/npm/v/@ai.all/ui/next?label=next)](https://www.npmjs.com/package/@ai.all/ui?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ui?include_prereleases&label=release)](https://github.com/ai-all-ai/ui/releases) | Vue components, design tokens, a living Brandbook, developer tools, and the Media Engine. |
17
+ | [DS](https://github.com/ai-all-ai/ds) ([`@ai.all/ds`](https://www.npmjs.com/package/@ai.all/ds)) | [![npm latest](https://img.shields.io/npm/v/@ai.all/ds?label=latest)](https://www.npmjs.com/package/@ai.all/ds) | [![npm next](https://img.shields.io/npm/v/@ai.all/ds/next?label=next)](https://www.npmjs.com/package/@ai.all/ds?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ds?include_prereleases&label=release)](https://github.com/ai-all-ai/ds/releases) | Static build orchestration, safe HTML optimization, optional document-matched CSS inlining, compression and size reporting, as a CLI, a Node API and a Nuxt module. |
18
+
19
+ ## Versions
20
+
21
+ Release versions come from the checked-out manifests; npm and GitHub columns are live badges and update on their own.
22
+
23
+ | Product | Release version | npm `latest` | npm `next` | Latest GitHub release | Tested version |
24
+ | --- | --- | --- | --- | --- | --- |
25
+ | AI.ALL | 1.3.0 | [![npm latest](https://img.shields.io/npm/v/@ai.all/aiall?label=latest)](https://www.npmjs.com/package/@ai.all/aiall) | [![npm next](https://img.shields.io/npm/v/@ai.all/aiall/next?label=next)](https://www.npmjs.com/package/@ai.all/aiall?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/aiall?include_prereleases&label=release)](https://github.com/ai-all-ai/aiall/releases) | 1.3.0 |
26
+ | DS7 | 2.12.0 | [![npm latest](https://img.shields.io/npm/v/@ai.all/ds7?label=latest)](https://www.npmjs.com/package/@ai.all/ds7) | [![npm next](https://img.shields.io/npm/v/@ai.all/ds7/next?label=next)](https://www.npmjs.com/package/@ai.all/ds7?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ds7?include_prereleases&label=release)](https://github.com/ai-all-ai/ds7/releases) | 2.12.0 |
27
+ | UI | 1.0.0 | [![npm latest](https://img.shields.io/npm/v/@ai.all/ui?label=latest)](https://www.npmjs.com/package/@ai.all/ui) | [![npm next](https://img.shields.io/npm/v/@ai.all/ui/next?label=next)](https://www.npmjs.com/package/@ai.all/ui?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ui?include_prereleases&label=release)](https://github.com/ai-all-ai/ui/releases) | 1.0.0 |
28
+ | DS | 0.1.0-beta.1 | [![npm latest](https://img.shields.io/npm/v/@ai.all/ds?label=latest)](https://www.npmjs.com/package/@ai.all/ds) | [![npm next](https://img.shields.io/npm/v/@ai.all/ds/next?label=next)](https://www.npmjs.com/package/@ai.all/ds?activeTab=versions) | [![GitHub release](https://img.shields.io/github/v/release/ai-all-ai/ds?include_prereleases&label=release)](https://github.com/ai-all-ai/ds/releases) | 0.1.0-beta.1 |
29
+
30
+ ## DS ownership
31
+
32
+ - Owns static-output post-processing and build-size analysis; framework-specific generators remain responsible for rendering and bundling.
33
+ - Its working beta package wraps existing generator commands, optionally optimizes prerendered HTML and document-used CSS, and writes compression sidecars.
34
+ - 0.1.0-beta.0 is published on npm `next` (`npm i -D @ai.all/ds@next`); its API remains experimental.
35
+
36
+ ## Dependencies
37
+
38
+ - No product runtime dependencies.
39
+
40
+ ## Integration notes
41
+
42
+ - AI.ALL works without DS7 or UI. Packs are opt-in and do not install other products by themselves.
43
+ - DS7 depends on UI because its current initializer creates a Nuxt application that consumes UI components, styles, and the Brandbook. Removing that dependency requires an explicit UI-free initializer profile and an integration migration.
44
+ - UI can be used without AI.ALL or DS7. Its AI.ALL pack is optional.
45
+ - DS7 currently provides responsive image generation as well as media validation. Moving generation to UI is a target, not a completed migration; keep the DS7 command until UI feature parity and consumer migration are verified.
46
+ - DS 0.1.0-beta.0 is a tested beta on npm `next`. DS7 and UI can consume it through its Node API or Nuxt module; its API remains experimental.
47
+
48
+ Refresh this summary from the canonical AI.ALL repository with `npm run ecosystem:sync -- --require-all`.