foldkit-plus 0.20.0 → 0.21.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/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/form-recipes/file.d.mts +1 -0
- package/dist/form-recipes/file.mjs +2 -0
- package/dist/host.d.mts +1 -0
- package/dist/host.mjs +2 -0
- package/dist/remote-drizzle/pg.d.mts +1 -0
- package/dist/remote-drizzle/pg.mjs +2 -0
- package/dist/setup.d.mts.map +1 -1
- package/dist/setup.mjs +2 -2
- package/dist/setup.mjs.map +1 -1
- package/dist/ssr/loader.d.mts +1 -0
- package/dist/ssr/loader.mjs +2 -0
- package/package.json +73 -52
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-form-recipes/file";
|
package/dist/host.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-host";
|
package/dist/host.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-remote-drizzle/pg";
|
package/dist/setup.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.mts","names":[],"sources":["../src/setup.ts"],"mappings":";YAOY;;iBAGK;WACN;;WAEA,UAAU,SAAS;;WAEnB;;WAEA,cAAc;;WAEd,QAAQ;;;iBAIF;WACN;WACA;;;;;;iBAOM;WACN;WACA;WACA;;iBAGM;WACN,SAAS,OAAO,OAAO;WACvB,SAAS;WACT,UAAU;;;;;;;;qBAYR;;qBAMA,MAAM;WACR;WACA,SAAS;WACT;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"setup.d.mts","names":[],"sources":["../src/setup.ts"],"mappings":";YAOY;;iBAGK;WACN;;WAEA,UAAU,SAAS;;WAEnB;;WAEA,cAAc;;WAEd,QAAQ;;;iBAIF;WACN;WACA;;;;;;iBAOM;WACN;WACA;WACA;;iBAGM;WACN,SAAS,OAAO,OAAO;WACvB,SAAS;WACT,UAAU;;;;;;;;qBAYR;;qBAMA,MAAM;WACR;WACA,SAAS;WACT;;;;;;;;;qBAmHE,UAAU;WACZ;WACA,WAAW;WACX;;;;;;;;;;qBAoDE,gBAAgB;;;;;;;;qBAkBhB,gBAAa,gBAAkB,QAAU;;;;;qBAqFzC,aAAU,SACZ,SAAO,UACN,uBAAqB;qBA8BpB,eAAU,SAAA,SAAA,YAAoC"}
|
package/dist/setup.mjs
CHANGED
|
@@ -122,8 +122,8 @@ const jobs = [
|
|
|
122
122
|
guide: "richtext"
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
|
-
job: "Server rendering that hands the Model over",
|
|
126
|
-
imports: ["ssr"],
|
|
125
|
+
job: "Server rendering that hands the Model over, and the server handler around it",
|
|
126
|
+
imports: ["ssr", "host"],
|
|
127
127
|
guide: "ssr"
|
|
128
128
|
},
|
|
129
129
|
{
|
package/dist/setup.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.mjs","names":[],"sources":["../src/setup.ts"],"sourcesContent":["/**\n * What `npx foldkit-plus setup` prints: instructions a coding agent can follow\n * in order, for the project it is run in. Pure: the CLI reads the project and\n * this package's manifest and passes them in, so a test can give any project.\n */\nimport { Option } from 'effect'\n\nexport type Manager = 'pnpm' | 'npm' | 'yarn' | 'bun'\n\n/** What the project's `package.json` says about the libraries Foldkit Plus needs. */\nexport interface Project {\n readonly name: string\n /** Each named library's version range, from any dependency field. */\n readonly versions: Readonly<Record<string, string>>\n /** Whether a `.gitattributes` applies here: in the project's folder or one above it in its repository. */\n readonly gitattributes: boolean\n /** Where pnpm reads this project's settings, which a workspace keeps at its root. */\n readonly pnpmSettings: PnpmSettings\n /** The versions of Effect's packages (`effectPackages`) its npm lockfile holds, nested copies included. */\n readonly locked: ReadonlyArray<string>\n}\n\n/** A file pnpm reads settings from, in `folder` relative to the project (`.`, `../..`). */\nexport interface PnpmSettings {\n readonly folder: string\n readonly file: 'package.json' | 'pnpm-workspace.yaml'\n}\n\n/**\n * The versions this release is built and tested against, from its own\n * manifest: the workspace's Foldkit and Effect.\n */\nexport interface Versions {\n readonly plus: string\n readonly effect: string\n readonly foldkit: string\n}\n\nexport interface SetupInput {\n readonly project: Option.Option<Project>\n readonly manager: Manager\n readonly versions: Versions\n}\n\nconst SITE = 'https://foldkit-plus.pages.dev'\nconst REPOSITORY = 'https://github.com/doeixd/foldkit-plus'\n\n/**\n * The `create-foldkit-app` release whose templates pin the Foldkit this\n * release needs (0.41.0 installs `foldkit`, `@foldkit/ui` and `@foldkit/devtools`\n * 0.170.0, `@foldkit/vite-plugin` 0.29.0 and `effect` 4.1.0). A release that\n * moves the `foldkit` peer moves this with it.\n */\nexport const SCAFFOLDER = 'create-foldkit-app@0.41.0'\n\nconst GREENFIELD = `${REPOSITORY}/blob/main/skills/foldkit-plus/references/greenfield.md`\nconst AGENTS_BLOCK = `${REPOSITORY}/blob/main/skills/foldkit-plus/references/agents-md.md`\n\n/** What each job needs, where to import it from, and where it is explained. */\nexport const jobs: ReadonlyArray<{\n readonly job: string\n readonly imports: ReadonlyArray<string>\n readonly guide: string\n}> = [\n {\n job: 'Name what a feature may read and which Messages it may send',\n imports: ['surface', 'metadata'],\n guide: 'surface',\n },\n {\n job: 'A reusable Submodel placed several times, every part wired',\n imports: ['bundle', 'bundle-surface'],\n guide: 'bundle',\n },\n {\n job: 'Restyle or extend views from outside, through typed slots',\n imports: ['mixins', 'mixins-surface', 'mixins-ui'],\n guide: 'mixins',\n },\n {\n job: 'Media queries, timers, sockets, clipboard, undo history',\n imports: ['primitives'],\n guide: 'primitives',\n },\n {\n job: 'Declare the domain once: entities, relations, queries',\n imports: ['entity'],\n guide: 'entity',\n },\n {\n job: 'Server-owned data in the Model: queries, mutations, live updates',\n imports: ['remote', 'remote-server', 'remote-drizzle'],\n guide: 'remote',\n },\n {\n job: 'Edits that survive offline and converge across devices',\n imports: ['sync', 'durable'],\n guide: 'sync',\n },\n { job: 'Who may do what, enforced on every seam', imports: ['guard'], guide: 'guard' },\n {\n job: 'Who is signed in: a Yielded Auth session as the principal',\n imports: ['auth'],\n guide: 'auth',\n },\n {\n job: 'A slice of the Model kept in the URL or in storage',\n imports: ['mirror'],\n guide: 'mirror',\n },\n {\n job: 'Forms: drafts, validation, a decoded value, and dates, times and addresses in them',\n imports: ['form', 'mixins-form', 'form-recipes'],\n guide: 'form',\n },\n {\n job: 'Edit, create and list screens over Remote',\n imports: ['crud', 'mixins-crud'],\n guide: 'crud',\n },\n {\n job: 'An interactive data grid over rows you own',\n imports: ['data-grid', 'mixins-data-grid'],\n guide: 'data-grid',\n },\n {\n job: 'Drafts, revisions and publishing for content',\n imports: ['cms', 'cms-drizzle'],\n guide: 'cms',\n },\n {\n job: 'Pages as data, and a builder that edits them',\n imports: ['composition', 'builder', 'mixins-builder'],\n guide: 'composition',\n },\n {\n job: 'Rich text: the document, its editor, Markdown and code',\n imports: [\n 'richtext',\n 'richtext-dom',\n 'mixins-richtext',\n 'richtext-markdown',\n 'richtext-code',\n 'richtext-code-shiki',\n ],\n guide: 'richtext',\n },\n { job: 'Server rendering that hands the Model over', imports: ['ssr'], guide: 'ssr' },\n {\n job: 'Responsive images, their variants and placeholders, and icons as data',\n imports: ['media'],\n guide: 'media',\n },\n { job: 'Route topology as data: nodes, typed targets, titles', imports: ['site'], guide: 'site' },\n {\n job: 'What an AI agent may see and do, over MCP, WebMCP, A2A or Agent Native',\n imports: ['agent', 'agent-mcp', 'agent-webmcp', 'agent-a2a', 'agent-native'],\n guide: 'agent',\n },\n {\n job: 'React components in a Foldkit view, or Foldkit inside React',\n imports: ['react', 'react-codegen'],\n guide: 'react',\n },\n]\n\n/**\n * The packages `foldkit-plus` does not install, since each needs a library of\n * its own, and that library at the range the adapter peers on: a manager\n * given a bare name installs the `latest` tag, which for `@yielded/auth` is a\n * beta older than the one `foldkit-auth` names. `test/generated.test.ts`\n * holds this to the manifests.\n */\nexport const adapters: ReadonlyArray<{\n readonly name: string\n readonly libraries: ReadonlyArray<string>\n readonly when: string\n}> = [\n {\n name: 'foldkit-agent-native',\n libraries: ['@agent-native/core@0.214.0'],\n when: 'agents through Agent Native',\n },\n {\n name: 'foldkit-auth',\n libraries: ['@yielded/auth@0.1.0-beta.47'],\n when: 'sign-in and sessions with Yielded Auth',\n },\n {\n name: 'foldkit-cms-drizzle',\n libraries: ['drizzle-orm@1.0.0-rc.5'],\n when: \"the CMS's server on Drizzle\",\n },\n {\n name: 'foldkit-mixins-ui',\n libraries: ['@foldkit/ui@^0.170.0'],\n when: 'styling `@foldkit/ui` components through slots',\n },\n {\n name: 'foldkit-react',\n libraries: ['react@^19.0.0', 'react-dom@^19.0.0'],\n when: 'React interop',\n },\n {\n name: 'foldkit-react-codegen',\n libraries: ['typescript@>=5.7.2 <7'],\n when: 'compiling Foldkit views to React TSX (a dev dependency)',\n },\n {\n name: 'foldkit-remote-drizzle',\n libraries: ['drizzle-orm@1.0.0-rc.5'],\n when: 'answering Remote reads with Drizzle',\n },\n {\n name: 'foldkit-richtext-code-shiki',\n libraries: ['shiki@^4.4.3'],\n when: 'highlighting code blocks with Shiki',\n },\n]\n\n/**\n * The Effect packages an application meets that something names at a version\n * of its own: Foldkit's peers and its Vite plugin's dependencies name one\n * minor (`~4.1.0`), and each `@effect/*` package peers on an `effect` at least\n * its own version. Setup holds all of them at the Effect this release is\n * tested on, as `pnpm-workspace.yaml` does here (`test/generated.test.ts`\n * keeps the two lists together).\n */\nexport const effectPackages: ReadonlyArray<string> = [\n 'effect',\n '@effect/platform-browser',\n '@effect/platform-node',\n '@effect/platform-node-shared',\n '@effect/sql-sqlite-node',\n]\n\nconst releaseOf = (version: string) =>\n /^(\\d+)\\.(\\d+)\\.(\\d+)$/.exec(version)?.slice(1).map(Number) ?? []\n\n/**\n * The Effect release setup pins: the one this release is tested on, or a later\n * patch of the same minor that the project's lockfile already holds. npm keeps\n * a locked package that an override contradicts rather than move it down, so\n * pinning 4.1.0 left the 4.1.1 that `@foldkit/vite-plugin`'s `~4.1.0` had\n * locked under it, which `npm ls` calls invalid.\n */\nexport const effectRelease = (tested: string, locked: ReadonlyArray<string>): string => {\n const [major, minor] = releaseOf(tested)\n return locked.reduce((newest, version) => {\n const [lockedMajor, lockedMinor, patch = -1] = releaseOf(version)\n return lockedMajor === major && lockedMinor === minor && patch > (releaseOf(newest)[2] ?? -1)\n ? version\n : newest\n }, tested)\n}\n\n/** Where the pins go, and the block that holds them. */\ninterface Pins {\n /** The file, as the step names it: `package.json`, `../../pnpm-workspace.yaml`. */\n readonly file: string\n readonly language: 'json' | 'yaml'\n readonly text: string\n}\n\n/** A YAML key, quoted where `@` would start something else. */\nconst yamlKey = (key: string) => (key.startsWith('@') ? `'${key}'` : key)\n\n/**\n * The settings that hold every Effect package at `effect`, to merge into the\n * file the manager reads them from. npm applies an override to a package the\n * project depends on only where the project names that same version, so its\n * block sets those dependencies too (a `$name` reference would follow them,\n * but npm 10 cannot resolve a scoped one); pnpm reads them only at a\n * workspace's root.\n */\nconst pinsOf = (\n manager: Manager,\n effect: string,\n direct: ReadonlySet<string>,\n pnpmSettings: PnpmSettings,\n): Pins => {\n const pins = Object.fromEntries(effectPackages.map(name => [name, effect]))\n const allowedVersions = { effect, '@effect/platform-browser': effect }\n if (manager === 'pnpm' && pnpmSettings.file === 'pnpm-workspace.yaml') {\n const lines = (entries: Readonly<Record<string, string>>, indent: string) =>\n Object.entries(entries).map(([name, version]) => `${indent}${yamlKey(name)}: ${version}`)\n return {\n file: `${pnpmSettings.folder}/pnpm-workspace.yaml`,\n language: 'yaml',\n text: [\n 'overrides:',\n ...lines(pins, ' '),\n 'peerDependencyRules:',\n ' allowedVersions:',\n ...lines(allowedVersions, ' '),\n ].join('\\n'),\n }\n }\n const fields = {\n npm: {\n dependencies: Object.fromEntries(\n effectPackages.filter(name => direct.has(name)).map(name => [name, effect]),\n ),\n overrides: pins,\n },\n pnpm: { pnpm: { overrides: pins, peerDependencyRules: { allowedVersions } } },\n yarn: { resolutions: pins },\n bun: { overrides: pins },\n }[manager]\n return {\n file:\n manager === 'pnpm' && pnpmSettings.folder !== '.'\n ? `${pnpmSettings.folder}/package.json`\n : 'package.json',\n language: 'json',\n text: JSON.stringify(fields, null, 2),\n }\n}\n\n/** Why `manager` needs the pins, after \"first merge this into `package.json`\". */\nconst pinsWhy: Readonly<Record<Manager, string>> = {\n npm: 'npm refuses a peer it does not match, and `overrides` lets one in without turning every peer check off; it overrides a dependency of the project only at the version the project names, so the block sets those too',\n pnpm: \"`overrides` sets the version, and `peerDependencyRules` lets Foldkit's exact peers accept it\",\n yarn: \"`resolutions` sets the version; Yarn warns of Foldkit's exact peers, and installs\",\n bun: \"`overrides` sets the version; Bun warns of Foldkit's exact peers, and installs\",\n}\n\n/**\n * The command that adds `packages` with `manager`, at exactly the versions\n * named when `exact`. A range a shell would read (`^`, `>`, a space) is quoted.\n */\nexport const addCommand = (\n manager: Manager,\n packages: ReadonlyArray<string>,\n exact = false,\n): string =>\n [\n manager,\n manager === 'npm' ? 'install' : 'add',\n ...(exact ? [manager === 'npm' || manager === 'pnpm' ? '--save-exact' : '--exact'] : []),\n ...packages.map(spec => (/^[\\w@/.-]+$/.test(spec) ? spec : `\"${spec}\"`)),\n ].join(' ')\n\n/** The major version a range asks for: `^4.0.0`, `~4.1`, `4.0.0-beta.1` all ask for 4. */\nconst majorOf = (range: string): Option.Option<number> =>\n Option.fromNullishOr(/(\\d+)/.exec(range)?.[1]).pipe(Option.map(Number))\n\n/** What the project has of a library against what this release needs, as a line to act on. */\nconst finding = (project: Project, library: string, wanted: string): string =>\n Option.match(Option.fromNullishOr(project.versions[library]), {\n onNone: () => `- \\`${library}\\` is not installed: step 2 adds \\`${library}@${wanted}\\`.`,\n onSome: range => {\n // Foldkit is 0.x, where a minor version breaks; Effect is past 1.\n const matches =\n library === 'foldkit'\n ? range.replace(/^[\\^~=v]*/, '').startsWith(wanted.split('.').slice(0, 2).join('.'))\n : Option.getOrUndefined(majorOf(range)) === Option.getOrUndefined(majorOf(wanted))\n return matches\n ? `- \\`${library}\\` ${range}: fits.`\n : `- \\`${library}\\` is ${range}, and Foldkit Plus needs ${wanted}: step 2 moves it to ${wanted}. Check the application builds after.`\n },\n })\n\nexport const setupGuide = ({ project, manager, versions }: SetupInput): string => {\n // Every Effect package the project names moves with `effect`, so the pins hold.\n const listed = Option.match(project, {\n onNone: () => [],\n onSome: found => effectPackages.filter(name => found.versions[name] !== undefined),\n })\n const moved = new Set(['effect', '@effect/platform-browser', ...listed])\n const effect = effectRelease(\n versions.effect,\n Option.match(project, { onNone: () => [], onSome: found => found.locked }),\n )\n const pins = pinsOf(\n manager,\n effect,\n moved,\n Option.match(project, {\n onNone: () => ({ folder: '.', file: 'package.json' }),\n onSome: found => found.pnpmSettings,\n }),\n )\n // Foldkit's devtools peer on `@foldkit/ui` at any release, and a manager left\n // to pick one takes the newest, which may peer on a newer Effect (#229).\n const uiPeer = Option.exists(\n project,\n found =>\n found.versions['@foldkit/devtools'] !== undefined &&\n found.versions['@foldkit/ui'] === undefined,\n )\n // npm's block already names the Effect packages the project depends on.\n const install = addCommand(\n manager,\n [\n ...(manager === 'npm'\n ? []\n : effectPackages.filter(name => moved.has(name)).map(name => `${name}@${effect}`)),\n `foldkit@${versions.foldkit}`,\n ...(uiPeer ? [`@foldkit/ui@${versions.foldkit}`] : []),\n 'foldkit-plus',\n ],\n true,\n )\n const check = Option.match(project, {\n onNone: () => [\n 'There is no `package.json` here: this is a new application. Do not scaffold yet. Follow the greenfield guide, which asks the user about the goals, the look and the domain before any code:',\n '',\n `- ${GREENFIELD} (in the skill of step 3, \\`references/greenfield.md\\`)`,\n '',\n `When its first step has a name and a rendering mode, it scaffolds with the command for that mode; \\`--example\\` is for spa alone, and an ssg or ssr scaffold refuses it${manager === 'npm' ? \". An ssg scaffold names `@foldkit/devtools` but not `@foldkit/ui`, its peer, so npm takes the newest `@foldkit/ui`, and refuses the install once that one needs a newer Effect than the scaffold's: `--force` lets it install with a warning, and step 2 replaces that `@foldkit/ui` with the one at the scaffold's Foldkit release (`--legacy-peer-deps` would also drop peers the scaffolder itself needs)\" : ''}:`,\n '',\n '```bash',\n `npx ${SCAFFOLDER} --name <name> --rendering spa --example counter --package-manager ${manager}`,\n `npx ${manager === 'npm' ? '--force ' : ''}${SCAFFOLDER} --name <name> --rendering ssg --package-manager ${manager}`,\n `npx ${SCAFFOLDER} --name <name> --rendering ssr --package-manager ${manager}`,\n '```',\n '',\n 'Then run `npx --legacy-peer-deps foldkit-plus setup` again in the new folder and continue from step 2.',\n ],\n onSome: found => [\n `This is \\`${found.name}\\`, installed with ${manager}.`,\n '',\n finding(found, 'effect', effect),\n finding(found, 'foldkit', versions.foldkit),\n ...(uiPeer\n ? [\n `- \\`@foldkit/devtools\\` peers on \\`@foldkit/ui\\`, which the project does not name: step 2 adds \\`@foldkit/ui@${versions.foldkit}\\`, since a manager left to choose takes the newest, which may need a newer Effect.`,\n ]\n : []),\n // Never overwritten: line endings are the project's to choose once chosen.\n ...(found.gitattributes\n ? ['- `.gitattributes` is there: leave it as it is.']\n : [\n \"- There is no `.gitattributes`. Write one at the repository's root (beside `package.json` if this is not yet a repository), so Git keeps the LF line endings the formatter writes and `git add` on Windows does not warn of every file:\",\n '',\n '```gitattributes',\n '* text=auto eol=lf',\n '*.wasm binary',\n '```',\n ]),\n ],\n })\n return [\n `# Foldkit Plus ${versions.plus}: setup`,\n '',\n 'Instructions for a coding agent, in order. Each step says what to run and why. Tell the user what you did at the end.',\n '',\n '## What these are',\n '',\n '- **Effect** (https://effect.website): TypeScript for typed effects, errors, schemas and streams. Foldkit Plus targets Effect 4.',\n '- **Foldkit** (https://foldkit.dev): an application is one state machine on Effect, a Schema-typed `Model`, a `Message` union and one pure `update`; I/O runs in Commands and Subscriptions.',\n '- **Foldkit Plus**: packages that extend a Foldkit application to agents, servers, other devices, the URL and design systems without a second place to keep state. An agent sends only Messages `update` already handles; server data lives in the Model; replicas replay the same Messages; the URL mirrors a slice of the Model.',\n '',\n '## 1. Check the project',\n '',\n ...check,\n '',\n '## 2. Install',\n '',\n `Foldkit and its tooling take one Effect minor, and Foldkit Plus is tested on ${versions.effect}.${effect === versions.effect ? '' : ` The lockfile already holds ${effect}, a later patch of that minor, and npm keeps a locked package rather than move it down to an override, so the pins name ${effect}.`} To install one copy of each Effect package, at that release, first merge this into \\`${pins.file}\\`, keeping what it holds (${pinsWhy[manager]}${pins.file === 'package.json' ? '' : '; pnpm reads them only at the workspace root'}):`,\n '',\n `\\`\\`\\`${pins.language}`,\n pins.text,\n '```',\n '',\n 'Then install:',\n '',\n '```bash',\n install,\n '```',\n '',\n '`foldkit-plus` brings every package except the adapters below, each of which needs a library of its own. Add one only when the application needs it:',\n '',\n ...adapters.map(\n each => `- ${each.when}: \\`${addCommand(manager, [each.name, ...each.libraries])}\\``,\n ),\n '',\n '## 3. Add the agent skill',\n '',\n '```bash',\n 'npx skills add doeixd/foldkit-plus --skill foldkit-plus',\n '```',\n '',\n 'It teaches you which package owns which kind of state, when to reach for each, and a working example of each. Read its `SKILL.md` before writing code with Foldkit Plus, and the reference for the package at hand before changing it. To look one symbol or topic up in the docs of the versions installed here, run `npx foldkit-plus docs <symbol or words>` (`--list` for what there is).',\n // An empty folder was sent to the guide in step 1.\n ...Option.match(project, {\n onNone: () => [],\n onSome: () => [\n '',\n `Paste the block in its \\`references/agents-md.md\\` (${AGENTS_BLOCK}) under Project Notes in the project's \\`AGENTS.md\\`: the house rules and known traps for an application on these packages.`,\n '',\n `Building a new application rather than extending one? Follow its \\`references/greenfield.md\\` (${GREENFIELD}): goals and the look, then the domain with the user, recorded in the project and mapped to these packages, then a plan for architecture, performance, SEO, testing, CI and deployment, before implementing.`,\n ],\n }),\n '',\n '## 4. Import',\n '',\n 'The namespaces most applications use come from the root:',\n '',\n '```ts',\n \"import { Surface, Projection, Remote, Sync, Mirror, Agent, Style } from 'foldkit-plus'\",\n '```',\n '',\n 'Everything else is a subpath named for its package, for example `foldkit-plus/remote-server` on the server, `foldkit-plus/sync/journal`, `foldkit-plus/mixins/theme`. Pick a package by who owns the data:',\n '',\n '| Job | Import from | Guide |',\n '| --- | --- | --- |',\n ...jobs.map(\n each =>\n `| ${each.job} | ${each.imports.map(name => `\\`foldkit-plus/${name}\\``).join(', ')} | ${SITE}/${each.guide} |`,\n ),\n '',\n '## 5. Rules every package keeps',\n '',\n '- One owner per datum: never keep a fact in the Model and again in a cache, a URL store or a second reducer.',\n '- Behaviour goes through Messages and `update`; agents, replicas and Behaviors never change the Model directly.',\n '- Rendering performs no I/O: fetching, syncing and mirroring run in Commands and Subscriptions.',\n '- Absence is an Effect `Option`, not `null`, except at a JSON, database or DOM boundary.',\n '',\n '## More',\n '',\n `- Guides and API: ${SITE}`,\n `- Demos: ${SITE}/demos`,\n `- Source and changelog: ${REPOSITORY}`,\n '',\n ].join('\\n')\n}\n"],"mappings":";;;;;;;AA4CA,MAAM,OAAO;AACb,MAAM,aAAa;;;;;;;AAQnB,MAAa,aAAa;AAE1B,MAAM,aAAa,GAAG,WAAW;AACjC,MAAM,eAAe,GAAG,WAAW;;AAGnC,MAAa,OAIR;CACH;EACE,KAAK;EACL,SAAS,CAAC,WAAW,UAAU;EAC/B,OAAO;CACT;CACA;EACE,KAAK;EACL,SAAS,CAAC,UAAU,gBAAgB;EACpC,OAAO;CACT;CACA;EACE,KAAK;EACL,SAAS;GAAC;GAAU;GAAkB;EAAW;EACjD,OAAO;CACT;CACA;EACE,KAAK;EACL,SAAS,CAAC,YAAY;EACtB,OAAO;CACT;CACA;EACE,KAAK;EACL,SAAS,CAAC,QAAQ;EAClB,OAAO;CACT;CACA;EACE,KAAK;EACL,SAAS;GAAC;GAAU;GAAiB;EAAgB;EACrD,OAAO;CACT;CACA;EACE,KAAK;EACL,SAAS,CAAC,QAAQ,SAAS;EAC3B,OAAO;CACT;CACA;EAAE,KAAK;EAA2C,SAAS,CAAC,OAAO;EAAG,OAAO;CAAQ;CACrF;EACE,KAAK;EACL,SAAS,CAAC,MAAM;EAChB,OAA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|
|
1
|
+
{"version":3,"file":"setup.mjs","names":[],"sources":["../src/setup.ts"],"sourcesContent":["/**\n * What `npx foldkit-plus setup` prints: instructions a coding agent can follow\n * in order, for the project it is run in. Pure: the CLI reads the project and\n * this package's manifest and passes them in, so a test can give any project.\n */\nimport { Option } from 'effect'\n\nexport type Manager = 'pnpm' | 'npm' | 'yarn' | 'bun'\n\n/** What the project's `package.json` says about the libraries Foldkit Plus needs. */\nexport interface Project {\n readonly name: string\n /** Each named library's version range, from any dependency field. */\n readonly versions: Readonly<Record<string, string>>\n /** Whether a `.gitattributes` applies here: in the project's folder or one above it in its repository. */\n readonly gitattributes: boolean\n /** Where pnpm reads this project's settings, which a workspace keeps at its root. */\n readonly pnpmSettings: PnpmSettings\n /** The versions of Effect's packages (`effectPackages`) its npm lockfile holds, nested copies included. */\n readonly locked: ReadonlyArray<string>\n}\n\n/** A file pnpm reads settings from, in `folder` relative to the project (`.`, `../..`). */\nexport interface PnpmSettings {\n readonly folder: string\n readonly file: 'package.json' | 'pnpm-workspace.yaml'\n}\n\n/**\n * The versions this release is built and tested against, from its own\n * manifest: the workspace's Foldkit and Effect.\n */\nexport interface Versions {\n readonly plus: string\n readonly effect: string\n readonly foldkit: string\n}\n\nexport interface SetupInput {\n readonly project: Option.Option<Project>\n readonly manager: Manager\n readonly versions: Versions\n}\n\nconst SITE = 'https://foldkit-plus.pages.dev'\nconst REPOSITORY = 'https://github.com/doeixd/foldkit-plus'\n\n/**\n * The `create-foldkit-app` release whose templates pin the Foldkit this\n * release needs (0.41.0 installs `foldkit`, `@foldkit/ui` and `@foldkit/devtools`\n * 0.170.0, `@foldkit/vite-plugin` 0.29.0 and `effect` 4.1.0). A release that\n * moves the `foldkit` peer moves this with it.\n */\nexport const SCAFFOLDER = 'create-foldkit-app@0.41.0'\n\nconst GREENFIELD = `${REPOSITORY}/blob/main/skills/foldkit-plus/references/greenfield.md`\nconst AGENTS_BLOCK = `${REPOSITORY}/blob/main/skills/foldkit-plus/references/agents-md.md`\n\n/** What each job needs, where to import it from, and where it is explained. */\nexport const jobs: ReadonlyArray<{\n readonly job: string\n readonly imports: ReadonlyArray<string>\n readonly guide: string\n}> = [\n {\n job: 'Name what a feature may read and which Messages it may send',\n imports: ['surface', 'metadata'],\n guide: 'surface',\n },\n {\n job: 'A reusable Submodel placed several times, every part wired',\n imports: ['bundle', 'bundle-surface'],\n guide: 'bundle',\n },\n {\n job: 'Restyle or extend views from outside, through typed slots',\n imports: ['mixins', 'mixins-surface', 'mixins-ui'],\n guide: 'mixins',\n },\n {\n job: 'Media queries, timers, sockets, clipboard, undo history',\n imports: ['primitives'],\n guide: 'primitives',\n },\n {\n job: 'Declare the domain once: entities, relations, queries',\n imports: ['entity'],\n guide: 'entity',\n },\n {\n job: 'Server-owned data in the Model: queries, mutations, live updates',\n imports: ['remote', 'remote-server', 'remote-drizzle'],\n guide: 'remote',\n },\n {\n job: 'Edits that survive offline and converge across devices',\n imports: ['sync', 'durable'],\n guide: 'sync',\n },\n { job: 'Who may do what, enforced on every seam', imports: ['guard'], guide: 'guard' },\n {\n job: 'Who is signed in: a Yielded Auth session as the principal',\n imports: ['auth'],\n guide: 'auth',\n },\n {\n job: 'A slice of the Model kept in the URL or in storage',\n imports: ['mirror'],\n guide: 'mirror',\n },\n {\n job: 'Forms: drafts, validation, a decoded value, and dates, times and addresses in them',\n imports: ['form', 'mixins-form', 'form-recipes'],\n guide: 'form',\n },\n {\n job: 'Edit, create and list screens over Remote',\n imports: ['crud', 'mixins-crud'],\n guide: 'crud',\n },\n {\n job: 'An interactive data grid over rows you own',\n imports: ['data-grid', 'mixins-data-grid'],\n guide: 'data-grid',\n },\n {\n job: 'Drafts, revisions and publishing for content',\n imports: ['cms', 'cms-drizzle'],\n guide: 'cms',\n },\n {\n job: 'Pages as data, and a builder that edits them',\n imports: ['composition', 'builder', 'mixins-builder'],\n guide: 'composition',\n },\n {\n job: 'Rich text: the document, its editor, Markdown and code',\n imports: [\n 'richtext',\n 'richtext-dom',\n 'mixins-richtext',\n 'richtext-markdown',\n 'richtext-code',\n 'richtext-code-shiki',\n ],\n guide: 'richtext',\n },\n {\n job: 'Server rendering that hands the Model over, and the server handler around it',\n imports: ['ssr', 'host'],\n guide: 'ssr',\n },\n {\n job: 'Responsive images, their variants and placeholders, and icons as data',\n imports: ['media'],\n guide: 'media',\n },\n { job: 'Route topology as data: nodes, typed targets, titles', imports: ['site'], guide: 'site' },\n {\n job: 'What an AI agent may see and do, over MCP, WebMCP, A2A or Agent Native',\n imports: ['agent', 'agent-mcp', 'agent-webmcp', 'agent-a2a', 'agent-native'],\n guide: 'agent',\n },\n {\n job: 'React components in a Foldkit view, or Foldkit inside React',\n imports: ['react', 'react-codegen'],\n guide: 'react',\n },\n]\n\n/**\n * The packages `foldkit-plus` does not install, since each needs a library of\n * its own, and that library at the range the adapter peers on: a manager\n * given a bare name installs the `latest` tag, which for `@yielded/auth` is a\n * beta older than the one `foldkit-auth` names. `test/generated.test.ts`\n * holds this to the manifests.\n */\nexport const adapters: ReadonlyArray<{\n readonly name: string\n readonly libraries: ReadonlyArray<string>\n readonly when: string\n}> = [\n {\n name: 'foldkit-agent-native',\n libraries: ['@agent-native/core@0.214.0'],\n when: 'agents through Agent Native',\n },\n {\n name: 'foldkit-auth',\n libraries: ['@yielded/auth@0.1.0-beta.47'],\n when: 'sign-in and sessions with Yielded Auth',\n },\n {\n name: 'foldkit-cms-drizzle',\n libraries: ['drizzle-orm@1.0.0-rc.5'],\n when: \"the CMS's server on Drizzle\",\n },\n {\n name: 'foldkit-mixins-ui',\n libraries: ['@foldkit/ui@^0.170.0'],\n when: 'styling `@foldkit/ui` components through slots',\n },\n {\n name: 'foldkit-react',\n libraries: ['react@^19.0.0', 'react-dom@^19.0.0'],\n when: 'React interop',\n },\n {\n name: 'foldkit-react-codegen',\n libraries: ['typescript@>=5.7.2 <7'],\n when: 'compiling Foldkit views to React TSX (a dev dependency)',\n },\n {\n name: 'foldkit-remote-drizzle',\n libraries: ['drizzle-orm@1.0.0-rc.5'],\n when: 'answering Remote reads with Drizzle',\n },\n {\n name: 'foldkit-richtext-code-shiki',\n libraries: ['shiki@^4.4.3'],\n when: 'highlighting code blocks with Shiki',\n },\n]\n\n/**\n * The Effect packages an application meets that something names at a version\n * of its own: Foldkit's peers and its Vite plugin's dependencies name one\n * minor (`~4.1.0`), and each `@effect/*` package peers on an `effect` at least\n * its own version. Setup holds all of them at the Effect this release is\n * tested on, as `pnpm-workspace.yaml` does here (`test/generated.test.ts`\n * keeps the two lists together).\n */\nexport const effectPackages: ReadonlyArray<string> = [\n 'effect',\n '@effect/platform-browser',\n '@effect/platform-node',\n '@effect/platform-node-shared',\n '@effect/sql-sqlite-node',\n]\n\nconst releaseOf = (version: string) =>\n /^(\\d+)\\.(\\d+)\\.(\\d+)$/.exec(version)?.slice(1).map(Number) ?? []\n\n/**\n * The Effect release setup pins: the one this release is tested on, or a later\n * patch of the same minor that the project's lockfile already holds. npm keeps\n * a locked package that an override contradicts rather than move it down, so\n * pinning 4.1.0 left the 4.1.1 that `@foldkit/vite-plugin`'s `~4.1.0` had\n * locked under it, which `npm ls` calls invalid.\n */\nexport const effectRelease = (tested: string, locked: ReadonlyArray<string>): string => {\n const [major, minor] = releaseOf(tested)\n return locked.reduce((newest, version) => {\n const [lockedMajor, lockedMinor, patch = -1] = releaseOf(version)\n return lockedMajor === major && lockedMinor === minor && patch > (releaseOf(newest)[2] ?? -1)\n ? version\n : newest\n }, tested)\n}\n\n/** Where the pins go, and the block that holds them. */\ninterface Pins {\n /** The file, as the step names it: `package.json`, `../../pnpm-workspace.yaml`. */\n readonly file: string\n readonly language: 'json' | 'yaml'\n readonly text: string\n}\n\n/** A YAML key, quoted where `@` would start something else. */\nconst yamlKey = (key: string) => (key.startsWith('@') ? `'${key}'` : key)\n\n/**\n * The settings that hold every Effect package at `effect`, to merge into the\n * file the manager reads them from. npm applies an override to a package the\n * project depends on only where the project names that same version, so its\n * block sets those dependencies too (a `$name` reference would follow them,\n * but npm 10 cannot resolve a scoped one); pnpm reads them only at a\n * workspace's root.\n */\nconst pinsOf = (\n manager: Manager,\n effect: string,\n direct: ReadonlySet<string>,\n pnpmSettings: PnpmSettings,\n): Pins => {\n const pins = Object.fromEntries(effectPackages.map(name => [name, effect]))\n const allowedVersions = { effect, '@effect/platform-browser': effect }\n if (manager === 'pnpm' && pnpmSettings.file === 'pnpm-workspace.yaml') {\n const lines = (entries: Readonly<Record<string, string>>, indent: string) =>\n Object.entries(entries).map(([name, version]) => `${indent}${yamlKey(name)}: ${version}`)\n return {\n file: `${pnpmSettings.folder}/pnpm-workspace.yaml`,\n language: 'yaml',\n text: [\n 'overrides:',\n ...lines(pins, ' '),\n 'peerDependencyRules:',\n ' allowedVersions:',\n ...lines(allowedVersions, ' '),\n ].join('\\n'),\n }\n }\n const fields = {\n npm: {\n dependencies: Object.fromEntries(\n effectPackages.filter(name => direct.has(name)).map(name => [name, effect]),\n ),\n overrides: pins,\n },\n pnpm: { pnpm: { overrides: pins, peerDependencyRules: { allowedVersions } } },\n yarn: { resolutions: pins },\n bun: { overrides: pins },\n }[manager]\n return {\n file:\n manager === 'pnpm' && pnpmSettings.folder !== '.'\n ? `${pnpmSettings.folder}/package.json`\n : 'package.json',\n language: 'json',\n text: JSON.stringify(fields, null, 2),\n }\n}\n\n/** Why `manager` needs the pins, after \"first merge this into `package.json`\". */\nconst pinsWhy: Readonly<Record<Manager, string>> = {\n npm: 'npm refuses a peer it does not match, and `overrides` lets one in without turning every peer check off; it overrides a dependency of the project only at the version the project names, so the block sets those too',\n pnpm: \"`overrides` sets the version, and `peerDependencyRules` lets Foldkit's exact peers accept it\",\n yarn: \"`resolutions` sets the version; Yarn warns of Foldkit's exact peers, and installs\",\n bun: \"`overrides` sets the version; Bun warns of Foldkit's exact peers, and installs\",\n}\n\n/**\n * The command that adds `packages` with `manager`, at exactly the versions\n * named when `exact`. A range a shell would read (`^`, `>`, a space) is quoted.\n */\nexport const addCommand = (\n manager: Manager,\n packages: ReadonlyArray<string>,\n exact = false,\n): string =>\n [\n manager,\n manager === 'npm' ? 'install' : 'add',\n ...(exact ? [manager === 'npm' || manager === 'pnpm' ? '--save-exact' : '--exact'] : []),\n ...packages.map(spec => (/^[\\w@/.-]+$/.test(spec) ? spec : `\"${spec}\"`)),\n ].join(' ')\n\n/** The major version a range asks for: `^4.0.0`, `~4.1`, `4.0.0-beta.1` all ask for 4. */\nconst majorOf = (range: string): Option.Option<number> =>\n Option.fromNullishOr(/(\\d+)/.exec(range)?.[1]).pipe(Option.map(Number))\n\n/** What the project has of a library against what this release needs, as a line to act on. */\nconst finding = (project: Project, library: string, wanted: string): string =>\n Option.match(Option.fromNullishOr(project.versions[library]), {\n onNone: () => `- \\`${library}\\` is not installed: step 2 adds \\`${library}@${wanted}\\`.`,\n onSome: range => {\n // Foldkit is 0.x, where a minor version breaks; Effect is past 1.\n const matches =\n library === 'foldkit'\n ? range.replace(/^[\\^~=v]*/, '').startsWith(wanted.split('.').slice(0, 2).join('.'))\n : Option.getOrUndefined(majorOf(range)) === Option.getOrUndefined(majorOf(wanted))\n return matches\n ? `- \\`${library}\\` ${range}: fits.`\n : `- \\`${library}\\` is ${range}, and Foldkit Plus needs ${wanted}: step 2 moves it to ${wanted}. Check the application builds after.`\n },\n })\n\nexport const setupGuide = ({ project, manager, versions }: SetupInput): string => {\n // Every Effect package the project names moves with `effect`, so the pins hold.\n const listed = Option.match(project, {\n onNone: () => [],\n onSome: found => effectPackages.filter(name => found.versions[name] !== undefined),\n })\n const moved = new Set(['effect', '@effect/platform-browser', ...listed])\n const effect = effectRelease(\n versions.effect,\n Option.match(project, { onNone: () => [], onSome: found => found.locked }),\n )\n const pins = pinsOf(\n manager,\n effect,\n moved,\n Option.match(project, {\n onNone: () => ({ folder: '.', file: 'package.json' }),\n onSome: found => found.pnpmSettings,\n }),\n )\n // Foldkit's devtools peer on `@foldkit/ui` at any release, and a manager left\n // to pick one takes the newest, which may peer on a newer Effect (#229).\n const uiPeer = Option.exists(\n project,\n found =>\n found.versions['@foldkit/devtools'] !== undefined &&\n found.versions['@foldkit/ui'] === undefined,\n )\n // npm's block already names the Effect packages the project depends on.\n const install = addCommand(\n manager,\n [\n ...(manager === 'npm'\n ? []\n : effectPackages.filter(name => moved.has(name)).map(name => `${name}@${effect}`)),\n `foldkit@${versions.foldkit}`,\n ...(uiPeer ? [`@foldkit/ui@${versions.foldkit}`] : []),\n 'foldkit-plus',\n ],\n true,\n )\n const check = Option.match(project, {\n onNone: () => [\n 'There is no `package.json` here: this is a new application. Do not scaffold yet. Follow the greenfield guide, which asks the user about the goals, the look and the domain before any code:',\n '',\n `- ${GREENFIELD} (in the skill of step 3, \\`references/greenfield.md\\`)`,\n '',\n `When its first step has a name and a rendering mode, it scaffolds with the command for that mode; \\`--example\\` is for spa alone, and an ssg or ssr scaffold refuses it${manager === 'npm' ? \". An ssg scaffold names `@foldkit/devtools` but not `@foldkit/ui`, its peer, so npm takes the newest `@foldkit/ui`, and refuses the install once that one needs a newer Effect than the scaffold's: `--force` lets it install with a warning, and step 2 replaces that `@foldkit/ui` with the one at the scaffold's Foldkit release (`--legacy-peer-deps` would also drop peers the scaffolder itself needs)\" : ''}:`,\n '',\n '```bash',\n `npx ${SCAFFOLDER} --name <name> --rendering spa --example counter --package-manager ${manager}`,\n `npx ${manager === 'npm' ? '--force ' : ''}${SCAFFOLDER} --name <name> --rendering ssg --package-manager ${manager}`,\n `npx ${SCAFFOLDER} --name <name> --rendering ssr --package-manager ${manager}`,\n '```',\n '',\n 'Then run `npx --legacy-peer-deps foldkit-plus setup` again in the new folder and continue from step 2.',\n ],\n onSome: found => [\n `This is \\`${found.name}\\`, installed with ${manager}.`,\n '',\n finding(found, 'effect', effect),\n finding(found, 'foldkit', versions.foldkit),\n ...(uiPeer\n ? [\n `- \\`@foldkit/devtools\\` peers on \\`@foldkit/ui\\`, which the project does not name: step 2 adds \\`@foldkit/ui@${versions.foldkit}\\`, since a manager left to choose takes the newest, which may need a newer Effect.`,\n ]\n : []),\n // Never overwritten: line endings are the project's to choose once chosen.\n ...(found.gitattributes\n ? ['- `.gitattributes` is there: leave it as it is.']\n : [\n \"- There is no `.gitattributes`. Write one at the repository's root (beside `package.json` if this is not yet a repository), so Git keeps the LF line endings the formatter writes and `git add` on Windows does not warn of every file:\",\n '',\n '```gitattributes',\n '* text=auto eol=lf',\n '*.wasm binary',\n '```',\n ]),\n ],\n })\n return [\n `# Foldkit Plus ${versions.plus}: setup`,\n '',\n 'Instructions for a coding agent, in order. Each step says what to run and why. Tell the user what you did at the end.',\n '',\n '## What these are',\n '',\n '- **Effect** (https://effect.website): TypeScript for typed effects, errors, schemas and streams. Foldkit Plus targets Effect 4.',\n '- **Foldkit** (https://foldkit.dev): an application is one state machine on Effect, a Schema-typed `Model`, a `Message` union and one pure `update`; I/O runs in Commands and Subscriptions.',\n '- **Foldkit Plus**: packages that extend a Foldkit application to agents, servers, other devices, the URL and design systems without a second place to keep state. An agent sends only Messages `update` already handles; server data lives in the Model; replicas replay the same Messages; the URL mirrors a slice of the Model.',\n '',\n '## 1. Check the project',\n '',\n ...check,\n '',\n '## 2. Install',\n '',\n `Foldkit and its tooling take one Effect minor, and Foldkit Plus is tested on ${versions.effect}.${effect === versions.effect ? '' : ` The lockfile already holds ${effect}, a later patch of that minor, and npm keeps a locked package rather than move it down to an override, so the pins name ${effect}.`} To install one copy of each Effect package, at that release, first merge this into \\`${pins.file}\\`, keeping what it holds (${pinsWhy[manager]}${pins.file === 'package.json' ? '' : '; pnpm reads them only at the workspace root'}):`,\n '',\n `\\`\\`\\`${pins.language}`,\n pins.text,\n '```',\n '',\n 'Then install:',\n '',\n '```bash',\n install,\n '```',\n '',\n '`foldkit-plus` brings every package except the adapters below, each of which needs a library of its own. Add one only when the application needs it:',\n '',\n ...adapters.map(\n each => `- ${each.when}: \\`${addCommand(manager, [each.name, ...each.libraries])}\\``,\n ),\n '',\n '## 3. Add the agent skill',\n '',\n '```bash',\n 'npx skills add doeixd/foldkit-plus --skill foldkit-plus',\n '```',\n '',\n 'It teaches you which package owns which kind of state, when to reach for each, and a working example of each. Read its `SKILL.md` before writing code with Foldkit Plus, and the reference for the package at hand before changing it. To look one symbol or topic up in the docs of the versions installed here, run `npx foldkit-plus docs <symbol or words>` (`--list` for what there is).',\n // An empty folder was sent to the guide in step 1.\n ...Option.match(project, {\n onNone: () => [],\n onSome: () => [\n '',\n `Paste the block in its \\`references/agents-md.md\\` (${AGENTS_BLOCK}) under Project Notes in the project's \\`AGENTS.md\\`: the house rules and known traps for an application on these packages.`,\n '',\n `Building a new application rather than extending one? Follow its \\`references/greenfield.md\\` (${GREENFIELD}): goals and the look, then the domain with the user, recorded in the project and mapped to these packages, then a plan for architecture, performance, SEO, testing, CI and deployment, before implementing.`,\n ],\n }),\n '',\n '## 4. Import',\n '',\n 'The namespaces most applications use come from the root:',\n '',\n '```ts',\n \"import { Surface, Projection, Remote, Sync, Mirror, Agent, Style } from 'foldkit-plus'\",\n '```',\n '',\n 'Everything else is a subpath named for its package, for example `foldkit-plus/remote-server` on the server, `foldkit-plus/sync/journal`, `foldkit-plus/mixins/theme`. Pick a package by who owns the data:',\n '',\n '| Job | Import from | Guide |',\n '| --- | --- | --- |',\n ...jobs.map(\n each =>\n `| ${each.job} | ${each.imports.map(name => `\\`foldkit-plus/${name}\\``).join(', ')} | ${SITE}/${each.guide} |`,\n ),\n '',\n '## 5. Rules every package keeps',\n '',\n '- One owner per datum: never keep a fact in the Model and again in a cache, a URL store or a second reducer.',\n '- Behaviour goes through Messages and `update`; agents, replicas and Behaviors never change the Model directly.',\n '- Rendering performs no I/O: fetching, syncing and mirroring run in Commands and Subscriptions.',\n '- Absence is an Effect `Option`, not `null`, except at a JSON, database or DOM boundary.',\n '',\n '## More',\n '',\n `- Guides and API: ${SITE}`,\n `- Demos: ${SITE}/demos`,\n `- Source and changelog: ${REPOSITORY}`,\n '',\n ].join('\\n')\n}\n"],"mappings":";;;;;;;AA4CA,MAAM,OAAO;AACb,MAAM,aAAa;;;;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;EACA;EACA,GAAG,SAAS,KACV,SAAQ,KAAK,KAAK,KAAK,MAAM,WAAW,SAAS,CAAC,KAAK,MAAM,GAAG,KAAK,SAAS,CAAC,EAAE,GACnF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG,OAAO,MAAM,SAAS;GACvB,cAAc,CAAC;GACf,cAAc;IACZ;IACA,uDAAuD,aAAa;IACpE;IACA,kGAAkG,WAAW;GAC/G;EACF,CAAC;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAG,KAAK,KACN,SACE,KAAK,KAAK,IAAI,KAAK,KAAK,QAAQ,KAAI,SAAQ,kBAAkB,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,KAAK,KAAK,GAAG,KAAK,MAAM,GAC/G;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB;EACrB,YAAY,KAAK;EACjB,2BAA2B;EAC3B;CACF,CAAC,CAAC,KAAK,IAAI;AACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-ssr/loader";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foldkit-plus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Every Foldkit Plus package in one install, `npx foldkit-plus setup`, which tells a coding agent how to start, and `npx foldkit-plus docs`, which answers from the installed docs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"foldkit",
|
|
@@ -173,6 +173,11 @@
|
|
|
173
173
|
"types": "./dist/form.d.mts",
|
|
174
174
|
"import": "./dist/form.mjs"
|
|
175
175
|
},
|
|
176
|
+
"./form-recipes/file": {
|
|
177
|
+
"foldkit-plus:source": "./src/form-recipes/file.ts",
|
|
178
|
+
"types": "./dist/form-recipes/file.d.mts",
|
|
179
|
+
"import": "./dist/form-recipes/file.mjs"
|
|
180
|
+
},
|
|
176
181
|
"./form-recipes/html": {
|
|
177
182
|
"foldkit-plus:source": "./src/form-recipes/html.ts",
|
|
178
183
|
"types": "./dist/form-recipes/html.d.mts",
|
|
@@ -223,6 +228,11 @@
|
|
|
223
228
|
"types": "./dist/guard/media.d.mts",
|
|
224
229
|
"import": "./dist/guard/media.mjs"
|
|
225
230
|
},
|
|
231
|
+
"./host": {
|
|
232
|
+
"foldkit-plus:source": "./src/host.ts",
|
|
233
|
+
"types": "./dist/host.d.mts",
|
|
234
|
+
"import": "./dist/host.mjs"
|
|
235
|
+
},
|
|
226
236
|
"./media": {
|
|
227
237
|
"foldkit-plus:source": "./src/media.ts",
|
|
228
238
|
"types": "./dist/media.d.mts",
|
|
@@ -493,6 +503,11 @@
|
|
|
493
503
|
"types": "./dist/remote-drizzle.d.mts",
|
|
494
504
|
"import": "./dist/remote-drizzle.mjs"
|
|
495
505
|
},
|
|
506
|
+
"./remote-drizzle/pg": {
|
|
507
|
+
"foldkit-plus:source": "./src/remote-drizzle/pg.ts",
|
|
508
|
+
"types": "./dist/remote-drizzle/pg.d.mts",
|
|
509
|
+
"import": "./dist/remote-drizzle/pg.mjs"
|
|
510
|
+
},
|
|
496
511
|
"./remote-server": {
|
|
497
512
|
"foldkit-plus:source": "./src/remote-server.ts",
|
|
498
513
|
"types": "./dist/remote-server.d.mts",
|
|
@@ -588,6 +603,11 @@
|
|
|
588
603
|
"types": "./dist/ssr/client.d.mts",
|
|
589
604
|
"import": "./dist/ssr/client.mjs"
|
|
590
605
|
},
|
|
606
|
+
"./ssr/loader": {
|
|
607
|
+
"foldkit-plus:source": "./src/ssr/loader.ts",
|
|
608
|
+
"types": "./dist/ssr/loader.d.mts",
|
|
609
|
+
"import": "./dist/ssr/loader.mjs"
|
|
610
|
+
},
|
|
591
611
|
"./ssr/vite": {
|
|
592
612
|
"foldkit-plus:source": "./src/ssr/vite.ts",
|
|
593
613
|
"types": "./dist/ssr/vite.d.mts",
|
|
@@ -630,43 +650,44 @@
|
|
|
630
650
|
"LICENSE"
|
|
631
651
|
],
|
|
632
652
|
"dependencies": {
|
|
633
|
-
"foldkit-agent": "0.
|
|
634
|
-
"foldkit-agent-
|
|
635
|
-
"foldkit-
|
|
636
|
-
"foldkit-
|
|
637
|
-
"foldkit-
|
|
638
|
-
"foldkit-bundle
|
|
639
|
-
"foldkit-
|
|
640
|
-
"foldkit-
|
|
641
|
-
"foldkit-composition": "0.
|
|
642
|
-
"foldkit-
|
|
643
|
-
"foldkit-
|
|
644
|
-
"foldkit-
|
|
645
|
-
"foldkit-entity": "0.
|
|
646
|
-
"foldkit-
|
|
647
|
-
"foldkit-
|
|
648
|
-
"foldkit-
|
|
649
|
-
"foldkit-
|
|
650
|
-
"foldkit-mirror": "0.
|
|
651
|
-
"foldkit-mixins
|
|
652
|
-
"foldkit-
|
|
653
|
-
"foldkit-mixins-crud": "0.12.0",
|
|
654
|
-
"foldkit-mixins-form": "0.13.0",
|
|
653
|
+
"foldkit-agent": "0.12.0",
|
|
654
|
+
"foldkit-agent-mcp": "0.11.0",
|
|
655
|
+
"foldkit-agent-a2a": "0.10.0",
|
|
656
|
+
"foldkit-builder": "0.7.0",
|
|
657
|
+
"foldkit-bundle-surface": "0.8.0",
|
|
658
|
+
"foldkit-bundle": "0.12.0",
|
|
659
|
+
"foldkit-cms": "0.12.0",
|
|
660
|
+
"foldkit-crud": "0.15.0",
|
|
661
|
+
"foldkit-composition": "0.7.0",
|
|
662
|
+
"foldkit-data-grid": "0.7.0",
|
|
663
|
+
"foldkit-form": "0.12.0",
|
|
664
|
+
"foldkit-form-recipes": "0.5.0",
|
|
665
|
+
"foldkit-entity": "0.17.0",
|
|
666
|
+
"foldkit-guard": "0.10.0",
|
|
667
|
+
"foldkit-media": "0.7.0",
|
|
668
|
+
"foldkit-host": "0.1.0",
|
|
669
|
+
"foldkit-durable": "0.13.0",
|
|
670
|
+
"foldkit-mirror": "0.10.0",
|
|
671
|
+
"foldkit-mixins": "0.24.0",
|
|
672
|
+
"foldkit-agent-webmcp": "0.11.0",
|
|
655
673
|
"foldkit-metadata": "0.1.0",
|
|
656
|
-
"foldkit-mixins": "0.
|
|
657
|
-
"foldkit-mixins-
|
|
658
|
-
"foldkit-mixins-
|
|
659
|
-
"foldkit-
|
|
660
|
-
"foldkit-
|
|
661
|
-
"foldkit-
|
|
662
|
-
"foldkit-
|
|
663
|
-
"foldkit-
|
|
664
|
-
"foldkit-
|
|
665
|
-
"foldkit-richtext-
|
|
666
|
-
"foldkit-
|
|
667
|
-
"foldkit-
|
|
668
|
-
"foldkit-
|
|
669
|
-
"foldkit-
|
|
674
|
+
"foldkit-mixins-data-grid": "0.6.0",
|
|
675
|
+
"foldkit-mixins-crud": "0.13.0",
|
|
676
|
+
"foldkit-mixins-builder": "0.7.0",
|
|
677
|
+
"foldkit-mixins-form": "0.14.0",
|
|
678
|
+
"foldkit-mixins-richtext": "0.9.0",
|
|
679
|
+
"foldkit-mixins-surface": "0.10.0",
|
|
680
|
+
"foldkit-primitives": "0.19.0",
|
|
681
|
+
"foldkit-remote-server": "0.22.0",
|
|
682
|
+
"foldkit-remote": "0.25.0",
|
|
683
|
+
"foldkit-richtext-code": "0.6.0",
|
|
684
|
+
"foldkit-richtext-dom": "0.10.0",
|
|
685
|
+
"foldkit-richtext-markdown": "0.7.0",
|
|
686
|
+
"foldkit-site": "0.8.0",
|
|
687
|
+
"foldkit-ssr": "0.12.0",
|
|
688
|
+
"foldkit-richtext": "0.9.0",
|
|
689
|
+
"foldkit-sync": "0.16.0",
|
|
690
|
+
"foldkit-surface": "0.14.0"
|
|
670
691
|
},
|
|
671
692
|
"peerDependencies": {
|
|
672
693
|
"effect": "^4.1.0",
|
|
@@ -675,14 +696,14 @@
|
|
|
675
696
|
"esbuild": "^0.28.0",
|
|
676
697
|
"playwright": "^1.64.0",
|
|
677
698
|
"wrangler": "^4.116.0",
|
|
678
|
-
"foldkit-
|
|
679
|
-
"foldkit-cms-drizzle": "^0.
|
|
680
|
-
"foldkit-
|
|
681
|
-
"foldkit-
|
|
682
|
-
"foldkit-mixins-ui": "^0.24.0",
|
|
683
|
-
"foldkit-remote-drizzle": "^0.18.0",
|
|
699
|
+
"foldkit-agent-native": "^0.10.0",
|
|
700
|
+
"foldkit-cms-drizzle": "^0.10.0",
|
|
701
|
+
"foldkit-mixins-ui": "^0.25.0",
|
|
702
|
+
"foldkit-richtext-code-shiki": "^0.6.0",
|
|
684
703
|
"foldkit-react-codegen": "^0.3.0",
|
|
685
|
-
"foldkit-
|
|
704
|
+
"foldkit-react": "^0.8.0",
|
|
705
|
+
"foldkit-auth": "^0.5.0",
|
|
706
|
+
"foldkit-remote-drizzle": "^0.19.0"
|
|
686
707
|
},
|
|
687
708
|
"peerDependenciesMeta": {
|
|
688
709
|
"foldkit-agent-native": {
|
|
@@ -734,14 +755,14 @@
|
|
|
734
755
|
"typescript": "7.0.2",
|
|
735
756
|
"vite": "8.3.5",
|
|
736
757
|
"wrangler": "4.116.0",
|
|
737
|
-
"foldkit-agent-native": "0.
|
|
738
|
-
"foldkit-auth": "0.
|
|
739
|
-
"foldkit-cms-drizzle": "0.
|
|
740
|
-
"foldkit-
|
|
741
|
-
"foldkit-react": "0.
|
|
742
|
-
"foldkit-
|
|
743
|
-
"foldkit-richtext-code-shiki": "0.
|
|
744
|
-
"foldkit-
|
|
758
|
+
"foldkit-agent-native": "0.10.0",
|
|
759
|
+
"foldkit-auth": "0.5.0",
|
|
760
|
+
"foldkit-cms-drizzle": "0.10.0",
|
|
761
|
+
"foldkit-mixins-ui": "0.25.0",
|
|
762
|
+
"foldkit-react": "0.8.0",
|
|
763
|
+
"foldkit-remote-drizzle": "0.19.0",
|
|
764
|
+
"foldkit-richtext-code-shiki": "0.6.0",
|
|
765
|
+
"foldkit-react-codegen": "0.3.0"
|
|
745
766
|
},
|
|
746
767
|
"setup": {
|
|
747
768
|
"foldkit": "0.170.0",
|