kawaijs 0.1.11 → 0.1.13
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 +51 -4
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +152 -1147
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +132 -55
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts +1 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +301 -1258
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/embed.d.ts +25 -0
- package/dist/commands/embed.d.ts.map +1 -0
- package/dist/commands/embed.js +110 -0
- package/dist/commands/embed.js.map +1 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +104 -6
- package/dist/commands/validate.js.map +1 -1
- package/dist/config.d.ts +119 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +93 -0
- package/dist/config.js.map +1 -0
- package/dist/i18n.d.ts +8 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +49 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -33
- package/dist/index.js.map +1 -1
- package/dist/parse-args.d.ts +29 -0
- package/dist/parse-args.d.ts.map +1 -0
- package/dist/parse-args.js +106 -0
- package/dist/parse-args.js.map +1 -0
- package/dist/pwa.d.ts +22 -0
- package/dist/pwa.d.ts.map +1 -0
- package/dist/pwa.js +151 -0
- package/dist/pwa.js.map +1 -0
- package/dist/runtime-bundle.d.ts +3 -0
- package/dist/runtime-bundle.d.ts.map +1 -0
- package/dist/runtime-bundle.js +76 -0
- package/dist/runtime-bundle.js.map +1 -0
- package/dist/seo.d.ts +81 -0
- package/dist/seo.d.ts.map +1 -0
- package/dist/seo.js +534 -0
- package/dist/seo.js.map +1 -0
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -23,9 +23,10 @@ character yumia "Yumia" #f43f5e
|
|
|
23
23
|
|
|
24
24
|
label start:
|
|
25
25
|
scene bg classroom with fade
|
|
26
|
-
|
|
26
|
+
vfx sakura
|
|
27
|
+
show yumia happy at center with bounce
|
|
27
28
|
|
|
28
|
-
yumia "Good morning!
|
|
29
|
+
yumia "Good morning! Ready for the festival under the cherry blossoms?"
|
|
29
30
|
|
|
30
31
|
menu:
|
|
31
32
|
"Yes, absolutely!":
|
|
@@ -35,7 +36,7 @@ label start:
|
|
|
35
36
|
jump not_ready
|
|
36
37
|
|
|
37
38
|
label ready:
|
|
38
|
-
show yumia excited
|
|
39
|
+
show yumia excited with nod
|
|
39
40
|
yumia "Awesome! Let's get to work."
|
|
40
41
|
return
|
|
41
42
|
|
|
@@ -55,6 +56,8 @@ npx kawaijs create my-novel
|
|
|
55
56
|
cd my-novel
|
|
56
57
|
```
|
|
57
58
|
|
|
59
|
+
`create` copies the showcase starter (fade, sakura, sprite transitions, CG routes). Run `npx kawa dev ./examples/hello-world` in the monorepo for the same demo.
|
|
60
|
+
|
|
58
61
|
### 2. Validate Your Script
|
|
59
62
|
|
|
60
63
|
```bash
|
|
@@ -67,9 +70,10 @@ npx kawaijs validate
|
|
|
67
70
|
|
|
68
71
|
- **🌐 Web-Native**: Runs directly in modern browsers with zero backend dependencies. Deploy to GitHub Pages, Netlify, Vercel, Cloudflare Pages, or itch.io.
|
|
69
72
|
- **✍️ Writer-Friendly**: Indentation-based Kawa Script designed for narrative designers and story writers.
|
|
73
|
+
- **🌸 Atmosphere**: `vfx sakura` / rain / snow / fog / tint, scene `with fade`, sprite `with bounce|dissolve|nod`.
|
|
70
74
|
- **🎨 Deep CSS Theming**: Customize dialogue boxes, choice overlays, buttons, fonts, and animations using standard CSS and CSS custom properties.
|
|
71
75
|
- **⏱️ Deterministic Rollback**: Step backwards through dialogue and choices with instant snapshot rollbacks (`vm.rollback()`).
|
|
72
|
-
- **💾 Save & Load**: Built-in persistence for game save slots using LocalStorage
|
|
76
|
+
- **💾 Save & Load**: Built-in persistence for game save slots using LocalStorage (schema v2 with history).
|
|
73
77
|
- **📦 Modular Architecture**: Decoupled compiler (`@kawaijs/parser`), headless state machine (`@kawaijs/runtime`), and presentation layer (`@kawaijs/renderer-dom`).
|
|
74
78
|
|
|
75
79
|
---
|
|
@@ -80,6 +84,12 @@ npx kawaijs validate
|
|
|
80
84
|
# Create a new visual novel project
|
|
81
85
|
kawa create <project-name>
|
|
82
86
|
|
|
87
|
+
# Dev server (live reload) — optional deep-link + port
|
|
88
|
+
kawa dev [path] [--port 3000] [--at label]
|
|
89
|
+
|
|
90
|
+
# Static production bundle
|
|
91
|
+
kawa build [path] [--out dist] [--at label]
|
|
92
|
+
|
|
83
93
|
# Validate syntax, jump labels, and asset links
|
|
84
94
|
kawa validate [path]
|
|
85
95
|
|
|
@@ -87,6 +97,43 @@ kawa validate [path]
|
|
|
87
97
|
kawa version
|
|
88
98
|
```
|
|
89
99
|
|
|
100
|
+
Browser URL flags: `?at=<label>` (deep-link), `?embed=1` (iframe mode), `?continue=<token>` (restore shared save).
|
|
101
|
+
|
|
102
|
+
### SEO, favicon & social
|
|
103
|
+
|
|
104
|
+
Configure in `game/kawa.config.json`:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"seo": {
|
|
109
|
+
"favicon": "favicon.svg",
|
|
110
|
+
"description": "Your game blurb",
|
|
111
|
+
"keywords": ["visual novel", "web"],
|
|
112
|
+
"canonicalUrl": "https://you.example/game/",
|
|
113
|
+
"locale": "it_IT",
|
|
114
|
+
"twitterSite": "@studio"
|
|
115
|
+
},
|
|
116
|
+
"share": {
|
|
117
|
+
"defaultImage": "backgrounds/cover.png",
|
|
118
|
+
"twitterCard": "summary_large_image"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
- Drop `game/favicon.svg` (or `.png` / `.ico`) — or set `seo.favicon`
|
|
124
|
+
- `kawa build` copies the favicon into `dist/`, sets `<link rel="icon">` / apple-touch, OG/Twitter/JSON-LD, and uses it as the PWA icon
|
|
125
|
+
- With `seo.canonicalUrl`, also writes `dist/robots.txt`
|
|
126
|
+
|
|
127
|
+
`kawa build` emits a PWA (`manifest.webmanifest`, `sw.js`, icon) by default.
|
|
128
|
+
|
|
129
|
+
### Embed kit
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
kawa embed --width 960 --height 540 --at start --src https://you.example/game/
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Prints a responsive iframe snippet with `?embed=1` (and optional `?at=`).
|
|
136
|
+
|
|
90
137
|
---
|
|
91
138
|
|
|
92
139
|
## 📦 Modular Packages
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,UAAU,SAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CA4OlF"}
|