aktion-runtime 0.5.3 → 0.5.5
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 +126 -31
- package/dist/aktion.iife.js +106 -460
- package/dist/aktion.iife.js.map +1 -1
- package/dist/aktion.js +5688 -5055
- package/dist/aktion.js.map +1 -1
- package/dist/aktion.umd.cjs +106 -460
- package/dist/aktion.umd.cjs.map +1 -1
- package/dist/devtools.js +1367 -0
- package/dist/devtools.js.map +1 -0
- package/dist/language.js +15311 -0
- package/dist/language.js.map +1 -0
- package/dist/plugin.cjs +2650 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.js +2650 -0
- package/dist/plugin.js.map +1 -0
- package/dist/system_prompt.txt +164 -447
- package/dist/system_prompt_chat.txt +33 -84
- package/dist/testing.js +29496 -0
- package/dist/testing.js.map +1 -0
- package/dist/types/aktion-modules.d.ts +18 -0
- package/dist/types/compiler/index.d.ts +12 -0
- package/dist/types/compiler/linker.d.ts +27 -0
- package/dist/types/compiler/project.d.ts +45 -0
- package/dist/types/compiler/runtime.d.ts +59 -0
- package/dist/types/devtools/hook.d.ts +88 -0
- package/dist/types/devtools/index.d.ts +35 -0
- package/dist/types/devtools/panel.d.ts +109 -0
- package/dist/types/devtools/protocol.d.ts +130 -0
- package/dist/types/devtools/styles.d.ts +7 -0
- package/dist/types/element.d.ts +76 -8
- package/dist/types/index.d.ts +1 -0
- package/dist/types/language-api.d.ts +15 -0
- package/dist/types/parser/types.d.ts +38 -1
- package/dist/types/plugin/index.d.ts +17 -0
- package/dist/types/renderer/renderer.d.ts +28 -0
- package/dist/types/runtime/builtins.d.ts +5 -11
- package/dist/types/runtime/effects.d.ts +15 -0
- package/dist/types/runtime/http.d.ts +0 -1
- package/dist/types/testing/index.d.ts +201 -0
- package/dist/types/theme/index.d.ts +3 -3
- package/dist/types/theme/styles.d.ts +1 -1
- package/dist/types/tooling/formatter.d.ts +7 -1
- package/dist/types/tooling/index.d.ts +0 -3
- package/package.json +35 -2
- package/dist/types/library/components/theme.d.ts +0 -2
- package/dist/types/tooling/codemod.d.ts +0 -36
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParseError } from '../parser/types.js';
|
|
1
|
+
import { ParseError, Program } from '../parser/types.js';
|
|
2
2
|
export interface FormatResult {
|
|
3
3
|
/** Canonical source. Equal to the input when parse errors occur. */
|
|
4
4
|
formatted: string;
|
|
@@ -6,3 +6,9 @@ export interface FormatResult {
|
|
|
6
6
|
errors: ParseError[];
|
|
7
7
|
}
|
|
8
8
|
export declare function formatProgram(source: string): FormatResult;
|
|
9
|
+
/**
|
|
10
|
+
* Re-emit a parsed `Program` as canonical Aktion source. Exported so the
|
|
11
|
+
* module linker can serialise a merged (multi-file → single) program back to
|
|
12
|
+
* text for `mountCompiled`'s round-trip fields (reconnect re-parse, snapshots).
|
|
13
|
+
*/
|
|
14
|
+
export declare function printProgram(program: Program): string;
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*
|
|
12
12
|
* - `formatProgram(source)` — canonical pretty-printer.
|
|
13
13
|
* - `applyDelta(source, ops)` — structured edit protocol (§14).
|
|
14
|
-
* - `migrateV1(source)` — best-effort v1 → 0.5 codemod (Appendix A).
|
|
15
14
|
* - `inspectAST(source)` — Committed + Drafting AST snapshot.
|
|
16
15
|
* - `getDiagnostics(source, library)` — language-service diagnostics.
|
|
17
16
|
* - `getCompletions(source, position, library)` — completions.
|
|
@@ -21,8 +20,6 @@ export { formatProgram } from './formatter.js';
|
|
|
21
20
|
export type { FormatResult } from './formatter.js';
|
|
22
21
|
export { applyDelta } from './delta.js';
|
|
23
22
|
export type { DeltaOp, DeltaResult } from './delta.js';
|
|
24
|
-
export { migrateV1 } from './codemod.js';
|
|
25
|
-
export type { MigrateV1Result } from './codemod.js';
|
|
26
23
|
export { inspectAST, inspectProgram } from './inspector.js';
|
|
27
24
|
export type { InspectorBinding, InspectorView } from './inspector.js';
|
|
28
25
|
export { getDiagnostics, getCompletions, getHoverInfo, } from './language-service.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aktion-runtime",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Aktion is a single web component that turns a compact, streaming-first DSL into a rich, interactive UI inside its shadow DOM. Works in React, Vue, Angular, Svelte, plain HTML — or no framework at all.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -12,6 +12,26 @@
|
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
|
+
"./test": {
|
|
16
|
+
"types": "./dist/types/testing/index.d.ts",
|
|
17
|
+
"import": "./dist/testing.js"
|
|
18
|
+
},
|
|
19
|
+
"./devtools": {
|
|
20
|
+
"types": "./dist/types/devtools/index.d.ts",
|
|
21
|
+
"import": "./dist/devtools.js"
|
|
22
|
+
},
|
|
23
|
+
"./language": {
|
|
24
|
+
"types": "./dist/types/language-api.d.ts",
|
|
25
|
+
"import": "./dist/language.js"
|
|
26
|
+
},
|
|
27
|
+
"./vite": {
|
|
28
|
+
"types": "./dist/types/plugin/index.d.ts",
|
|
29
|
+
"import": "./dist/plugin.js",
|
|
30
|
+
"require": "./dist/plugin.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./aktion-modules": {
|
|
33
|
+
"types": "./dist/types/aktion-modules.d.ts"
|
|
34
|
+
},
|
|
15
35
|
"./style.css": "./dist/aktion.css",
|
|
16
36
|
"./system_prompt.txt": "./dist/system_prompt.txt",
|
|
17
37
|
"./system_prompt_chat.txt": "./dist/system_prompt_chat.txt"
|
|
@@ -24,8 +44,12 @@
|
|
|
24
44
|
},
|
|
25
45
|
"scripts": {
|
|
26
46
|
"dev": "npm run build && vite",
|
|
27
|
-
"build": "tsc -p tsconfig.build.json && vite build && node scripts/emit-prompt.mjs && node scripts/emit-entry.mjs",
|
|
47
|
+
"build": "tsc -p tsconfig.build.json && vite build && vite build --config vite.testing.config.ts && vite build --config vite.devtools.config.ts && vite build --config vite.language.config.ts && vite build --config vite.plugin.config.ts && node scripts/emit-prompt.mjs && node scripts/emit-entry.mjs",
|
|
28
48
|
"build:lib": "vite build",
|
|
49
|
+
"build:test": "vite build --config vite.testing.config.ts",
|
|
50
|
+
"build:devtools": "vite build --config vite.devtools.config.ts",
|
|
51
|
+
"build:language": "vite build --config vite.language.config.ts",
|
|
52
|
+
"build:plugin": "vite build --config vite.plugin.config.ts",
|
|
29
53
|
"build:prompt": "node scripts/emit-prompt.mjs",
|
|
30
54
|
"build:entry": "node scripts/emit-entry.mjs",
|
|
31
55
|
"build:docs": "node scripts/build-docs.mjs",
|
|
@@ -34,7 +58,16 @@
|
|
|
34
58
|
"test:watch": "vitest",
|
|
35
59
|
"prepublishOnly": "npm run build"
|
|
36
60
|
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"vite": "^5.0.0 || ^6.0.0"
|
|
63
|
+
},
|
|
64
|
+
"peerDependenciesMeta": {
|
|
65
|
+
"vite": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
37
69
|
"devDependencies": {
|
|
70
|
+
"@types/node": "^20.19.41",
|
|
38
71
|
"typescript": "^5.6.3",
|
|
39
72
|
"vite": "^5.4.10",
|
|
40
73
|
"vite-plugin-dts": "^4.3.0",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Aktion 0.5 §27 — automatic v1 → 0.5 source codemod.
|
|
3
|
-
*
|
|
4
|
-
* The migration helper accepts a *v1* source string and returns a
|
|
5
|
-
* best-effort *0.5* equivalent, plus a list of advisory notes describing
|
|
6
|
-
* each transformation. The codemod targets the legacy surfaces enumerated
|
|
7
|
-
* in `language-update-final.md` Appendix A; surfaces that have no clean
|
|
8
|
-
* textual rewrite (e.g. `Action([@Set, …])`'s open-ended payload DSL)
|
|
9
|
-
* surface a note pointing the author at the manual migration path.
|
|
10
|
-
*
|
|
11
|
-
* Why a text codemod rather than an AST-to-AST one? The v1 grammar is
|
|
12
|
-
* accepted as a hard parse error by the current parser (the legacy
|
|
13
|
-
* `name=value`, `$$x` sigil, `Name(args) = expr` macros, etc. all raise
|
|
14
|
-
* definitive errors). Re-introducing v1 syntax just to round-trip
|
|
15
|
-
* through the parser would defeat the purpose of removing it — and a
|
|
16
|
-
* focused set of regexes handles the line-oriented transforms cleanly
|
|
17
|
-
* because the v1 grammar is itself line-oriented.
|
|
18
|
-
*
|
|
19
|
-
* The codemod is idempotent: feeding its output back through `migrateV1`
|
|
20
|
-
* is a no-op.
|
|
21
|
-
*/
|
|
22
|
-
export interface MigrateV1Result {
|
|
23
|
-
/** Best-effort 0.5 source. */
|
|
24
|
-
source: string;
|
|
25
|
-
/** Human-readable record of every transform that fired, in source order. */
|
|
26
|
-
notes: string[];
|
|
27
|
-
/** Hand-migration hints for surfaces that have no clean text rewrite. */
|
|
28
|
-
manualMigrations: string[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Run the v1 → 0.5 codemod on `source`. The transform is best-effort:
|
|
32
|
-
* unmigratable surfaces produce a `manualMigrations` note instead of an
|
|
33
|
-
* automatic rewrite, so the caller knows which lines still need a human
|
|
34
|
-
* touch.
|
|
35
|
-
*/
|
|
36
|
-
export declare function migrateV1(source: string): MigrateV1Result;
|