Skip to content

Commit e05ae9c

Browse files
Phase 0+1: README template, service-package README, unified package.json publishing metadata
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/31298df6-e8fb-4b22-9182-02fb8a2606b3 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 4737f9c commit e05ae9c

44 files changed

Lines changed: 1304 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Package README & `package.json` Publishing Checklist (Internal)
2+
3+
> **Audience:** Maintainers of the ObjectStack monorepo.
4+
> **Purpose:** Guarantee every package published to npm under `@objectstack/*` has consistent, high-quality documentation and publishing metadata.
5+
> **Status:** Canonical. All PRs that add a new package, or that modify any `README.md` or `package.json` under `packages/**`, must satisfy this checklist.
6+
7+
---
8+
9+
## 1. Canonical README Structure
10+
11+
Every package `README.md` MUST follow this section order. Sections that do not apply to a package can be omitted, but the order of remaining sections must not change.
12+
13+
```markdown
14+
# @objectstack/<package-name>
15+
16+
> One-line pitch: what this package is and what problem it solves.
17+
18+
[![npm](https://img.shields.io/npm/v/@objectstack/<package-name>.svg)](https://www.npmjs.com/package/@objectstack/<package-name>)
19+
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
20+
21+
## Overview
22+
23+
2–4 sentences. Where this package sits in the ObjectStack architecture (Core / Adapter / Plugin / Driver / Service). Who should use it.
24+
25+
## Installation
26+
27+
\`\`\`bash
28+
pnpm add @objectstack/<package-name>
29+
# or
30+
npm install @objectstack/<package-name>
31+
\`\`\`
32+
33+
## Quick Start
34+
35+
Minimum runnable example — imports, construction, usage. Must reference only public exports.
36+
37+
\`\`\`typescript
38+
import { ... } from '@objectstack/<package-name>';
39+
\`\`\`
40+
41+
## Key Exports / API
42+
43+
Brief list of the most important public exports (classes, functions, types). Link to generated API reference in the docs site rather than duplicating full signatures.
44+
45+
## Configuration
46+
47+
Config options (if any) as a table. Use the same key names as the Zod schema (camelCase).
48+
49+
## When to use
50+
51+
- ✅ Good fit for scenario X.
52+
- ✅ Good fit for scenario Y.
53+
54+
## When not to use
55+
56+
- ❌ Not a good fit for Z — use `@objectstack/other-package` instead.
57+
58+
## Related Packages
59+
60+
- [`@objectstack/spec`](../spec) — protocol schemas.
61+
- [`@objectstack/core`](../core) — kernel and DI.
62+
- … package-specific relations.
63+
64+
## Links
65+
66+
- 📖 Docs: <https://objectstack.ai/docs>
67+
- 📚 API Reference: <https://objectstack.ai/docs/references>
68+
- 🧭 Protocol: <https://objectstack.ai/docs/protocol>
69+
- 🧪 Examples: [`examples/`](../../../examples)
70+
- 🤖 Skill: [`skills/objectstack-<domain>/SKILL.md`](../../../skills) _(if applicable)_
71+
72+
## License
73+
74+
Apache-2.0 © ObjectStack
75+
```
76+
77+
### README conventions
78+
79+
- **Title**: Always `# @objectstack/<package-name>` as the first line. No marketing titles above the scoped name.
80+
- **Pitch**: Exactly one sentence. Must describe the package, not the ecosystem.
81+
- **Badges**: npm version + Apache-2.0 license badge. Additional badges (CI, coverage) may be added but must use shields.io and be the last line of the badge block.
82+
- **Code blocks**: Always tagged with language (`typescript`, `bash`, `json`). Imports must be from the package being documented, not relative paths.
83+
- **API examples**: Must compile against the current published API. Verify by grepping `src/index.ts` for the symbols used.
84+
- **Internal terminology**: Use canonical names from `packages/spec/src/kernel/metadata-plugin.zod.ts` (singular: `view`, `flow`, `agent`, `tool`, not plural).
85+
- **Links**: Prefer absolute URLs to the docs site for user-facing references; repository-relative links are only allowed for cross-package pointers within the monorepo.
86+
87+
---
88+
89+
## 2. `package.json` Publishing Checklist
90+
91+
Every publishable package MUST have the following fields. Private packages (`"private": true`) are exempt but apps (under `apps/`) should stay private.
92+
93+
### Required fields
94+
95+
| Field | Requirement | Example |
96+
|:---|:---|:---|
97+
| `name` | Scoped `@objectstack/<slug>` | `"@objectstack/core"` |
98+
| `version` | Aligned with monorepo release train (currently `4.0.4`) | `"4.0.4"` |
99+
| `description` | One sentence, ≤ 140 chars, starts with product/scope | `"ObjectStack core kernel — DI, plugin lifecycle, EventBus"` |
100+
| `license` | `Apache-2.0` | `"Apache-2.0"` |
101+
| `author` | `"ObjectStack"` | `"ObjectStack"` |
102+
| `keywords` | ≥ 3 tags. First must be `objectstack`. | `["objectstack", "kernel", "di"]` |
103+
| `repository` | Object form with `directory` | see below |
104+
| `homepage` | Package landing page on docs site | `"https://objectstack.ai/docs/packages/core"` |
105+
| `bugs` | Issues URL | `"https://github.com/objectstack-ai/framework/issues"` |
106+
| `engines.node` | `">=18.0.0"` | `">=18.0.0"` |
107+
| `main` | CJS entry or `dist/index.js` | `"./dist/index.js"` |
108+
| `types` | Type declarations entry | `"./dist/index.d.ts"` |
109+
| `exports` | At minimum `"."`. Subpath exports must mirror `src/*` | see below |
110+
| `files` | Whitelist: `["dist", "README.md", ...]` — never publish `src/` | `["dist", "README.md"]` |
111+
| `publishConfig.access` | `"public"` | `"public"` |
112+
113+
### Canonical `repository` block
114+
115+
```json
116+
"repository": {
117+
"type": "git",
118+
"url": "https://github.com/objectstack-ai/framework.git",
119+
"directory": "packages/<path-to-package>"
120+
}
121+
```
122+
123+
### Canonical `exports` block (single entry)
124+
125+
```json
126+
"exports": {
127+
".": {
128+
"types": "./dist/index.d.ts",
129+
"import": "./dist/index.mjs",
130+
"require": "./dist/index.js"
131+
}
132+
}
133+
```
134+
135+
### Canonical `files` whitelist
136+
137+
```json
138+
"files": ["dist", "README.md", "LICENSE"]
139+
```
140+
141+
Add `json-schema`, `prompts`, `llms.txt`, etc. only when the package actually ships those assets.
142+
143+
### Forbidden in published packages
144+
145+
- `devDependencies` entries that reference deleted packages
146+
- `main` pointing at `src/`
147+
- Non-scoped names (`"objectstack-*"` is grandfathered only for the VS Code extension)
148+
- `"private": true` on a package that needs to be installable from npm
149+
150+
---
151+
152+
## 3. Pre-release PR Checklist
153+
154+
Every release PR must verify for each package:
155+
156+
- [ ] README exists and matches §1 structure.
157+
- [ ] Code examples in README reference symbols that exist in `src/index.ts`.
158+
- [ ] `package.json` has every required field in §2.
159+
- [ ] `version` is aligned with the release train.
160+
- [ ] `exports` / `main` / `types` all point at `dist/` artifacts that the build actually produces.
161+
- [ ] `pnpm build` succeeds and produces the files listed in `files`.
162+
- [ ] `pnpm test` passes or is `--passWithNoTests` intentionally.
163+
- [ ] `lychee` link check passes for README.
164+
- [ ] `CHANGELOG.md` has an entry covering this package's changes.
165+
166+
---
167+
168+
## 4. Docs-site Linkage
169+
170+
Each package MUST have a corresponding guide page under `content/docs/guides/packages.mdx` (overview table) and a detailed reference under `content/docs/references/<domain>/<slug>.mdx` (auto-generated from Zod schemas for protocol packages; hand-written for runtime packages).
171+
172+
When introducing a new package:
173+
174+
1. Add a row to the overview table in `content/docs/guides/packages.mdx`.
175+
2. If the package defines Zod schemas, run `pnpm --filter @objectstack/spec gen:docs`.
176+
3. If the package is a runtime (plugin/service/driver/adapter), add a hand-written reference page under `content/docs/references/<domain>/`.
177+
4. Update `ROADMAP.md` Package Status Matrix.
178+
179+
---
180+
181+
## 5. Deprecation / Removal
182+
183+
To deprecate a package:
184+
185+
1. Add `"deprecated": "<reason + migration hint>"` to `package.json`.
186+
2. Prefix README with a `> **Deprecated.** Use [`@objectstack/replacement`](…) instead.` callout.
187+
3. Move its row in `content/docs/guides/packages.mdx` into a "Deprecated" section.
188+
4. Keep publishing patch releases until downstream migration is complete.
189+
190+
---
191+
192+
Last updated: 2026-04-17

packages/adapters/express/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,31 @@
2626
"express": "^5.2.1",
2727
"typescript": "^6.0.2",
2828
"vitest": "^4.1.4"
29+
},
30+
"description": "Express adapter for ObjectStack — mounts the generated REST API onto an Express app.",
31+
"keywords": [
32+
"objectstack",
33+
"express",
34+
"adapter",
35+
"rest",
36+
"node"
37+
],
38+
"author": "ObjectStack",
39+
"repository": {
40+
"type": "git",
41+
"url": "https://github.com/objectstack-ai/framework.git",
42+
"directory": "packages/adapters/express"
43+
},
44+
"homepage": "https://objectstack.ai/docs",
45+
"bugs": "https://github.com/objectstack-ai/framework/issues",
46+
"publishConfig": {
47+
"access": "public"
48+
},
49+
"files": [
50+
"dist",
51+
"README.md"
52+
],
53+
"engines": {
54+
"node": ">=18.0.0"
2955
}
3056
}

packages/adapters/fastify/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,31 @@
2525
"fastify": "^5.8.4",
2626
"typescript": "^6.0.2",
2727
"vitest": "^4.1.4"
28+
},
29+
"description": "Fastify adapter for ObjectStack — mounts the generated REST API onto a Fastify app.",
30+
"keywords": [
31+
"objectstack",
32+
"fastify",
33+
"adapter",
34+
"rest",
35+
"node"
36+
],
37+
"author": "ObjectStack",
38+
"repository": {
39+
"type": "git",
40+
"url": "https://github.com/objectstack-ai/framework.git",
41+
"directory": "packages/adapters/fastify"
42+
},
43+
"homepage": "https://objectstack.ai/docs",
44+
"bugs": "https://github.com/objectstack-ai/framework/issues",
45+
"publishConfig": {
46+
"access": "public"
47+
},
48+
"files": [
49+
"dist",
50+
"README.md"
51+
],
52+
"engines": {
53+
"node": ">=18.0.0"
2854
}
2955
}

packages/adapters/hono/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,31 @@
2828
"hono": "^4.12.12",
2929
"typescript": "^6.0.2",
3030
"vitest": "^4.1.4"
31+
},
32+
"description": "Hono adapter for ObjectStack — edge-compatible REST API server for Cloudflare Workers, Deno, Bun, and Node.",
33+
"keywords": [
34+
"objectstack",
35+
"hono",
36+
"adapter",
37+
"edge",
38+
"rest"
39+
],
40+
"author": "ObjectStack",
41+
"repository": {
42+
"type": "git",
43+
"url": "https://github.com/objectstack-ai/framework.git",
44+
"directory": "packages/adapters/hono"
45+
},
46+
"homepage": "https://objectstack.ai/docs",
47+
"bugs": "https://github.com/objectstack-ai/framework/issues",
48+
"publishConfig": {
49+
"access": "public"
50+
},
51+
"files": [
52+
"dist",
53+
"README.md"
54+
],
55+
"engines": {
56+
"node": ">=18.0.0"
3157
}
3258
}

packages/adapters/nestjs/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,30 @@
2020
"@objectstack/runtime": "workspace:*",
2121
"typescript": "^6.0.2",
2222
"vitest": "^4.1.4"
23+
},
24+
"description": "NestJS adapter for ObjectStack — integrates the generated REST API into a NestJS module.",
25+
"keywords": [
26+
"objectstack",
27+
"nestjs",
28+
"adapter",
29+
"rest"
30+
],
31+
"author": "ObjectStack",
32+
"repository": {
33+
"type": "git",
34+
"url": "https://github.com/objectstack-ai/framework.git",
35+
"directory": "packages/adapters/nestjs"
36+
},
37+
"homepage": "https://objectstack.ai/docs",
38+
"bugs": "https://github.com/objectstack-ai/framework/issues",
39+
"publishConfig": {
40+
"access": "public"
41+
},
42+
"files": [
43+
"dist",
44+
"README.md"
45+
],
46+
"engines": {
47+
"node": ">=18.0.0"
2348
}
2449
}

packages/adapters/nextjs/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,31 @@
2222
"react-dom": "^19.2.5",
2323
"typescript": "^6.0.2",
2424
"vitest": "^4.1.4"
25+
},
26+
"description": "Next.js adapter for ObjectStack — App Router route handlers for the ObjectStack REST API.",
27+
"keywords": [
28+
"objectstack",
29+
"nextjs",
30+
"adapter",
31+
"app-router",
32+
"rest"
33+
],
34+
"author": "ObjectStack",
35+
"repository": {
36+
"type": "git",
37+
"url": "https://github.com/objectstack-ai/framework.git",
38+
"directory": "packages/adapters/nextjs"
39+
},
40+
"homepage": "https://objectstack.ai/docs",
41+
"bugs": "https://github.com/objectstack-ai/framework/issues",
42+
"publishConfig": {
43+
"access": "public"
44+
},
45+
"files": [
46+
"dist",
47+
"README.md"
48+
],
49+
"engines": {
50+
"node": ">=18.0.0"
2551
}
2652
}

packages/adapters/nuxt/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,31 @@
2525
"h3": "^1.15.11",
2626
"typescript": "^6.0.2",
2727
"vitest": "^4.1.4"
28+
},
29+
"description": "Nuxt adapter for ObjectStack — Nitro server routes for the ObjectStack REST API.",
30+
"keywords": [
31+
"objectstack",
32+
"nuxt",
33+
"adapter",
34+
"nitro",
35+
"rest"
36+
],
37+
"author": "ObjectStack",
38+
"repository": {
39+
"type": "git",
40+
"url": "https://github.com/objectstack-ai/framework.git",
41+
"directory": "packages/adapters/nuxt"
42+
},
43+
"homepage": "https://objectstack.ai/docs",
44+
"bugs": "https://github.com/objectstack-ai/framework/issues",
45+
"publishConfig": {
46+
"access": "public"
47+
},
48+
"files": [
49+
"dist",
50+
"README.md"
51+
],
52+
"engines": {
53+
"node": ">=18.0.0"
2854
}
2955
}

0 commit comments

Comments
 (0)