Skip to content

Commit 990eaf2

Browse files
committed
feat(cli): add Atlas theme setup
Add an explicit rocket init --yes path for converting CommonJS package metadata to ESM, scaffold a public theme stylesheet, and let Atlas layout data load project-owned stylesheets after package CSS. The docs and generated Rocket skill now cover constrained dev-server fallbacks, curl HTML smoke tests, and the starter theming path; the staged README cleanup and build script update are included with the setup pass.
1 parent 7cd896a commit 990eaf2

29 files changed

Lines changed: 392 additions & 89 deletions

.agents/skills/rocket/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ description: Use when editing Rocket Pages, config, layouts, component reference
1515
- Markdown using Rocket custom elements needs a `components` export; use Atlas component maps or `rocketDemoComponents`.
1616
- Add `menu.iconName` to Atlas docs navigation Pages so the left navigation has icons.
1717
- Direct layout re-exports are supported when no local wrapper function is needed.
18+
- For Atlas theming, use shared layout data with `stylesheets` and centralized CSS variables instead of per-Page style injection.
19+
- To add a general Page, create `docs/pages/name.rocket.md`, set `config.path`, `metadata`, `menu.iconName`, and use the shared docs layout.
1820
- Custom layouts rendering `rocket-icon` need `addBootstrapIconLibrary(pageData)` before `document()`.
1921
- Static JavaScript Pages render once per concrete path; query/header/cookie/live-data output needs `render: 'server'`.
2022
- Static Request Demos should target concrete non-query URLs.
2123
- After adding a `js demo`, verify the parent Page and Standalone Demo URL `/page/_demo/demoName/`.
24+
- If `rocket init` fails because package.json has `"type": "commonjs"`, change it to `"type": "module"` or rerun `npx rocket init --yes`.
25+
- If dev server watchers fail with `EMFILE`, run `npm start -- --no-watch --no-open` and use `Ctrl+R` for manual restarts.
26+
- When smoke-testing Pages with curl, send `Accept: text/html`: `curl -H 'Accept: text/html' http://localhost:8888/path`.
2227
- Keep `npm run build` passing; record Rocket package issues separately from local workarounds.

.changeset/atlas-theme-init.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket/js': patch
3+
---
4+
5+
Add project-owned stylesheet hooks to Atlas layout data and wire `rocket init` to scaffold a central theme stylesheet. The initializer also supports an explicit `--yes` path for converting CommonJS package metadata to ESM, and the docs now cover constrained dev-server fallbacks and curl Page smoke tests.

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ release PR can update this file with the final version and package notes.
1111

1212
## 0.1.0
1313

14-
- Relaunches Rocket as `@rocket/js`.
15-
- Marks the package as alpha.
14+
- Starts Rocket's current public alpha as `@rocket/js`.
15+
- Marks the package as alpha before `1.0.0`.
1616
- Introduces the AI-assisted setup path, explicit Page config docs, static output docs, and Web
1717
Component documentation examples.

README.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> Rocket is in alpha. Expect APIs and documentation to keep improving before 1.0.
1+
> Rocket is in public alpha. Expect APIs and documentation to keep improving before 1.0.
22
33
<p align="center">
44
<picture width="60%">
@@ -157,29 +157,14 @@ Use Rocket for:
157157
- documentation sites
158158
- Web Component and design-system docs
159159
- AI-generated sites you want to own afterward
160-
- pages that should ship as HTML before they ship JavaScript
160+
- pages that should ship as HTML before JavaScript
161161

162162
Do not use Rocket for:
163163

164164
- SPA products with complex client-side routing
165165
- backend applications
166-
- projects that need a huge plugin marketplace today
167-
- teams that want React, Astro, Eleventy, or VitePress conventions specifically
168-
169-
## Why not Astro, Eleventy, or VitePress?
170-
171-
Those are good tools. Rocket chooses a narrower shape:
172-
173-
| Need | Rocket |
174-
| -------------------------- | ------ |
175-
| Content-first static sites | Yes |
176-
| Web Component docs | Strong |
177-
| Zero JS default | Core |
178-
| Explicit page config | Core |
179-
| AI-friendly project shape | Core |
180-
| Full app framework | No |
181-
| Huge plugin ecosystem | No |
182-
| React-first authoring | No |
166+
- projects that need a large plugin ecosystem today
167+
- teams that specifically want React, Astro, Eleventy, or VitePress conventions
183168

184169
## Package and dependency philosophy
185170

@@ -190,8 +175,8 @@ browser JavaScript is only emitted for loading strategies you choose.
190175

191176
## Status and docs
192177

193-
Rocket is currently **alpha** at `0.1.x`. APIs can change before `1.0.0`; breaking changes are
194-
documented through changesets and release notes.
178+
Rocket is currently in **public alpha** at `0.1.x`. APIs can change before `1.0.0`;
179+
breaking changes are documented through changesets and release notes.
195180

196181
- [Start With AI](https://rocket.modern-web.dev/setup/build-with-ai/)
197182
- [Manual Quick Start](https://rocket.modern-web.dev/setup/manual-quick-start/)

ROADMAP.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Roadmap
22

3-
Rocket is currently alpha. This roadmap describes the work that makes the relaunch credible and the
4-
criteria for a future `1.0.0`.
3+
Rocket is currently in public alpha. This roadmap describes the work that keeps the public alpha
4+
credible and the criteria for a future `1.0.0`.
55

6-
## Relaunch
6+
## Public Alpha
77

88
- Keep the public positioning focused on AI-generated, owned static sites and Web Component docs.
99
- Keep README, docs, npm package metadata, and release notes aligned on `@rocket/js`.
10-
- Publish with npm provenance from GitHub Actions.
10+
- Treat npm as the `@rocket/js` release channel, not a separate launch status.
11+
- Continue publishing with npm provenance from GitHub Actions.
1112
- Maintain `SECURITY.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, and a committed lockfile.
1213
- Surface one polished marketing-site example, one component-library docs example, and one
1314
AI-generated-from-brief example.

SECURITY.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Supported Versions
44

5-
Rocket is in alpha. Security fixes target the latest published `0.1.x` release and the `main`
6-
branch unless a release note says otherwise.
5+
Rocket is in public alpha. Security fixes target the latest published `0.1.x` release and the
6+
`main` branch unless a release note says otherwise.
77

88
## Reporting a Vulnerability
99

@@ -16,14 +16,30 @@ request a private security contact. Do not open a public issue for an active vul
1616

1717
## Release Security
1818

19+
Rocket's public alpha is the adoption status. npm is the release channel for `@rocket/js`.
1920
Maintainers should publish npm releases from GitHub Actions, not local machines. The release workflow
20-
is configured for npm provenance. For npm trusted publishing, configure the `@rocket/js` package on
21-
npm to trust this repository and `.github/workflows/release.yml` on the `main` branch.
21+
is configured for trusted publishing and npm provenance. Published `@rocket/js` versions have
22+
already been released through the trusted publisher, and the npm package is configured to require
23+
two-factor authentication and disallow token-based publishing.
2224

23-
Before public npm launch, maintainers should verify:
25+
Before the public alpha announcement, maintainers should verify:
2426

27+
- README, docs, package metadata, roadmap, changelog, and release notes call Rocket a public alpha at
28+
the latest `0.1.x` version; avoid suggesting the already-published package is not yet available
29+
on npm.
2530
- npm organization 2FA is enabled for maintainers and publishers.
26-
- npm trusted publishing is configured for the release workflow.
27-
- The package page shows provenance for the published version.
28-
- Release PRs keep `package-lock.json` synchronized with `package.json`.
31+
- The `@rocket/js` npm package settings still show the GitHub Actions trusted publisher for
32+
`modernweb-dev/rocket`, `.github/workflows/release.yml`, and the `main` branch.
33+
- The npm package publishing policy still requires 2FA and disallows token-based publishing; unused
34+
automation tokens are revoked.
35+
- `.github/workflows/release.yml` keeps `id-token: write`, uses GitHub-hosted runners, disables the
36+
package-manager cache for release installs, and does not publish with `NPM_TOKEN` or
37+
`NODE_AUTH_TOKEN`.
38+
- `package.json` has a public `repository.url` that matches the GitHub repository used by trusted
39+
publishing and provenance.
40+
- Release PRs keep `package-lock.json` synchronized with `package.json`, include required
41+
changesets, and update changelog output.
2942
- Dependency changes pass GitHub dependency review.
43+
- `npm pack --dry-run` output contains only intended package files.
44+
- The npm package page shows provenance for the latest published version; maintainers can also run
45+
`npm audit signatures` with the latest npm CLI from a project that installs `@rocket/js`.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Rocket initializer creates an Atlas docs starter
22

3-
The Rocket Initializer is a post-install project initializer, not a package bootstrapper or full site generator. `rocket init` should create a compact Atlas-backed documentation starter by default: `rocket-config.js`, shared Atlas data, a hero home Page, a general docs Page, a JavaScript Demo Page, a Request Demo Page backed by a concrete static JSON Page, and a removable project-local Rocket Agent Skill at `.agents/skills/rocket/SKILL.md`. This starter gives Site Authors and Coding Agents a buildable example of the package-provided Atlas layouts, matching component-map exports, `menu.iconName` navigation icons, Standalone Demo URLs, and static Request Demos without requiring a custom layout first.
3+
The Rocket Initializer is a post-install project initializer, not a package bootstrapper or full site generator. `rocket init` should create a compact Atlas-backed documentation starter by default: `rocket-config.js`, shared Atlas data, a public theme stylesheet, a hero home Page, a general docs Page, a JavaScript Demo Page, a Request Demo Page backed by a concrete static JSON Page, and a removable project-local Rocket Agent Skill at `.agents/skills/rocket/SKILL.md`. This starter gives Site Authors and Coding Agents a buildable example of the package-provided Atlas layouts, matching component-map exports, project-owned Atlas theme stylesheets, `menu.iconName` navigation icons, Standalone Demo URLs, and static Request Demos without requiring a custom layout first.
44

5-
When `package.json` exists, the initializer should add missing `type`, `start`, and `build` fields without replacing existing choices. If generic `start` or `build` scripts already exist, it should add missing `rocket:start` or `rocket:build` scripts instead. Rocket remains ESM-only for this initializer: missing `type` becomes `"module"`, existing `"module"` is preserved, and existing `"commonjs"` fails before writing files. General Documentation Pages always start under `docs/pages`, while the config also discovers colocated Component Reference Pages under `src`, so the same initializer works for Standalone Rocket Sites and existing codebases without modes, flags, `AGENTS.md`, dependency installation, or dependency mutation.
5+
When `package.json` exists, the initializer should add missing `type`, `start`, and `build` fields without replacing existing choices. If generic `start` or `build` scripts already exist, it should add missing `rocket:start` or `rocket:build` scripts instead. Rocket remains ESM-only for this initializer: missing `type` becomes `"module"`, existing `"module"` is preserved, and existing `"commonjs"` fails before writing files unless the caller explicitly passes `--yes` to approve changing it to `"module"`. General Documentation Pages always start under `docs/pages`, while the config also discovers colocated Component Reference Pages under `src`, so the same initializer works for Standalone Rocket Sites and existing codebases without dependency installation or dependency mutation.
66

77
Existing files and package fields should never be overwritten by default; when a Rocket-related starter file already exists, the initializer should leave it untouched and report the skipped path. The initializer should not run install, start, build, or validation commands; it only writes starter files and prints next steps.

docs/pages/advanced/10-atlas-layouts.rocket.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export const siteData = {
111111
],
112112
},
113113
footerData: [],
114+
stylesheets: ['/rocket-theme.css'],
114115
navigationIconServerBudget: 35,
115116
};
116117
```
@@ -126,14 +127,18 @@ URLs are treated as external even when `external` is omitted.
126127
icon when Rocket has a matching icon asset. The optional `label` shows visible text to the right of
127128
the icon. Omit `label` for an icon-only link.
128129
130+
`stylesheets` is optional. Use it for project-owned theme CSS loaded after the package Atlas CSS.
131+
Keep color and spacing overrides centralized there, usually as CSS variables, instead of injecting
132+
Page-specific style blocks.
133+
129134
`navigationIconServerBudget` controls how many automatic `rocket-icon` hosts in the docs
130135
navigation are server-rendered before the remaining navigation icons are deferred to the browser.
131136
Atlas defaults this to `35`, which keeps likely above-the-fold navigation icons in the first HTML
132137
response while avoiding work for deep navigation entries. Set it in your project-owned `siteData` to
133138
raise, lower, or zero the budget.
134139
135-
The docs layout reads `headerData` and `navigationIconServerBudget`; keep `footerData` as an empty
136-
array when the same data module is not used by another layout.
140+
The docs layout reads `headerData`, `stylesheets`, and `navigationIconServerBudget`; keep
141+
`footerData` as an empty array when the same data module is not used by another layout.
137142
138143
Keep this data in your project. Do not import Rocket's docs-site `docs/pages/globalData.js` into a
139144
user site.

docs/pages/advanced/30-dev-server.rocket.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ Use flags when you need a different startup shape:
5353
npx rocket start --port 3000
5454
npx rocket start --no-open
5555
npx rocket start --no-watch
56+
npx rocket start --no-watch --no-open
5657
```
5758

5859
`--no-open` leaves the browser closed. `--no-watch` disables automatic reload watchers; use
59-
`Ctrl+R` for manual restarts when you want to reload after a change.
60+
`Ctrl+R` for manual restarts when you want to reload after a change. If startup fails with
61+
`EMFILE`, retry with `npm start -- --no-watch --no-open` or
62+
`npx rocket start --no-watch --no-open`.
6063

6164
## Restart
6265

@@ -132,6 +135,13 @@ The dev server also distinguishes document requests from asset requests. For non
132135
Rocket tries to resolve the requested path relative to the current Page's source file when a
133136
matching file exists.
134137

138+
Plain `curl` sends `Accept: */*`, which Rocket treats as asset-like in development. When
139+
smoke-testing a Page from the terminal, send an HTML accept header:
140+
141+
```bash
142+
curl -H 'Accept: text/html' http://localhost:8888/docs
143+
```
144+
135145
For build-safe asset URLs, prefer the [`resolve` function](/reference/assets) in Page server code or
136146
layout code. For stable root-relative files such as favicons, verification files, and downloads,
137147
use [Public Assets](/reference/assets).

docs/pages/build-a-site/0-index.rocket.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The track covers the current Atlas docs shape:
5454

5555
- a local `docs/docsLayout.js` wrapper around `atlasDocLayout`
5656
- project-owned `DocData` in `docs/siteData.js`
57+
- centralized Atlas theme variables in `public/rocket-theme.css`
5758
- Site Head Metadata in `rocket-config.js`
5859
- top header links, social links, and menu icon rendering
5960
- page-specific Atlas aside tips through `metadata.custom.atlasDoc`

0 commit comments

Comments
 (0)