create-react-native-library-template 0.1.1 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-react-native-library-template",
3
- "version": "0.1.1",
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",
@@ -88,11 +88,13 @@ implementation. For a component named `Foo`:
88
88
 
89
89
  CI (`.github/workflows/ci.yml`) runs lint, typecheck, tests, build, and Storybook tests on
90
90
  every PR. On pushes to `main`, `.github/workflows/release.yml` uses changesets to open/update
91
- a "Version Packages" PR; merging it versions `@template/ui` and writes its changelog. The next
92
- push to `main` runs `changeset publish`, which publishes `@template/ui` to npm (requires an
93
- `NPM_TOKEN` repository secret). Scaffolded projects follow the same flow rename the
94
- `@template/*` packages to your own npm scope and set `NPM_TOKEN`. Never edit versions in
95
- `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.
96
98
  `.github/workflows/deploy-storybook.yml` builds the web Storybook (`storybook/web`) on every
97
99
  push to `main` and deploys it to GitHub Pages (repo Settings → Pages → Source: GitHub Actions).
98
100
 
@@ -17,7 +17,7 @@
17
17
  "storybook": "bun run --cwd storybook/web storybook",
18
18
  "storybook:native": "bun run --cwd storybook/native start",
19
19
  "changeset": "changeset",
20
- "version-packages": "changeset version",
20
+ "version-packages": "node scripts/version-packages.mjs",
21
21
  "release": "bun run build && changeset publish",
22
22
  "prepare": "husky"
23
23
  },
@@ -1,5 +1,11 @@
1
1
  # @template/ui
2
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
+
3
9
  ## 0.1.4
4
10
 
5
11
  ### Patch Changes
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@template/ui",
3
- "version": "0.1.4",
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}`);