Skip to content

Commit 1211c3c

Browse files
authored
Merge pull request #598 from mCodex/fix/tsError
Fix/ts error
2 parents 6e81007 + e0626a7 commit 1211c3c

8 files changed

Lines changed: 282 additions & 2927 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
increment:
7+
description: 'Version increment (leave empty to derive from conventional commits)'
8+
required: false
9+
default: ''
10+
type: choice
11+
options:
12+
- ''
13+
- patch
14+
- minor
15+
- major
16+
- prerelease
17+
dry-run:
18+
description: 'Dry run (no publish, no push)'
19+
required: false
20+
default: false
21+
type: boolean
522

623
permissions:
724
contents: read
@@ -24,25 +41,35 @@ jobs:
2441
uses: actions/checkout@v4
2542
with:
2643
fetch-depth: 0
44+
persist-credentials: true
45+
2746
- name: Setup Node.js
2847
uses: actions/setup-node@v4
2948
with:
3049
node-version: '24'
3150
cache: 'yarn'
51+
registry-url: 'https://registry.npmjs.org'
3252

33-
- name: Install npm dependencies (yarn)
34-
run: yarn install --frozen-lockfile
53+
- name: Configure git identity
54+
run: |
55+
git config user.name "github-actions[bot]"
56+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
3557
36-
- name: Build lib
37-
run: yarn build
58+
- name: Install dependencies
59+
run: yarn install --frozen-lockfile
3860

3961
- name: Release
4062
env:
4163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4264
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43-
NPM_CONFIG_PROVENANCE: true
44-
GIT_AUTHOR_NAME: ${{ github.actor }}
45-
GIT_AUTHOR_EMAIL: '${{ github.actor }}@users.noreply.github.com'
46-
GIT_COMMITTER_NAME: ${{ github.actor }}
47-
GIT_COMMITTER_EMAIL: '${{ github.actor }}@users.noreply.github.com'
48-
run: yarn release
65+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
66+
NPM_CONFIG_PROVENANCE: 'true'
67+
run: |
68+
ARGS="--ci"
69+
if [ -n "${{ inputs.increment }}" ]; then
70+
ARGS="$ARGS --increment=${{ inputs.increment }}"
71+
fi
72+
if [ "${{ inputs.dry-run }}" = "true" ]; then
73+
ARGS="$ARGS --dry-run"
74+
fi
75+
yarn release $ARGS

.release-it.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [6.1.1](https://github.com/mcodex/react-native-sensitive-info/compare/v6.1.0...v6.1.1) (2026-04-29)
2+
3+
### Bug Fixes
4+
5+
* update error classes to handle cause assignment for TypeScript compatibility ([003b00e](https://github.com/mcodex/react-native-sensitive-info/commit/003b00e2bf96af28685afdf2da57d067a87339c1))
16
## [6.1.0](https://github.com/mcodex/react-native-sensitive-info/compare/v6.0.0-rc.12...v6.1.0) (2026-04-28)
27

38
### Features

package.json

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-sensitive-info",
3-
"version": "6.1.0",
3+
"version": "6.1.1",
44
"description": "🔐 React Native secure storage, rebuilt with Nitro Modules ⚡️ Biometric-ready, StrongBox-aware, and metadata-rich for modern mobile apps",
55
"main": "./lib/commonjs/index.js",
66
"module": "./lib/module/index.js",
@@ -50,8 +50,7 @@
5050
"scripts": {
5151
"typecheck": "tsc --noEmit",
5252
"clean": "git clean -dfX",
53-
"release": "semantic-release",
54-
"release:it": "release-it --config .release-it.json",
53+
"release": "release-it",
5554
"build": "npm run typecheck && bob build",
5655
"codegen": "nitrogen --logLevel=\"debug\" && npm run build && node post-script.js",
5756
"lint": "biome check --write .",
@@ -109,14 +108,12 @@
109108
},
110109
"devDependencies": {
111110
"@biomejs/biome": "^2.4.13",
112-
"@semantic-release/changelog": "^6.0.3",
113-
"@semantic-release/git": "^10.0.1",
111+
"@release-it/conventional-changelog": "^11.0.0",
114112
"@testing-library/dom": "^10.4.1",
115113
"@testing-library/react": "^16.3.2",
116114
"@types/jest": "^30.0.0",
117115
"@types/react": "19.2.x",
118116
"babel-plugin-react-compiler": "^1.0.0",
119-
"conventional-changelog-cli": "^5.0.0",
120117
"conventional-changelog-conventionalcommits": "^9.3.1",
121118
"jest": "^30.3.0",
122119
"jest-environment-jsdom": "^30.3.0",
@@ -128,7 +125,6 @@
128125
"react-native-builder-bob": "^0.41.0",
129126
"react-native-nitro-modules": "0.35.6",
130127
"release-it": "^20.0.1",
131-
"semantic-release": "^25.0.3",
132128
"ts-jest": "^29.4.9",
133129
"ts-node": "^10.9.2",
134130
"typescript": "^6.0.3"
@@ -164,5 +160,73 @@
164160
]
165161
]
166162
},
163+
"release-it": {
164+
"git": {
165+
"commitMessage": "chore(release): v${version}",
166+
"tagName": "v${version}",
167+
"tagAnnotation": "Release v${version}",
168+
"requireCleanWorkingDir": true,
169+
"requireBranch": [
170+
"master",
171+
"next"
172+
],
173+
"requireUpstream": false,
174+
"push": true,
175+
"pushArgs": [
176+
"--follow-tags"
177+
]
178+
},
179+
"npm": {
180+
"publish": true,
181+
"verifyAccess": true,
182+
"tokenRef": "NPM_TOKEN"
183+
},
184+
"github": {
185+
"release": true,
186+
"releaseName": "v${version}",
187+
"tokenRef": "GITHUB_TOKEN"
188+
},
189+
"hooks": {
190+
"before:init": [
191+
"npm run typecheck",
192+
"npm run build"
193+
]
194+
},
195+
"plugins": {
196+
"@release-it/conventional-changelog": {
197+
"preset": {
198+
"name": "conventionalcommits",
199+
"types": [
200+
{
201+
"type": "feat",
202+
"section": "✨ Features"
203+
},
204+
{
205+
"type": "fix",
206+
"section": "🐛 Bug Fixes"
207+
},
208+
{
209+
"type": "perf",
210+
"section": "💨 Performance Improvements"
211+
},
212+
{
213+
"type": "refactor",
214+
"section": "🔄 Code Refactors"
215+
},
216+
{
217+
"type": "docs",
218+
"section": "📚 Documentation"
219+
},
220+
{
221+
"type": "chore",
222+
"section": "🛠️ Other changes"
223+
}
224+
]
225+
},
226+
"infile": "CHANGELOG.md",
227+
"header": "# Changelog"
228+
}
229+
}
230+
},
167231
"packageManager": "yarn@4.10.3"
168232
}

release.config.cjs

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/errors.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,15 @@ export class SensitiveInfoError extends Error {
7272
message: string,
7373
options?: { cause?: unknown }
7474
) {
75-
super(message, options)
75+
super(message)
7676
this.name = 'SensitiveInfoError'
7777
this.code = code
78+
// Assign `cause` directly instead of passing it to `super()` so this
79+
// compiles cleanly under TS configs whose `lib` predates ES2022 (where
80+
// the second `Error` constructor argument was introduced).
81+
if (options && 'cause' in options) {
82+
;(this as { cause?: unknown }).cause = options.cause
83+
}
7884
}
7985
}
8086

src/hooks/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ export class HookError extends Error {
3838
message: string,
3939
{ cause, operation, hint }: HookErrorOptions = {}
4040
) {
41-
super(message, { cause })
41+
super(message)
4242
this.name = 'HookError'
4343
this.operation = operation
4444
this.hint = hint
45+
// Assign `cause` directly instead of passing it to `super()` so this
46+
// compiles cleanly under TS configs whose `lib` predates ES2022 (where
47+
// the second `Error` constructor argument was introduced).
48+
if (cause !== undefined) {
49+
;(this as { cause?: unknown }).cause = cause
50+
}
4551
}
4652
}
4753

0 commit comments

Comments
 (0)