@reqvire-org/ads 0.0.0-stage → 0.3.0
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/LICENSE +21 -0
- package/README.md +284 -2
- package/dist/assets.mjs +52 -0
- package/dist/bootstrap-ds/ADS.md +203 -0
- package/dist/bootstrap-ds/README.md +98 -0
- package/dist/bootstrap-ds/biome.css.json +21 -0
- package/dist/bootstrap-ds/design-system/assets/brand/README.md +28 -0
- package/dist/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/index.ts +5 -0
- package/dist/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
- package/dist/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
- package/dist/bootstrap-ds/design-system/styles.css +5 -0
- package/dist/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
- package/dist/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
- package/dist/bootstrap-ds/design-system/tokens/base.css +27 -0
- package/dist/bootstrap-ds/design-system/tokens/colors.css +29 -0
- package/dist/bootstrap-ds/design-system/tokens/elevation.css +15 -0
- package/dist/bootstrap-ds/design-system/tokens/spacing.css +15 -0
- package/dist/bootstrap-ds/design-system/tokens/typography.css +13 -0
- package/dist/bootstrap-ds/ds.config.json +13 -0
- package/dist/bootstrap-ds/gitignore.template +8 -0
- package/dist/bootstrap-ds/package-lock.json +4660 -0
- package/dist/bootstrap-ds/package.json +41 -0
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
- package/dist/bootstrap-ds/src/vite-env.d.ts +7 -0
- package/dist/bootstrap-ds/tsconfig.build.json +12 -0
- package/dist/bootstrap-ds/tsconfig.json +20 -0
- package/dist/bootstrap-ds/vite.config.ts +21 -0
- package/dist/boundaries.mjs +130 -0
- package/dist/brand-assets.mjs +82 -0
- package/dist/check.mjs +222 -0
- package/dist/cli.mjs +106 -0
- package/dist/config.mjs +181 -0
- package/dist/contracts/tokens.json +52 -0
- package/dist/html.mjs +30 -0
- package/dist/index.mjs +9 -0
- package/dist/init.mjs +194 -0
- package/dist/lint-config.mjs +40 -0
- package/dist/mcp/THIRD_PARTY_NOTICES.md +786 -0
- package/dist/mcp/apps.mjs +53 -0
- package/dist/mcp/build-status.mjs +164 -0
- package/dist/mcp/catalog.mjs +65 -0
- package/dist/mcp/context.mjs +69 -0
- package/dist/mcp/mutations.mjs +301 -0
- package/dist/mcp/patch.mjs +114 -0
- package/dist/mcp/preview-watch.mjs +169 -0
- package/dist/mcp/preview-widget.bundle.js +113 -0
- package/dist/mcp/project-widget.bundle.js +113 -0
- package/dist/mcp/prompts.mjs +28 -0
- package/dist/mcp/resource-loader.js +138 -0
- package/dist/mcp/sandbox-host.mjs +22 -0
- package/dist/mcp/server.mjs +377 -0
- package/dist/mcp/showcase-host.mjs +68 -0
- package/dist/mcp/skills.mjs +77 -0
- package/dist/mcp/widget.bundle.js +150 -0
- package/dist/oxlint.mjs +81 -0
- package/dist/preview-resources.mjs +198 -0
- package/dist/project-documents.mjs +27 -0
- package/dist/public-props.mjs +74 -0
- package/dist/scenarios-compiler.mjs +287 -0
- package/dist/scenarios-vite.d.mts +3 -0
- package/dist/scenarios-vite.mjs +71 -0
- package/dist/scenarios.mjs +212 -0
- package/dist/showcase/client.bundle.js +127 -0
- package/dist/showcase/index.html +17 -0
- package/dist/showcase/sandbox.js +30 -0
- package/dist/showcase/style.css +7 -0
- package/dist/showcase-coverage.mjs +118 -0
- package/dist/showcase.mjs +77 -0
- package/dist/skills/README.md +68 -0
- package/dist/skills/ads-assimilate/SKILL.md +292 -0
- package/dist/skills/ads-assimilate/agents/openai.yaml +4 -0
- package/dist/skills/ads-assimilate/references/cli.md +111 -0
- package/dist/skills/ads-assimilate/references/lint-and-docs.md +87 -0
- package/dist/skills/ads-assimilate/references/native-implementation.md +98 -0
- package/dist/skills/ads-assimilate/references/testing.md +107 -0
- package/dist/skills/ads-break-ui/LICENSE.upstream +21 -0
- package/dist/skills/ads-break-ui/README.md +16 -0
- package/dist/skills/ads-break-ui/SKILL.md +235 -0
- package/dist/skills/ads-break-ui/agents/openai.yaml +4 -0
- package/dist/skills/ads-break-ui/references/catalog.md +135 -0
- package/dist/skills/ads-break-ui/references/verification.md +48 -0
- package/dist/skills/ads-designer/LICENSE.upstream +21 -0
- package/dist/skills/ads-designer/README.md +19 -0
- package/dist/skills/ads-designer/SKILL.md +400 -0
- package/dist/skills/ads-designer/agents/openai.yaml +4 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +203 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +98 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/biome.css.json +21 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +28 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +5 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/styles.css +5 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/base.css +27 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/colors.css +29 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/elevation.css +15 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/spacing.css +15 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/typography.css +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/gitignore.template +8 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/package-lock.json +4660 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +41 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/src/vite-env.d.ts +7 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.build.json +12 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +20 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +21 -0
- package/dist/skills/ads-designer/references/cli.md +111 -0
- package/dist/skills/ads-designer/references/design-craft.md +65 -0
- package/dist/skills/ads-designer/references/mobile.md +73 -0
- package/dist/skills/ads-import/SKILL.md +335 -0
- package/dist/skills/ads-import/agents/openai.yaml +4 -0
- package/dist/skills/ads-import/references/branding.md +44 -0
- package/dist/skills/ads-import/references/cli.md +111 -0
- package/dist/skills/ads-import/references/implementation.md +111 -0
- package/dist/skills/ads-import/references/tokens.md +96 -0
- package/dist/skills/ads-motion/LICENSE.upstream +21 -0
- package/dist/skills/ads-motion/README.md +22 -0
- package/dist/skills/ads-motion/SKILL.md +217 -0
- package/dist/skills/ads-motion/agents/openai.yaml +4 -0
- package/dist/skills/ads-motion/references/audit.md +44 -0
- package/dist/skills/ads-motion/references/build.md +81 -0
- package/dist/skills/ads-motion/references/performance.md +55 -0
- package/dist/skills/ads-motion/references/review.md +35 -0
- package/dist/skills/ads-motion/references/verification.md +39 -0
- package/dist/token-policy.mjs +10 -0
- package/dist/tokens.mjs +142 -0
- package/dist/ui-framework.mjs +59 -0
- package/dist/units.mjs +168 -0
- package/docs/ADS.md +310 -0
- package/docs/ARCHITECTURE.md +311 -0
- package/docs/CHANGELOG.md +106 -0
- package/docs/GUIDE.md +722 -0
- package/docs/MCP.md +690 -0
- package/package.json +107 -4
package/docs/GUIDE.md
ADDED
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
# ADS tool guide
|
|
2
|
+
|
|
3
|
+
ADS is development tooling for a project's local design system. This package
|
|
4
|
+
contains a Node CLI, shared token contract, static checks, an Oxlint plugin, and
|
|
5
|
+
empty foundation scaffolding. It includes no component or pattern catalogue,
|
|
6
|
+
fonts, mock screens, or UI runtime dependency.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Implementation support
|
|
11
|
+
|
|
12
|
+
Linaria is required for component and pattern styling. Projects choose their
|
|
13
|
+
UI framework and visual design; `init` preserves framework configuration and
|
|
14
|
+
adds no React runtime dependency. See the
|
|
15
|
+
[architecture](https://github.com/reqvire-org/ads/blob/main/docs/ARCHITECTURE.md#linaria-is-the-implementation-mechanism)
|
|
16
|
+
for the rationale.
|
|
17
|
+
|
|
18
|
+
Current source checking supports `.js`, `.jsx`, `.ts`, `.tsx`, their module
|
|
19
|
+
variants, `.css`, and imported Linaria `css` and `styled` templates. JSX style/type checks
|
|
20
|
+
support React and native Preact, including imported factory aliases and
|
|
21
|
+
DOM/CSS types. Scenario discovery, coverage, ownership checks and MCP delivery
|
|
22
|
+
apply to both. The empty application starter uses React; this checkout’s working
|
|
23
|
+
example uses native Preact 11 with TypeScript and Linaria. ADS adds neither runtime
|
|
24
|
+
to a receiving application and never silently aliases React to Preact.
|
|
25
|
+
|
|
26
|
+
Vue/Svelte single-file components and HTML templates are not parsed by these
|
|
27
|
+
guards. Web Component JS/TS logic and separate CSS can be checked, but HTML
|
|
28
|
+
template strings and Shadow DOM style constructs lack equivalent coverage.
|
|
29
|
+
Retain framework-specific checks; a clean ADS check does not validate those
|
|
30
|
+
unchecked surfaces.
|
|
31
|
+
|
|
32
|
+
### Linaria integration
|
|
33
|
+
|
|
34
|
+
Before authoring components or patterns, integrate Linaria extraction with the
|
|
35
|
+
project's existing build:
|
|
36
|
+
|
|
37
|
+
- Install compatible Linaria packages and the extraction integration for the
|
|
38
|
+
project's bundler. ADS implementations use `css` and `cx` from
|
|
39
|
+
`@linaria/atomic`.
|
|
40
|
+
- For Vite, run `@wyw-in-js/vite` before the framework transform. Apply equivalent
|
|
41
|
+
extraction to application and project preview builds.
|
|
42
|
+
- Resolve `@ds` to the local public entry in the bundler and TypeScript, and load
|
|
43
|
+
the foundation CSS once. Preserve intentional CSS side effects.
|
|
44
|
+
- Compile an actual styled component and inspect its emitted CSS and browser
|
|
45
|
+
result. Static source checks do not establish complete extraction or
|
|
46
|
+
unused-style removal.
|
|
47
|
+
|
|
48
|
+
The [empty starter's dependencies](https://github.com/reqvire-org/ads/blob/main/bootstrap-ds/package.json),
|
|
49
|
+
[entry build](https://github.com/reqvire-org/ads/blob/main/bootstrap-ds/vite.config.ts),
|
|
50
|
+
and [preview compiler](https://github.com/reqvire-org/ads/blob/main/bootstrap-ds/scripts/build-mcp-previews.mjs)
|
|
51
|
+
provide the React/Vite setup. Merge the needed integration into an existing
|
|
52
|
+
project instead of replacing its configuration.
|
|
53
|
+
|
|
54
|
+
`ads init` does not install Linaria, configure extraction, or verify the complete
|
|
55
|
+
styling pipeline. It sets up token/source checks and build hooks. The copied
|
|
56
|
+
standalone starter already includes Linaria dependencies and Vite integration.
|
|
57
|
+
|
|
58
|
+
### Native Preact integration
|
|
59
|
+
|
|
60
|
+
An existing Preact project keeps its own runtime. Use `preact` for rendering and
|
|
61
|
+
DOM types, `preact/hooks` for hooks, and optionally `@preact/signals` for reactive
|
|
62
|
+
state. Configure TypeScript with `"jsx": "react-jsx"` and
|
|
63
|
+
`"jsxImportSource": "preact"`. A Vite build can use its native transform:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
esbuild: { jsx: "automatic", jsxImportSource: "preact" },
|
|
67
|
+
plugins: [wyw(), /* project plugins */],
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Apply that configuration to both application and preview builds. Mount preview
|
|
71
|
+
entries with `render(<Scenario />, root)` from `preact`; React entries use their
|
|
72
|
+
existing React mount. Keep Linaria's `css`/`cx` extraction; native Preact does not
|
|
73
|
+
need `@linaria/react`'s React `styled` wrapper. Use `onInput` for live text updates
|
|
74
|
+
and `event.currentTarget` for the typed element. Native SVG uses DOM names such as
|
|
75
|
+
`stroke-width` and `stroke-linecap`; React’s camel-case presentation aliases are
|
|
76
|
+
not normalized by the native renderer. The `svg-attribute` guard checks those
|
|
77
|
+
attributes when the project/file JSX runtime or factory is native Preact. Preact 11 accepts refs as props
|
|
78
|
+
and exports DOM types such as `HTMLAttributes` directly; Preact 10's `JSX` type
|
|
79
|
+
namespace is also recognized by guards. See the [Preact upgrade guide](https://preactjs.com/guide/v11/upgrade-guide/).
|
|
80
|
+
|
|
81
|
+
The [working example](https://github.com/reqvire-org/ads/tree/main/design-system)
|
|
82
|
+
and its [compiler adapter](https://github.com/reqvire-org/ads/blob/main/scripts/build-mcp-previews.mjs)
|
|
83
|
+
show the native setup. When converting the copied React starter to Preact,
|
|
84
|
+
update its runtime dependencies, JSX settings, framework transform, mount adapter,
|
|
85
|
+
and existing `framework` field together. Change the existing foundation scenario's
|
|
86
|
+
hooks to `preact/hooks`; init preserves copied source. Then run `ads init` using
|
|
87
|
+
the saved choice. For a Preact app without a saved framework, run
|
|
88
|
+
`ads init --framework preact`; newly generated foundation scenarios use native
|
|
89
|
+
hooks. Init preserves the application's compiler, dependencies and mount adapter.
|
|
90
|
+
|
|
91
|
+
### CSS correctness in the example and starter
|
|
92
|
+
|
|
93
|
+
The example and empty starter use Biome only for CSS, configured in
|
|
94
|
+
`biome.css.json`. Parsing rejects malformed CSS and invalid hex colors, including
|
|
95
|
+
token values. Explicit lint rules reject duplicate font names and selectors;
|
|
96
|
+
the starter also rejects duplicate properties. Formatting is disabled. Oxlint
|
|
97
|
+
continues to handle JavaScript/TypeScript, and ADS guards enforce token usage and
|
|
98
|
+
ownership separately. `ads init` preserves an existing project's lint tools.
|
|
99
|
+
|
|
100
|
+
CSS regression tests cover rejected input, valid theme/nesting
|
|
101
|
+
contexts, and exclusion of JavaScript and generated outputs.
|
|
102
|
+
|
|
103
|
+
## Set up an existing project
|
|
104
|
+
|
|
105
|
+
Use Node 22.12 or newer. Run inside the project containing `package.json`:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npx @reqvire-org/ads init --framework react
|
|
109
|
+
npm install
|
|
110
|
+
npm run build
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
For a Bun-managed project, use the same init command, followed by `bun install`
|
|
114
|
+
and `bun run build`. No archive or directory argument is needed for a published
|
|
115
|
+
release. `init` requires an existing project; it does not create an application.
|
|
116
|
+
For starting from zero, the `ads-designer` skill carries a standalone empty
|
|
117
|
+
React/TypeScript/Linaria application scaffold. Copy that first, then run `init`
|
|
118
|
+
inside it when a tool distribution is available.
|
|
119
|
+
|
|
120
|
+
Choose `--framework react` or `--framework preact` when the project has no saved
|
|
121
|
+
framework. Init persists it as `framework` in `ds.config.json`. Subsequent runs
|
|
122
|
+
reuse the saved value, and the copied React starter already declares React.
|
|
123
|
+
There is no implicit framework detection or default for initialization.
|
|
124
|
+
|
|
125
|
+
A conflicting flag stops init before writes. Init also checks available
|
|
126
|
+
TypeScript/JavaScript JSX settings, including inherited configurations and project
|
|
127
|
+
references, for clear React/Preact conflicts. It preserves compiler files and
|
|
128
|
+
does not install a framework or establish that the complete bundler setup works.
|
|
129
|
+
Projects without JSX settings can still record their choice and configure the
|
|
130
|
+
compiler separately. Svelte and other frameworks are not accepted yet.
|
|
131
|
+
|
|
132
|
+
Existing ADS configs without `framework` remain readable by checks and inspection.
|
|
133
|
+
On the next init, supply the flag once; init adds that field while preserving
|
|
134
|
+
other settings and existing source. To migrate frameworks, update the project
|
|
135
|
+
and its saved choice explicitly; init is not a framework conversion command.
|
|
136
|
+
|
|
137
|
+
Initialization:
|
|
138
|
+
|
|
139
|
+
- Adds the tool to `devDependencies`, with the executing version pinned by
|
|
140
|
+
default. Keeps an existing tool version unless `--tool-package` overrides it.
|
|
141
|
+
Adds Oxlint if the project does not already depend on it.
|
|
142
|
+
- Creates missing `ds.config.json`, foundation CSS, a public entry, and empty
|
|
143
|
+
component/pattern directories, brand guidance, and an empty font directory.
|
|
144
|
+
Seeds token defaults only when the configured
|
|
145
|
+
token folder contains no CSS. New foundation scenarios use the selected
|
|
146
|
+
framework's hooks. Existing ADS source and token values remain unchanged;
|
|
147
|
+
incomplete existing token contracts need an explicit migration.
|
|
148
|
+
- Adds `lint:ds`, which refreshes lint configuration, runs `ads check`, and
|
|
149
|
+
executes core and registered project Oxlint rules.
|
|
150
|
+
- Adds `assets:ds` (`ads assets`) after those checks and before the existing
|
|
151
|
+
`prebuild` hook, preserving the actual
|
|
152
|
+
`build` command. If the project has no build script, adds a validation/generation
|
|
153
|
+
build. Repeating init does not duplicate the hook.
|
|
154
|
+
- Adds the same checks and generation to `prebuild:showcase` when a standalone
|
|
155
|
+
`build:showcase` script exists, preserving its existing hook and build command.
|
|
156
|
+
- Adds `dev:showcase` as `ads showcase` when absent. An existing run command is
|
|
157
|
+
preserved; deliberately switch it when migrating to the built-in MCP client.
|
|
158
|
+
- Adds `ads-mcp` with guarded editing enabled and `ads-read-mcp` with editing
|
|
159
|
+
disabled, preserving existing scripts with those names. Both start the showcase.
|
|
160
|
+
- Generates `.ds/oxlintrc.json` and appends `.ds/` to the project's ignore file.
|
|
161
|
+
|
|
162
|
+
Application files, framework configuration, unrelated scripts/dependencies,
|
|
163
|
+
and lockfiles are preserved. `init` does not install dependencies or configure
|
|
164
|
+
framework aliases, CSS extraction, or application entry points. Resolve `@ds`
|
|
165
|
+
to the local public entry in TypeScript and the bundler, and load foundation CSS
|
|
166
|
+
once when integrating ADS source into the app. Complete the
|
|
167
|
+
[Linaria integration](#linaria-integration) using the existing framework.
|
|
168
|
+
|
|
169
|
+
An unrelated custom `lint:ds` or `assets:ds` script causes init to stop before writing files;
|
|
170
|
+
rename it or integrate the checks deliberately. Writes are preflighted and do
|
|
171
|
+
not follow symlinks. Keep normal version control review of the resulting changes.
|
|
172
|
+
|
|
173
|
+
After installation, normal builds use the project's installed tool. They refresh
|
|
174
|
+
lint configuration after tool/plugin changes, cloning/moving the project, or
|
|
175
|
+
removing `.ds/`; they do not rely on the initializing npx cache. Commit the
|
|
176
|
+
updated lockfile. npm CI can use `npm ci`, then `npm run build`.
|
|
177
|
+
|
|
178
|
+
## Package manager detection
|
|
179
|
+
|
|
180
|
+
`init` chooses npm or Bun in this order:
|
|
181
|
+
|
|
182
|
+
1. Explicit `--package-manager npm` or `--package-manager bun`.
|
|
183
|
+
2. The project's `packageManager` field.
|
|
184
|
+
3. Its Bun (`bun.lock` or `bun.lockb`) or npm (`package-lock.json`) lockfile.
|
|
185
|
+
4. The invoking runner's package-manager metadata, otherwise npm.
|
|
186
|
+
|
|
187
|
+
With both lockfile types and no declared package manager, specify the flag.
|
|
188
|
+
This version supports npm and Bun. It never replaces or removes a lockfile.
|
|
189
|
+
An existing Bun lockfile takes precedence over the npm runner used by `npx`.
|
|
190
|
+
For a Bun project with no lockfile or package-manager metadata yet:
|
|
191
|
+
|
|
192
|
+
```sh
|
|
193
|
+
npx @reqvire-org/ads init --framework react --package-manager bun
|
|
194
|
+
bun install
|
|
195
|
+
bun run build
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The flag chooses the ADS hook's runner; it does not translate the app's existing
|
|
199
|
+
scripts. Node remains required by the tool and Oxlint integration.
|
|
200
|
+
|
|
201
|
+
## Migrating from DS
|
|
202
|
+
|
|
203
|
+
ADS uses the package `@reqvire-org/ads`, CLI `ads`, MCP tools named `ads_*`,
|
|
204
|
+
resource namespaces `ads://`, `ui://ads` and `skill://ads`, and skills named
|
|
205
|
+
`ads-*`. Replace the old `@reqvire-org/ds` dependency and package imports, install
|
|
206
|
+
dependencies, then run `ads init` to refresh managed build hooks. Existing
|
|
207
|
+
`ds.config.json`, `.ds/`, `design-system/`, `@ds`, shared token names and
|
|
208
|
+
`--ds-*`/`--ux-*` ownership prefixes remain valid. Project UI requires no rewrite.
|
|
209
|
+
|
|
210
|
+
Use `ads-mcp` and `ads-read-mcp` for the editing and read-only launch scripts.
|
|
211
|
+
Update MCP client configuration to the new package/server name and reconnect;
|
|
212
|
+
tool names and resource URIs have changed. Install the renamed `ads-*` skills
|
|
213
|
+
when using local skill installation. Rebuild previews with the new tool to
|
|
214
|
+
refresh generated resource manifests. Existing `DS.md` project guides are still
|
|
215
|
+
discovered; the tool's contract and new scaffold use `ADS.md`.
|
|
216
|
+
|
|
217
|
+
npm has no in-place package rename: publish `@reqvire-org/ads` as a new package.
|
|
218
|
+
Set up its own trusted publisher for `reqvire-org/ads`, workflow
|
|
219
|
+
`release.yml`, allowing `npm publish` and `npm dist-tag`. Once ADS is available,
|
|
220
|
+
deprecate the old package with a migration message:
|
|
221
|
+
|
|
222
|
+
```sh
|
|
223
|
+
npm deprecate @reqvire-org/ds "Renamed to @reqvire-org/ads. Install that package instead."
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Keep old releases available for existing consumers. See npm's
|
|
227
|
+
[package rename guidance](https://docs.npmjs.com/unpublishing-packages-from-the-registry/),
|
|
228
|
+
[deprecation guidance](https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions/)
|
|
229
|
+
and [trusted publishing setup](https://docs.npmjs.com/trusted-publishers/).
|
|
230
|
+
|
|
231
|
+
## Develop ADS locally
|
|
232
|
+
|
|
233
|
+
To run this checkout's MCP server and showcase together:
|
|
234
|
+
|
|
235
|
+
```sh
|
|
236
|
+
npm run ads-mcp -- --port 4191 # guarded editing enabled
|
|
237
|
+
# or:
|
|
238
|
+
npm run ads-read-mcp -- --port 4191 # read-only
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Run one at a time and open **http://127.0.0.1:4191/**. Both build the local tool
|
|
242
|
+
before starting stdio MCP, the showcase and its managed preview compiler. For an
|
|
243
|
+
MCP client's launch configuration, use `npm --silent run ads-mcp` or
|
|
244
|
+
`npm --silent run ads-read-mcp` so npm's banner does not enter the JSON-RPC stream.
|
|
245
|
+
The local tool build logs go to stderr. Use `--no-showcase` after `--` when only
|
|
246
|
+
the stdio connection is needed. `npm run dev:showcase` remains browser-only.
|
|
247
|
+
|
|
248
|
+
Use `npm link` to try changes from this checkout in a project already set up
|
|
249
|
+
with ADS. From the ADS repository root:
|
|
250
|
+
|
|
251
|
+
```sh
|
|
252
|
+
npm install
|
|
253
|
+
npm run build
|
|
254
|
+
npm link
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Then run inside the test project, after installing its normal dependencies:
|
|
258
|
+
|
|
259
|
+
```sh
|
|
260
|
+
npm link @reqvire-org/ads
|
|
261
|
+
npm exec -- ads --version
|
|
262
|
+
npm run build
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
The project now uses your checkout through a symlink. Keep the normal published
|
|
266
|
+
dependency in its `package.json`; linking is local development setup. The
|
|
267
|
+
versionless `npx -y @reqvire-org/ads mcp` configuration uses that linked copy when
|
|
268
|
+
the client starts in this project. The version check confirms which build is
|
|
269
|
+
running. See [npm's linking documentation](https://docs.npmjs.com/cli/v11/commands/npm-link/)
|
|
270
|
+
and [local-package resolution](https://docs.npmjs.com/cli/v11/commands/npm-exec/).
|
|
271
|
+
|
|
272
|
+
After changing ADS tool code, packaged skills, starter files or the showcase
|
|
273
|
+
client, run `npm run build` in this checkout and reconnect MCP. The link points
|
|
274
|
+
to the rebuilt `dist/`; it does not compile source automatically. Changes to
|
|
275
|
+
the test project's components and styles still use its managed preview watcher.
|
|
276
|
+
After another `npm install` or `npm ci` in the test project, run
|
|
277
|
+
`npm link @reqvire-org/ads` again if the install replaced the link.
|
|
278
|
+
|
|
279
|
+
To return to the published version, run `npm unlink --no-save @reqvire-org/ads`
|
|
280
|
+
then `npm install` in the test project. To remove the global development link,
|
|
281
|
+
run `npm unlink --global @reqvire-org/ads`.
|
|
282
|
+
|
|
283
|
+
For this checkout's diagnostic MCP client, run:
|
|
284
|
+
|
|
285
|
+
```sh
|
|
286
|
+
npm run dev:mcp-explorer
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Open **http://127.0.0.1:4190/**. It builds ADS and starts the real stdio server,
|
|
290
|
+
its showcase and the configured preview compiler. The
|
|
291
|
+
[explorer guide](../mcp-explorer/README.md) covers tools, resources, prompts, skills,
|
|
292
|
+
notifications and widget checks. Run `npm run dev:showcase` instead for normal
|
|
293
|
+
visual review. These development commands are not required in projects using
|
|
294
|
+
the published package.
|
|
295
|
+
|
|
296
|
+
## Test a local package
|
|
297
|
+
|
|
298
|
+
Use a tarball to verify the packed release and a clean install before publishing.
|
|
299
|
+
For iterative development, use the linking workflow above. From the repository root:
|
|
300
|
+
|
|
301
|
+
```sh
|
|
302
|
+
npm install
|
|
303
|
+
npm run build
|
|
304
|
+
npm run pack:tool
|
|
305
|
+
ads_tool_package="$PWD/output/npm/reqvire-org-ads-0.3.0.tgz"
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Then change into an existing test project containing `package.json`:
|
|
309
|
+
|
|
310
|
+
```sh
|
|
311
|
+
cd /absolute/path/to/test-project
|
|
312
|
+
npx --yes --package "$ads_tool_package" ads init --framework react --tool-package "$ads_tool_package"
|
|
313
|
+
npm install
|
|
314
|
+
npm run build
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Use `bun install` and `bun run build` for Bun. Keep npx options before `ds`.
|
|
318
|
+
`--tool-package` accepts an absolute local tarball path, a version, or a matching
|
|
319
|
+
package/version. A tarball becomes a `file:` development dependency, so keep it
|
|
320
|
+
available for subsequent installs. A published pinned version is portable
|
|
321
|
+
between machines without an archive. Routine builds need no global install.
|
|
322
|
+
|
|
323
|
+
## Commands and checks
|
|
324
|
+
|
|
325
|
+
| Command | Behavior |
|
|
326
|
+
|---------|----------|
|
|
327
|
+
| `ads init --framework react` | Add ADS tooling to the current project; accepts `react` or `preact`; saved choices can omit the flag |
|
|
328
|
+
| `ads check [directory]` | Read-only core token, source import, and style checks |
|
|
329
|
+
| `ads tokens [directory]` | List declared values and theme/media scopes |
|
|
330
|
+
| `ads assets [directory]` | Generate standard icons from `assets.iconSource` |
|
|
331
|
+
| `ads lint-config [directory]` | Generate or refresh `.ds/oxlintrc.json` |
|
|
332
|
+
| `ads mcp [directory]` | Serve tools, resources, prompts, skills and preview Apps; start the local showcase |
|
|
333
|
+
| `ads mcp --mutations` | Enable guarded edits to the local ADS, validated before application |
|
|
334
|
+
| `ads showcase [directory]` | Start the same MCP runtime and showcase for browser-only use |
|
|
335
|
+
| `ads --version`, `ads --help` | Version and usage |
|
|
336
|
+
|
|
337
|
+
`init` accepts no directory argument. Other commands default to the current
|
|
338
|
+
directory and can inspect another directory. `--json` gives structured results
|
|
339
|
+
for inspection/setup commands; `mcp` uses stdout exclusively for JSON-RPC.
|
|
340
|
+
Exit codes are 0 for success, 1 for check findings, and 2 for invalid
|
|
341
|
+
input/configuration or execution errors.
|
|
342
|
+
|
|
343
|
+
Guarded MCP editing is opt-in. Its mandatory checks and optional project
|
|
344
|
+
`mcp.mutationChecks` scripts run in a temporary project copy with installed
|
|
345
|
+
dependencies. See the [editing contract](MCP.md#guarded-editing) for unit ownership,
|
|
346
|
+
Git patches, bounded reads and preview review. Keep normal build gates enabled
|
|
347
|
+
for edits made by other tools.
|
|
348
|
+
|
|
349
|
+
`check` validates required shared names in `:root`, readily checkable value
|
|
350
|
+
categories, undefined aliases, alias cycles, and individual theme/media
|
|
351
|
+
overrides. Project-specific values and additional definitions within ADS's fixed
|
|
352
|
+
naming contract are allowed. The contract's `naming` section lists the fixed
|
|
353
|
+
shared families and names; projects cannot configure alternative prefixes.
|
|
354
|
+
`--ds-*`, `--ux-*`, and `--showcase-*` variables remain owned by their layers,
|
|
355
|
+
including when a file is inside `tokens/`. Shared token assignments outside
|
|
356
|
+
`tokens/` fail. Source styles also check shared references for undeclared names.
|
|
357
|
+
It does not change values, import a theme, or synchronize definitions.
|
|
358
|
+
|
|
359
|
+
Source checks enforce the configured public alias for app/showcase consumers,
|
|
360
|
+
reject JSX inline styling except configured files, and check CSS and imported
|
|
361
|
+
Linaria `css` and `styled` templates for raw visual values and namespace ownership. Private
|
|
362
|
+
ADS implementation imports and showcase-local files are allowed. The checker
|
|
363
|
+
recognizes imported aliases and shadowed bindings.
|
|
364
|
+
|
|
365
|
+
These are static checks, not framework type checking or browser CSS evaluation.
|
|
366
|
+
Arbitrary computed expressions, combined conditional cascade behavior, computed
|
|
367
|
+
module specifiers, JSX spreads, other styling engines, and renderer-specific APIs
|
|
368
|
+
need the project's existing checks and review. Continue to run its type checking,
|
|
369
|
+
component tests, and browser comparisons. Component-specific rules run through
|
|
370
|
+
Oxlint in `lint:ds`; `ads check` does not execute those plugins.
|
|
371
|
+
|
|
372
|
+
## Showcase
|
|
373
|
+
|
|
374
|
+
ADS ships a minimal browser shell, MCP client and Apps host. `ads mcp` serves the
|
|
375
|
+
website alongside its stdio connection; `ads showcase` starts the same runtime
|
|
376
|
+
for browser-only use. Run commands from the project root. Open the printed URL,
|
|
377
|
+
or use `ads_status.showcaseUrl` from an already connected runtime. An available
|
|
378
|
+
loopback port is selected by default; `--port 4185` selects a fixed port.
|
|
379
|
+
`ads mcp --no-showcase` keeps a headless stdio server.
|
|
380
|
+
|
|
381
|
+
The client negotiates the current modern MCP protocol, discovers menus with
|
|
382
|
+
`ads_tokens`/`ads_scenarios`, invokes `ads_show_tokens`/`ads_show_scenario` and renders
|
|
383
|
+
Apps through the official bridge. It refreshes menus on catalogue notifications
|
|
384
|
+
and refreshes the active scenario in the same App after a successful build. Errors identify
|
|
385
|
+
stale retained output. Its neutral header and left pane align and collapse
|
|
386
|
+
together. Themes flow through the Apps host context. No project catalogue pages
|
|
387
|
+
or direct component imports are used by this client.
|
|
388
|
+
|
|
389
|
+
The project's responsibilities are the real implementations, colocated scenarios
|
|
390
|
+
and fixtures, foundation CSS/Linaria extraction, and a preview compiler. The
|
|
391
|
+
empty React starter includes a Vite compiler adapter and its tiny mount entry
|
|
392
|
+
under `design-system/showcase/mcp/`. Init alone does not install or wire this
|
|
393
|
+
compiler. For an existing app, adapt the starter's build script and mount entry,
|
|
394
|
+
add its `build:mcp-previews` package script, and configure it explicitly:
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
{
|
|
398
|
+
"mcp": {
|
|
399
|
+
"showcaseTitle": "My Project Design System",
|
|
400
|
+
"previewManifest": ".ds/preview/manifest.json",
|
|
401
|
+
"previewWatch": { "command": "node", "args": ["scripts/build-mcp-previews.mjs", "--watch"] }
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
Keep the saved `framework` (`react` or `preact`), JSX transform and mount adapter
|
|
407
|
+
consistent. The optional title defaults to the project package name followed by
|
|
408
|
+
` · Design System`. The browser shell stays the same for both frameworks. There is
|
|
409
|
+
one managed compiler per runtime, shared by stdio and HTTP clients. It builds
|
|
410
|
+
a shared multi-entry graph on first demand and after source changes; the App
|
|
411
|
+
loads only the selected scenario's dependencies. TSX/Linaria compilation still
|
|
412
|
+
happens automatically. Accepted configuration-unit mutations replace the managed
|
|
413
|
+
compiler while keeping MCP connected. External compiler/configuration or dependency
|
|
414
|
+
changes may require restarting the runtime; ordinary owner/fixture/style/asset edits do not.
|
|
415
|
+
See [the compiler contract](MCP.md#configure-the-project-compiler) for revisions,
|
|
416
|
+
diagnostics, invalidation and the shared resource graph.
|
|
417
|
+
|
|
418
|
+
Colocate `Scenario.tsx` and `fixture.ts` beside tokens and each component/pattern, or use
|
|
419
|
+
`<Owner>.scenario.tsx` and `<Owner>.fixture.ts` for flat owners. Larger entries
|
|
420
|
+
live under `composition/<Name>/`. A default zero-input mountable view imports the
|
|
421
|
+
real public UI and a local fixture, and exports literal metadata:
|
|
422
|
+
|
|
423
|
+
```tsx
|
|
424
|
+
import { Button } from "@ds";
|
|
425
|
+
import { fixture } from "./fixture";
|
|
426
|
+
export const scenario = { title: "Button states", covers: ["Button"] };
|
|
427
|
+
export default function Scenario() { return <Button>{fixture.label}</Button>; }
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
IDs derive from filenames; do not maintain another registry or hand-assigned IDs.
|
|
431
|
+
Token scenarios live beside foundation CSS under the configured token directory.
|
|
432
|
+
The starter includes `tokens/Foundation.scenario.tsx` and its local fixture for
|
|
433
|
+
plain value inspection without a component library. For styled samples, use a
|
|
434
|
+
public project review pattern and keep its presentation in that pattern:
|
|
435
|
+
|
|
436
|
+
```tsx
|
|
437
|
+
import { TokenSamples } from "@ds";
|
|
438
|
+
import { fixture } from "./Typography.fixture";
|
|
439
|
+
export const scenario = { title: fixture.title, covers: ["TokenSamples"], tokens: fixture.tokens };
|
|
440
|
+
export default function Scenario() { return <TokenSamples {...fixture} />; }
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
`TokenSamples` is an example project-owned pattern, not an npm tool component.
|
|
444
|
+
The fixture defines literal names and sample text, with no copied token values.
|
|
445
|
+
Add/remove names when foundation tokens change. `token-scenario-reference`,
|
|
446
|
+
`token-scenario-render` and `token-scenario-coverage` enforce real references and
|
|
447
|
+
coverage for every token. The same source/style/import checks apply under tokens/.
|
|
448
|
+
|
|
449
|
+
Fixtures/adapters own development inputs, state, callbacks and simulated services.
|
|
450
|
+
The entry requires no browser page, application router/store or prior setup.
|
|
451
|
+
Several contextual parts may share a scenario with their real parent. Larger
|
|
452
|
+
entries reuse public production screen patterns instead of reassembling screens.
|
|
453
|
+
|
|
454
|
+
`scenario-contract`, `scenario-render` and `scenario-coverage` require addressable
|
|
455
|
+
coverage for every public renderable component/pattern, including unused exports.
|
|
456
|
+
Only reachable real render references count. Types/constants/utilities are
|
|
457
|
+
excluded. Scenarios and fixture helpers are development-only; runtime code and
|
|
458
|
+
the public barrel cannot import or re-export them. They define no CSS, custom
|
|
459
|
+
classes or native widget replicas. Reusable review layouts are public project
|
|
460
|
+
patterns; the outer browser shell is tooling UI. Full-app integration harnesses
|
|
461
|
+
belong in application tests. See the [contract](ADS.md#showcase-contract).
|
|
462
|
+
|
|
463
|
+
For this checkout, `npm run dev:showcase` builds the tool and launches its client;
|
|
464
|
+
`npm run build:showcase` compiles scenario artifacts for verification. Use `bun
|
|
465
|
+
run` with the same script names. These commands do not install a UI catalogue.
|
|
466
|
+
The optional `scenarioRegistryPlugin` remains available for legacy Vite browsers,
|
|
467
|
+
but the built-in client reads discovery through MCP. Existing custom showcases
|
|
468
|
+
are preserved by init; replace their run command deliberately when migrating.
|
|
469
|
+
|
|
470
|
+
Run core and registered project checks before preview compilation, alongside
|
|
471
|
+
framework checks and meaningful tests. Review real entries at narrow/wide sizes,
|
|
472
|
+
in both themes and relevant states. Browser verification still establishes
|
|
473
|
+
layout, keyboard/focus, interactions and motion; compiler success does not.
|
|
474
|
+
|
|
475
|
+
Public `*Props` declarations omit inherited DOM `style`; arbitrary visual strings
|
|
476
|
+
also fail. Measured geometry uses explicit boundaries. HTML mount styles may
|
|
477
|
+
only establish full root height and body overflow. Project presentation belongs
|
|
478
|
+
in owned component/pattern styles, with tokens supplying visual values.
|
|
479
|
+
|
|
480
|
+
## Branding
|
|
481
|
+
|
|
482
|
+
ADS has fixed token names and ownership namespaces. Change values in the existing
|
|
483
|
+
token files; `--accent`, `--font-sans`, `--radius-md`, and the other shared roles
|
|
484
|
+
keep their meanings across projects. Foreign prefixes such as `--nuv-*` or
|
|
485
|
+
`--brand-*` fail. Components own `--ds-*`, patterns own `--ux-*`, and the showcase
|
|
486
|
+
reserves `--showcase-*` for showcase boundaries. Fixture files still define no
|
|
487
|
+
custom styling; the frame pattern uses `--ux-*`. Branding never assigns
|
|
488
|
+
component state variables.
|
|
489
|
+
|
|
490
|
+
Keep original SVG artwork and a usage/credits/license README in
|
|
491
|
+
`design-system/assets/brand/`, and font files in `assets/fonts/`. Font declarations
|
|
492
|
+
belong in optional `tokens/fonts.css`, imported first. The foundation entry is
|
|
493
|
+
import-only: fonts (when present), colors, typography, spacing, elevation, base.
|
|
494
|
+
Fixed artwork colors and geometry are permitted inside SVG assets; they do not
|
|
495
|
+
permit raw visual values in component or pattern styles.
|
|
496
|
+
|
|
497
|
+
Select one SVG master with an ADS-relative path:
|
|
498
|
+
|
|
499
|
+
```json
|
|
500
|
+
{ "assets": { "iconSource": "assets/brand/app-icon.svg" } }
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
Merge this into `ds.config.json`; the source must be a real SVG inside
|
|
504
|
+
`assets/brand/`. `ads assets` generates these files in ignored `.ds/assets/`:
|
|
505
|
+
|
|
506
|
+
| Output | Size |
|
|
507
|
+
|--------|------|
|
|
508
|
+
| `favicon.svg` | Copy of the original SVG |
|
|
509
|
+
| `favicon.ico` | 16, 32, 48 px entries |
|
|
510
|
+
| `apple-touch-icon.png` | 180 × 180 |
|
|
511
|
+
| `icon-192.png` | 192 × 192 |
|
|
512
|
+
| `icon-512.png` | 512 × 512 |
|
|
513
|
+
|
|
514
|
+
Rendering preserves colors, aspect ratio, and transparent padding. Include a
|
|
515
|
+
background in the original if needed for a platform. Every invocation rebuilds
|
|
516
|
+
the small output set; there is no rendering cache, asset registry, or theme
|
|
517
|
+
resolver. With no `iconSource`, it succeeds without writing. All images render
|
|
518
|
+
before generated files are replaced, so invalid artwork leaves prior outputs
|
|
519
|
+
intact. Sources, duplicate output mounts, and symlinked write paths are checked.
|
|
520
|
+
|
|
521
|
+
Initialized builds run:
|
|
522
|
+
|
|
523
|
+
```text
|
|
524
|
+
lint-config → ads check → Oxlint → ads assets → existing prebuild → existing build
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
`lint:ds` remains read-only except for generated lint configuration. `assets:ds`
|
|
528
|
+
runs `ads assets`; checks do not require outputs on a clean checkout. A failed
|
|
529
|
+
check or generation stops the build. Re-running init preserves token values,
|
|
530
|
+
artwork, existing configuration, and unrelated scripts.
|
|
531
|
+
|
|
532
|
+
Mount `.ds/assets/` using the application's existing bundler. Init does not change
|
|
533
|
+
framework configuration. For a Vite app with no other public directory, a project
|
|
534
|
+
can set `publicDir: path.resolve(import.meta.dirname, ".ds/assets")`; when it
|
|
535
|
+
already has public assets, use its existing asset merge/copy step and reject
|
|
536
|
+
duplicate output paths. Use the same assets in development and production.
|
|
537
|
+
Application manifest metadata and other platform exports remain project-owned.
|
|
538
|
+
|
|
539
|
+
### Generic architecture guards
|
|
540
|
+
|
|
541
|
+
`ads check` enforces reusable architecture policies alongside token checks:
|
|
542
|
+
|
|
543
|
+
| Guard | Shared enforcement |
|
|
544
|
+
|----------------|------------------------------|
|
|
545
|
+
| Public APIs | Inherited/explicit style props and open-ended visual color/fill/stroke strings |
|
|
546
|
+
| Renderer boundaries | JSX inline styles, React/Preact CSS types, imperative `.style` writes, bulk style writes, and style-object escapes |
|
|
547
|
+
| Asset ownership | ADS/public mount collisions, configured generated assets in source, and tracked generated output |
|
|
548
|
+
| Product patterns | CSS/JSX namespace ownership; ADS implementations and showcase cannot import app source |
|
|
549
|
+
| Primitive state | State-variable overrides outside components; undocumented non-state component variables |
|
|
550
|
+
| Fixed token ownership | Foreign token names, shared token overrides, misplaced component/pattern/showcase variables, and noncanonical foundation imports |
|
|
551
|
+
| Showcase ownership | Fixture CSS/Linaria definitions, custom JSX classes, native controls/widget roles, state styling, private CSS/aliased imports, legacy catalogue dependencies and source ownership, and runtime imports of fixtures/test helpers |
|
|
552
|
+
| Scenario coverage | All public renderable UI has path-discovered entries, colocated fixtures, literal metadata and reachable public render references; runtime imports of scenarios/fixtures are rejected |
|
|
553
|
+
| Data access | Direct global fetch/XHR/WebSocket/EventSource in ADS source is rejected; injected services, workers and lazy imports remain allowed |
|
|
554
|
+
| Showcase coverage | Public ADS UI referenced by production JSX/React `createElement` has showcase render references; imports and tests alone do not count |
|
|
555
|
+
|
|
556
|
+
ES module imports, re-exports, and dynamic imports with literal specifiers use
|
|
557
|
+
TypeScript's project configuration, including aliases and bundler resource
|
|
558
|
+
queries. ADS implementations and showcase fixtures cannot import app code.
|
|
559
|
+
Private imports within ADS implementations remain allowed, including when the ADS
|
|
560
|
+
is nested inside `src/`. Application integration harnesses belong in test support.
|
|
561
|
+
|
|
562
|
+
Project rule registration is explicit:
|
|
563
|
+
|
|
564
|
+
```json
|
|
565
|
+
{
|
|
566
|
+
"oxlint": {
|
|
567
|
+
"plugins": [{ "name": "project", "path": "scripts/oxlint-project.mjs" }],
|
|
568
|
+
"rules": { "project/domain-usage": "error" },
|
|
569
|
+
"overrides": [
|
|
570
|
+
{ "files": ["src/test/**"], "rules": { "project/domain-usage": "off" } }
|
|
571
|
+
]
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Override patterns are project-relative, cannot escape the project, and configure
|
|
577
|
+
Oxlint only. They do not suppress architecture checks from `ads check`. A plugin
|
|
578
|
+
can import Node-only `loadConfig`, `importResolver`, and `styleWriteViolation`
|
|
579
|
+
from `@reqvire-org/ads` when it needs the same validated boundaries as core.
|
|
580
|
+
Unknown configuration fields fail rather than silently weakening checks.
|
|
581
|
+
|
|
582
|
+
Component interaction variables such as `--ds-button-hover-bg` cannot be
|
|
583
|
+
assigned by app code, patterns, or showcase code. This includes static JSX style
|
|
584
|
+
objects in files with inline-style exceptions. Reading a variable is allowed;
|
|
585
|
+
the component owns its state definitions. Documented non-state customizations
|
|
586
|
+
are registered explicitly. State variables cannot be allowlisted.
|
|
587
|
+
|
|
588
|
+
Keep renderer-, framework-, and component-specific project guards too. The
|
|
589
|
+
shared tool does not validate a third-party graph renderer's own APIs, arbitrary
|
|
590
|
+
runtime spreads, or the semantic meaning of a
|
|
591
|
+
measured value. Register Oxlint plugins through `oxlint.plugins` / `oxlint.rules`
|
|
592
|
+
and continue running standalone checks through the existing build.
|
|
593
|
+
|
|
594
|
+
### Project boundaries and assets
|
|
595
|
+
|
|
596
|
+
Optional configuration adds only the permissions and paths that the project
|
|
597
|
+
actually uses; the tool contains no component or product-specific lists:
|
|
598
|
+
|
|
599
|
+
```json
|
|
600
|
+
{
|
|
601
|
+
"boundaries": {
|
|
602
|
+
"styleWrites": [
|
|
603
|
+
{ "file": "design-system/components/geometry.ts", "properties": ["--ds-panel-height"] }
|
|
604
|
+
],
|
|
605
|
+
"componentVariables": ["--ds-panel-gap"]
|
|
606
|
+
},
|
|
607
|
+
"assets": {
|
|
608
|
+
"iconSource": "assets/brand/app-icon.svg",
|
|
609
|
+
"publicDirs": ["public/assets"],
|
|
610
|
+
"generatedPaths": ["dist", "dist-showcase", ".vite", ".ds"],
|
|
611
|
+
"generatedFiles": ["icon-generated.png"]
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
Merge these sections into `ds.config.json`. `styleWrites` permits only the
|
|
617
|
+
listed CSS properties in that exact file. Use kebab-case (`user-select`) or an
|
|
618
|
+
exact custom property. Static assignments, `setProperty`, and `removeProperty`
|
|
619
|
+
can use that boundary; `cssText`, computed property names, escaped style
|
|
620
|
+
objects, and bulk writes remain forbidden. Plain property reads are allowed.
|
|
621
|
+
`inlineStyleFiles` is a separate file-level JSX/type exception and never
|
|
622
|
+
permits imperative writes by itself.
|
|
623
|
+
|
|
624
|
+
Asset checks compare `design-system/assets/` with each configured public mount
|
|
625
|
+
and `design-system/showcase/public/assets/`, adjusting for `dsDir`. A relative
|
|
626
|
+
asset path may have one source owner per mount, even if duplicate contents
|
|
627
|
+
match. `generatedFiles` names asset-relative paths forbidden in those source
|
|
628
|
+
directories; nothing is inferred from filenames such as `favicon.ico`.
|
|
629
|
+
|
|
630
|
+
`generatedPaths` names project-relative files or directories that must not be
|
|
631
|
+
tracked. Legacy `dist-kit/` and `dist-showcase/` output is also generated;
|
|
632
|
+
the built-in client uses project preview artifacts under `.ds/`.
|
|
633
|
+
Git inspects tracked files, including nested workspaces. Outside a Git repo,
|
|
634
|
+
there are no tracked outputs to check; other asset checks still run. Real Git
|
|
635
|
+
inspection errors fail the check. These guards read files and never delete them.
|
|
636
|
+
|
|
637
|
+
## Configuration and component rules
|
|
638
|
+
|
|
639
|
+
`ds.config.json` uses schema version 1. Paths stay within the receiving project:
|
|
640
|
+
|
|
641
|
+
```json
|
|
642
|
+
{
|
|
643
|
+
"schemaVersion": 1,
|
|
644
|
+
"sourceDir": "src",
|
|
645
|
+
"dsDir": "design-system",
|
|
646
|
+
"publicAlias": "@ds",
|
|
647
|
+
"publicEntry": "index.ts",
|
|
648
|
+
"stylesEntry": "styles.css",
|
|
649
|
+
"tokenDir": "tokens",
|
|
650
|
+
"inlineStyleFiles": [],
|
|
651
|
+
"oxlint": { "plugins": [], "rules": {} }
|
|
652
|
+
}
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
These source-layout defaults apply when the file is absent; the example omits
|
|
656
|
+
the required init-time framework choice. Run `ads init --framework react` (or
|
|
657
|
+
`preact`) to save it. To use another layout, write this configuration before init. Configure TypeScript and the app bundler to resolve
|
|
658
|
+
the same alias; this file does not rewrite their configuration.
|
|
659
|
+
|
|
660
|
+
Colocate component-specific rules with the project component and register a
|
|
661
|
+
project-owned Oxlint plugin adapter explicitly:
|
|
662
|
+
|
|
663
|
+
```json
|
|
664
|
+
{
|
|
665
|
+
"oxlint": {
|
|
666
|
+
"plugins": [
|
|
667
|
+
{ "name": "project-ui", "path": "scripts/oxlint-project-ui.mjs" }
|
|
668
|
+
],
|
|
669
|
+
"rules": { "project-ui/feature-usage": "error" }
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
Merge that section into the project configuration, then run the normal build.
|
|
675
|
+
Generated configuration registers `ads/public-import`, `ads/no-inline-style`, `ads/no-app-import`, and
|
|
676
|
+
explicit project plugins. Core tooling imports no particular component.
|
|
677
|
+
Registered project configuration and build helpers may import one another;
|
|
678
|
+
this boundary is derived when lint configuration is generated. It does not
|
|
679
|
+
allow application code to import private ADS modules or build helpers to import
|
|
680
|
+
private UI implementation.
|
|
681
|
+
`inlineStyleFiles` should name only documented geometry/renderer boundaries,
|
|
682
|
+
not broad styling exceptions. Ignore `.ds/`; generated paths refer to the project
|
|
683
|
+
and its locally installed tool.
|
|
684
|
+
|
|
685
|
+
`lint-config` remains a low-level command for custom build integration and
|
|
686
|
+
debugging. For pipelines outside package-manager build hooks, run the same
|
|
687
|
+
sequence before compilation, from the project root with local binaries available:
|
|
688
|
+
|
|
689
|
+
```sh
|
|
690
|
+
ads lint-config .
|
|
691
|
+
ads check .
|
|
692
|
+
oxlint --deny-warnings --config .ds/oxlintrc.json src design-system
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
Retain unrelated lint, type checking, and framework build commands.
|
|
696
|
+
|
|
697
|
+
## External content
|
|
698
|
+
|
|
699
|
+
Use the repository's `ads-import` skill for selected external ADS source or theme
|
|
700
|
+
values, and `ads-assimilate` for a native implementation inspired by an upstream
|
|
701
|
+
library. These agent workflows handle dependency closure, token mapping, motion
|
|
702
|
+
comparisons, source credits, applicable notices, and local documentation.
|
|
703
|
+
They are agent workflows, rather than CLI import/design subcommands. Install
|
|
704
|
+
them through `npx skills`, or read the packaged skills through the
|
|
705
|
+
[stdio MCP server](MCP.md#skills). MCP serving does not install or automatically
|
|
706
|
+
activate a skill, and the tool still bundles no UI component/example library.
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
## Release maintenance
|
|
710
|
+
|
|
711
|
+
Choose a version that is not already in `npm view @reqvire-org/ads versions`.
|
|
712
|
+
Published npm versions cannot be replaced, even by moving or recreating a Git
|
|
713
|
+
tag; see [npm publishing rules](https://docs.npmjs.com/cli/v11/commands/npm-publish/).
|
|
714
|
+
|
|
715
|
+
Update `package.json` and its lockfile with
|
|
716
|
+
`npm version <new-version> --no-git-tag-version --ignore-scripts`, commit and push
|
|
717
|
+
those files, then push the matching `v<new-version>` tag. `release.yml` checks
|
|
718
|
+
version availability, tests packed npm/Bun installs, publishes the package and
|
|
719
|
+
creates the GitHub release. Stable tags publish as `latest`; prerelease tags
|
|
720
|
+
publish as `next`. Check the workflow result and npm version before updating
|
|
721
|
+
consumer dependencies. The manual workflow moves a label to an existing
|
|
722
|
+
published version; it does not publish new source.
|