Skip to content

Commit bfeab05

Browse files
authored
chore: pick useful changes from turbo pr (#12190)
Co-authored-by: Jack-Works <[email protected]>
1 parent dfa11fd commit bfeab05

Some content is hidden

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

67 files changed

+308
-491
lines changed

.ignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Ignores for rg or ag
22
patches/
3-
packages/mask/dashboard/assets/images/SetupTutorial.svg
4-
53
**/locale/*.{po,json}

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.2.0
1+
v23.6.0

cspell.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@
241241
"ignoreRegExpList": ["/[A-Za-z0-9]{44}/", "/[A-Za-z0-9]{46}/", "/[A-Za-z0-9]{59}/"],
242242
"overrides": [],
243243
"words": [
244-
"Arbitrum",
245-
"Boba",
244+
"arbitrum",
245+
"boba",
246246
"cashtags",
247-
"Celo",
247+
"celo",
248248
"endregion",
249249
"linkedin",
250250
"luma",
251251
"muln",
252-
"Sepolia",
252+
"sepolia",
253253
"tanstack",
254254
"tiktok",
255255
"tweetnacl",

eslint.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ const moduleSystemRules = {
529529
'import/no-duplicates': 'warn', // duplicate specifiers
530530
'import/no-empty-named-blocks': 'warn', // bans import T, {}
531531
'unused-imports/no-unused-imports': 'warn',
532-
// 'unicorn/prefer-node-protocol': 'warn',
532+
'unicorn/prefer-node-protocol': 'warn',
533533
'@typescript-eslint/consistent-type-exports': ['warn', { fixMixedExportsWithInlineTypeSpecifier: true }],
534534
'@typescript-eslint/consistent-type-imports': [
535535
'warn',
@@ -597,7 +597,6 @@ export default tseslint.config(
597597
'**/i18n_generated.ts',
598598
'**/languages.ts',
599599
'packages/contracts',
600-
'packages/scripts',
601600
'packages/mask/.webpack',
602601
],
603602
},

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"packageManager": "[email protected]",
55
"engines": {
6-
"node": ">=22.2.0",
6+
"node": ">=23.6.0",
77
"yarn": ">=999.0.0",
88
"npm": ">=999.0.0"
99
},
@@ -70,7 +70,6 @@
7070
"@masknet/eslint-plugin": "^0.3.0",
7171
"@masknet/typescript-plugin": "workspace:^",
7272
"@nice-labs/git-rev": "^3.5.1",
73-
"@swc-node/register": "^1.10.9",
7473
"@swc/core": "1.11.7",
7574
"@tanstack/eslint-plugin-query": "^5.66.1",
7675
"@types/lodash-es": "^4.17.12",
@@ -155,10 +154,10 @@
155154
"@protobufjs/[email protected]": "patches/@[email protected]",
156155
157156
158-
159157
160158
"@splinetool/[email protected]": "patches/@[email protected]",
161-
"@scamsniffer/detector": "patches/@scamsniffer__detector.patch"
159+
"@scamsniffer/detector": "patches/@scamsniffer__detector.patch",
160+
"gulp": "patches/gulp.patch"
162161
}
163162
}
164163
}

packages/backup-format/tests/encryption.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect, beforeAll } from 'vitest'
2-
import { webcrypto } from 'crypto'
2+
import { webcrypto } from 'node:crypto'
33
import { encryptBackup, decryptBackup } from '../src/index.js'
44

55
beforeAll(() => {

packages/gun-utils/builder.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createRequire } from 'module'
22
import { readFile, writeFile } from 'fs/promises'
3+
import { minify } from '@swc/core'
34
const require = createRequire(import.meta.url)
45
const files = await Promise.all(
56
[
@@ -69,12 +70,15 @@ const patchedSource = files
6970
// patch instanceof Object to instanceof globalThis.Object
7071
.replace(/instanceof\s+Object/g, 'instanceof globalThis.Object')
7172

72-
const result = `(() => {
73+
const result = await minify(
74+
`(() => {
7375
${init.toString().replace('// Source Code Here', patchedSource)};
7476
if (!globalThis.Gun) {
7577
globalThis.Gun = ${init.name}().Gun;
7678
}
7779
})();
7880
undefined;
79-
`
80-
writeFile(new URL('./gun.js', import.meta.url), result)
81+
`,
82+
{ mangle: false, compress: false },
83+
)
84+
writeFile(new URL('./gun.js', import.meta.url), result.code)

packages/gun-utils/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
"dependencies": {
1818
"event-iterator": "^2.0.0",
1919
"gun": "0.2020.1234"
20+
},
21+
"devDependencies": {
22+
"@swc/core": "1.9.3"
2023
}
2124
}

packages/mask/.webpack/config.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ import { emitJSONFile } from '@nice-labs/emit-file-webpack-plugin'
77
import DevtoolsIgnorePlugin from 'devtools-ignore-webpack-plugin'
88
import WebExtensionPlugin from 'webpack-target-webextension'
99
import ReactCompiler from 'react-compiler-webpack'
10-
import { getGitInfo } from './git-info.js'
11-
import { emitManifestFile } from './plugins/manifest.js'
10+
import { getGitInfo } from './git-info.ts'
11+
import { emitManifestFile } from './plugins/manifest.ts'
1212
// @ts-expect-error
1313
import LavaMoat from '@lavamoat/webpack'
1414

1515
import { readFile, readdir } from 'node:fs/promises'
1616
import { createRequire } from 'node:module'
1717
import { join } from 'node:path'
1818

19-
import { computeCacheKey, computedBuildFlags, normalizeBuildFlags, type BuildFlags } from './flags.js'
20-
import { ProfilingPlugin } from './plugins/ProfilingPlugin.js'
21-
import { joinEntryItem, normalizeEntryDescription, type EntryDescription } from './utils.js'
19+
import { computeCacheKey, computedBuildFlags, normalizeBuildFlags, type BuildFlags } from './flags.ts'
20+
import { ProfilingPlugin } from './plugins/ProfilingPlugin.ts'
21+
import { joinEntryItem, normalizeEntryDescription, type EntryDescription } from './utils.ts'
2222

23-
import './clean-hmr.js'
24-
import { TrustedTypesPlugin } from './plugins/TrustedTypesPlugin.js'
23+
import './clean-hmr.ts'
24+
import { TrustedTypesPlugin } from './plugins/TrustedTypesPlugin.ts'
2525

2626
const require = createRequire(import.meta.url)
2727
const patchesDir = join(import.meta.dirname, '../../../patches')
@@ -492,11 +492,12 @@ export async function createConfiguration(
492492
}
493493
}
494494

495-
enum TemplateType {
496-
Loading,
497-
NoLoading,
498-
Background,
499-
}
495+
const TemplateType = {
496+
Loading: 0,
497+
NoLoading: 1,
498+
Background: 2,
499+
} as const
500+
type TemplateType = (typeof TemplateType)[keyof typeof TemplateType]
500501
const pages = {
501502
loading: readFile(join(import.meta.dirname, './with-loading.html'), 'utf8'),
502503
noLoading: readFile(join(import.meta.dirname, './with-no-loading.html'), 'utf8'),

packages/mask/.webpack/flags.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import type { Configuration } from 'webpack'
22
import { join, isAbsolute } from 'node:path'
33

4-
export enum ManifestFile {
5-
ChromiumMV2 = 'chromium-mv2',
6-
ChromiumMV3 = 'chromium-mv3',
7-
ChromiumBetaMV3 = 'chromium-beta-mv3',
8-
FirefoxMV2 = 'firefox-mv2',
9-
FirefoxMV3 = 'firefox-mv3',
10-
SafariMV3 = 'safari-mv3',
4+
export const ManifestFile = {
5+
ChromiumMV2: 'chromium-mv2',
6+
ChromiumMV3: 'chromium-mv3',
7+
ChromiumBetaMV3: 'chromium-beta-mv3',
8+
FirefoxMV2: 'firefox-mv2',
9+
FirefoxMV3: 'firefox-mv3',
10+
SafariMV3: 'safari-mv3',
1111
}
12+
export type ManifestFile = (typeof ManifestFile)[keyof typeof ManifestFile]
1213
export interface BuildFlags {
1314
/** If this field is set, manifest.json will copy the content of manifest-*.json */
1415
manifestFile?: ManifestFile

0 commit comments

Comments
 (0)