foldkit-plus 0.0.0-stage → 0.2.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 +89 -2
- package/dist/agent-a2a.d.mts +1 -0
- package/dist/agent-a2a.mjs +2 -0
- package/dist/agent-mcp.d.mts +1 -0
- package/dist/agent-mcp.mjs +2 -0
- package/dist/agent-native.d.mts +1 -0
- package/dist/agent-native.mjs +2 -0
- package/dist/agent-webmcp.d.mts +1 -0
- package/dist/agent-webmcp.mjs +2 -0
- package/dist/agent.d.mts +1 -0
- package/dist/agent.mjs +2 -0
- package/dist/builder.d.mts +1 -0
- package/dist/builder.mjs +2 -0
- package/dist/bundle-surface.d.mts +1 -0
- package/dist/bundle-surface.mjs +2 -0
- package/dist/bundle.d.mts +1 -0
- package/dist/bundle.mjs +2 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +91 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/cms-drizzle.d.mts +1 -0
- package/dist/cms-drizzle.mjs +2 -0
- package/dist/cms.d.mts +1 -0
- package/dist/cms.mjs +2 -0
- package/dist/composition/appearance.d.mts +1 -0
- package/dist/composition/appearance.mjs +2 -0
- package/dist/composition/foldkit.d.mts +1 -0
- package/dist/composition/foldkit.mjs +2 -0
- package/dist/composition/remote.d.mts +1 -0
- package/dist/composition/remote.mjs +2 -0
- package/dist/composition/richtext.d.mts +1 -0
- package/dist/composition/richtext.mjs +2 -0
- package/dist/composition/surface.d.mts +1 -0
- package/dist/composition/surface.mjs +2 -0
- package/dist/composition.d.mts +1 -0
- package/dist/composition.mjs +2 -0
- package/dist/crud.d.mts +1 -0
- package/dist/crud.mjs +2 -0
- package/dist/data-grid/crud.d.mts +1 -0
- package/dist/data-grid/crud.mjs +2 -0
- package/dist/data-grid.d.mts +1 -0
- package/dist/data-grid.mjs +2 -0
- package/dist/durable/core.d.mts +1 -0
- package/dist/durable/core.mjs +2 -0
- package/dist/durable.d.mts +1 -0
- package/dist/durable.mjs +2 -0
- package/dist/entity/conformance.d.mts +1 -0
- package/dist/entity/conformance.mjs +2 -0
- package/dist/entity.d.mts +1 -0
- package/dist/entity.mjs +2 -0
- package/dist/form.d.mts +1 -0
- package/dist/form.mjs +2 -0
- package/dist/guard/agent.d.mts +1 -0
- package/dist/guard/agent.mjs +2 -0
- package/dist/guard/drizzle.d.mts +1 -0
- package/dist/guard/drizzle.mjs +2 -0
- package/dist/guard/server.d.mts +1 -0
- package/dist/guard/server.mjs +2 -0
- package/dist/guard/sync.d.mts +1 -0
- package/dist/guard/sync.mjs +2 -0
- package/dist/guard.d.mts +1 -0
- package/dist/guard.mjs +2 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.mjs +11 -0
- package/dist/metadata.d.mts +1 -0
- package/dist/metadata.mjs +2 -0
- package/dist/mirror.d.mts +1 -0
- package/dist/mirror.mjs +2 -0
- package/dist/mixins/app.d.mts +1 -0
- package/dist/mixins/app.mjs +2 -0
- package/dist/mixins/defaults.d.mts +1 -0
- package/dist/mixins/defaults.mjs +2 -0
- package/dist/mixins/foundations.d.mts +1 -0
- package/dist/mixins/foundations.mjs +2 -0
- package/dist/mixins/layers.d.mts +1 -0
- package/dist/mixins/layers.mjs +2 -0
- package/dist/mixins/layout.d.mts +1 -0
- package/dist/mixins/layout.mjs +2 -0
- package/dist/mixins/prose.d.mts +1 -0
- package/dist/mixins/prose.mjs +2 -0
- package/dist/mixins/testing.d.mts +1 -0
- package/dist/mixins/testing.mjs +2 -0
- package/dist/mixins/theme.d.mts +1 -0
- package/dist/mixins/theme.mjs +2 -0
- package/dist/mixins/utilities.d.mts +1 -0
- package/dist/mixins/utilities.mjs +2 -0
- package/dist/mixins-builder.d.mts +1 -0
- package/dist/mixins-builder.mjs +2 -0
- package/dist/mixins-crud.d.mts +1 -0
- package/dist/mixins-crud.mjs +2 -0
- package/dist/mixins-data-grid.d.mts +1 -0
- package/dist/mixins-data-grid.mjs +2 -0
- package/dist/mixins-form/ui.d.mts +1 -0
- package/dist/mixins-form/ui.mjs +2 -0
- package/dist/mixins-form.d.mts +1 -0
- package/dist/mixins-form.mjs +2 -0
- package/dist/mixins-richtext.d.mts +1 -0
- package/dist/mixins-richtext.mjs +2 -0
- package/dist/mixins-surface.d.mts +1 -0
- package/dist/mixins-surface.mjs +2 -0
- package/dist/mixins-ui.d.mts +1 -0
- package/dist/mixins-ui.mjs +2 -0
- package/dist/mixins.d.mts +1 -0
- package/dist/mixins.mjs +2 -0
- package/dist/primitives/device.d.mts +1 -0
- package/dist/primitives/device.mjs +2 -0
- package/dist/primitives/dom.d.mts +1 -0
- package/dist/primitives/dom.mjs +2 -0
- package/dist/primitives/events.d.mts +1 -0
- package/dist/primitives/events.mjs +2 -0
- package/dist/primitives/interaction.d.mts +1 -0
- package/dist/primitives/interaction.mjs +2 -0
- package/dist/primitives/media.d.mts +1 -0
- package/dist/primitives/media.mjs +2 -0
- package/dist/primitives/motion.d.mts +1 -0
- package/dist/primitives/motion.mjs +2 -0
- package/dist/primitives/net.d.mts +1 -0
- package/dist/primitives/net.mjs +2 -0
- package/dist/primitives/observers.d.mts +1 -0
- package/dist/primitives/observers.mjs +2 -0
- package/dist/primitives/state.d.mts +1 -0
- package/dist/primitives/state.mjs +2 -0
- package/dist/primitives/time.d.mts +1 -0
- package/dist/primitives/time.mjs +2 -0
- package/dist/primitives.d.mts +1 -0
- package/dist/primitives.mjs +2 -0
- package/dist/react-codegen.d.mts +1 -0
- package/dist/react-codegen.mjs +2 -0
- package/dist/react.d.mts +1 -0
- package/dist/react.mjs +2 -0
- package/dist/remote/port.d.mts +1 -0
- package/dist/remote/port.mjs +2 -0
- package/dist/remote-drizzle.d.mts +1 -0
- package/dist/remote-drizzle.mjs +2 -0
- package/dist/remote-server/fetch.d.mts +1 -0
- package/dist/remote-server/fetch.mjs +2 -0
- package/dist/remote-server/port.d.mts +1 -0
- package/dist/remote-server/port.mjs +2 -0
- package/dist/remote-server.d.mts +1 -0
- package/dist/remote-server.mjs +2 -0
- package/dist/remote.d.mts +1 -0
- package/dist/remote.mjs +2 -0
- package/dist/richtext-code-shiki.d.mts +1 -0
- package/dist/richtext-code-shiki.mjs +2 -0
- package/dist/richtext-code.d.mts +1 -0
- package/dist/richtext-code.mjs +2 -0
- package/dist/richtext-dom/editor-bundle.d.mts +1 -0
- package/dist/richtext-dom/editor-bundle.mjs +2 -0
- package/dist/richtext-dom/editor.d.mts +1 -0
- package/dist/richtext-dom/editor.mjs +2 -0
- package/dist/richtext-dom/events.d.mts +1 -0
- package/dist/richtext-dom/events.mjs +2 -0
- package/dist/richtext-dom/host.d.mts +1 -0
- package/dist/richtext-dom/host.mjs +2 -0
- package/dist/richtext-dom/html.d.mts +1 -0
- package/dist/richtext-dom/html.mjs +2 -0
- package/dist/richtext-dom/input.d.mts +1 -0
- package/dist/richtext-dom/input.mjs +2 -0
- package/dist/richtext-dom/toolbar.d.mts +1 -0
- package/dist/richtext-dom/toolbar.mjs +2 -0
- package/dist/richtext-dom/view.d.mts +1 -0
- package/dist/richtext-dom/view.mjs +2 -0
- package/dist/richtext-dom.d.mts +1 -0
- package/dist/richtext-dom.mjs +2 -0
- package/dist/richtext-markdown.d.mts +1 -0
- package/dist/richtext-markdown.mjs +2 -0
- package/dist/richtext.d.mts +1 -0
- package/dist/richtext.mjs +2 -0
- package/dist/setup.d.mts +40 -0
- package/dist/setup.d.mts.map +1 -0
- package/dist/setup.mjs +266 -0
- package/dist/setup.mjs.map +1 -0
- package/dist/site.d.mts +1 -0
- package/dist/site.mjs +2 -0
- package/dist/ssr/client.d.mts +1 -0
- package/dist/ssr/client.mjs +2 -0
- package/dist/ssr/vite.d.mts +1 -0
- package/dist/ssr/vite.mjs +2 -0
- package/dist/ssr.d.mts +1 -0
- package/dist/ssr.mjs +2 -0
- package/dist/surface.d.mts +1 -0
- package/dist/surface.mjs +2 -0
- package/dist/sync/do.d.mts +1 -0
- package/dist/sync/do.mjs +2 -0
- package/dist/sync/entity.d.mts +1 -0
- package/dist/sync/entity.mjs +2 -0
- package/dist/sync/journal.d.mts +1 -0
- package/dist/sync/journal.mjs +2 -0
- package/dist/sync/remote.d.mts +1 -0
- package/dist/sync/remote.mjs +2 -0
- package/dist/sync.d.mts +1 -0
- package/dist/sync.mjs +2 -0
- package/package.json +588 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Patrick Glenn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `foldkit-plus`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Every Foldkit Plus package in one install, and a setup command for your coding
|
|
4
|
+
agent.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npx foldkit-plus setup
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Tell your agent to run that in your project. It prints, for that project, how to
|
|
11
|
+
install Effect, Foldkit and Foldkit Plus with the package manager the project
|
|
12
|
+
uses, how to add the agent skill, and which package does which job. It reads
|
|
13
|
+
your `package.json` first and says when `effect` or `foldkit` is missing or at a
|
|
14
|
+
version this release does not support. It writes nothing; the agent runs what it
|
|
15
|
+
says.
|
|
16
|
+
|
|
17
|
+
## What it is
|
|
18
|
+
|
|
19
|
+
[Foldkit Plus](https://foldkit-plus.pages.dev) is a family of packages that
|
|
20
|
+
extend a [Foldkit](https://foldkit.dev) application to agents, servers, other
|
|
21
|
+
devices, the URL and design systems without a second place to keep state. Each
|
|
22
|
+
is published on its own (`foldkit-remote`, `foldkit-sync`, …). This package
|
|
23
|
+
depends on them, so one install brings the set, and re-exports each:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
foldkit-remote -> foldkit-plus/remote
|
|
27
|
+
foldkit-remote/port -> foldkit-plus/remote/port
|
|
28
|
+
foldkit-remote-server -> foldkit-plus/remote-server
|
|
29
|
+
foldkit-mixins/theme -> foldkit-plus/mixins/theme
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
A subpath is the package itself, re-exported: `foldkit-plus/remote`'s `Remote`
|
|
33
|
+
is `foldkit-remote`'s, so the two can be mixed in one application.
|
|
34
|
+
|
|
35
|
+
## Import
|
|
36
|
+
|
|
37
|
+
The namespaces most applications use come from the root:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { Projection, Remote, Surface, Sync } from 'foldkit-plus'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The root holds `Agent`, `Bundle`, `Entity`, `Expr`, `Order`, `Query`,
|
|
44
|
+
`Relation`, `Form`, `Mirror`, the Mixins vocabulary (`Style`, `Slot`, `Slots`,
|
|
45
|
+
`SlotView`, `Behavior`, `Capability`, `Event`), `Remote`, `RemoteClient`,
|
|
46
|
+
`RemoteData`, `RemotePolicy`, `Site`, `Surface`, `Projection`, `MessageSet`,
|
|
47
|
+
`Sync`, `DocumentId` and `ReplicaId`. A name two packages export is left to
|
|
48
|
+
their subpaths, so nothing at the root is ambiguous. Nothing at the root runs
|
|
49
|
+
only on a server: import `foldkit-plus/ssr`, `foldkit-plus/remote-server` or
|
|
50
|
+
`foldkit-plus/durable` where the server is.
|
|
51
|
+
|
|
52
|
+
## What it does not install: adapters
|
|
53
|
+
|
|
54
|
+
A package that needs a library of its own is an optional peer here, so
|
|
55
|
+
installing `foldkit-plus` installs none of those libraries. Its subpath works
|
|
56
|
+
once you add it with its library:
|
|
57
|
+
|
|
58
|
+
| Adapter | Library | For |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `foldkit-react` | `react`, `react-dom` | React interop |
|
|
61
|
+
| `foldkit-react-codegen` | `typescript` | Views compiled to React TSX |
|
|
62
|
+
| `foldkit-remote-drizzle` | `drizzle-orm` | Remote reads answered with Drizzle |
|
|
63
|
+
| `foldkit-cms-drizzle` | `drizzle-orm` | The CMS's server on Drizzle |
|
|
64
|
+
| `foldkit-mixins-ui` | `@foldkit/ui` | `@foldkit/ui` components styled through slots |
|
|
65
|
+
| `foldkit-richtext-code-shiki` | `shiki` | Code blocks highlighted with Shiki |
|
|
66
|
+
| `foldkit-agent-native` | `@agent-native/core` | Agents through Agent Native |
|
|
67
|
+
|
|
68
|
+
`npx foldkit-plus setup` lists them with the command that adds each.
|
|
69
|
+
|
|
70
|
+
## Versions
|
|
71
|
+
|
|
72
|
+
`effect` and `foldkit` are peers: this release targets Effect 4 (`^4.0.0`,
|
|
73
|
+
tested on 4.0.4) and Foldkit `0.168`, and `setup` installs the Effect that
|
|
74
|
+
Foldkit names (`4.0.0`). Each release of `foldkit-plus` pins the release of every
|
|
75
|
+
package it brings, so the set is one tested combination; the
|
|
76
|
+
[release matrix](https://github.com/doeixd/foldkit-plus/blob/main/docs/releases.md)
|
|
77
|
+
lists them.
|
|
78
|
+
|
|
79
|
+
## In this repository
|
|
80
|
+
|
|
81
|
+
The re-exports, the manifest's exports and dependencies, and the tsconfigs'
|
|
82
|
+
references are generated from the workspace:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm --filter foldkit-plus generate # then pnpm install and pnpm paths
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`test/generated.test.ts` fails until it has run after a package or an entry
|
|
89
|
+
point is added, moved or removed, and when the setup guide's list of adapters
|
|
90
|
+
or jobs leaves a package out.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-agent-a2a";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-agent-mcp";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-agent-native";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-agent-webmcp";
|
package/dist/agent.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-agent";
|
package/dist/agent.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-builder";
|
package/dist/builder.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-bundle-surface";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-bundle";
|
package/dist/bundle.mjs
ADDED
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { setupGuide } from "./setup.mjs";
|
|
3
|
+
import { Option, Schema } from "effect";
|
|
4
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
//#region src/cli.ts
|
|
9
|
+
/**
|
|
10
|
+
* `npx foldkit-plus setup`: reads the project in the current folder and this
|
|
11
|
+
* package's own manifest, and prints `setup.ts`'s instructions for it.
|
|
12
|
+
*/
|
|
13
|
+
const usage = `Usage: npx foldkit-plus setup
|
|
14
|
+
|
|
15
|
+
Prints, for the project in this folder, how to install Effect, Foldkit and
|
|
16
|
+
Foldkit Plus, how to add the agent skill, and which package does which job:
|
|
17
|
+
instructions written for a coding agent to follow.`;
|
|
18
|
+
const Versions = Schema.Record(Schema.String, Schema.String);
|
|
19
|
+
const Manifest = Schema.Struct({
|
|
20
|
+
name: Schema.optional(Schema.String),
|
|
21
|
+
version: Schema.optional(Schema.String),
|
|
22
|
+
dependencies: Schema.optional(Versions),
|
|
23
|
+
devDependencies: Schema.optional(Versions),
|
|
24
|
+
peerDependencies: Schema.optional(Versions),
|
|
25
|
+
setup: Schema.optional(Schema.Struct({
|
|
26
|
+
effect: Schema.String,
|
|
27
|
+
foldkit: Schema.String
|
|
28
|
+
}))
|
|
29
|
+
});
|
|
30
|
+
const readManifest = (path) => Schema.decodeUnknownSync(Manifest)(JSON.parse(readFileSync(path, "utf8")));
|
|
31
|
+
/** The project here, if this is one. */
|
|
32
|
+
const projectIn = (folder) => {
|
|
33
|
+
const path = join(folder, "package.json");
|
|
34
|
+
if (!existsSync(path)) return Option.none();
|
|
35
|
+
const manifest = readManifest(path);
|
|
36
|
+
return Option.some({
|
|
37
|
+
name: manifest.name ?? "this project",
|
|
38
|
+
versions: {
|
|
39
|
+
...manifest.peerDependencies,
|
|
40
|
+
...manifest.devDependencies,
|
|
41
|
+
...manifest.dependencies
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The project's package manager by its lockfile, here or in a project folder
|
|
47
|
+
* above (a workspace keeps one at its root), else the one running this.
|
|
48
|
+
*/
|
|
49
|
+
const managerIn = (folder) => {
|
|
50
|
+
const locks = [
|
|
51
|
+
["pnpm-lock.yaml", "pnpm"],
|
|
52
|
+
["bun.lock", "bun"],
|
|
53
|
+
["bun.lockb", "bun"],
|
|
54
|
+
["yarn.lock", "yarn"],
|
|
55
|
+
["package-lock.json", "npm"]
|
|
56
|
+
];
|
|
57
|
+
const project = existsSync(join(folder, "package.json"));
|
|
58
|
+
for (let at = folder; project && at !== homedir(); at = dirname(at)) {
|
|
59
|
+
const locked = locks.find(([file]) => existsSync(join(at, file)));
|
|
60
|
+
if (locked !== void 0) return locked[1];
|
|
61
|
+
if (existsSync(join(at, ".git")) || dirname(at) === at) break;
|
|
62
|
+
}
|
|
63
|
+
const agent = process.env["npm_config_user_agent"] ?? "";
|
|
64
|
+
return locks.map(([, manager]) => manager).find((manager) => agent.startsWith(`${manager}/`)) ?? "npm";
|
|
65
|
+
};
|
|
66
|
+
/** The versions this release installs, from its own manifest, beside `dist` and `src` alike. */
|
|
67
|
+
const ownVersions = () => {
|
|
68
|
+
const own = readManifest(fileURLToPath(new URL("../package.json", import.meta.url)));
|
|
69
|
+
if (own.version === void 0) throw new Error("foldkit-plus's manifest has no version");
|
|
70
|
+
if (own.setup === void 0) throw new Error("foldkit-plus's manifest names no setup versions");
|
|
71
|
+
return {
|
|
72
|
+
plus: own.version,
|
|
73
|
+
...own.setup
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const [command = "setup"] = process.argv.slice(2);
|
|
77
|
+
if (command === "setup") {
|
|
78
|
+
const folder = process.cwd();
|
|
79
|
+
process.stdout.write(setupGuide({
|
|
80
|
+
project: projectIn(folder),
|
|
81
|
+
manager: managerIn(folder),
|
|
82
|
+
versions: ownVersions()
|
|
83
|
+
}));
|
|
84
|
+
} else {
|
|
85
|
+
process.stdout.write(`${usage}\n`);
|
|
86
|
+
process.exitCode = command === "--help" || command === "-h" || command === "help" ? 0 : 1;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export {};
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `npx foldkit-plus setup`: reads the project in the current folder and this\n * package's own manifest, and prints `setup.ts`'s instructions for it.\n */\nimport { Option, Schema } from 'effect'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport { setupGuide, type Manager, type Project } from './setup.js'\n\nconst usage = `Usage: npx foldkit-plus setup\n\nPrints, for the project in this folder, how to install Effect, Foldkit and\nFoldkit Plus, how to add the agent skill, and which package does which job:\ninstructions written for a coding agent to follow.`\n\nconst Versions = Schema.Record(Schema.String, Schema.String)\nconst Manifest = Schema.Struct({\n name: Schema.optional(Schema.String),\n version: Schema.optional(Schema.String),\n dependencies: Schema.optional(Versions),\n devDependencies: Schema.optional(Versions),\n peerDependencies: Schema.optional(Versions),\n setup: Schema.optional(Schema.Struct({ effect: Schema.String, foldkit: Schema.String })),\n})\nconst readManifest = (path: string) =>\n Schema.decodeUnknownSync(Manifest)(JSON.parse(readFileSync(path, 'utf8')))\n\n/** The project here, if this is one. */\nconst projectIn = (folder: string): Option.Option<Project> => {\n const path = join(folder, 'package.json')\n if (!existsSync(path)) return Option.none()\n const manifest = readManifest(path)\n return Option.some({\n name: manifest.name ?? 'this project',\n versions: {\n ...manifest.peerDependencies,\n ...manifest.devDependencies,\n ...manifest.dependencies,\n },\n })\n}\n\n/**\n * The project's package manager by its lockfile, here or in a project folder\n * above (a workspace keeps one at its root), else the one running this.\n */\nconst managerIn = (folder: string): Manager => {\n const locks: ReadonlyArray<readonly [string, Manager]> = [\n ['pnpm-lock.yaml', 'pnpm'],\n ['bun.lock', 'bun'],\n ['bun.lockb', 'bun'],\n ['yarn.lock', 'yarn'],\n ['package-lock.json', 'npm'],\n ]\n // Up to the repository's root and no further, and never into the home\n // folder: a lockfile left there says nothing about this project. A folder\n // that is no project has no lockfile of its own to find.\n const project = existsSync(join(folder, 'package.json'))\n for (let at = folder; project && at !== homedir(); at = dirname(at)) {\n const locked = locks.find(([file]) => existsSync(join(at, file)))\n if (locked !== undefined) return locked[1]\n if (existsSync(join(at, '.git')) || dirname(at) === at) break\n }\n const agent = process.env['npm_config_user_agent'] ?? ''\n return (\n locks.map(([, manager]) => manager).find(manager => agent.startsWith(`${manager}/`)) ?? 'npm'\n )\n}\n\n/** The versions this release installs, from its own manifest, beside `dist` and `src` alike. */\nconst ownVersions = () => {\n const own = readManifest(fileURLToPath(new URL('../package.json', import.meta.url)))\n if (own.version === undefined) throw new Error(\"foldkit-plus's manifest has no version\")\n if (own.setup === undefined) throw new Error(\"foldkit-plus's manifest names no setup versions\")\n return { plus: own.version, ...own.setup }\n}\n\nconst [command = 'setup'] = process.argv.slice(2)\nif (command === 'setup') {\n const folder = process.cwd()\n process.stdout.write(\n setupGuide({ project: projectIn(folder), manager: managerIn(folder), versions: ownVersions() }),\n )\n} else {\n process.stdout.write(`${usage}\\n`)\n process.exitCode = command === '--help' || command === '-h' || command === 'help' ? 0 : 1\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,QAAQ;;;;;AAMd,MAAM,WAAW,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM;AAC3D,MAAM,WAAW,OAAO,OAAO;CAC7B,MAAM,OAAO,SAAS,OAAO,MAAM;CACnC,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,cAAc,OAAO,SAAS,QAAQ;CACtC,iBAAiB,OAAO,SAAS,QAAQ;CACzC,kBAAkB,OAAO,SAAS,QAAQ;CAC1C,OAAO,OAAO,SAAS,OAAO,OAAO;EAAE,QAAQ,OAAO;EAAQ,SAAS,OAAO;CAAO,CAAC,CAAC;AACzF,CAAC;AACD,MAAM,gBAAgB,SACpB,OAAO,kBAAkB,QAAQ,CAAC,CAAC,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC,CAAC;;AAG3E,MAAM,aAAa,WAA2C;CAC5D,MAAM,OAAO,KAAK,QAAQ,cAAc;CACxC,IAAI,CAAC,WAAW,IAAI,GAAG,OAAO,OAAO,KAAK;CAC1C,MAAM,WAAW,aAAa,IAAI;CAClC,OAAO,OAAO,KAAK;EACjB,MAAM,SAAS,QAAQ;EACvB,UAAU;GACR,GAAG,SAAS;GACZ,GAAG,SAAS;GACZ,GAAG,SAAS;EACd;CACF,CAAC;AACH;;;;;AAMA,MAAM,aAAa,WAA4B;CAC7C,MAAM,QAAmD;EACvD,CAAC,kBAAkB,MAAM;EACzB,CAAC,YAAY,KAAK;EAClB,CAAC,aAAa,KAAK;EACnB,CAAC,aAAa,MAAM;EACpB,CAAC,qBAAqB,KAAK;CAC7B;CAIA,MAAM,UAAU,WAAW,KAAK,QAAQ,cAAc,CAAC;CACvD,KAAK,IAAI,KAAK,QAAQ,WAAW,OAAO,QAAQ,GAAG,KAAK,QAAQ,EAAE,GAAG;EACnE,MAAM,SAAS,MAAM,MAAM,CAAC,UAAU,WAAW,KAAK,IAAI,IAAI,CAAC,CAAC;EAChE,IAAI,WAAW,KAAA,GAAW,OAAO,OAAO;EACxC,IAAI,WAAW,KAAK,IAAI,MAAM,CAAC,KAAK,QAAQ,EAAE,MAAM,IAAI;CAC1D;CACA,MAAM,QAAQ,QAAQ,IAAI,4BAA4B;CACtD,OACE,MAAM,KAAK,GAAG,aAAa,OAAO,CAAC,CAAC,MAAK,YAAW,MAAM,WAAW,GAAG,QAAQ,EAAE,CAAC,KAAK;AAE5F;;AAGA,MAAM,oBAAoB;CACxB,MAAM,MAAM,aAAa,cAAc,IAAI,IAAI,mBAAmB,YAAY,GAAG,CAAC,CAAC;CACnF,IAAI,IAAI,YAAY,KAAA,GAAW,MAAM,IAAI,MAAM,wCAAwC;CACvF,IAAI,IAAI,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,iDAAiD;CAC9F,OAAO;EAAE,MAAM,IAAI;EAAS,GAAG,IAAI;CAAM;AAC3C;AAEA,MAAM,CAAC,UAAU,WAAW,QAAQ,KAAK,MAAM,CAAC;AAChD,IAAI,YAAY,SAAS;CACvB,MAAM,SAAS,QAAQ,IAAI;CAC3B,QAAQ,OAAO,MACb,WAAW;EAAE,SAAS,UAAU,MAAM;EAAG,SAAS,UAAU,MAAM;EAAG,UAAU,YAAY;CAAE,CAAC,CAChG;AACF,OAAO;CACL,QAAQ,OAAO,MAAM,GAAG,MAAM,GAAG;CACjC,QAAQ,WAAW,YAAY,YAAY,YAAY,QAAQ,YAAY,SAAS,IAAI;AAC1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-cms-drizzle";
|
package/dist/cms.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-cms";
|
package/dist/cms.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-composition/appearance";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-composition/foldkit";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-composition/remote";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-composition/richtext";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-composition/surface";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-composition";
|
package/dist/crud.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-crud";
|
package/dist/crud.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-data-grid/crud";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-data-grid";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-durable/core";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-durable";
|
package/dist/durable.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-entity/conformance";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-entity";
|
package/dist/entity.mjs
ADDED
package/dist/form.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-form";
|
package/dist/form.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-guard/agent";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-guard/drizzle";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-guard/server";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-guard/sync";
|
package/dist/guard.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-guard";
|
package/dist/guard.mjs
ADDED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Agent } from "foldkit-agent";
|
|
2
|
+
import { Bundle } from "foldkit-bundle";
|
|
3
|
+
import { Entity, Expr, Order, Query, Relation } from "foldkit-entity";
|
|
4
|
+
import { Form } from "foldkit-form";
|
|
5
|
+
import { Mirror } from "foldkit-mirror";
|
|
6
|
+
import { Behavior, Capability, Event, Slot, SlotView, Slots, Style } from "foldkit-mixins";
|
|
7
|
+
import { Remote, RemoteClient, RemoteData, RemotePolicy } from "foldkit-remote";
|
|
8
|
+
import { Site } from "foldkit-site";
|
|
9
|
+
import { MessageSet, Projection, Surface } from "foldkit-surface";
|
|
10
|
+
import { DocumentId, ReplicaId, Sync } from "foldkit-sync";
|
|
11
|
+
export { Agent, Behavior, Bundle, Capability, DocumentId, Entity, Event, Expr, Form, MessageSet, Mirror, Order, Projection, Query, Relation, Remote, RemoteClient, RemoteData, RemotePolicy, ReplicaId, Site, Slot, SlotView, Slots, Style, Surface, Sync };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Agent } from "foldkit-agent";
|
|
2
|
+
import { Bundle } from "foldkit-bundle";
|
|
3
|
+
import { Entity, Expr, Order, Query, Relation } from "foldkit-entity";
|
|
4
|
+
import { Form } from "foldkit-form";
|
|
5
|
+
import { Mirror } from "foldkit-mirror";
|
|
6
|
+
import { Behavior, Capability, Event, Slot, SlotView, Slots, Style } from "foldkit-mixins";
|
|
7
|
+
import { Remote, RemoteClient, RemoteData, RemotePolicy } from "foldkit-remote";
|
|
8
|
+
import { Site } from "foldkit-site";
|
|
9
|
+
import { MessageSet, Projection, Surface } from "foldkit-surface";
|
|
10
|
+
import { DocumentId, ReplicaId, Sync } from "foldkit-sync";
|
|
11
|
+
export { Agent, Behavior, Bundle, Capability, DocumentId, Entity, Event, Expr, Form, MessageSet, Mirror, Order, Projection, Query, Relation, Remote, RemoteClient, RemoteData, RemotePolicy, ReplicaId, Site, Slot, SlotView, Slots, Style, Surface, Sync };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-metadata";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mirror";
|
package/dist/mirror.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/app";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/defaults";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/foundations";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/layers";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/layout";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/prose";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/testing";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/theme";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins/utilities";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-builder";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-crud";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-data-grid";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-form/ui";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-form";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-richtext";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-surface";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "foldkit-mixins-ui";
|