Skip to content

Commit 924c316

Browse files
committed
ci(release): support scoped prerelease package
1 parent cc9bf7d commit 924c316

6 files changed

Lines changed: 23 additions & 9 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Link a reproduction or paste the smallest possible code sample.
2626

2727
## Environment
2828

29-
- `react-timer-hook` version:
29+
- `@crup/react-timer-hook` version:
3030
- React version:
3131
- React Strict Mode enabled: yes/no
3232
- Browser or runtime:

.github/workflows/prerelease.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ jobs:
5050
pnpm test
5151
5252
- name: Set prerelease version
53-
run: pnpm version "${{ inputs.version_base }}-${{ inputs.tag }}.${{ github.run_number }}" --no-git-tag-version
53+
env:
54+
PACKAGE_VERSION: ${{ inputs.version_base }}-${{ inputs.tag }}.${{ github.run_number }}
55+
run: |
56+
node -e "const fs = require('node:fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.version = process.env.PACKAGE_VERSION; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');"
57+
node -e "const pkg = require('./package.json'); console.log(`${pkg.name}@${pkg.version}`);"
5458
5559
- name: Build package
5660
run: |

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
# react-timer-hook
1+
# @crup/react-timer-hook
22

33
A small React hook library for deterministic timer lifecycles.
44

55
This package is planned as a replacement for the previous `react-timer-hook` API. It intentionally does not ship formatting, timezone conversion, `ampm` fields, or countdown/stopwatch/clock mode enums. It gives you raw time data and lifecycle controls so your app can decide what the timer means.
66

77
## Status
88

9-
Planning and implementation spec stage. Hook implementation is not present yet.
9+
Alpha-ready v1 implementation. The package is intended to be published under the `@crup` npm scope.
10+
11+
## Install
12+
13+
```sh
14+
pnpm add @crup/react-timer-hook
15+
npm install @crup/react-timer-hook
16+
```
1017

1118
## Planned Public API
1219

1320
```ts
14-
import { useTimer, useTimerGroup, durationParts } from 'react-timer-hook';
21+
import { useTimer, useTimerGroup, durationParts } from '@crup/react-timer-hook';
1522
```
1623

1724
V1 should expose only:

docs/BRANCHING_AND_COMMITS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Example versions:
4444
Install test builds with:
4545

4646
```sh
47-
npm install react-timer-hook@alpha
48-
pnpm add react-timer-hook@alpha
47+
npm install @crup/react-timer-hook@alpha
48+
pnpm add @crup/react-timer-hook@alpha
4949
```
5050

5151
## Local Changesets Prerelease Flow

docs/OSS_GTM.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ For the first installable test versions, publish:
180180
Consumers test with:
181181

182182
```sh
183-
npm install react-timer-hook@alpha
183+
npm install @crup/react-timer-hook@alpha
184184
```
185185

186186
Keep prerelease publishing manual at first with `workflow_dispatch`, so every push to `next` does not automatically publish to npm.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "react-timer-hook",
2+
"name": "@crup/react-timer-hook",
33
"version": "0.0.0",
44
"description": "Deterministic React timer lifecycle hooks for timers, schedules, and many independent timers.",
55
"main": "./dist/index.cjs",
@@ -18,6 +18,9 @@
1818
"LICENSE"
1919
],
2020
"sideEffects": false,
21+
"publishConfig": {
22+
"access": "public"
23+
},
2124
"engines": {
2225
"node": ">=25.0.0"
2326
},

0 commit comments

Comments
 (0)