Skip to content

Commit c7ed132

Browse files
authored
chore: update deps (#11955)
Co-authored-by: Jack-Works <Jack-Works@users.noreply.github.com>
1 parent 59db8d6 commit c7ed132

File tree

109 files changed

+4197
-5368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+4197
-5368
lines changed

.github/workflows/linters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
with:
6565
ref: ${{ github.event.pull_request.head.ref }}
6666
- uses: actions/setup-node@v4
67-
- run: npx prettier@3.3.2 --write .
67+
- run: npx prettier@3.4.1 --write .
6868
- uses: EndBug/add-and-commit@v9
6969
with:
7070
message: 'fix: prettier'

eslint.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ const deferPackages = [
3737

3838
const avoidMistakeRules = {
3939
// Libraries
40+
'@tanstack/query/exhaustive-deps': 'error', // avoid unstable results from the hook being deps
4041
'@tanstack/query/stable-query-client': 'error',
42+
'@tanstack/query/infinite-query-property-order': 'warn', // help TypeScript to infer type correctly
4143
'@tanstack/query/no-rest-destructuring': 'error',
44+
'@tanstack/query/no-unstable-deps': 'error', // avoid unstable results from the hook being deps
4245
'@lingui/no-single-tag-to-translate': 'error',
4346
// '@lingui/no-single-variables-to-translate': 'error', // we're mixing two i18n frameworks, a lot of false positive reports
4447
// https://github.com/lingui/eslint-plugin/issues/46
@@ -100,6 +103,7 @@ const avoidMistakeRules = {
100103
// '@typescript-eslint/no-invalid-void-type': 'warn', // Disallow void type outside of generic or return types
101104
'@typescript-eslint/no-misused-new': 'error', // wrong 'new ()' or 'constructor()' signatures
102105
'@typescript-eslint/no-unsafe-function-type': 'error',
106+
// '@typescript-eslint/no-unsafe-type-assertion': 'error', // bans `expr as T`
103107
'@typescript-eslint/no-wrapper-object-types': 'error',
104108
/// Unicode support
105109
'no-misleading-character-class': 'error', // RegEx
@@ -477,6 +481,11 @@ const moduleSystemRules = {
477481
from: './packages/mask/shared-ui/',
478482
message: 'Background cannot import Ui specific code.',
479483
},
484+
{
485+
target: './packages/mask/shared/**',
486+
from: './packages/mask/shared-ui/',
487+
message: 'packages/mask/shared cannot import services. Move it to packages/mask/shared-ui instead.',
488+
},
480489
{
481490
target: './packages/mask/!(background)/**',
482491
from: './packages/mask/background/',
@@ -620,6 +629,23 @@ export default tseslint.config(
620629
'unicorn/consistent-function-scoping': 'off',
621630
},
622631
},
632+
{
633+
files: ['packages/mask/shared/**/*.ts', 'packages/mask/shared/**/*.tsx'],
634+
rules: {
635+
'@typescript-eslint/no-restricted-imports': [
636+
'error',
637+
{
638+
paths: [
639+
{
640+
name: '#services',
641+
message:
642+
'packages/mask/shared cannot import services. Move it to packages/mask/shared-ui instead.',
643+
},
644+
],
645+
},
646+
],
647+
},
648+
},
623649
{
624650
files: ['packages/**/*.ts', 'packages/**/*.tsx'],
625651
ignores: [

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"lint:ci-report": "pnpm run lint:ci --format=junit --output-file=reports/junit/eslint-results.xml --max-warnings=0",
2525
"prepare": "husky",
2626
"svgo": "svgo packages/icons/*/*.svg",
27-
"test": "vitest --pool=forks",
27+
"test": "vitest",
2828
"spellcheck": "cspell lint --no-must-find-files",
2929
"clean": "npx gulp clean",
3030
"lingui:compile": "npx gulp lingui-compile",
@@ -36,8 +36,8 @@
3636
"@emotion/react": "11.11.4",
3737
"@emotion/serialize": "1.1.4",
3838
"@emotion/styled": "11.11.5",
39-
"@lingui/core": "^4.12.0",
40-
"@lingui/react": "^4.12.0",
39+
"@lingui/core": "^4.14.0",
40+
"@lingui/react": "^4.14.0",
4141
"@masknet/kit": "0.4.1",
4242
"@mui/base": "5.0.0-beta.40",
4343
"@mui/icons-material": "5.15.21",
@@ -48,52 +48,52 @@
4848
"@types/masknet__global-types": "workspace:^",
4949
"@types/react": "npm:types-react@beta",
5050
"@types/react-dom": "npm:types-react-dom@beta",
51-
"@typescript/lib-dom": "npm:@types/web@^0.0.171",
52-
"knip": "^5.23.2",
51+
"@typescript/lib-dom": "npm:@types/web@^0.0.183",
52+
"knip": "^5.38.1",
5353
"lodash-es": "^4.17.21",
5454
"react": "0.0.0-experimental-58af67a8f8-20240628",
5555
"react-dom": "0.0.0-experimental-58af67a8f8-20240628",
5656
"ses": "1.9.0",
5757
"ts-results-es": "^4.2.0"
5858
},
5959
"devDependencies": {
60-
"@changesets/cli": "^2.27.6",
61-
"@commitlint/cli": "^19.3.0",
62-
"@commitlint/config-conventional": "^19.2.2",
63-
"@eslint-react/eslint-plugin": "^1.15.0",
64-
"@eslint/compat": "^1.1.1",
65-
"@lingui/cli": "^4.12.0",
66-
"@lingui/macro": "^4.12.0",
67-
"@lingui/swc-plugin": "^4.0.10",
60+
"@changesets/cli": "^2.27.10",
61+
"@commitlint/cli": "^19.6.0",
62+
"@commitlint/config-conventional": "^19.6.0",
63+
"@eslint-react/eslint-plugin": "^1.17.1",
64+
"@eslint/compat": "^1.2.3",
65+
"@lingui/cli": "^4.14.0",
66+
"@lingui/macro": "^4.14.0",
67+
"@lingui/swc-plugin": "^4.1.0",
6868
"@masknet/cli": "workspace:^",
6969
"@masknet/config": "workspace:^",
7070
"@masknet/eslint-plugin": "^0.3.0",
7171
"@nice-labs/git-rev": "^3.5.1",
7272
"@swc-node/register": "^1.10.9",
73-
"@swc/core": "1.7.35",
74-
"@tanstack/eslint-plugin-query": "^5.59.7",
73+
"@swc/core": "1.9.3",
74+
"@tanstack/eslint-plugin-query": "^5.61.4",
7575
"@types/lodash-es": "^4.17.12",
76-
"@vitest/ui": "^1.6.0",
77-
"cspell": "^8.9.1",
78-
"eslint": "9.12.0",
76+
"@vitest/ui": "^2.1.6",
77+
"cspell": "^8.16.1",
78+
"eslint": "9.15.0",
7979
"eslint-formatter-junit": "^8.40.0",
8080
"eslint-import-resolver-typescript": "^3.6.3",
8181
"eslint-plugin-i": "^2.29.1",
82-
"eslint-plugin-lingui": "^0.4.0",
83-
"eslint-plugin-react-compiler": "19.0.0-beta-8a03594-20241020",
82+
"eslint-plugin-lingui": "^0.8.1",
83+
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
8484
"eslint-plugin-react-hooks": "^5.0.0",
8585
"eslint-plugin-tss-unused-classes": "^1.0.3",
8686
"eslint-plugin-unicorn": "^56.0.0",
8787
"eslint-plugin-unused-imports": "^4.1.4",
8888
"gulp": "^5.0.0",
8989
"husky": "^9.0.11",
90-
"lint-staged": "^15.2.7",
91-
"prettier": "^3.3.2",
90+
"lint-staged": "^15.2.10",
91+
"prettier": "^3.4.1",
9292
"svgo": "^3.3.2",
93-
"typescript": "5.7.0-beta",
94-
"typescript-eslint": "^8.8.1",
95-
"vite": "^5.3.2",
96-
"vitest": "^1.6.0"
93+
"typescript": "5.7.2",
94+
"typescript-eslint": "^8.16.0",
95+
"vite": "^5.1.8",
96+
"vitest": "^2.1.6"
9797
},
9898
"pnpm": {
9999
"overrides": {

packages/gun-utils/src/instance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function createGun() {
3434
{},
3535
)
3636
}
37-
private declare abort: () => void
38-
private declare keepAlive: () => void
37+
declare private abort: () => void
38+
declare private keepAlive: () => void
3939
declare timer: ReturnType<typeof setTimeout> | undefined
4040
override send(data: any) {
4141
this.keepAlive()

packages/injected-script/main/Patches/EventTarget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function normalizeAddEventListenerArgs(
147147
options?: boolean | AddEventListenerOptions | undefined,
148148
): EventListenerDescriptor {
149149
// https://dom.spec.whatwg.org/#event-flatten-more
150-
const capture = $.Boolean(typeof options === 'boolean' ? options : options?.capture ?? false)
150+
const capture = $.Boolean(typeof options === 'boolean' ? options : (options?.capture ?? false))
151151
let once = false
152152
let passive: boolean | null = null
153153
let signal: AbortSignal | null = null

packages/injected-script/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"start": "rollup -c -w"
2626
},
2727
"devDependencies": {
28-
"rollup": "^4.18.0",
29-
"rollup-plugin-swc3": "^0.11.2"
28+
"rollup": "^4.27.4",
29+
"rollup-plugin-swc3": "^0.12.1"
3030
}
3131
}

packages/mask-sdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
},
2222
"devDependencies": {
2323
"@rollup/plugin-image": "^3.0.3",
24-
"@rollup/plugin-node-resolve": "^15.2.3",
24+
"@rollup/plugin-node-resolve": "^15.3.0",
2525
"async-call-rpc": "^6.4.2",
26-
"rollup": "^4.18.0",
27-
"rollup-plugin-swc3": "^0.11.2"
26+
"rollup": "^4.27.4",
27+
"rollup-plugin-swc3": "^0.12.1"
2828
}
2929
}

packages/mask/.webpack/config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,17 +350,11 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
350350
),
351351
},
352352
output: {
353-
environment: {
354-
module: false,
355-
dynamicImport: true,
356-
},
357353
path: flags.outputPath,
358354
filename: 'entry/[name].js',
359355
chunkFilename: productionLike ? 'bundled/[id].js' : 'bundled/chunk-[name].js',
360356
assetModuleFilename: productionLike ? 'assets/[hash][ext][query]' : 'assets/[name]-[hash][ext][query]',
361357
webassemblyModuleFilename: 'assets/[hash].wasm',
362-
hotUpdateMainFilename: 'hot/[runtime].[fullhash].json',
363-
hotUpdateChunkFilename: 'hot/[id].[fullhash].js',
364358
devtoolModuleFilenameTemplate:
365359
productionLike ?
366360
'webpack://[namespace]/[resource-path]'

packages/mask/.webpack/plugins/TrustedTypesPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class TrustedTypesRuntimeModule extends RuntimeModule {
1111
return Template.asString('/* TrustedTypesRuntimeModule skipped because compilation is undefined. */')
1212
return Template.asString([
1313
'if (typeof trustedTypes !== "undefined" && location.protocol.includes("extension") && !trustedTypes.defaultPolicy) {',
14-
Template.indent([`trustedTypes.createPolicy('default', { createScriptURL: (string) => string });`]),
14+
Template.indent(`trustedTypes.createPolicy('default', { createScriptURL: String });`),
1515
'}',
1616
])
1717
}
@@ -21,7 +21,7 @@ export class TrustedTypesPlugin {
2121
compiler.hooks.compilation.tap('TrustedTypes', (compilation) => {
2222
compilation.hooks.afterChunks.tap('TrustedTypes', (chunks) => {
2323
for (const c of chunks) {
24-
if (!c.hasEntryModule()) continue
24+
if (!compilation.chunkGraph.getNumberOfEntryModules(c)) continue
2525
compilation.addRuntimeModule(c, new TrustedTypesRuntimeModule(), compilation.chunkGraph)
2626
}
2727
})

packages/mask/content-script/components/InjectedComponents/DecryptedPost/DecryptedPostSuccess.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo, useContext, useEffect, useState } from 'react'
2-
import { attachNextIDToProfile } from '../../../../shared/index.js'
2+
import { attachNextIDToProfile } from '../../../../shared-ui/index.js'
33
import { AdditionalContent } from '../AdditionalPostContent.js'
44
import { SelectProfileDialog } from '../SelectPeopleDialog.js'
55
import { makeStyles } from '@masknet/theme'

0 commit comments

Comments
 (0)