@polyglot-bundles/th-stories 1.1.0 → 1.2.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.
Files changed (2) hide show
  1. package/package.json +17 -6
  2. 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.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "description": "Thai Little Scoops stories - .ink source files from polyglot-bundles",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
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.1.0"
20
+ },
12
21
  "publishConfig": {
13
22
  "access": "public"
14
23
  },
@@ -26,11 +35,13 @@
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": "echo 'No build needed - source files only'",
34
- "clean": "echo 'No cleanup needed'"
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 Stories Bundle
2
+ * @polyglot-bundles/th-stories — Thai Little Scoops stories.
3
3
  *
4
- * This package contains Thai Little Scoops stories in .ink format.
5
- * The source files are in src/stories/
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
- export interface Story {
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[] = Object.entries(modules).map(([path, content]) => ({
27
- slug: path.replace("./stories/", "").replace(".ink", ""),
28
- content,
29
- }));
16
+ export const stories: Story[] = loadStoriesFromGlob(modules);
17
+ export type { Story };