react-intl-number-input 0.8.5 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -1,131 +1,183 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [0.8.5] - 2026-09-03
11
-
12
- ### Fixed
13
-
14
- - Finalized demo and build scripts migration to TypeScript.
15
- - Corrected package entry points for better ESM compatibility.
16
-
17
- ## [0.8.4] - 2026-09-03
18
-
19
- ### Fixed
20
-
21
- - Attempted publish (version skipped due to registry timeout).
22
-
23
- ## [0.8.3] - 2026-09-03
24
-
25
- ### Added
26
-
27
- - Dual build support: the package now ships both CommonJS (`dist/index.js`) and ESM (`dist/esm/index.js`) versions.
28
- - Sourcemaps with inline sources included in the package for better debugging experience.
29
- - `CHANGELOG.md` and `CONTRIBUTING.md` are now included in the npm package.
30
- - `engines` field added to `package.json` specifying Node.js >= 20.
31
- - Proper accessibility support: the input now has `role="spinbutton"` and relevant `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes.
32
- - Full `forwardRef` support: `ref` now correctly points to the underlying `<input>` element and supports imperative methods via `useImperativeHandle`.
33
- - Demo and build scripts migrated to TypeScript and modern ES modules.
34
-
35
- ### Changed
36
-
37
- - Improved cursor management: typing within the masked input now correctly preserves the cursor position instead of jumping to the end.
38
- - Enhanced synthetic events: `onChange` events triggered by step buttons or `setValue` now include more standard event properties (`currentTarget`, `persist`, etc.) for better compatibility.
39
- - Build process updated to use multiple `tsc` configurations for CJS and ESM.
40
- - `package.json` `exports` updated to support modern ESM resolution while maintaining CJS compatibility.
41
-
42
- ## [0.8.2] - 2026-08-15
43
-
44
- This is a maintainer/toolchain release. The published component API, peer dependency (`react >=16.8.0 <20`), and CommonJS entry are unchanged.
45
-
46
- ### Security
47
-
48
- - Pinned transitive `js-yaml` to `4.3.1` ([GHSA-5p4m-2wfm-xmqj](https://github.com/advisories/GHSA-5p4m-2wfm-xmqj))
49
-
50
- ### Changed
51
-
52
- - Replaced the Babel + Webpack toolchain with TypeScript (`tsc`) for the library and esbuild for the demo
53
- - Dropped the `fast-uri` override (it only existed for webpack-dev-server)
54
- - Contributor Node.js requirement is now 20+ (no longer tied to Babel 8)
55
-
56
- ## [0.8.1] - 2026-08-13
57
-
58
- ### Changed
59
-
60
- - Updated development dependencies: React `19.2.8`, webpack `5.109.2`, webpack-cli `7.2.2`, html-webpack-plugin `5.6.8`, `@types/react` `19.2.18`
61
- - Upgraded `@testing-library/jest-dom` from `6.9.1` to `7.0.1`
62
-
63
- ## [0.8.0] - 2026-07-27
64
-
65
- ### Added
66
-
67
- - `renderControls` render prop with exported `ControlsRenderProps` for custom stepper UI (`increment`, `decrement`, `setValue`, bounds, and formatted value)
68
-
69
- ### Changed
70
-
71
- - Step increments now use display units: `step={1}` with `precision={2}` adds `0.01` (previously added `100` to the numeric value)
72
- - `renderControls` renders the input and controls as siblings without an opinionated wrapper — layout is controlled by the consumer
73
- - When both `renderControls` and `showStepButtons` are set, `renderControls` takes precedence
74
- - Development toolchain upgraded: Babel 8, TypeScript 7, Webpack 5.108, webpack-cli 7.2, webpack-dev-server 6
75
- - Babel config updated for Babel 8 defaults (`modules: "commonjs"`, classic JSX runtime) so the published CJS build remains compatible with React 16.8+
76
- - Contributor Node.js requirement updated to `^22.18.0 || >=24.11.0` (Babel 8)
77
-
78
- ### Fixed
79
-
80
- - Step buttons and custom controls now read the numeric value from an internal ref instead of re-parsing the masked string (fixes incorrect steps with prefix/suffix or locale formatting)
81
- - Controlled `value` prop updates now apply `minValue`/`maxValue` clamping before formatting
82
- - Resolved transitive security advisories in the dev dependency tree (`npm audit` clean)
83
-
84
- ## [0.7.0] - 2026-06-20
85
-
86
- ### Added
87
-
88
- - TypeScript source and published type declarations (`IntlNumberInputProps`)
89
- - `forwardRef` support for the underlying `<input>`
90
- - Standard HTML input attribute passthrough (`onFocus`, `aria-*`, `data-*`, `autoComplete`, etc.)
91
- - Step buttons (`showStepButtons`, `step`)
92
- - `minValue` / `maxValue` constraints
93
- - `onBlur` callback
94
- - `inputMode` prop
95
- - Prefix/suffix HTML sanitization
96
- - Redesigned interactive demo page with labeled examples and independent state
97
- - `CONTRIBUTING.md` and `CHANGELOG.md` documentation
98
-
99
- ### Changed
100
-
101
- - Migrated from JSX to TypeScript
102
- - Removed runtime `prop-types` dependency (TypeScript types are the source of truth)
103
- - `onBlur` now returns clamped numeric values consistent with `onChange`
104
- - Prefix/suffix sanitization is SSR-safe (no `document` access)
105
- - `peerDependencies` now require only `react` (not `react-dom`)
106
- - Split consumer and maintainer documentation (`README.md`, `CONTRIBUTING.md`)
107
-
108
- ### Fixed
109
-
110
- - SSR crash when rendering on the server
111
- - `onBlur` returning unclamped values while display was clamped
112
-
113
- ## [0.6.0] - 2025
114
-
115
- ### Changed
116
-
117
- - Updated build toolchain to Babel 7 and Webpack 5
118
- - Added Jest test suite
119
- - Updated demo to React 19
120
- - Security updates for vulnerable dependencies
121
-
122
- ## [0.5.0] and earlier
123
-
124
- See [git history](https://github.com/nandorip/react-intl-number-input/commits/master) for changes prior to 0.6.0.
125
-
126
- [Unreleased]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.2...HEAD
127
- [0.8.2]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.1...v0.8.2
128
- [0.8.1]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.0...v0.8.1
129
- [0.8.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.7.0...v0.8.0
130
- [0.7.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.6.0...v0.7.0
131
- [0.6.0]: https://github.com/nandorip/react-intl-number-input/releases/tag/v0.6.0
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.9.0] - 2026-10-13
11
+
12
+ ### Added
13
+
14
+ - Opt-in `controlled` mode that keeps the parent's `value` authoritative when edits are rejected. The default preserves historical optimistic editing.
15
+ - Optional `readOnly` information for custom controls and formatted `aria-valuetext`.
16
+ - Regression tests, library/demo type checking, installed npm tarball checks for CJS, ESM, types, SSR and DOM interactions, and a React 16.8–19 CI compatibility matrix.
17
+
18
+ ### Fixed
19
+
20
+ - Keep numeric state, formatted text, custom controls and accessibility attributes synchronized when values, bounds, locale or precision change.
21
+ - Avoid rescaling existing numeric state on blur after a precision change.
22
+ - Parse Han decimal and supplementary-plane digits and preserve localized caret positions.
23
+ - Preserve amounts when editing numeric prefixes or suffixes.
24
+ - Enforce `readOnly` for built-in and custom controls.
25
+ - Avoid decimal stepping accumulation within JavaScript's safe integer range.
26
+ - Supply actual input elements and consistent event methods in programmatic change callbacks.
27
+ - Build artifacts during `prepack` and validate the package before publication.
28
+ - Correct README examples, Node.js requirements and the demo's currency hint and accessible input names.
29
+
30
+ ### Changed
31
+
32
+ - Extract pure numeric helpers while retaining public callback signatures, scaled step units, implied-decimal string values, zero-on-clear behavior and existing element layout.
33
+ - Use `gh-pages` 6.1.1 to avoid the development-only `braces` vulnerability in the newer dependency chain; the demo deployment command is unchanged.
34
+ - Add `npm run release` and a GitHub Actions workflow that publishes with provenance.
35
+
36
+ ## [0.8.7] - 2026-10-01
37
+
38
+ ### Fixed
39
+
40
+ - Initialize the internal numeric value within `minValue` and `maxValue` bounds so the displayed value, accessibility attributes, and custom controls agree on the first render.
41
+ - Ignore digits in configured prefixes and suffixes when parsing edits.
42
+ - Parse locale-specific digits such as Arabic-Indic numerals.
43
+ - Prevent custom `setValue` controls from changing disabled inputs or accepting non-finite values.
44
+
45
+ ### Added
46
+
47
+ - Keyboard stepping with Arrow Up and Arrow Down; hold Shift to adjust by ten steps.
48
+
49
+ ## [0.8.6] - 2026-09-23
50
+
51
+ This is a maintainer/toolchain release. The published component API is unchanged.
52
+
53
+ ### Security
54
+
55
+ - Bumped transitive `js-yaml` override to `4.3.2` ([GHSA-2883-xcg3-v3hh](https://github.com/advisories/GHSA-2883-xcg3-v3hh))
56
+
57
+ ### Changed
58
+
59
+ - Updated development dependencies: React `19.3.0`, Jest `30.5.2`, `@testing-library/react` `16.3.3`, `@types/react` `19.3.0`
60
+ - Allowed install scripts for `esbuild` and `unrs-resolver` via `allowScripts`
61
+
62
+ ## [0.8.5] - 2026-09-03
63
+
64
+ ### Fixed
65
+
66
+ - Finalized demo and build scripts migration to TypeScript.
67
+ - Corrected package entry points for better ESM compatibility.
68
+
69
+ ## [0.8.4] - 2026-09-03
70
+
71
+ ### Fixed
72
+
73
+ - Attempted publish (version skipped due to registry timeout).
74
+
75
+ ## [0.8.3] - 2026-09-03
76
+
77
+ ### Added
78
+
79
+ - Dual build support: the package now ships both CommonJS (`dist/index.js`) and ESM (`dist/esm/index.js`) versions.
80
+ - Sourcemaps with inline sources included in the package for better debugging experience.
81
+ - `CHANGELOG.md` and `CONTRIBUTING.md` are now included in the npm package.
82
+ - `engines` field added to `package.json` specifying Node.js >= 20.
83
+ - Proper accessibility support: the input now has `role="spinbutton"` and relevant `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes.
84
+ - Full `forwardRef` support: `ref` now correctly points to the underlying `<input>` element and supports imperative methods via `useImperativeHandle`.
85
+ - Demo and build scripts migrated to TypeScript and modern ES modules.
86
+
87
+ ### Changed
88
+
89
+ - Improved cursor management: typing within the masked input now correctly preserves the cursor position instead of jumping to the end.
90
+ - Enhanced synthetic events: `onChange` events triggered by step buttons or `setValue` now include more standard event properties (`currentTarget`, `persist`, etc.) for better compatibility.
91
+ - Build process updated to use multiple `tsc` configurations for CJS and ESM.
92
+ - `package.json` `exports` updated to support modern ESM resolution while maintaining CJS compatibility.
93
+
94
+ ## [0.8.2] - 2026-08-15
95
+
96
+ This is a maintainer/toolchain release. The published component API, peer dependency (`react >=16.8.0 <20`), and CommonJS entry are unchanged.
97
+
98
+ ### Security
99
+
100
+ - Pinned transitive `js-yaml` to `4.3.1` ([GHSA-5p4m-2wfm-xmqj](https://github.com/advisories/GHSA-5p4m-2wfm-xmqj))
101
+
102
+ ### Changed
103
+
104
+ - Replaced the Babel + Webpack toolchain with TypeScript (`tsc`) for the library and esbuild for the demo
105
+ - Dropped the `fast-uri` override (it only existed for webpack-dev-server)
106
+ - Contributor Node.js requirement is now 20+ (no longer tied to Babel 8)
107
+
108
+ ## [0.8.1] - 2026-08-13
109
+
110
+ ### Changed
111
+
112
+ - Updated development dependencies: React `19.2.8`, webpack `5.109.2`, webpack-cli `7.2.2`, html-webpack-plugin `5.6.8`, `@types/react` `19.2.18`
113
+ - Upgraded `@testing-library/jest-dom` from `6.9.1` to `7.0.1`
114
+
115
+ ## [0.8.0] - 2026-07-27
116
+
117
+ ### Added
118
+
119
+ - `renderControls` render prop with exported `ControlsRenderProps` for custom stepper UI (`increment`, `decrement`, `setValue`, bounds, and formatted value)
120
+
121
+ ### Changed
122
+
123
+ - Step increments now use display units: `step={1}` with `precision={2}` adds `0.01` (previously added `100` to the numeric value)
124
+ - `renderControls` renders the input and controls as siblings without an opinionated wrapper — layout is controlled by the consumer
125
+ - When both `renderControls` and `showStepButtons` are set, `renderControls` takes precedence
126
+ - Development toolchain upgraded: Babel 8, TypeScript 7, Webpack 5.108, webpack-cli 7.2, webpack-dev-server 6
127
+ - Babel config updated for Babel 8 defaults (`modules: "commonjs"`, classic JSX runtime) so the published CJS build remains compatible with React 16.8+
128
+ - Contributor Node.js requirement updated to `^22.18.0 || >=24.11.0` (Babel 8)
129
+
130
+ ### Fixed
131
+
132
+ - Step buttons and custom controls now read the numeric value from an internal ref instead of re-parsing the masked string (fixes incorrect steps with prefix/suffix or locale formatting)
133
+ - Controlled `value` prop updates now apply `minValue`/`maxValue` clamping before formatting
134
+ - Resolved transitive security advisories in the dev dependency tree (`npm audit` clean)
135
+
136
+ ## [0.7.0] - 2026-06-20
137
+
138
+ ### Added
139
+
140
+ - TypeScript source and published type declarations (`IntlNumberInputProps`)
141
+ - `forwardRef` support for the underlying `<input>`
142
+ - Standard HTML input attribute passthrough (`onFocus`, `aria-*`, `data-*`, `autoComplete`, etc.)
143
+ - Step buttons (`showStepButtons`, `step`)
144
+ - `minValue` / `maxValue` constraints
145
+ - `onBlur` callback
146
+ - `inputMode` prop
147
+ - Prefix/suffix HTML sanitization
148
+ - Redesigned interactive demo page with labeled examples and independent state
149
+ - `CONTRIBUTING.md` and `CHANGELOG.md` documentation
150
+
151
+ ### Changed
152
+
153
+ - Migrated from JSX to TypeScript
154
+ - Removed runtime `prop-types` dependency (TypeScript types are the source of truth)
155
+ - `onBlur` now returns clamped numeric values consistent with `onChange`
156
+ - Prefix/suffix sanitization is SSR-safe (no `document` access)
157
+ - `peerDependencies` now require only `react` (not `react-dom`)
158
+ - Split consumer and maintainer documentation (`README.md`, `CONTRIBUTING.md`)
159
+
160
+ ### Fixed
161
+
162
+ - SSR crash when rendering on the server
163
+ - `onBlur` returning unclamped values while display was clamped
164
+
165
+ ## [0.6.0] - 2025
166
+
167
+ ### Changed
168
+
169
+ - Updated build toolchain to Babel 7 and Webpack 5
170
+ - Added Jest test suite
171
+ - Updated demo to React 19
172
+ - Security updates for vulnerable dependencies
173
+
174
+ ## [0.5.0] and earlier
175
+
176
+ See [git history](https://github.com/nandorip/react-intl-number-input/commits/master) for changes prior to 0.6.0.
177
+
178
+ [Unreleased]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.2...HEAD
179
+ [0.8.2]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.1...v0.8.2
180
+ [0.8.1]: https://github.com/nandorip/react-intl-number-input/compare/v0.8.0...v0.8.1
181
+ [0.8.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.7.0...v0.8.0
182
+ [0.7.0]: https://github.com/nandorip/react-intl-number-input/compare/v0.6.0...v0.7.0
183
+ [0.6.0]: https://github.com/nandorip/react-intl-number-input/releases/tag/v0.6.0
package/CONTRIBUTING.md CHANGED
@@ -1,120 +1,145 @@
1
- # Contributing
2
-
3
- Thank you for your interest in contributing to `react-intl-number-input`.
4
-
5
- ## Requirements
6
-
7
- - Node.js 20+ (recommended: current Active LTS)
8
- - npm 10+
9
-
10
- These versions are required to build and test the library. Consumers of the published npm package are not constrained by this.
11
-
12
- ## Getting started
13
-
14
- ```bash
15
- git clone https://github.com/nandorip/react-intl-number-input.git
16
- cd react-intl-number-input
17
- npm install
18
- ```
19
-
20
- ## Local development
21
-
22
- Start the demo app with live rebuild:
23
-
24
- ```bash
25
- npm start
26
- ```
27
-
28
- Open [http://localhost:3001](http://localhost:3001). The demo lives in `example/` and imports the component from `src/`.
29
-
30
- ## Scripts
31
-
32
- | Command | Description |
33
- | --- | --- |
34
- | `npm start` | esbuild dev server for the demo |
35
- | `npm test` | Run unit tests with Jest |
36
- | `npm run build:lib` | Compile `src/` to CommonJS, ESM, and types in `dist/` |
37
- | `npm run build` | Build the demo bundle in `example/dist` |
38
- | `npm run publish-demo` | Build and deploy the demo to GitHub Pages |
39
-
40
- ## Project structure
41
-
42
- ```
43
- src/ Library source (TypeScript)
44
- dist/ Published build output (generated, not committed)
45
- example/ Demo app and GitHub Pages bundle
46
- ```
47
-
48
- The npm package ships `dist/`, `README.md`, `LICENSE`, `CHANGELOG.md`, and `CONTRIBUTING.md` (see `files` in `package.json`).
49
-
50
- ## Testing
51
-
52
- Run the full test suite before opening a pull request:
53
-
54
- ```bash
55
- npm test
56
- ```
57
-
58
- Tests live alongside the source in `src/index.test.tsx`.
59
-
60
- ## Building the library
61
-
62
- To produce the publishable artifacts locally:
63
-
64
- ```bash
65
- npm run build:lib
66
- ```
67
-
68
- This generates:
69
-
70
- - `dist/index.js` — CommonJS build (`tsc`)
71
- - `dist/esm/index.js` — ESM build (`tsc`)
72
- - `dist/index.d.ts` — TypeScript declarations
73
-
74
- ## Publishing to npm
75
-
76
- ### Prerequisites
77
-
78
- - npm account with publish access to `react-intl-number-input`
79
- - logged in: `npm login`
80
-
81
- ### Release checklist
82
-
83
- 1. Update `CHANGELOG.md` with the new version and changes.
84
- 2. Bump the version in `package.json` following [semver](https://semver.org/):
85
- ```bash
86
- npm version patch # 0.7.0 → 0.7.1
87
- npm version minor # 0.7.0 → 0.8.0
88
- npm version major # 0.7.0 → 1.0.0
89
- ```
90
- 3. Publish:
91
- ```bash
92
- npm publish
93
- ```
94
-
95
- The `prepublishOnly` script runs automatically before publish:
96
-
97
- ```
98
- npm test → npm run build:lib
99
- ```
100
-
101
- Do not commit `dist/` — it is built during publish and excluded via `.gitignore`.
102
-
103
- ### Deploying the demo
104
-
105
- To update the live demo on GitHub Pages:
106
-
107
- ```bash
108
- npm run publish-demo
109
- ```
110
-
111
- ## Pull requests
112
-
113
- 1. Fork the repository and create a feature branch.
114
- 2. Make your changes with tests where applicable.
115
- 3. Run `npm test` and ensure it passes.
116
- 4. Open a pull request with a clear description of the change.
117
-
118
- ## Reporting issues
119
-
120
- Open an issue at [github.com/nandorip/react-intl-number-input/issues](https://github.com/nandorip/react-intl-number-input/issues).
1
+ # Contributing
2
+
3
+ Thank you for your interest in contributing to `react-intl-number-input`.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 20+ (recommended: current Active LTS)
8
+ - npm 10+
9
+
10
+ The package declares Node.js 20+ in `engines`. The runtime component executes in browsers; Node.js is used for installation, builds, tests and publication.
11
+
12
+ ## Getting started
13
+
14
+ ```bash
15
+ git clone https://github.com/nandorip/react-intl-number-input.git
16
+ cd react-intl-number-input
17
+ npm install
18
+ ```
19
+
20
+ ## Local development
21
+
22
+ Start the demo app with live rebuild:
23
+
24
+ ```bash
25
+ npm start
26
+ ```
27
+
28
+ Open [http://localhost:3001](http://localhost:3001). The demo lives in `example/` and imports the component from `src/`.
29
+
30
+ ## Scripts
31
+
32
+ | Command | Description |
33
+ | --- | --- |
34
+ | `npm start` | esbuild dev server for the demo |
35
+ | `npm test` | Run unit tests with Jest |
36
+ | `npm run typecheck` | Check library and demo types |
37
+ | `npm run check` | Tests, type checking, library builds and installed-tarball validation |
38
+ | `npm run check:package` | Validate the built npm tarball: CJS, ESM, types, SSR and DOM interactions |
39
+ | `npm run build:lib` | Compile `src/` to CommonJS, ESM, and types in `dist/` |
40
+ | `npm run build` | Build the demo bundle in `example/dist` |
41
+ | `npm run publish-demo` | Build and deploy the demo to GitHub Pages |
42
+
43
+ ## Project structure
44
+
45
+ ```
46
+ src/ Library source (TypeScript)
47
+ dist/ Published build output (generated, not committed)
48
+ example/ Demo app and GitHub Pages bundle
49
+ ```
50
+
51
+ The npm package ships `dist/`, `README.md`, `LICENSE`, `CHANGELOG.md`, and `CONTRIBUTING.md` (see `files` in `package.json`).
52
+
53
+ ## Testing
54
+
55
+ Run the full test suite before opening a pull request:
56
+
57
+ ```bash
58
+ npm run check
59
+ ```
60
+
61
+ Tests live alongside the source in `src/index.test.tsx` and `src/regressions.test.tsx`. CI also checks the installed package with React 16.8, 17, 18 and 19, and runs the full checks on Node.js 20 and 24.
62
+
63
+ ## Building the library
64
+
65
+ To produce the publishable artifacts locally:
66
+
67
+ ```bash
68
+ npm run build:lib
69
+ ```
70
+
71
+ This generates:
72
+
73
+ - `dist/index.js` — CommonJS build (`tsc`)
74
+ - `dist/esm/index.js` — ESM build (`tsc`)
75
+ - `dist/index.d.ts` — TypeScript declarations
76
+
77
+ ## Publishing to npm
78
+
79
+ ### Ownership & Accounts
80
+
81
+ The package is published under the npm account **`wipmob`** (`nandorip@live.com`).
82
+
83
+ > **Tip (Co-Maintainer):** To allow publishing from the `nandorip` account as well, add it via npm CLI or web interface:
84
+ > ```bash
85
+ > npm owner add nandorip react-intl-number-input
86
+ > ```
87
+ > Or manage collaborators at [npmjs.com/package/react-intl-number-input/access](https://www.npmjs.com/package/react-intl-number-input/access).
88
+
89
+ ### Method 1: Automated Release via GitHub Actions (Recommended)
90
+
91
+ This repository includes an automated workflow ([`.github/workflows/publish.yml`](.github/workflows/publish.yml)) with npm provenance attestations. This avoids local 2FA prompts and terminal issues.
92
+
93
+ 1. **One-time setup:**
94
+ - In your npm account (**`wipmob`**), generate an **Automation Token** or **Granular Access Token** with *Read and write* permissions for `react-intl-number-input`.
95
+ - In GitHub, go to **Settings > Secrets and variables > Actions** and add `NPM_TOKEN` with your token.
96
+ 2. **Publishing a release:**
97
+ - Create a new Release on GitHub (e.g. `v0.9.0`), or trigger the workflow manually under **Actions > Publish to npm > Run workflow**.
98
+ - GitHub Actions will run all checks, build, verify the tarball, and publish with `--provenance` automatically.
99
+
100
+ ### Method 2: Local CLI Release (`npm run release`)
101
+
102
+ A release helper script is available to validate requirements, run the test suite, and publish:
103
+
104
+ 1. **Verify login:**
105
+ ```bash
106
+ npm whoami # Should return 'wipmob' (or 'nandorip' if added as owner)
107
+ ```
108
+ If not logged in: `npm login`.
109
+ 2. **Bump version (if not already done):**
110
+ ```bash
111
+ npm version patch # or minor / major
112
+ ```
113
+ 3. **Execute release:**
114
+ ```bash
115
+ npm run release
116
+ ```
117
+ If your account requires 2FA and you are in a non-interactive shell, pass the OTP directly:
118
+ ```bash
119
+ npm run release -- --otp=123456
120
+ ```
121
+
122
+ The script automatically:
123
+ - Confirms the active npm user.
124
+ - Runs `npm run check` (Jest tests, TypeScript, library builds, tarball verification).
125
+ - Runs `npm publish`.
126
+ - Creates and pushes the git tag `v<version>`.
127
+
128
+ ### Deploying the demo
129
+
130
+ To update the live demo on GitHub Pages independently:
131
+
132
+ ```bash
133
+ npm run publish-demo
134
+ ```
135
+
136
+ ## Pull requests
137
+
138
+ 1. Fork the repository and create a feature branch.
139
+ 2. Make your changes with tests where applicable.
140
+ 3. Run `npm run check` and ensure it passes.
141
+ 4. Open a pull request with a clear description of the change.
142
+
143
+ ## Reporting issues
144
+
145
+ Open an issue at [github.com/nandorip/react-intl-number-input/issues](https://github.com/nandorip/react-intl-number-input/issues).