olova 2.0.67 → 2.0.70
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 +5 -5
- package/README.md +42 -42
- package/dist/compiler.d.ts +76 -1
- package/dist/compiler.js +566 -420
- package/dist/compiler.js.map +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +400 -38
- package/dist/core.js.map +1 -1
- package/dist/global.d.ts +1 -1
- package/dist/global.js +54 -8
- package/dist/global.js.map +1 -1
- package/dist/index.js +534 -424
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts +8 -3
- package/dist/runtime.js +512 -32
- package/dist/runtime.js.map +1 -1
- package/dist/{signals-core-BdfWh1Yt.d.ts → signals-core-BWZ5zXK5.d.ts} +6 -5
- package/dist/vite.js +534 -424
- package/dist/vite.js.map +1 -1
- package/package.json +86 -83
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.1.0
|
|
4
|
-
|
|
5
|
-
- Initial standalone package setup for publishing the Olova plugin, compiler, runtime, and Vite integration.
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- Initial standalone package setup for publishing the Olova plugin, compiler, runtime, and Vite integration.
|
package/README.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# olova
|
|
2
|
-
|
|
3
|
-
Standalone npm package for the Olova compiler, runtime, and Vite plugin.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install olova
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Install Vite separately if you plan to use `olova/vite`.
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install -D vite
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Exports
|
|
18
|
-
|
|
19
|
-
- `olova`
|
|
20
|
-
- `olova/
|
|
21
|
-
- `olova/
|
|
22
|
-
- `olova/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Local package workflow
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install
|
|
31
|
-
npm run build
|
|
32
|
-
npm run pack:check
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Publish later
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm login
|
|
39
|
-
npm publish
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
If the `olova` package name is already taken on npm, change the `name` field in `package.json` before publishing.
|
|
1
|
+
# olova
|
|
2
|
+
|
|
3
|
+
Standalone npm package for the Olova compiler, runtime, and Vite plugin.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install olova
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Install Vite separately if you plan to use `olova/vite`.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -D vite
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Exports
|
|
18
|
+
|
|
19
|
+
- `olova`
|
|
20
|
+
- `olova/core`
|
|
21
|
+
- `olova/state`
|
|
22
|
+
- `olova/vite`
|
|
23
|
+
|
|
24
|
+
For app code, prefer importing from `olova/core`.
|
|
25
|
+
Use `olova/vite` only for the Vite plugin.
|
|
26
|
+
|
|
27
|
+
## Local package workflow
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install
|
|
31
|
+
npm run build
|
|
32
|
+
npm run pack:check
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Publish later
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm login
|
|
39
|
+
npm publish
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If the `olova` package name is already taken on npm, change the `name` field in `package.json` before publishing.
|
package/dist/compiler.d.ts
CHANGED
|
@@ -1,13 +1,88 @@
|
|
|
1
|
+
type StyleBlock = {
|
|
2
|
+
content: string;
|
|
3
|
+
attrs: Record<string, string | true>;
|
|
4
|
+
};
|
|
5
|
+
type ParsedOlovaFile = {
|
|
6
|
+
script: string;
|
|
7
|
+
template: string;
|
|
8
|
+
styles: StyleBlock[];
|
|
9
|
+
};
|
|
10
|
+
|
|
1
11
|
type CompileResult = {
|
|
2
12
|
code: string;
|
|
3
13
|
css?: string;
|
|
4
14
|
map?: unknown;
|
|
5
15
|
};
|
|
16
|
+
type TextBinding = {
|
|
17
|
+
id: string;
|
|
18
|
+
expr: string;
|
|
19
|
+
};
|
|
20
|
+
type HtmlBinding = {
|
|
21
|
+
id: string;
|
|
22
|
+
expr: string;
|
|
23
|
+
};
|
|
24
|
+
type AttrBinding = {
|
|
25
|
+
id: string;
|
|
26
|
+
attr: string;
|
|
27
|
+
expr: string;
|
|
28
|
+
};
|
|
29
|
+
type EventBinding = {
|
|
30
|
+
id: string;
|
|
31
|
+
event: string;
|
|
32
|
+
expr: string;
|
|
33
|
+
};
|
|
34
|
+
type SlotBinding = {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
};
|
|
38
|
+
type SlotFactoryDef = {
|
|
39
|
+
varName: string;
|
|
40
|
+
name: string;
|
|
41
|
+
descriptor: TemplateTransformResult;
|
|
42
|
+
};
|
|
43
|
+
type ComponentBinding = {
|
|
44
|
+
id: string;
|
|
45
|
+
component: string;
|
|
46
|
+
propsExpr: string;
|
|
47
|
+
slotFactories: SlotFactoryDef[];
|
|
48
|
+
};
|
|
49
|
+
type IfBinding = {
|
|
50
|
+
id: string;
|
|
51
|
+
expr: string;
|
|
52
|
+
trueBranch: TemplateTransformResult;
|
|
53
|
+
falseBranch?: TemplateTransformResult;
|
|
54
|
+
};
|
|
55
|
+
type TemplateTransformResult = {
|
|
56
|
+
html: string;
|
|
57
|
+
textBindings: TextBinding[];
|
|
58
|
+
htmlBindings: HtmlBinding[];
|
|
59
|
+
attrBindings: AttrBinding[];
|
|
60
|
+
eventBindings: EventBinding[];
|
|
61
|
+
slotBindings: SlotBinding[];
|
|
62
|
+
componentBindings: ComponentBinding[];
|
|
63
|
+
ifBindings: IfBinding[];
|
|
64
|
+
buildFnStr?: string;
|
|
65
|
+
};
|
|
66
|
+
declare function collectScriptInfo(script: string): {
|
|
67
|
+
importsCode: string;
|
|
68
|
+
scriptBodyCode: string;
|
|
69
|
+
stateNames: Set<string>;
|
|
70
|
+
allSignalNames: Set<string>;
|
|
71
|
+
componentNames: Set<string>;
|
|
72
|
+
jsxFunctionNames: Set<string>;
|
|
73
|
+
};
|
|
6
74
|
interface CompileOptions {
|
|
7
75
|
filename?: string;
|
|
8
76
|
dev?: boolean;
|
|
9
77
|
exportName?: string;
|
|
10
78
|
}
|
|
79
|
+
type CompilePhasesResult = {
|
|
80
|
+
parsed: ParsedOlovaFile;
|
|
81
|
+
script: ReturnType<typeof collectScriptInfo>;
|
|
82
|
+
template: TemplateTransformResult;
|
|
83
|
+
scopeId?: string;
|
|
84
|
+
};
|
|
85
|
+
declare function analyzeOlovaPhases(source: string, options?: CompileOptions): CompilePhasesResult;
|
|
11
86
|
declare function compileOlovaScriptModule(source: string, options?: CompileOptions): CompileResult;
|
|
12
87
|
declare function compileOlova(source: string, options?: CompileOptions): CompileResult;
|
|
13
88
|
|
|
@@ -41,4 +116,4 @@ declare function generateBuildFunction(html: string, stateNames: Set<string>, tr
|
|
|
41
116
|
containsJsx: boolean;
|
|
42
117
|
}, counters: TransformContext, componentNames: Set<string>): string;
|
|
43
118
|
|
|
44
|
-
export { compileOlova, compileOlovaScriptModule, generateBuildFunction, parseHTML };
|
|
119
|
+
export { analyzeOlovaPhases, compileOlova, compileOlovaScriptModule, generateBuildFunction, parseHTML };
|