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

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.3",
3
+ "version": "0.1.5",
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",
@@ -7,5 +7,8 @@
7
7
  "access": "public",
8
8
  "baseBranch": "main",
9
9
  "updateInternalDependencies": "patch",
10
- "ignore": ["@template/storybook-web", "@template/example"]
10
+ "ignore": [
11
+ "@template/storybook-web",
12
+ "@template/example"
13
+ ]
11
14
  }
@@ -24,7 +24,6 @@ jobs:
24
24
  with:
25
25
  bun-version: latest
26
26
 
27
- # `changeset publish` shells out to npm, which needs Node and registry auth.
28
27
  - uses: actions/setup-node@v4
29
28
  with:
30
29
  node-version: 22
@@ -43,4 +42,4 @@ jobs:
43
42
  env:
44
43
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
44
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -87,14 +87,26 @@ implementation. For a component named `Foo`:
87
87
  ## Releasing
88
88
 
89
89
  CI (`.github/workflows/ci.yml`) runs lint, typecheck, tests, build, and Storybook tests on
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
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.
90
+ every PR. Releasing is driven entirely by changesets: on pushes to `main`,
91
+ `.github/workflows/release.yml` opens/updates a "Version Packages" PR; merging it runs
92
+ `changeset version` (bumping versions and writing changelogs) and the next push runs
93
+ `bun run release` (`changeset publish`) to publish to npm. It needs the `NPM_TOKEN` repository
94
+ secret. Never edit versions in `package.json` or `CHANGELOG.md` by hand — write a changeset
95
+ (`bun run changeset`) instead.
96
+
97
+ What actually publishes differs by context, and the difference is entirely config-driven (same
98
+ workflow both places):
99
+
100
+ - **This template repo** publishes only the scaffolder (`create-react-native-library-template`).
101
+ `create/` is a Bun workspace member, so changesets versions it natively. The three
102
+ `@template/*` packages are `private` **and** listed in the changesets `ignore` array
103
+ (`.changeset/config.json`), so they are never versioned or published here — they are
104
+ placeholder code. Write changesets against `create-react-native-library-template`.
105
+ - **Scaffolded projects** publish their library. The scaffolder strips `create` from the
106
+ root `workspaces`, removes `@template/ui` from the changesets `ignore` array, and drops its
107
+ `private` flag — so the library releases through this very same workflow once you rename the
108
+ `@template/*` packages to your own npm scope (update the same `ignore` array) and set `NPM_TOKEN`.
109
+
98
110
  `.github/workflows/deploy-storybook.yml` builds the web Storybook (`storybook/web`) on every
99
111
  push to `main` and deploys it to GitHub Pages (repo Settings → Pages → Source: GitHub Actions).
100
112
 
package/template/bun.lock CHANGED
@@ -16,6 +16,13 @@
16
16
  "typescript": "^6",
17
17
  },
18
18
  },
19
+ "create": {
20
+ "name": "create-react-native-library-template",
21
+ "version": "0.1.4",
22
+ "bin": {
23
+ "create-react-native-library-template": "index.mjs",
24
+ },
25
+ },
19
26
  "packages/ui": {
20
27
  "name": "@template/ui",
21
28
  "version": "0.1.0",
@@ -1049,6 +1056,8 @@
1049
1056
 
1050
1057
  "core-js-compat": ["core-js-compat@3.49.0", "", { "dependencies": { "browserslist": "^4.28.1" } }, "sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA=="],
1051
1058
 
1059
+ "create-react-native-library-template": ["create-react-native-library-template@workspace:create"],
1060
+
1052
1061
  "cross-fetch": ["cross-fetch@3.2.0", "", { "dependencies": { "node-fetch": "^2.7.0" } }, "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q=="],
1053
1062
 
1054
1063
  "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
@@ -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": "node scripts/version-packages.mjs",
20
+ "version-packages": "changeset version",
21
21
  "release": "bun run build && changeset publish",
22
22
  "prepare": "husky"
23
23
  },
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@template/ui",
3
- "version": "0.1.5",
4
- "private": true,
3
+ "version": "0.1.0",
5
4
  "description": "Reusable React Native UI component library",
6
5
  "license": "MIT",
7
6
  "repository": {
@@ -1,34 +0,0 @@
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,21 +0,0 @@
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}`);