create-react-native-library-template 0.1.0 → 0.1.3

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 (27) hide show
  1. package/README.md +1 -1
  2. package/index.mjs +2 -1
  3. package/package.json +1 -1
  4. package/template/.github/workflows/deploy-storybook.yml +47 -0
  5. package/template/.husky/pre-commit +3 -0
  6. package/template/AGENTS.md +44 -28
  7. package/template/README.md +2 -2
  8. package/template/bun.lock +26 -23
  9. package/template/package.json +10 -8
  10. package/template/packages/ui/CHANGELOG.md +34 -0
  11. package/template/packages/ui/package.json +2 -1
  12. package/template/scripts/version-packages.mjs +21 -0
  13. /package/template/{apps → storybook}/native/.rnstorybook/index.tsx +0 -0
  14. /package/template/{apps → storybook}/native/.rnstorybook/main.ts +0 -0
  15. /package/template/{apps → storybook}/native/.rnstorybook/preview.tsx +0 -0
  16. /package/template/{apps → storybook}/native/app.json +0 -0
  17. /package/template/{apps → storybook}/native/babel.config.js +0 -0
  18. /package/template/{apps → storybook}/native/index.ts +0 -0
  19. /package/template/{apps → storybook}/native/metro.config.js +0 -0
  20. /package/template/{apps → storybook}/native/package.json +0 -0
  21. /package/template/{apps → storybook}/native/tsconfig.json +0 -0
  22. /package/template/{apps/storybook → storybook/web}/.storybook/main.ts +0 -0
  23. /package/template/{apps/storybook → storybook/web}/.storybook/preview.tsx +0 -0
  24. /package/template/{apps/storybook → storybook/web}/.storybook/vitest.setup.ts +0 -0
  25. /package/template/{apps/storybook → storybook/web}/package.json +0 -0
  26. /package/template/{apps/storybook → storybook/web}/tsconfig.json +0 -0
  27. /package/template/{apps/storybook → storybook/web}/vitest.config.ts +0 -0
package/README.md CHANGED
@@ -9,7 +9,7 @@ bun create react-native-library-template my-library
9
9
 
10
10
  ## What you get
11
11
 
12
- - **Bun workspaces** monorepo: the library (`packages/ui`), a web Storybook (`apps/storybook`), and an Expo app running Storybook on device (`apps/native`).
12
+ - **Bun workspaces** monorepo: the library (`packages/ui`), a web Storybook (`storybook/web`), and an Expo app running Storybook on device (`storybook/native`).
13
13
  - **Storybook 10** on web (react-native-web + Vite) and native, sharing the same CSF3 stories.
14
14
  - **Vitest** unit tests (jsdom + react-native-web) and story tests (browser mode, `play` functions).
15
15
  - **Biome** linting/formatting, **TypeScript** strict mode.
package/index.mjs CHANGED
@@ -51,8 +51,9 @@ Scaffolded ${projectName} in ${targetDir}
51
51
 
52
52
  Next steps:
53
53
  cd ${target}
54
+ git init
54
55
  bun install
55
- git init && git add -A && git commit -m "Initial commit"
56
+ git add -A && git commit -m "Initial commit"
56
57
 
57
58
  Useful commands:
58
59
  bun run storybook # web Storybook at http://localhost:6006
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-react-native-library-template",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "Scaffold a React Native UI library monorepo: Bun workspaces, Expo, Storybook (web + native), Vitest, Biome and Changesets",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,47 @@
1
+ name: Deploy Storybook
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ concurrency:
9
+ group: pages
10
+ cancel-in-progress: false
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ jobs:
18
+ build:
19
+ name: Build web Storybook
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - uses: oven-sh/setup-bun@v2
25
+ with:
26
+ bun-version: latest
27
+
28
+ - name: Install dependencies
29
+ run: bun install --frozen-lockfile
30
+
31
+ - name: Build Storybook
32
+ run: bun run --cwd storybook/web build-storybook
33
+
34
+ - uses: actions/upload-pages-artifact@v3
35
+ with:
36
+ path: storybook/web/storybook-static
37
+
38
+ deploy:
39
+ name: Deploy to GitHub Pages
40
+ needs: build
41
+ runs-on: ubuntu-latest
42
+ environment:
43
+ name: github-pages
44
+ url: ${{ steps.deployment.outputs.page_url }}
45
+ steps:
46
+ - id: deployment
47
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,3 @@
1
+ bun run lint
2
+ bun run typecheck
3
+ bun run test:unit
@@ -4,14 +4,15 @@ Monorepo for a publishable React Native UI library. Bun workspaces:
4
4
 
5
5
  | Workspace | Package | Purpose |
6
6
  | --- | --- | --- |
7
- | `packages/ui` | `@template/ui` | The library. The only published package. |
8
- | `apps/storybook` | `@template/storybook-web` | Web Storybook (react-native-web + Vite) and Storybook tests (Vitest browser mode). |
9
- | `apps/native` | `@template/example` | Expo app running Storybook React Native on device. |
7
+ | `packages/ui` | `@template/ui` | The library. Versioned by changesets but `private` (see [Releasing](#releasing)). |
8
+ | `storybook/web` | `@template/storybook-web` | Web Storybook (react-native-web + Vite) and Storybook tests (Vitest browser mode). |
9
+ | `storybook/native` | `@template/example` | Expo app running Storybook React Native on device. |
10
10
 
11
11
  Tooling: **bun** (package manager + script runner), **biome** (lint + format), **TypeScript 6**
12
12
  (strict, `verbatimModuleSyntax` — use `import type` for types), **vitest** (unit tests via
13
13
  react-native-web in jsdom; story tests via `@storybook/addon-vitest` in Chromium),
14
- **react-native-builder-bob** (library build), **changesets** (versioning/publishing).
14
+ **react-native-builder-bob** (library build), **changesets** (versioning/publishing),
15
+ **husky** (git hooks — a `pre-commit` hook runs lint, typecheck, and unit tests).
15
16
 
16
17
  ## Commands (run from the repo root)
17
18
 
@@ -34,32 +35,44 @@ Follow the `Button` component (`packages/ui/src/components/Button/`) as the refe
34
35
  implementation. For a component named `Foo`:
35
36
 
36
37
  1. **Create the folder** `packages/ui/src/components/Foo/` containing exactly:
37
- - `Foo.tsx` — the component.
38
- - `Foo.test.tsx` — vitest unit tests.
39
- - `Foo.stories.tsx` — Storybook stories (CSF3), including at least one `play` function.
40
- - `index.ts` — re-exports: `export { Foo, type FooProps } from './Foo';`
41
- 2. **Write the component** (`Foo.tsx`):
38
+ - `foo.tsx` — the component.
39
+ - `foo.test.tsx` — vitest unit tests.
40
+ - `foo.stories.tsx` — Storybook stories (CSF3), including at least one `play` function.
41
+
42
+ **No `index.ts`** barrel files are forbidden everywhere in the library. Public entry
43
+ points are declared in the `exports` map of `packages/ui/package.json` (step 3), and
44
+ internal imports always target the concrete file (`../../theme/tokens`), never a folder.
45
+ 2. **Write the component** (`foo.tsx`):
42
46
  - Named function export (`export function Foo(...)`), never a default export.
43
47
  - Export a `FooProps` interface with a JSDoc comment per prop; document defaults with `@default`.
44
48
  - Only import from `react`, `react-native`, and internal modules. New runtime dependencies
45
49
  need explicit approval — they become dependencies for every consumer of the library.
46
50
  - Use only RN APIs that exist on react-native-web (`View`, `Text`, `Pressable`,
47
51
  `StyleSheet`, ...), otherwise unit tests and the web Storybook will break.
48
- - Style with `StyleSheet.create` and the design tokens from `src/theme` (`colors`,
52
+ - Style with `StyleSheet.create` and the design tokens from `src/theme/tokens.ts` (`colors`,
49
53
  `spacing`, `radii`, `fontSizes`) — no hard-coded colors or magic numbers. Add new tokens
50
54
  to `src/theme/tokens.ts` if needed.
51
55
  - Accessibility is required: set `accessibilityRole`, `accessibilityState`, and accept an
52
56
  `accessibilityLabel` prop. Also accept `style` (as `StyleProp<...>`) and `testID`.
53
- 3. **Export it from the library**: add `export * from './components/Foo';` to
54
- `packages/ui/src/index.ts`.
55
- 4. **Write stories** (`Foo.stories.tsx`):
57
+ 3. **Export it from the library**: add a `./foo` subpath to the `exports` map in
58
+ `packages/ui/package.json`, mirroring the existing `./button` entry:
59
+ ```json
60
+ "./foo": {
61
+ "source": "./src/components/Foo/foo.tsx",
62
+ "types": "./lib/typescript/components/Foo/foo.d.ts",
63
+ "default": "./lib/module/components/Foo/foo.js"
64
+ }
65
+ ```
66
+ Consumers then use `import { Foo } from '@template/ui/foo'`. There is no root entry
67
+ point and no `src/index.ts` — never add one.
68
+ 4. **Write stories** (`foo.stories.tsx`):
56
69
  - CSF3 with `satisfies Meta<typeof Foo>` and `StoryObj<typeof meta>`; title `Components/Foo`.
57
70
  - Set default `args` for every prop; use `fn()` from `storybook/test` for callbacks.
58
71
  - One story per visual variant/state, plus interaction stories with `play` functions
59
72
  asserting behavior (`within`, `userEvent`, `expect` from `storybook/test`).
60
73
  - Stories are shared by the web and native Storybooks — keep them platform-neutral and
61
74
  import types only from `@storybook/react` (type-only imports are erased at runtime).
62
- 5. **Write unit tests** (`Foo.test.tsx`) with `@testing-library/react`. They run in jsdom with
75
+ 5. **Write unit tests** (`foo.test.tsx`) with `@testing-library/react`. They run in jsdom with
63
76
  `react-native` aliased to `react-native-web`. Query by accessible role/name
64
77
  (`screen.getByRole('button', { name: ... })`), and cover: rendering, interaction callbacks,
65
78
  and disabled/edge states.
@@ -75,23 +88,26 @@ implementation. For a component named `Foo`:
75
88
 
76
89
  CI (`.github/workflows/ci.yml`) runs lint, typecheck, tests, build, and Storybook tests on
77
90
  every PR. On pushes to `main`, `.github/workflows/release.yml` uses changesets to open/update
78
- a "Version Packages" PR; merging it publishes `@template/ui` to npm (requires the `NPM_TOKEN`
79
- repository secret). Never edit versions in `package.json` or `CHANGELOG.md` by hand.
91
+ a "Version Packages" PR; merging it versions `@template/ui` and writes its changelog (the
92
+ library itself stays `private`, so `changeset publish` skips it this is a template repo,
93
+ the library is for scaffolded projects). The Version PR also bumps the scaffolder version;
94
+ the next push to `main` publishes `create-react-native-library-template` to npm (requires
95
+ `NPM_TOKEN`). Scaffolded projects follow the same flow — rename the `@template/*` packages
96
+ to your own npm scope and set `NPM_TOKEN`. Never edit versions in `package.json` or
97
+ `CHANGELOG.md` by hand.
98
+ `.github/workflows/deploy-storybook.yml` builds the web Storybook (`storybook/web`) on every
99
+ push to `main` and deploys it to GitHub Pages (repo Settings → Pages → Source: GitHub Actions).
80
100
 
81
101
  ## Gotchas
82
102
 
83
- - `apps/native/.rnstorybook/storybook.requires.ts` is generated (by Metro or
84
- `bun run --cwd apps/native storybook-generate`) and gitignored never edit it.
103
+ - The husky `pre-commit` hook (`.husky/pre-commit`) runs `bun run lint`, `bun run typecheck`,
104
+ and `bun run test:unit` before every commit. Hooks install via the `prepare` script on
105
+ `bun install`. It does not run the Storybook browser tests (they need Chromium) — run
106
+ `bun run test:storybook` yourself before pushing, since CI does. To bypass the hook in a
107
+ pinch, commit with `--no-verify`.
108
+ - `storybook/native/.rnstorybook/storybook.requires.ts` is generated (by Metro or
109
+ `bun run --cwd storybook/native storybook-generate`) and gitignored — never edit it.
85
110
  - Test/story files are excluded from the published package and from the bob build; keep
86
111
  runtime code out of them.
87
112
  - The example app must stay on Expo SDK-pinned dependency versions (`bunx expo install ...`
88
- from `apps/native` when adding native modules).
89
-
90
- ## Scaffolder (`create/`)
91
-
92
- `create/` holds `create-react-native-library-template`, the npm package behind
93
- `bun create react-native-library-template`. It is **not** a workspace and is not managed by
94
- changesets: it has zero dependencies and is published manually. Its `prepack` script snapshots
95
- every tracked file of this repo (except `create/` itself) into `create/template/` (renaming
96
- `.gitignore` → `gitignore`, which the CLI reverses on scaffold); `postpack` deletes the
97
- snapshot. To release it: bump `create/package.json` version, then `cd create && npm publish`.
113
+ from `storybook/native` when adding native modules).
@@ -15,8 +15,8 @@ Template for building and publishing a React Native UI component library.
15
15
 
16
16
  ```
17
17
  packages/ui/ @template/ui — the library (published)
18
- apps/storybook/ Web Storybook + Storybook tests
19
- apps/native/ Expo app running Storybook React Native on device
18
+ storybook/web/ Web Storybook + Storybook tests
19
+ storybook/native/ Expo app running Storybook React Native on device
20
20
  ```
21
21
 
22
22
  ## Getting started
package/template/bun.lock CHANGED
@@ -12,10 +12,30 @@
12
12
  "biome-one-liner-plugin": "1.3.2",
13
13
  "biome-react-best-practices-plugin": "1.1.0",
14
14
  "biome-typescript-best-practices-plugin": "1.0.0",
15
+ "husky": "^9.1.7",
15
16
  "typescript": "^6",
16
17
  },
17
18
  },
18
- "apps/native": {
19
+ "packages/ui": {
20
+ "name": "@template/ui",
21
+ "version": "0.1.0",
22
+ "devDependencies": {
23
+ "@storybook/react": "^10.4.6",
24
+ "@testing-library/jest-dom": "^6.9.1",
25
+ "@testing-library/react": "^16.3.2",
26
+ "@types/react": "~19.1.10",
27
+ "jsdom": "^29.1.1",
28
+ "react": "19.1.0",
29
+ "react-dom": "19.1.0",
30
+ "react-native": "0.81.5",
31
+ "react-native-builder-bob": "^0.43.0",
32
+ "react-native-web": "0.21.2",
33
+ "storybook": "^10.4.6",
34
+ "typescript": "^6",
35
+ "vitest": "^4.1.10",
36
+ },
37
+ },
38
+ "storybook/native": {
19
39
  "name": "@template/example",
20
40
  "version": "0.0.0",
21
41
  "dependencies": {
@@ -46,7 +66,7 @@
46
66
  "typescript": "^6",
47
67
  },
48
68
  },
49
- "apps/storybook": {
69
+ "storybook/web": {
50
70
  "name": "@template/storybook-web",
51
71
  "version": "0.0.0",
52
72
  "dependencies": {
@@ -71,25 +91,6 @@
71
91
  "vitest": "^4.1.10",
72
92
  },
73
93
  },
74
- "packages/ui": {
75
- "name": "@template/ui",
76
- "version": "0.1.0",
77
- "devDependencies": {
78
- "@storybook/react": "^10.4.6",
79
- "@testing-library/jest-dom": "^6.9.1",
80
- "@testing-library/react": "^16.3.2",
81
- "@types/react": "~19.1.10",
82
- "jsdom": "^29.1.1",
83
- "react": "19.1.0",
84
- "react-dom": "19.1.0",
85
- "react-native": "0.81.5",
86
- "react-native-builder-bob": "^0.43.0",
87
- "react-native-web": "0.21.2",
88
- "storybook": "^10.4.6",
89
- "typescript": "^6",
90
- "vitest": "^4.1.10",
91
- },
92
- },
93
94
  },
94
95
  "packages": {
95
96
  "@0no-co/graphql.web": ["@0no-co/graphql.web@1.3.2", "", { "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" }, "optionalPeers": ["graphql"] }, "sha512-Q1+pRlLhE31GOY/2c9BAEnFTNxO7Awtc6fhhEDlxyCBQ2N0IhD32cPVvPChrK9mwBNSgRdW/sF1kd2e0ojHj1Q=="],
@@ -794,9 +795,9 @@
794
795
 
795
796
  "@storybook/react-vite": ["@storybook/react-vite@10.4.6", "", { "dependencies": { "@joshwooding/vite-plugin-react-docgen-typescript": "^0.7.0", "@rollup/pluginutils": "^5.0.2", "@storybook/builder-vite": "10.4.6", "@storybook/react": "10.4.6", "empathic": "^2.0.0", "magic-string": "^0.30.0", "react-docgen": "^8.0.0", "resolve": "^1.22.8", "tsconfig-paths": "^4.2.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "storybook": "^10.4.6", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-0arEQtybqGYXHbXpTot+Wv9YtG+V5Vp43QayXavPKQ20M8mpEzhyCPKd0EhqMGSC1Z1UEt0hm365WUBhI9LfKA=="],
796
797
 
797
- "@template/example": ["@template/example@workspace:apps/native"],
798
+ "@template/example": ["@template/example@workspace:storybook/native"],
798
799
 
799
- "@template/storybook-web": ["@template/storybook-web@workspace:apps/storybook"],
800
+ "@template/storybook-web": ["@template/storybook-web@workspace:storybook/web"],
800
801
 
801
802
  "@template/ui": ["@template/ui@workspace:packages/ui"],
802
803
 
@@ -1268,6 +1269,8 @@
1268
1269
 
1269
1270
  "human-id": ["human-id@4.2.0", "", { "bin": { "human-id": "dist/cli.js" } }, "sha512-K3GbkIWqyvvlpfhBPlbEvD97TtqBpAYA4kt+cn2lD2x2HuohzZCibcA2nOlnJT6exqvJLggoB5nv2dNf192nEA=="],
1270
1271
 
1272
+ "husky": ["husky@9.1.7", "", { "bin": { "husky": "bin.js" } }, "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA=="],
1273
+
1271
1274
  "hyphenate-style-name": ["hyphenate-style-name@1.1.0", "", {}, "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw=="],
1272
1275
 
1273
1276
  "iconv-lite": ["iconv-lite@0.7.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ=="],
@@ -4,30 +4,32 @@
4
4
  "private": true,
5
5
  "workspaces": [
6
6
  "packages/*",
7
- "apps/*"
7
+ "storybook/*"
8
8
  ],
9
9
  "scripts": {
10
10
  "build": "bun run --cwd packages/ui build",
11
- "typecheck": "bun run --cwd packages/ui typecheck && bun run --cwd apps/storybook typecheck && bun run --cwd apps/native typecheck",
11
+ "typecheck": "bun run --cwd packages/ui typecheck && bun run --cwd storybook/web typecheck && bun run --cwd storybook/native typecheck",
12
12
  "lint": "biome check .",
13
13
  "lint:fix": "biome check --write .",
14
14
  "test": "bun run test:unit && bun run test:storybook",
15
15
  "test:unit": "bun run --cwd packages/ui test",
16
- "test:storybook": "bun run --cwd apps/storybook test",
17
- "storybook": "bun run --cwd apps/storybook storybook",
18
- "storybook:native": "bun run --cwd apps/native start",
16
+ "test:storybook": "bun run --cwd storybook/web test",
17
+ "storybook": "bun run --cwd storybook/web storybook",
18
+ "storybook:native": "bun run --cwd storybook/native start",
19
19
  "changeset": "changeset",
20
- "version-packages": "changeset version",
21
- "release": "bun run build && changeset publish"
20
+ "version-packages": "node scripts/version-packages.mjs",
21
+ "release": "bun run build && changeset publish",
22
+ "prepare": "husky"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@biomejs/biome": "^2.5.3",
25
26
  "@changesets/cli": "^2.31.0",
26
27
  "@iv-stpn/biome-config": "1.2.10",
27
- "biome-one-liner-plugin": "1.3.2",
28
28
  "biome-drizzle-best-practices-plugin": "2.0.0",
29
+ "biome-one-liner-plugin": "1.3.2",
29
30
  "biome-react-best-practices-plugin": "1.1.0",
30
31
  "biome-typescript-best-practices-plugin": "1.0.0",
32
+ "husky": "^9.1.7",
31
33
  "typescript": "^6"
32
34
  }
33
35
  }
@@ -0,0 +1,34 @@
1
+ # @template/ui
2
+
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 92189ad: Add custom `version-packages` script that bumps the scaffolder version whenever changesets are consumed, so the template repo's release workflow republishes `create-react-native-library-template` alongside library changes. Update AGENTS.md to reflect the flow: only the scaffolder publishes from the template repo; `@template/ui` stays private. No runtime changes to the published package.
8
+
9
+ ## 0.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 2618470: Mark `@template/ui` as `private` so the release workflow no longer tries to publish the placeholder `@template` scope to npm (which 404s). Changesets still versions it and writes its changelog; the template only publishes the `create/` scaffolder. Scaffolded projects publish their library normally once the `@template/*` packages are renamed to your own npm scope and the `NPM_TOKEN` repository secret is set.
14
+ - 4424a60: Remove the `private` flag from `@template/ui` so the release workflow publishes it to npm (the flag was preventing `changeset publish` from touching it). The scaffolder no longer strips it — scaffolded projects get a publishable library by default, which publishes once the scope is renamed and `NPM_TOKEN` is set.
15
+
16
+ ## 0.1.3
17
+
18
+ ### Patch Changes
19
+
20
+ - a6ba45e: Mark `@template/ui` as `private` so the release workflow no longer tries to publish the placeholder `@template` scope to npm (which 404s). Changesets still versions it and writes its changelog; the template only publishes the `create/` scaffolder. Scaffolded projects that want to publish their library should rename the `@template/*` packages to their own npm scope, remove `"private": true` from `packages/ui/package.json`, and set the `NPM_TOKEN` repository secret.
21
+ - f8a35ba: Add live-demo and npm badges plus a hosted-Storybook/scaffolder description to the repo `README.md`, and wrap those repo-only sections in `template-exclude` markers so scaffolded projects get a clean README without the template's own demo links and package badges. No runtime changes to the published package.
22
+
23
+ ## 0.1.2
24
+
25
+ ### Patch Changes
26
+
27
+ - 6c594db: Add a husky `pre-commit` hook that runs lint, typecheck, and unit tests before every commit. Hooks install via a `prepare` script on `bun install`, and the setup is included in scaffolded projects (`bun create react-native-library-template`). The scaffolder's "Next steps" now runs `git init` before `bun install` so the hooks install on the first install. No runtime changes to the published package.
28
+
29
+ ## 0.1.1
30
+
31
+ ### Patch Changes
32
+
33
+ - f77680d: Repo housekeeping: Storybook workspaces moved from `apps/` to `storybook/` (`storybook/web`, `storybook/native`), the web Storybook demo now deploys to GitHub Pages from `main`, and the contributor guide documents the exports-map convention (per-subpath `exports` in `package.json`, no barrel files). No runtime changes to the published package.
34
+ - 98fd966: Remove `.tsx` extensions from relative imports in test and story files — they made `tsc --noEmit` fail with TS5097 since `allowImportingTsExtensions` is not enabled.
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@template/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
+ "private": true,
4
5
  "description": "Reusable React Native UI component library",
5
6
  "license": "MIT",
6
7
  "repository": {
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from 'node:child_process';
3
+ import { readFileSync, writeFileSync } from 'node:fs';
4
+ import { dirname, resolve } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
8
+
9
+ // Run changeset version
10
+ execFileSync('bun', ['run', 'changeset', 'version'], { cwd: root, stdio: 'inherit' });
11
+
12
+ // Bump the scaffolder version when changesets are consumed. This is a template repo;
13
+ // the scaffolder must republish when template files change. Always bump it: if no changesets
14
+ // existed, the version PR doesn't open and this doesn't run; if changesets exist, they're
15
+ // for template changes and the scaffolder should ship alongside.
16
+ const createPackagePath = resolve(root, 'create/package.json');
17
+ const createPackage = JSON.parse(readFileSync(createPackagePath, 'utf8'));
18
+ const [major, minor, patch] = createPackage.version.split('.').map(Number);
19
+ createPackage.version = `${major}.${minor}.${patch + 1}`;
20
+ writeFileSync(createPackagePath, `${JSON.stringify(createPackage, null, 2)}\n`);
21
+ console.log(`Bumped create-react-native-library-template to ${createPackage.version}`);
File without changes
File without changes