kerfjs 4.4.0 → 4.5.0-beta.1
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/CHANGELOG.md +284 -104
- package/LICENSE +1 -1
- package/README.md +73 -54
- package/ai/cursorrules +130 -48
- package/ai/manifest.json +63 -5
- package/ai/skill.md +148 -65
- package/dist/actions.d.ts +1 -1
- package/dist/actions.js +4 -4
- package/dist/actions.js.map +1 -1
- package/dist/array-signal.js +5 -5
- package/dist/async.js +34 -24
- package/dist/async.js.map +1 -1
- package/dist/attach.d.ts +11 -8
- package/dist/attach.js +54 -4
- package/dist/attach.js.map +1 -1
- package/dist/{chunk-QIP723L4.js → chunk-5WRGJZV6.js} +4 -3
- package/dist/chunk-5WRGJZV6.js.map +1 -0
- package/dist/{chunk-GY4XV2UV.js → chunk-BDX3R4OM.js} +4 -3
- package/dist/chunk-BDX3R4OM.js.map +1 -0
- package/dist/{chunk-VVDJLWMP.js → chunk-CEQMZYLR.js} +2 -2
- package/dist/chunk-CEQMZYLR.js.map +1 -0
- package/dist/{chunk-KEZTD6H4.js → chunk-E5R5GNKE.js} +15 -5
- package/dist/chunk-E5R5GNKE.js.map +1 -0
- package/dist/{chunk-MRYM3O3V.js → chunk-ELXVRKY2.js} +12 -9
- package/dist/chunk-ELXVRKY2.js.map +1 -0
- package/dist/{chunk-U32TFTGZ.js → chunk-MK42GLPV.js} +3 -3
- package/dist/chunk-MK42GLPV.js.map +1 -0
- package/dist/{chunk-SUPUPSBE.js → chunk-QFUNWHKH.js} +42 -20
- package/dist/chunk-QFUNWHKH.js.map +1 -0
- package/dist/{chunk-SRWQKB33.js → chunk-V757BT6U.js} +206 -111
- package/dist/chunk-V757BT6U.js.map +1 -0
- package/dist/{chunk-YHH7OUFA.js → chunk-WKIPLNVO.js} +3 -3
- package/dist/chunk-WKIPLNVO.js.map +1 -0
- package/dist/{chunk-3APBEVHF.js → chunk-Y2FOYPBV.js} +3 -3
- package/dist/{chunk-3APBEVHF.js.map → chunk-Y2FOYPBV.js.map} +1 -1
- package/dist/{chunk-SAYPJ6XR.js → chunk-ZOIERTUW.js} +10 -6
- package/dist/chunk-ZOIERTUW.js.map +1 -0
- package/dist/dev.d.ts +9 -6
- package/dist/dev.js +66 -19
- package/dist/dev.js.map +1 -1
- package/dist/html.d.ts +1 -1
- package/dist/html.js +8 -7
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +28 -19
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.js +5 -5
- package/dist/list.d.ts +1 -1
- package/dist/list.js +304 -213
- package/dist/list.js.map +1 -1
- package/dist/overlay.d.ts +190 -280
- package/dist/overlay.js +471 -364
- package/dist/overlay.js.map +1 -1
- package/dist/remount.d.ts +5 -3
- package/dist/remount.js +29 -10
- package/dist/remount.js.map +1 -1
- package/dist/router.d.ts +1 -1
- package/dist/router.js +73 -28
- package/dist/router.js.map +1 -1
- package/dist/scope.d.ts +4 -3
- package/dist/scope.js +11 -10
- package/dist/scope.js.map +1 -1
- package/dist/testing.js +4 -4
- package/dist/timing.d.ts +3 -2
- package/dist/timing.js +5 -5
- package/dist/timing.js.map +1 -1
- package/llms.txt +13 -6
- package/package.json +35 -13
- package/setup/cli.mjs +90 -0
- package/setup/index.d.mts +37 -0
- package/setup/index.mjs +1347 -0
- package/setup/jsonc.mjs +201 -0
- package/setup/state.schema.json +56 -0
- package/dist/chunk-GY4XV2UV.js.map +0 -1
- package/dist/chunk-KEZTD6H4.js.map +0 -1
- package/dist/chunk-MRYM3O3V.js.map +0 -1
- package/dist/chunk-QIP723L4.js.map +0 -1
- package/dist/chunk-SAYPJ6XR.js.map +0 -1
- package/dist/chunk-SRWQKB33.js.map +0 -1
- package/dist/chunk-SUPUPSBE.js.map +0 -1
- package/dist/chunk-U32TFTGZ.js.map +0 -1
- package/dist/chunk-VVDJLWMP.js.map +0 -1
- package/dist/chunk-YHH7OUFA.js.map +0 -1
- /package/dist/{attrSelector-Cmu2ZoGO.d.ts → attr-Cmu2ZoGO.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kerfjs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0-beta.1",
|
|
4
4
|
"description": "Tiny reactive UI framework — fine-grained signals + DOM morphing + JSX. Apply the smallest possible cut to update your DOM.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"main": "./dist/index.js",
|
|
37
37
|
"types": "./dist/index.d.ts",
|
|
38
|
+
"bin": {
|
|
39
|
+
"kerfjs": "./setup/cli.mjs"
|
|
40
|
+
},
|
|
38
41
|
"exports": {
|
|
39
42
|
".": {
|
|
40
43
|
"types": "./dist/index.d.ts",
|
|
@@ -100,18 +103,24 @@
|
|
|
100
103
|
"types": "./dist/attach.d.ts",
|
|
101
104
|
"import": "./dist/attach.js"
|
|
102
105
|
},
|
|
103
|
-
"./ai/*": "./ai/*"
|
|
106
|
+
"./ai/*": "./ai/*",
|
|
107
|
+
"./setup": {
|
|
108
|
+
"types": "./setup/index.d.mts",
|
|
109
|
+
"import": "./setup/index.mjs"
|
|
110
|
+
},
|
|
111
|
+
"./setup/state.schema.json": "./setup/state.schema.json"
|
|
104
112
|
},
|
|
105
113
|
"files": [
|
|
106
114
|
"dist",
|
|
107
115
|
"ai",
|
|
116
|
+
"setup",
|
|
108
117
|
"llms.txt",
|
|
109
118
|
"README.md",
|
|
110
119
|
"CHANGELOG.md",
|
|
111
120
|
"LICENSE"
|
|
112
121
|
],
|
|
113
122
|
"scripts": {
|
|
114
|
-
"build": "tsup",
|
|
123
|
+
"build": "tsup && node scripts/clean-dist-output.mjs dist",
|
|
115
124
|
"dev": "tsup --watch",
|
|
116
125
|
"test": "vitest run --coverage",
|
|
117
126
|
"test:watch": "vitest",
|
|
@@ -123,13 +132,18 @@
|
|
|
123
132
|
"test:dist:examples": "npm run build && node node_modules/typescript7/bin/tsc -p site/src/examples/complete/tsconfig.json",
|
|
124
133
|
"test:dist:scaffold-typing": "npm run build && node node_modules/typescript7/bin/tsc -p tests/dist/scaffold-typing/tsconfig.json",
|
|
125
134
|
"test:browser": "npm run build && playwright test",
|
|
135
|
+
"test:ui": "npm --prefix ui test",
|
|
126
136
|
"bench:micro": "vitest bench --run --config vitest.config.bench.ts",
|
|
127
137
|
"bench:serve": "bash bench/site.sh",
|
|
128
|
-
"
|
|
138
|
+
"format": "prettier --write . --ignore-unknown",
|
|
139
|
+
"format:check": "prettier --check . --ignore-unknown",
|
|
140
|
+
"lint:eslint": "eslint src tests",
|
|
141
|
+
"lint": "npm run lint:eslint && npm run format:check",
|
|
129
142
|
"typecheck": "node node_modules/typescript7/bin/tsc --noEmit",
|
|
130
|
-
"check": "npm run lint && npm run typecheck && node scripts/check-doc-test-inventory.mjs && node scripts/check-doc-api-coverage.mjs && node scripts/check-doc-site-tickets.mjs && node scripts/check-cdn-versions.mjs && node scripts/check-dev-warn-docs.mjs && node scripts/check-skill-freshness.mjs && node scripts/check-design-rule-5.mjs && node scripts/check-feature-coverage.mjs && node scripts/check-ai-bundle.mjs && npm test && npm run build && node scripts/check-bundle-size.mjs && node scripts/check-doc-api-signatures.mjs && vitest run --config vitest.config.dist.ts && vitest run --config vitest.config.dist-full.ts && node node_modules/typescript7/bin/tsc -p tests/dist/jsx-typing/tsconfig.json && node node_modules/typescript7/bin/tsc -p site/src/examples/complete/tsconfig.json && node node_modules/typescript7/bin/tsc -p tests/dist/scaffold-typing/tsconfig.json && node scripts/check-docs-examples.mjs",
|
|
143
|
+
"check": "npm run lint && npm run typecheck && node scripts/check-doc-test-inventory.mjs && node scripts/check-doc-api-coverage.mjs && node scripts/check-doc-site-tickets.mjs && node scripts/check-cdn-versions.mjs && node scripts/check-dev-warn-docs.mjs && node scripts/check-skill-freshness.mjs && node scripts/check-design-rule-5.mjs && node scripts/check-feature-coverage.mjs && node scripts/sync-lockstep-versions.mjs --check && node scripts/check-ai-bundle.mjs && npm test && npm run build && node scripts/check-bundle-size.mjs && node scripts/check-doc-api-signatures.mjs && vitest run --config vitest.config.dist.ts && vitest run --config vitest.config.dist-full.ts && node node_modules/typescript7/bin/tsc -p tests/dist/jsx-typing/tsconfig.json && node node_modules/typescript7/bin/tsc -p site/src/examples/complete/tsconfig.json && node node_modules/typescript7/bin/tsc -p tests/dist/scaffold-typing/tsconfig.json && node scripts/check-docs-examples.mjs",
|
|
131
144
|
"check:docs:examples": "node scripts/check-docs-examples.mjs",
|
|
132
145
|
"check:full": "npm run check && npm run --silent check:audit && playwright test",
|
|
146
|
+
"check:ui": "npm --prefix ui run check",
|
|
133
147
|
"check:docs:test-inventory": "node scripts/check-doc-test-inventory.mjs",
|
|
134
148
|
"check:docs:api-coverage": "node scripts/check-doc-api-coverage.mjs",
|
|
135
149
|
"check:docs:site-tickets": "node scripts/check-doc-site-tickets.mjs",
|
|
@@ -139,6 +153,8 @@
|
|
|
139
153
|
"check:features": "node scripts/check-feature-coverage.mjs",
|
|
140
154
|
"check:ai-bundle-in-sync": "node scripts/check-ai-bundle.mjs",
|
|
141
155
|
"ai-bundle:sync": "node scripts/sync-ai-bundle.mjs",
|
|
156
|
+
"check:lockstep-versions": "node scripts/sync-lockstep-versions.mjs --check",
|
|
157
|
+
"sync:lockstep-versions": "node scripts/sync-lockstep-versions.mjs --write",
|
|
142
158
|
"clean": "rm -rf dist coverage node_modules/.cache",
|
|
143
159
|
"prepare": "husky",
|
|
144
160
|
"release": "bash scripts/release.sh",
|
|
@@ -158,34 +174,40 @@
|
|
|
158
174
|
"check:audit": "npm audit --omit=dev --audit-level=high"
|
|
159
175
|
},
|
|
160
176
|
"dependencies": {
|
|
161
|
-
"@preact/signals-core": "^1.14.1"
|
|
177
|
+
"@preact/signals-core": "^1.14.1",
|
|
178
|
+
"minimatch": "^9.0.9",
|
|
179
|
+
"yaml": "^2.9.1"
|
|
162
180
|
},
|
|
163
181
|
"devDependencies": {
|
|
164
182
|
"@eslint/js": "^10.0.1",
|
|
165
|
-
"@playwright/test": "^1.
|
|
183
|
+
"@playwright/test": "^1.63.0",
|
|
166
184
|
"@types/jsdom": "^28.0.1",
|
|
167
185
|
"@types/node": "^22.10.0",
|
|
168
186
|
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
169
187
|
"@typescript-eslint/parser": "^8.65.0",
|
|
170
|
-
"@vitest/coverage-v8": "^4.1.
|
|
171
|
-
"domotion-svg": "^0.
|
|
188
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
189
|
+
"domotion-svg": "^0.30.1",
|
|
172
190
|
"eslint": "^10.8.0",
|
|
173
191
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
174
192
|
"gitgist": "^1.1.0",
|
|
175
|
-
"happy-dom": "^20.
|
|
193
|
+
"happy-dom": "^20.14.5",
|
|
176
194
|
"http-server": "^14.1.1",
|
|
177
195
|
"husky": "^9.1.7",
|
|
178
196
|
"jsdom": "^29.1.1",
|
|
197
|
+
"prettier": "^3.9.8",
|
|
198
|
+
"prettier-plugin-astro": "^1.0.1",
|
|
199
|
+
"prettier-plugin-sh": "^0.19.0",
|
|
179
200
|
"tsup": "^8.3.0",
|
|
180
201
|
"typescript": "^6.0.3",
|
|
181
202
|
"typescript7": "npm:typescript@^7.0.2",
|
|
182
|
-
"vitest": "^4.1.
|
|
203
|
+
"vitest": "^4.1.11"
|
|
204
|
+
},
|
|
205
|
+
"overrides": {
|
|
206
|
+
"esbuild": "0.28.2"
|
|
183
207
|
},
|
|
184
208
|
"gitgist": {
|
|
185
209
|
"exclude": [
|
|
186
210
|
"site/public/demos/*.svg",
|
|
187
|
-
"site/src/content/docs/docs/*",
|
|
188
|
-
"site/src/content/docs/api.md",
|
|
189
211
|
"ai/*",
|
|
190
212
|
"site/public/llms.txt",
|
|
191
213
|
"bench/results.json",
|
package/setup/cli.mjs
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import console from 'node:console';
|
|
4
|
+
import process from 'node:process';
|
|
5
|
+
|
|
6
|
+
import { applyKerfSetup, formatSetupPlan, planKerfSetup } from './index.mjs';
|
|
7
|
+
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const command = args[0] && !args[0].startsWith('-') ? args.shift() : 'setup';
|
|
10
|
+
const take = (name) => {
|
|
11
|
+
const index = args.indexOf(name);
|
|
12
|
+
if (index < 0) return undefined;
|
|
13
|
+
const value = args[index + 1];
|
|
14
|
+
if (!value || value.startsWith('--'))
|
|
15
|
+
throw new Error(`${name} requires a value.`);
|
|
16
|
+
args.splice(index, 2);
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
const takeAll = (name) => {
|
|
20
|
+
const values = [];
|
|
21
|
+
while (args.includes(name)) values.push(take(name));
|
|
22
|
+
return values;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
27
|
+
console.log(`Usage: kerfjs setup [options]
|
|
28
|
+
|
|
29
|
+
Options:
|
|
30
|
+
--root <path> Workspace root (default: current directory)
|
|
31
|
+
--package <name> Select a workspace package by name or relative path
|
|
32
|
+
--core | --ui Choose a mode when it cannot be detected
|
|
33
|
+
--resolve <id>=<choice>
|
|
34
|
+
Resolve one conflict with keep or kerf (repeatable)
|
|
35
|
+
--write Apply the displayed plan (default is dry-run)
|
|
36
|
+
--yes Required with --write in non-interactive use
|
|
37
|
+
--offline Forbid registry access during dependency installation
|
|
38
|
+
--no-install Write configuration without running the package manager`);
|
|
39
|
+
process.exit(0);
|
|
40
|
+
}
|
|
41
|
+
if (command !== 'setup') throw new Error(`Unknown command ${command}.`);
|
|
42
|
+
const core = args.includes('--core');
|
|
43
|
+
const ui = args.includes('--ui');
|
|
44
|
+
if (core && ui) throw new Error('--core and --ui are mutually exclusive.');
|
|
45
|
+
const write = args.includes('--write');
|
|
46
|
+
const yes = args.includes('--yes');
|
|
47
|
+
const offline = args.includes('--offline');
|
|
48
|
+
const noInstall = args.includes('--no-install');
|
|
49
|
+
const root = take('--root');
|
|
50
|
+
const packageSelector = take('--package');
|
|
51
|
+
const resolutions = {};
|
|
52
|
+
for (const entry of takeAll('--resolve')) {
|
|
53
|
+
const index = entry.lastIndexOf('=');
|
|
54
|
+
if (index < 1) throw new Error('--resolve requires <id>=keep|kerf.');
|
|
55
|
+
const id = entry.slice(0, index);
|
|
56
|
+
const choice = entry.slice(index + 1);
|
|
57
|
+
if (id in resolutions && resolutions[id] !== choice)
|
|
58
|
+
throw new Error(`Conflicting resolutions for ${id}.`);
|
|
59
|
+
resolutions[id] = choice;
|
|
60
|
+
}
|
|
61
|
+
const known = new Set([
|
|
62
|
+
'--core',
|
|
63
|
+
'--ui',
|
|
64
|
+
'--write',
|
|
65
|
+
'--yes',
|
|
66
|
+
'--offline',
|
|
67
|
+
'--no-install',
|
|
68
|
+
]);
|
|
69
|
+
const unknown = args.filter((arg) => !known.has(arg));
|
|
70
|
+
if (unknown.length)
|
|
71
|
+
throw new Error(`Unknown arguments: ${unknown.join(' ')}`);
|
|
72
|
+
const plan = await planKerfSetup({
|
|
73
|
+
root,
|
|
74
|
+
package: packageSelector,
|
|
75
|
+
mode: ui ? 'ui' : core ? 'core' : undefined,
|
|
76
|
+
resolutions,
|
|
77
|
+
});
|
|
78
|
+
console.log(formatSetupPlan(plan));
|
|
79
|
+
if (plan.conflicts.length) {
|
|
80
|
+
process.exitCode = 2;
|
|
81
|
+
} else if (write) {
|
|
82
|
+
if (!yes)
|
|
83
|
+
throw new Error('--write requires --yes after reviewing the plan.');
|
|
84
|
+
await applyKerfSetup(plan, { install: !noInstall, offline });
|
|
85
|
+
console.log(`Applied ${plan.actions.length} change(s).`);
|
|
86
|
+
}
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error(`kerfjs setup: ${error.message}`);
|
|
89
|
+
process.exitCode = 2;
|
|
90
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface SetupConflict {
|
|
2
|
+
id: string;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SetupAction {
|
|
6
|
+
path: string;
|
|
7
|
+
absolutePath: string;
|
|
8
|
+
before: string | null;
|
|
9
|
+
after: string;
|
|
10
|
+
kind: string;
|
|
11
|
+
}
|
|
12
|
+
export interface KerfSetupPlan {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
root: string;
|
|
15
|
+
packageRoot: string;
|
|
16
|
+
packageName: string;
|
|
17
|
+
packageManager: 'npm' | 'pnpm' | 'yarn';
|
|
18
|
+
packageManagerVersion?: string;
|
|
19
|
+
packageManagerVariant?: 'classic' | 'berry';
|
|
20
|
+
mode: 'core' | 'ui';
|
|
21
|
+
setupVersion: string;
|
|
22
|
+
actions: SetupAction[];
|
|
23
|
+
conflicts: SetupConflict[];
|
|
24
|
+
generatedPaths: string[];
|
|
25
|
+
}
|
|
26
|
+
export function planKerfSetup(options?: {
|
|
27
|
+
root?: string;
|
|
28
|
+
package?: string;
|
|
29
|
+
mode?: 'core' | 'ui';
|
|
30
|
+
version?: string;
|
|
31
|
+
resolutions?: Record<string, 'keep' | 'kerf'>;
|
|
32
|
+
}): Promise<KerfSetupPlan>;
|
|
33
|
+
export function formatSetupPlan(plan: KerfSetupPlan): string;
|
|
34
|
+
export function applyKerfSetup(
|
|
35
|
+
plan: KerfSetupPlan,
|
|
36
|
+
options?: { install?: boolean; offline?: boolean; runner?: Function },
|
|
37
|
+
): Promise<{ changed: string[] }>;
|