@polyglot-bundles/th-stories 1.1.0 → 1.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/package.json +18 -7
- package/src/index.ts +6 -18
package/package.json
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polyglot-bundles/th-stories",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Thai Little Scoops stories - .ink source files from polyglot-bundles",
|
|
6
|
-
"main": "./
|
|
7
|
-
"types": "./
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
"files": [
|
|
15
|
+
"dist",
|
|
9
16
|
"src"
|
|
10
17
|
],
|
|
11
|
-
"dependencies": {
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@polyglot-bundles/stories-base": "0.7.0"
|
|
20
|
+
},
|
|
12
21
|
"publishConfig": {
|
|
13
22
|
"access": "public"
|
|
14
23
|
},
|
|
@@ -22,15 +31,17 @@
|
|
|
22
31
|
"license": "MIT",
|
|
23
32
|
"repository": {
|
|
24
33
|
"type": "git",
|
|
25
|
-
"url": "https://github.com/fustilio/polyglot-bundles",
|
|
34
|
+
"url": "git+https://github.com/fustilio/polyglot-bundles.git",
|
|
26
35
|
"directory": "packages/th/stories"
|
|
27
36
|
},
|
|
28
37
|
"devDependencies": {
|
|
38
|
+
"vite": "^8.0.8",
|
|
39
|
+
"vite-plugin-dts": "^4.5.4",
|
|
29
40
|
"@polyglot-bundles/lang-tooling": "0.0.0"
|
|
30
41
|
},
|
|
31
42
|
"scripts": {
|
|
32
43
|
"typecheck": "tsc --noEmit",
|
|
33
|
-
"build": "
|
|
34
|
-
"clean": "
|
|
44
|
+
"build": "vite build",
|
|
45
|
+
"clean": "rm -rf dist"
|
|
35
46
|
}
|
|
36
47
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Thai Little Scoops
|
|
2
|
+
* @polyglot-bundles/th-stories — Thai Little Scoops stories.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Example usage:
|
|
8
|
-
* ```ts
|
|
9
|
-
* import { stories } from '@polyglot-bundles/th-stories';
|
|
10
|
-
* // stories is an array of .ink source strings
|
|
11
|
-
* ```
|
|
4
|
+
* Source `.ink` files live in `src/stories/`. Loaded eagerly at build time
|
|
5
|
+
* via Vite's glob import.
|
|
12
6
|
*/
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
slug: string;
|
|
16
|
-
content: string;
|
|
17
|
-
}
|
|
8
|
+
import { loadStoriesFromGlob, type Story } from "@polyglot-bundles/stories-base";
|
|
18
9
|
|
|
19
|
-
// Load all .ink files from src/stories/ at build time via Vite's glob import
|
|
20
10
|
const modules = import.meta.glob<string>("./stories/*.ink", {
|
|
21
11
|
query: "?raw",
|
|
22
12
|
import: "default",
|
|
23
13
|
eager: true,
|
|
24
14
|
});
|
|
25
15
|
|
|
26
|
-
export const stories: Story[] =
|
|
27
|
-
|
|
28
|
-
content,
|
|
29
|
-
}));
|
|
16
|
+
export const stories: Story[] = loadStoriesFromGlob(modules);
|
|
17
|
+
export type { Story };
|