Skip to content

Commit 39af237

Browse files
committed
chore: bump deps
1 parent 7fbb50b commit 39af237

File tree

5 files changed

+2403
-3313
lines changed

5 files changed

+2403
-3313
lines changed

docs/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"dependencies": {
1313
"@textea/json-viewer": "workspace:^",
1414
"gray-matter": "^4.0.3",
15-
"next": "^13.5.0",
16-
"nextra": "^2.13.2",
17-
"nextra-theme-docs": "^2.3.0",
15+
"next": "^13.5.6",
16+
"nextra": "^2.13.3",
17+
"nextra-theme-docs": "^2.13.3",
1818
"react": "^18.2.0",
1919
"react-dom": "^18.2.0"
2020
},
2121
"devDependencies": {
22-
"@types/node": "^20.8.6",
23-
"@types/react": "^18.2.13",
24-
"@types/react-dom": "^18.2.14",
25-
"typescript": "^5.0.3"
22+
"@types/node": "^20.11.19",
23+
"@types/react": "^18.2.57",
24+
"@types/react-dom": "^18.2.19",
25+
"typescript": "^5.3.3"
2626
}
2727
}

package.json

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
"build": "tsc && rollup -c rollup.config.ts --configPlugin swc3"
6060
},
6161
"dependencies": {
62-
"clsx": "^2.0.0",
62+
"clsx": "^2.1.0",
6363
"copy-to-clipboard": "^3.3.3",
64-
"zustand": "^4.4.7"
64+
"zustand": "^4.5.2"
6565
},
6666
"lint-staged": {
6767
"!*.{ts,tsx,js,jsx}": "prettier --write --ignore-unknown",
@@ -75,50 +75,49 @@
7575
"react-dom": "^17 || ^18"
7676
},
7777
"devDependencies": {
78-
"@commitlint/cli": "^17.6.5",
79-
"@commitlint/config-angular": "^17.8.0",
80-
"@emotion/react": "^11.11.1",
81-
"@emotion/styled": "^11.11.0",
82-
"@mui/material": "^5.14.2",
83-
"@rollup/plugin-alias": "^5.0.0",
84-
"@rollup/plugin-commonjs": "^25.0.2",
85-
"@rollup/plugin-node-resolve": "^15.1.0",
78+
"@commitlint/cli": "^19.2.1",
79+
"@commitlint/config-angular": "^19.1.0",
80+
"@emotion/react": "^11.11.4",
81+
"@emotion/styled": "^11.11.5",
82+
"@mui/material": "^5.15.15",
83+
"@rollup/plugin-alias": "^5.1.0",
84+
"@rollup/plugin-commonjs": "^25.0.7",
85+
"@rollup/plugin-node-resolve": "^15.2.3",
8686
"@rollup/plugin-replace": "^5.0.5",
87-
"@swc/core": "^1.3.66",
88-
"@swc/helpers": "^0.5.3",
89-
"@testing-library/react": "^14.0.0",
90-
"@types/node": "^20.8.6",
91-
"@types/react": "^18.2.13",
92-
"@types/react-dom": "^18.2.14",
93-
"@typescript-eslint/eslint-plugin": "^6.7.3",
94-
"@typescript-eslint/parser": "^6.2.1",
95-
"@vitejs/plugin-react": "^4.0.3",
96-
"@vitest/coverage-v8": "^0.32.2",
97-
"eslint": "^8.43.0",
87+
"@swc/core": "^1.4.12",
88+
"@swc/helpers": "^0.5.8",
89+
"@testing-library/react": "^14.2.2",
90+
"@types/node": "^20.12.5",
91+
"@types/react": "^18.2.74",
92+
"@types/react-dom": "^18.2.24",
93+
"@typescript-eslint/eslint-plugin": "^7.5.0",
94+
"@typescript-eslint/parser": "^7.5.0",
95+
"@vitejs/plugin-react": "^4.2.1",
96+
"@vitest/coverage-v8": "^1.4.0",
97+
"eslint": "^8.57.0",
9898
"eslint-config-standard": "^17.1.0",
99-
"eslint-plugin-cypress": "^2.13.3",
100-
"eslint-plugin-import": "npm:eslint-plugin-i@^2.27.5-3",
101-
"eslint-plugin-n": "^16.3.1",
99+
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
100+
"eslint-plugin-n": "^16.6.2",
102101
"eslint-plugin-promise": "^6.1.1",
103-
"eslint-plugin-react": "^7.33.2",
102+
"eslint-plugin-react": "^7.34.1",
104103
"eslint-plugin-react-hooks": "^4.6.0",
105-
"eslint-plugin-simple-import-sort": "^10.0.0",
106-
"eslint-plugin-unused-imports": "^2.0.0",
107-
"expect-type": "^0.16.0",
108-
"husky": "^8.0.3",
109-
"jsdom": "^22.1.0",
110-
"lint-staged": "^13.2.2",
104+
"eslint-plugin-simple-import-sort": "^12.0.0",
105+
"eslint-plugin-unused-imports": "^3.1.0",
106+
"expect-type": "^0.19.0",
107+
"husky": "^9.0.11",
108+
"jsdom": "^24.0.0",
109+
"lint-staged": "^15.2.2",
111110
"pinst": "^3.0.0",
112-
"prettier": "^3.0.1",
111+
"prettier": "^3.2.5",
113112
"react": "^18.2.0",
114113
"react-dom": "^18.2.0",
115-
"rollup": "^3.25.2",
116-
"rollup-plugin-dts": "^5.3.0",
117-
"rollup-plugin-swc3": "^0.10.3",
118-
"ts-node": "^10.9.1",
119-
"typescript": "^5.1.3",
120-
"vite": "^4.5.3",
121-
"vitest": "^0.33.0"
114+
"rollup": "^4.14.0",
115+
"rollup-plugin-dts": "^6.1.0",
116+
"rollup-plugin-swc3": "^0.11.0",
117+
"ts-node": "^10.9.2",
118+
"typescript": "^5.4.4",
119+
"vite": "^5.2.8",
120+
"vitest": "^1.4.0"
122121
},
123122
"resolutions": {
124123
"browserslist": "4.21.5",

rollup.config.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,23 @@ const buildMatrix = (input: string, output: string, config: {
8484
// we have to copy this configuration because swc is not handling `.browserslistrc` properly
8585
// see https://github.com/swc-project/swc/issues/3365
8686
targets: 'and_chr 91,and_ff 89,and_qq 10.4,and_uc 12.12,android 91,baidu 7.12,chrome 90,edge 91,firefox 78,ios_saf 12.2,kaios 2.5,op_mini all,op_mob 76'
87-
}
87+
},
88+
tsconfig: false
8889
}))
89-
]
90+
],
91+
/**
92+
* Ignore "use client" waning
93+
* @see {@link https://github.com/TanStack/query/pull/5161#issuecomment-1477389761 Preserve 'use client' directives}
94+
*/
95+
onwarn (warning, warn) {
96+
if (
97+
warning.code === 'MODULE_LEVEL_DIRECTIVE' &&
98+
warning.message.includes('"use client"')
99+
) {
100+
return
101+
}
102+
warn(warning)
103+
}
90104
}
91105
}
92106

src/utils/index.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ function shallowCopy (value: any) {
3838
return value
3939
}
4040

41-
/**
42-
* Apply a value to a given path of an object.
43-
*/
44-
export function applyValue (input: any, path: (string | number)[], value: any) {
41+
function _applyValue (input: any, path: (string | number)[], value: any, visitedMapping = new Map<any, any>()) {
4542
if (typeof input !== 'object' || input === null) {
4643
if (path.length !== 0) {
4744
throw new Error('path is incorrect')
@@ -50,22 +47,36 @@ export function applyValue (input: any, path: (string | number)[], value: any) {
5047
}
5148

5249
const shouldCopy = shouldShallowCopy(input)
53-
if (shouldCopy) input = shallowCopy(input)
50+
if (shouldCopy) {
51+
let copiedInput = visitedMapping.get(input)
52+
if (!copiedInput) {
53+
copiedInput = shallowCopy(input)
54+
visitedMapping.set(input, copiedInput)
55+
}
56+
input = copiedInput
57+
}
5458

5559
const [key, ...restPath] = path
5660
if (key !== undefined) {
5761
if (key === '__proto__') {
5862
throw new TypeError('Modification of prototype is not allowed')
5963
}
6064
if (restPath.length > 0) {
61-
input[key] = applyValue(input[key], restPath, value)
65+
input[key] = _applyValue(input[key], restPath, value, visitedMapping)
6266
} else {
6367
input[key] = value
6468
}
6569
}
6670
return input
6771
}
6872

73+
/**
74+
* Apply a value to a given path of an object.
75+
*/
76+
export function applyValue (input: any, path: (string | number)[], value: any) {
77+
return _applyValue(input, path, value)
78+
}
79+
6980
/**
7081
* Delete a value from a given path of an object.
7182
*/

0 commit comments

Comments
 (0)