Skip to content

Commit 162ae45

Browse files
committed
chore: Yarn 4.x & update devDependencies
1 parent 9fc89c2 commit 162ae45

File tree

11 files changed

+10434
-7254
lines changed

11 files changed

+10434
-7254
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
path: node_modules
3131
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
3232

33-
- run: yarn install --frozen-lockfile
33+
- run: yarn install --immutable
3434
if: steps.node_modules_cache.outputs.cache-hit != 'true'
3535

3636
- run: yarn ci

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
node_modules/
22
coverage/
33
esm/
4+
# yarn berry
5+
.yarn/*
6+
!.yarn/patches
7+
!.yarn/plugins
8+
!.yarn/releases
9+
!.yarn/sdks
10+
!.yarn/versions

.yarn/releases/yarn-4.6.0.cjs

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

package.json

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
"!__tests__"
99
],
1010
"scripts": {
11-
"ci": "yarn lint && yarn test && yarn size",
12-
"presize": "yarn build",
11+
"ci": "yarn lint && yarn test && yarn build && yarn size",
1312
"size": "size-limit",
13+
"format": "prettier --write src/*.{js,ts,tsx}",
1414
"test": "jest --coverage",
1515
"lint": "eslint './src/*.{js,ts,tsx}' --quiet",
1616
"ts": "tsc --noEmit",
1717
"build": "rm -rf esm && tsc --outDir esm",
1818
"postbuild": "prettier --write esm/*.js esm/*.d.ts",
1919
"docs": "yarn doctoc API.md",
20-
"prepublishOnly": "yarn docs && yarn build"
20+
"prepublishOnly": "yarn docs && yarn build",
21+
"postinstall": "rm -rf node_modules/@types/react-native"
2122
},
2223
"peerDependencies": {
2324
"react": ">=16.4.0",
@@ -32,32 +33,32 @@
3233
}
3334
},
3435
"resolutions": {
35-
"@types/jest": "^29.5.12",
36-
"@types/react": "^18.2.58"
36+
"@types/jest": "^29.5.14",
37+
"@types/react": "^19.0.10"
3738
},
3839
"devDependencies": {
39-
"@size-limit/preset-app": "^11.0.2",
40+
"@size-limit/preset-app": "^11.2.0",
4041
"@testing-library/react-hooks": "^8.0.1",
41-
"@testing-library/react-native": "^12.4.3",
42-
"@tsconfig/react-native": "^3.0.3",
43-
"@types/jest": "^29.5.12",
44-
"@types/react": "^18.2.58",
45-
"@types/react-test-renderer": "^18.0.7",
46-
"@typescript-eslint/eslint-plugin": "^7.0.2",
47-
"@typescript-eslint/parser": "^7.0.2",
42+
"@testing-library/react-native": "^13.0.1",
43+
"@tsconfig/react-native": "^3.0.5",
44+
"@types/jest": "^29.5.14",
45+
"@types/react": "^19.0.10",
46+
"@types/react-test-renderer": "^19.0.0",
47+
"@typescript-eslint/eslint-plugin": "^8.24.1",
48+
"@typescript-eslint/parser": "^8.24.1",
4849
"doctoc": "^2.2.1",
49-
"eslint": "^8.57.0",
50-
"eslint-config-prettier": "^9.1.0",
51-
"eslint-plugin-prettier": "^5.1.3",
52-
"eslint-plugin-react": "^7.33.2",
50+
"eslint": "^8.57.1",
51+
"eslint-config-prettier": "^10.0.1",
52+
"eslint-plugin-prettier": "^5.2.3",
53+
"eslint-plugin-react": "^7.37.4",
5354
"jest": "^29.7.0",
54-
"prettier": "^3.2.5",
55-
"react": "^18.2.0",
56-
"react-native": "0.73.4",
57-
"react-native-test-app": "^3.2.11",
58-
"react-test-renderer": "^18.2.0",
59-
"size-limit": "^11.0.2",
60-
"typescript": "^5.3.3"
55+
"prettier": "^3.5.1",
56+
"react": "^19.0.0",
57+
"react-native": "^0.77.1",
58+
"react-native-test-app": "^4.1.3",
59+
"react-test-renderer": "^19.0.0",
60+
"size-limit": "^11.2.0",
61+
"typescript": "^5.7.3"
6162
},
6263
"author": "David <[email protected]>",
6364
"description": "A react-native component to input confirmation code for both Android and IOS",
@@ -80,5 +81,6 @@
8081
"pin-code",
8182
"confirmation-code-input",
8283
"pin-code-input"
83-
]
84+
],
85+
"packageManager": "[email protected]"
8486
}

src/Cursor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const DEFAULT_CURSOR_SYMBOL = '|';
77
export function Cursor({
88
cursorSymbol = DEFAULT_CURSOR_SYMBOL,
99
delay = DEFAULT_BLINKING_SPEED,
10-
}): JSX.Element {
10+
}): React.JSX.Element {
1111
const [visibleFlag, setFlag] = useState(true);
1212

1313
useInterval(() => setFlag((flag) => !flag), delay);

src/MaskSymbol.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function MaskSymbol({
1515
children: symbol,
1616
maskSymbol,
1717
delay = DEFAULT_BLINKING_SPEED,
18-
}: Props): JSX.Element {
18+
}: Props): React.ReactNode {
1919
const [visibleFlag, setFlag] = useState(true);
2020

2121
useTimeout(() => setFlag(false), delay);
@@ -26,6 +26,5 @@ export function MaskSymbol({
2626
}
2727
}, [isLastFilledCell]);
2828

29-
// @ts-expect-error `JSX.Element` is not a `ReactNode`
3029
return visibleFlag ? symbol : maskSymbol;
3130
}

src/__tests__/useBlurOnFulfill.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ it('should not throw an error when ref null and value length equal cellCount', (
4242
}),
4343
);
4444

45-
// @ts-expect-error - 'current' is mutable prop
4645
result.current.current = null;
4746

4847
value = '1234';

src/useTimer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type RunTimerFn = (handler: () => void, timeout: number) => number;
66
const creteUseTimer =
77
(clear: ClearTimerFn, runTimer: RunTimerFn) =>
88
(callback: () => void, delay: number): void => {
9-
const timerRef = useRef<number>();
9+
const timerRef = useRef<number>(-1);
1010

1111
useEffect(() => {
1212
const stop = () => clear(timerRef.current);

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"types": ["react-native", "jest"],
55
"rootDir": "./src",
66
"module": "ES2020",
7-
"skipLibCheck": false,
7+
"skipLibCheck": true,
88
"declaration": true,
99
"noEmit": false
1010
},

0 commit comments

Comments
 (0)