Use the packages without the CMS repo
The website-facing packages are plain TypeScript source — copy them into a standalone website workspace and drop every CMS-only dependency.
What to copy
your-site/
packages/
core/ # @narew/core — shared contracts (schemas, prose, validation, localized-read, binding, local manifest)
cli/ # @narew/cli — narew-cms commands (generate, content bind/env, dev, mcp; peer-depends on wrangler)
drizzle/ # @narew/drizzle — collection adapter, table() helper and Drizzle Kit defaults
content/ # @narew/content — OPTIONAL: preview runtime, binding helper, reader, Hono adapter
package.json # your own pnpm workspace rootThe copied packages sit under packages/ beside core/ — one workspace glob covers them all. Which packages a project needs depends on its role:
- Website only — reads a registered database and renders it: copy
packages/corealone. Live preview additionally takespackages/content, andpackages/clisuppliescontent envand thedevcommand (narew-cms dev). - Content-owning project — owns the Drizzle schema,
narew.config.tsand the migration history: copypackages/core,packages/cliandpackages/drizzle;narew-cms generateandcontent bind(--from-fileor individual flags) run here. - Combined content + website workspace: everything above, with
packages/contentoptional until preview is enabled.
Copy the source trees only — never node_modules, test fixtures (*.fixture.ts), testing directories (src/testing/), the CMS applications, or the repository root configs. git archive from a reviewed narew-cms commit into a new, empty folder is one valid way; move the site/* sources under packages/ afterwards:
git archive HEAD packages/core site/cli site/drizzle site/content | tar -x -C .
mkdir -p packages
mv site/cli site/drizzle site/content packages/
rmdir siteDrop site/content from the archive and the move when not using preview.
Standalone workspace
pnpm-workspace.yaml lists the copied directories:
packages:
- "packages/*"Cross-package references inside the copies already use workspace:*, so your root package.json can depend on the workspace exactly like the monorepo — without requiring @narew/content unless you opted into it:
{
"name": "your-site",
"version": "0.0.0",
"private": true,
"type": "module",
"dependencies": {
"@narew/core": "workspace:*"
},
"devDependencies": {
"@narew/cli": "workspace:*",
"@narew/drizzle": "workspace:*",
"drizzle-kit": "0.31.11",
"drizzle-orm": "0.45.4",
"typescript": "7.0.2",
"wrangler": "^4.0.0"
}
}Run pnpm install at the workspace root, then run project commands such as pnpm exec narew-cms generate from your content project directory. Note that @narew/cli declares wrangler as a peer dependency, so your host workspace supplies it in devDependencies as shown above.
To use preview, additionally copy the content package under packages/ and add "@narew/content": "workspace:*" to the website's dependencies. The base manifest above stays content-free otherwise. Modular exports allow sites to opt into only what they need:
@narew/content/bindingprovides lightweight signed binding verification without pulling Durable Objects or preview runtime code.@narew/content/readprovides the versioned, KV-cached raw-SQL reader with zero DO overhead.@narew/content/kyselyrequireskyselyas an optional peer dependency.@narew/content/honorequireshonoas an optional peer dependency (type-only at runtime).
Core modularity and lightweight runtime: @narew/core sets "sideEffects": false and exposes 10 targeted subpaths: ., ./prose, ./validation (which includes media schemas), ./defaults, ./content-binding, ./content-cache, ./content-session (including session inputs), ./storage, ./localization, and ./localized-read. Former subpaths @narew/core/website, @narew/core/media, and @narew/core/content-session-input are retired. For localized sites, import @narew/core/localized-read for fast locale fallback selection without pulling heavy CMS dictionary parsers or validation logic into your worker.
Pinned toolchain: Node 24 (>= 24.11), pnpm 11.23, TypeScript 7, drizzle-orm 0.45.4, drizzle-kit 0.31.11 — match these versions rather than floating. @narew/core is required for the Narew contracts and tooling; its runtime helpers (prose rendering, validation) are optional to call. See Website data access and Preview your website for usage.