@polyglot-bundles/th-stories 0.2.3 → 0.3.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 +37 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,44 +1,55 @@
|
|
|
1
1
|
# Thai Stories Bundle
|
|
2
2
|
|
|
3
|
-
**Package:** `@polyglot/
|
|
3
|
+
**Package:** `@polyglot-bundles/th-stories`
|
|
4
4
|
|
|
5
|
-
Thai
|
|
5
|
+
Thai Little Scoops stories in raw `.ink` format.
|
|
6
6
|
|
|
7
|
-
## Stories Included
|
|
7
|
+
## Stories Included (9)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
9
|
+
| Slug | Story Name |
|
|
10
|
+
|------|-----------|
|
|
11
|
+
| `a-day-at-the-park` | วันหนึ่งที่สวนสาธารณะ |
|
|
12
|
+
| `a-job-interview` | A Job Interview |
|
|
13
|
+
| `getting-breakfast` | Getting Breakfast |
|
|
14
|
+
| `making-requests` | Making Requests |
|
|
15
|
+
| `marys-hobbies` | Mary's Hobbies |
|
|
16
|
+
| `petes-defense` | Pete's Defense |
|
|
17
|
+
| `supermarket` | ซูเปอร์มาร์เก็ต |
|
|
18
|
+
| `supermarket.test` | Supermarket (test) |
|
|
19
|
+
| `work-life-balance` | Work Life Balance |
|
|
17
20
|
|
|
18
21
|
## Usage
|
|
19
22
|
|
|
20
23
|
```typescript
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
import { stories, Story } from "@polyglot-bundles/th-stories";
|
|
25
|
+
|
|
26
|
+
// All stories as raw .ink source strings
|
|
27
|
+
for (const story of stories) {
|
|
28
|
+
console.log(`${story.slug}: ${story.content.length} chars`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Type definition
|
|
32
|
+
interface Story {
|
|
33
|
+
slug: string; // filename without extension, e.g. "a-day-at-the-park"
|
|
34
|
+
content: string; // raw .ink source
|
|
35
|
+
}
|
|
29
36
|
```
|
|
30
37
|
|
|
31
38
|
## Structure
|
|
32
39
|
|
|
33
40
|
```
|
|
34
41
|
src/
|
|
35
|
-
├── stories/ #
|
|
36
|
-
│ ├── *.
|
|
37
|
-
│ └──
|
|
38
|
-
├──
|
|
39
|
-
└──
|
|
42
|
+
├── stories/ # .ink source files
|
|
43
|
+
│ ├── *.ink
|
|
44
|
+
│ └── *.test.ink
|
|
45
|
+
├── index.ts # Loads and exports all stories via Vite glob
|
|
46
|
+
└── env.d.ts # Vite client types
|
|
40
47
|
```
|
|
41
48
|
|
|
42
|
-
##
|
|
49
|
+
## Import in Vite-based Projects
|
|
50
|
+
|
|
51
|
+
This package uses Vite's `import.meta.glob` to load `.ink` files at build time. The raw content is bundled directly - no runtime file system access needed.
|
|
52
|
+
|
|
53
|
+
## Note
|
|
43
54
|
|
|
44
|
-
This
|
|
55
|
+
This package exports **raw `.ink` source**, not compiled GLOST JSON. Consuming projects are responsible for compiling `.ink` to GLOST format using inkjs.
|