foldkit-plus 0.1.0 → 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/README.md +3 -2
- package/dist/cli.mjs +8 -9
- package/dist/cli.mjs.map +1 -1
- package/dist/setup.d.mts.map +1 -1
- package/package.json +57 -53
package/README.md
CHANGED
|
@@ -69,8 +69,9 @@ once you add it with its library:
|
|
|
69
69
|
|
|
70
70
|
## Versions
|
|
71
71
|
|
|
72
|
-
`effect` and `foldkit` are peers: this release targets Effect
|
|
73
|
-
Foldkit `0.
|
|
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
|
|
74
75
|
package it brings, so the set is one tested combination; the
|
|
75
76
|
[release matrix](https://github.com/doeixd/foldkit-plus/blob/main/docs/releases.md)
|
|
76
77
|
lists them.
|
package/dist/cli.mjs
CHANGED
|
@@ -21,7 +21,11 @@ const Manifest = Schema.Struct({
|
|
|
21
21
|
version: Schema.optional(Schema.String),
|
|
22
22
|
dependencies: Schema.optional(Versions),
|
|
23
23
|
devDependencies: Schema.optional(Versions),
|
|
24
|
-
peerDependencies: Schema.optional(Versions)
|
|
24
|
+
peerDependencies: Schema.optional(Versions),
|
|
25
|
+
setup: Schema.optional(Schema.Struct({
|
|
26
|
+
effect: Schema.String,
|
|
27
|
+
foldkit: Schema.String
|
|
28
|
+
}))
|
|
25
29
|
});
|
|
26
30
|
const readManifest = (path) => Schema.decodeUnknownSync(Manifest)(JSON.parse(readFileSync(path, "utf8")));
|
|
27
31
|
/** The project here, if this is one. */
|
|
@@ -59,19 +63,14 @@ const managerIn = (folder) => {
|
|
|
59
63
|
const agent = process.env["npm_config_user_agent"] ?? "";
|
|
60
64
|
return locks.map(([, manager]) => manager).find((manager) => agent.startsWith(`${manager}/`)) ?? "npm";
|
|
61
65
|
};
|
|
62
|
-
/** The versions this release
|
|
66
|
+
/** The versions this release installs, from its own manifest, beside `dist` and `src` alike. */
|
|
63
67
|
const ownVersions = () => {
|
|
64
68
|
const own = readManifest(fileURLToPath(new URL("../package.json", import.meta.url)));
|
|
65
|
-
const pinned = (name) => {
|
|
66
|
-
const version = own.devDependencies?.[name];
|
|
67
|
-
if (version === void 0) throw new Error(`foldkit-plus's manifest pins no ${name}`);
|
|
68
|
-
return version;
|
|
69
|
-
};
|
|
70
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
71
|
return {
|
|
72
72
|
plus: own.version,
|
|
73
|
-
|
|
74
|
-
foldkit: pinned("foldkit")
|
|
73
|
+
...own.setup
|
|
75
74
|
};
|
|
76
75
|
};
|
|
77
76
|
const [command = "setup"] = process.argv.slice(2);
|
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +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})\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
|
|
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,K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|
|
1
|
-
{"version":3,"file":"setup.d.mts","names":[],"sources":["../src/setup.ts"],"mappings":";;YAOY;;iBAGK;WACN;;WAEA,UAAU,SAAS;;;iBAIb;WACN;WACA;WACA;;iBAGM;WACN,SAAS,OAAO,OAAO;WACvB,SAAS;WACT,UAAU;;;qBAOR,MAAM;WACR;WACA,SAAS;WACT;;;;;;qBAkGE,UAAU;WACZ;WACA,WAAW;WACX;;;qBAgCE,
|
|
1
|
+
{"version":3,"file":"setup.d.mts","names":[],"sources":["../src/setup.ts"],"mappings":";;YAOY;;iBAGK;WACN;;WAEA,UAAU,SAAS;;;iBAIb;WACN;WACA;WACA;;iBAGM;WACN,SAAS,OAAO,OAAO;WACvB,SAAS;WACT,UAAU;;;qBAOR,MAAM;WACR;WACA,SAAS;WACT;;;;;;qBAkGE,UAAU;WACZ;WACA,WAAW;WACX;;;qBAgCE,aAAU,SAAa,SAAO,UAAY;qBAuB1C,eAAU,SAAA,SAAA,YAAoC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foldkit-plus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Every Foldkit Plus package in one install, and `npx foldkit-plus setup`, which tells a coding agent how to start.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"foldkit",
|
|
@@ -495,52 +495,52 @@
|
|
|
495
495
|
"LICENSE"
|
|
496
496
|
],
|
|
497
497
|
"dependencies": {
|
|
498
|
-
"foldkit-agent": "0.
|
|
499
|
-
"foldkit-agent-a2a": "0.
|
|
500
|
-
"foldkit-agent-mcp": "0.
|
|
501
|
-
"foldkit-agent-webmcp": "0.
|
|
502
|
-
"foldkit-
|
|
503
|
-
"foldkit-bundle": "0.
|
|
504
|
-
"foldkit-
|
|
505
|
-
"foldkit-
|
|
506
|
-
"foldkit-crud": "0.
|
|
507
|
-
"foldkit-
|
|
508
|
-
"foldkit-
|
|
509
|
-
"foldkit-
|
|
510
|
-
"foldkit-
|
|
511
|
-
"foldkit-form": "0.
|
|
512
|
-
"foldkit-
|
|
498
|
+
"foldkit-agent": "0.8.0",
|
|
499
|
+
"foldkit-agent-a2a": "0.6.0",
|
|
500
|
+
"foldkit-agent-mcp": "0.6.0",
|
|
501
|
+
"foldkit-agent-webmcp": "0.7.0",
|
|
502
|
+
"foldkit-bundle": "0.7.0",
|
|
503
|
+
"foldkit-bundle-surface": "0.4.0",
|
|
504
|
+
"foldkit-cms": "0.7.0",
|
|
505
|
+
"foldkit-composition": "0.3.0",
|
|
506
|
+
"foldkit-crud": "0.8.0",
|
|
507
|
+
"foldkit-builder": "0.3.0",
|
|
508
|
+
"foldkit-data-grid": "0.2.0",
|
|
509
|
+
"foldkit-entity": "0.9.0",
|
|
510
|
+
"foldkit-durable": "0.9.0",
|
|
511
|
+
"foldkit-form": "0.5.0",
|
|
512
|
+
"foldkit-guard": "0.2.0",
|
|
513
513
|
"foldkit-metadata": "0.1.0",
|
|
514
|
-
"foldkit-mixins": "0.
|
|
515
|
-
"foldkit-
|
|
516
|
-
"foldkit-mixins
|
|
517
|
-
"foldkit-mixins-
|
|
518
|
-
"foldkit-mixins-
|
|
519
|
-
"foldkit-
|
|
520
|
-
"foldkit-mixins-
|
|
521
|
-
"foldkit-
|
|
522
|
-
"foldkit-primitives": "0.9.0",
|
|
523
|
-
"foldkit-remote-server": "0.13.2",
|
|
524
|
-
"foldkit-remote": "0.15.0",
|
|
514
|
+
"foldkit-mixins-builder": "0.3.0",
|
|
515
|
+
"foldkit-mirror": "0.6.0",
|
|
516
|
+
"foldkit-mixins": "0.11.0",
|
|
517
|
+
"foldkit-mixins-crud": "0.7.0",
|
|
518
|
+
"foldkit-mixins-data-grid": "0.2.0",
|
|
519
|
+
"foldkit-mixins-richtext": "0.3.0",
|
|
520
|
+
"foldkit-mixins-surface": "0.6.0",
|
|
521
|
+
"foldkit-primitives": "0.10.0",
|
|
525
522
|
"foldkit-richtext": "0.3.0",
|
|
526
|
-
"foldkit-
|
|
527
|
-
"foldkit-richtext-
|
|
528
|
-
"foldkit-
|
|
529
|
-
"foldkit-
|
|
530
|
-
"foldkit-
|
|
531
|
-
"foldkit-
|
|
532
|
-
"foldkit-
|
|
523
|
+
"foldkit-remote-server": "0.13.3",
|
|
524
|
+
"foldkit-richtext-code": "0.2.0",
|
|
525
|
+
"foldkit-mixins-form": "0.6.0",
|
|
526
|
+
"foldkit-richtext-markdown": "0.2.1",
|
|
527
|
+
"foldkit-richtext-dom": "0.4.0",
|
|
528
|
+
"foldkit-ssr": "0.6.0",
|
|
529
|
+
"foldkit-surface": "0.9.0",
|
|
530
|
+
"foldkit-sync": "0.11.0",
|
|
531
|
+
"foldkit-site": "0.3.0",
|
|
532
|
+
"foldkit-remote": "0.16.0"
|
|
533
533
|
},
|
|
534
534
|
"peerDependencies": {
|
|
535
535
|
"effect": "^4.0.0",
|
|
536
|
-
"foldkit": "^0.
|
|
537
|
-
"foldkit-
|
|
538
|
-
"foldkit-
|
|
539
|
-
"foldkit-
|
|
540
|
-
"foldkit-
|
|
541
|
-
"foldkit-react": "^0.3.0",
|
|
542
|
-
"foldkit-
|
|
543
|
-
"foldkit-
|
|
536
|
+
"foldkit": "^0.168.0",
|
|
537
|
+
"foldkit-cms-drizzle": "^0.6.3",
|
|
538
|
+
"foldkit-mixins-ui": "^0.10.0",
|
|
539
|
+
"foldkit-react": "^0.4.0",
|
|
540
|
+
"foldkit-agent-native": "^0.6.0",
|
|
541
|
+
"foldkit-react-codegen": "^0.3.0",
|
|
542
|
+
"foldkit-remote-drizzle": "^0.12.0",
|
|
543
|
+
"foldkit-richtext-code-shiki": "^0.2.0"
|
|
544
544
|
},
|
|
545
545
|
"peerDependenciesMeta": {
|
|
546
546
|
"foldkit-agent-native": {
|
|
@@ -566,19 +566,23 @@
|
|
|
566
566
|
}
|
|
567
567
|
},
|
|
568
568
|
"devDependencies": {
|
|
569
|
-
"effect": "4.0.
|
|
570
|
-
"foldkit": "0.
|
|
571
|
-
"tsdown": "^0.23.
|
|
572
|
-
"tsx": "^4.23.
|
|
573
|
-
"typescript": "
|
|
574
|
-
"foldkit-agent-native": "0.
|
|
575
|
-
"foldkit-
|
|
576
|
-
"foldkit-
|
|
577
|
-
"foldkit-react
|
|
578
|
-
"foldkit-
|
|
579
|
-
"foldkit-
|
|
569
|
+
"effect": "^4.0.4",
|
|
570
|
+
"foldkit": "0.168.0",
|
|
571
|
+
"tsdown": "^0.23.1",
|
|
572
|
+
"tsx": "^4.23.15",
|
|
573
|
+
"typescript": "7.0.2",
|
|
574
|
+
"foldkit-agent-native": "0.6.0",
|
|
575
|
+
"foldkit-mixins-ui": "0.10.0",
|
|
576
|
+
"foldkit-cms-drizzle": "0.6.3",
|
|
577
|
+
"foldkit-react": "0.4.0",
|
|
578
|
+
"foldkit-remote-drizzle": "0.12.0",
|
|
579
|
+
"foldkit-react-codegen": "0.3.0",
|
|
580
580
|
"foldkit-richtext-code-shiki": "0.2.0"
|
|
581
581
|
},
|
|
582
|
+
"setup": {
|
|
583
|
+
"foldkit": "0.168.0",
|
|
584
|
+
"effect": "4.0.0"
|
|
585
|
+
},
|
|
582
586
|
"scripts": {
|
|
583
587
|
"build": "tsdown",
|
|
584
588
|
"generate": "tsx scripts/generate.ts",
|