@vylos/cli 0.4.4 → 0.5.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 +66 -0
- package/package.json +2 -2
- package/templates/main.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @vylos/cli
|
|
2
|
+
|
|
3
|
+
CLI tooling for [Vylos](https://github.com/DevOpsBenjamin/Vylos) — scaffold, develop, and build visual novel projects.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@vylos/cli)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add -D @vylos/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Node.js >= 22.0.0.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Scaffold a new project
|
|
19
|
+
npx vylos create my-game
|
|
20
|
+
cd my-game
|
|
21
|
+
pnpm install
|
|
22
|
+
pnpm dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This generates a ready-to-run project with:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
my-game/
|
|
29
|
+
├── main.ts # Bootstrap
|
|
30
|
+
├── vylos.config.ts # Project metadata
|
|
31
|
+
├── plugins/my-game/ # Your game types
|
|
32
|
+
│ ├── index.ts # Barrel export
|
|
33
|
+
│ ├── characters.ts # Character extends VylosCharacter
|
|
34
|
+
│ ├── player.ts # Player extends Character
|
|
35
|
+
│ └── gameState.ts # GameState extends VylosGameState
|
|
36
|
+
├── locations/home/location.ts # Starter location
|
|
37
|
+
├── global/events/intro.ts # Intro event
|
|
38
|
+
└── global/actions/wait.ts # Wait action
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
All imports use the `@game` alias — no relative path mess:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import type { GameState } from '@game';
|
|
45
|
+
import { narrator } from '@game';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Commands
|
|
49
|
+
|
|
50
|
+
| Command | Description |
|
|
51
|
+
|---------|-------------|
|
|
52
|
+
| `vylos create <name>` | Scaffold a new project |
|
|
53
|
+
| `vylos dev [dir]` | Start Vite dev server |
|
|
54
|
+
| `vylos build [dir]` | Build single-file HTML for production |
|
|
55
|
+
|
|
56
|
+
## How it works
|
|
57
|
+
|
|
58
|
+
The CLI wraps Vite with pre-configured plugins for Vue, Tailwind CSS v4, and single-file HTML output. It automatically resolves the `@game` alias by scanning the `plugins/` directory, so the tsconfig path and Vite alias stay in sync.
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
Full docs and examples: [github.com/DevOpsBenjamin/Vylos](https://github.com/DevOpsBenjamin/Vylos)
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
[MIT](https://github.com/DevOpsBenjamin/Vylos/blob/main/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vylos/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/DevOpsBenjamin/Vylos"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"tailwindcss": "^4.0.0",
|
|
18
18
|
"@tailwindcss/vite": "^4.0.0",
|
|
19
19
|
"tsx": "^4.19.2",
|
|
20
|
-
"@vylos/core": "0.
|
|
20
|
+
"@vylos/core": "0.5.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"typescript": "^5.7.2"
|
package/templates/main.ts
CHANGED
|
@@ -62,6 +62,8 @@ const callbacks: EventRunnerCallbacks = {
|
|
|
62
62
|
onClear() {
|
|
63
63
|
engineState.setDialogue(null);
|
|
64
64
|
engineState.setChoices(null);
|
|
65
|
+
engineState.setForeground(null);
|
|
66
|
+
engineState.setOverlay(null);
|
|
65
67
|
},
|
|
66
68
|
resolveText(entry: string | TextEntry) {
|
|
67
69
|
return typeof entry === 'string' ? entry : entry['en'] ?? Object.values(entry)[0] ?? '';
|