Skip to content

Commit 63da5e5

Browse files
authored
chore: try tsgo (#12323)
1 parent b164499 commit 63da5e5

File tree

12 files changed

+139
-50
lines changed

12 files changed

+139
-50
lines changed

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"dbaeumer.vscode-eslint",
99
"aaron-bond.better-comments",
1010
"davidanson.vscode-markdownlint",
11-
"christian-kohler.path-intellisense"
11+
"christian-kohler.path-intellisense",
12+
"TypeScriptTeam.native-preview"
1213
],
1314
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1415
"unwantedRecommendations": []

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"typescript.tsdk": "node_modules/typescript/lib",
33
"typescript.preferences.importModuleSpecifierEnding": "js",
4+
"typescript.experimental.useTsgo": true,
45
"js/ts.implicitProjectConfig.module": "NodeNext",
56
"js/ts.implicitProjectConfig.target": "ESNext",
67
"editor.formatOnSave": true,

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
"tokenpocket",
212212
"transak",
213213
"trustwallet",
214+
"tsgo",
214215
"twimg",
215216
"twitterblue",
216217
"txes",

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"@swc/core": "1.13.3",
7777
"@tanstack/eslint-plugin-query": "^5.83.1",
7878
"@types/lodash-es": "^4.17.12",
79+
"@typescript/native-preview": "7.0.0-dev.20251211.1",
7980
"@vitest/ui": "^3.0.7",
8081
"cspell": "^8.17.5",
8182
"eslint": "9.32.0",
@@ -120,8 +121,15 @@
120121
"catalogs": [
121122
{
122123
"path": "./packages/shared-base-ui/src/locale/{locale}",
123-
"include": ["<rootDir>"],
124-
"exclude": ["**/node_modules/**", "**/*.d.ts", "**/dist/**", "**/build/**"]
124+
"include": [
125+
"<rootDir>"
126+
],
127+
"exclude": [
128+
"**/node_modules/**",
129+
"**/*.d.ts",
130+
"**/dist/**",
131+
"**/build/**"
132+
]
125133
}
126134
]
127135
}

packages/mask/shared-ui/service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const Services: ServicesType = {
4242
}
4343
setDebugObject('Services', Services)
4444
export default Services
45+
4546
export const GeneratorServices: AsyncGeneratorVersionOf<GeneratorServicesType> = add('GeneratorServices', true) as any
4647

4748
/**
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
declare function __mask__module__define__(
2-
id: string,
3-
module: import('../../sandboxed-plugin-runtime/node_modules/@masknet/compartment').VirtualModuleRecord,
4-
): void
1+
declare function __mask__module__define__(id: string, module: import('@masknet/compartment').VirtualModuleRecord): void
52
declare function __mask__module__reflection__(
63
specifier: string,
7-
): Promise<import('../../sandboxed-plugin-runtime/node_modules/@masknet/compartment').VirtualModuleRecord>
4+
): Promise<import('@masknet/compartment').VirtualModuleRecord>

packages/sandboxed-plugin-runtime/src/runtime/runtime.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ export class PluginRuntime {
7979
throw new SyntaxError('Import from other plugin is not supported. Try to import: ' + normalizedURL)
8080
}
8181

82-
const source: VirtualModuleRecord = await __mask__module__reflection__(normalizedURL)
83-
82+
const source = await __mask__module__reflection__(normalizedURL)
8483
return { normalizedURL, source }
8584
}
8685
async #importHook(referral: string | undefined, specifier: string): Promise<Module> {

packages/scripts/src/codegen/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { typescriptWatch } from './typescript.ts'
44
import { iconCodegen, iconCodegenWatch } from './icon-codegen.ts'
55

66
// typescript is explicitly eliminated from this task.
7-
// our build process does not rely on tsc to give output, we have an extra check for tsc.
7+
// our build process does not rely on tsgo to give output, we have an extra check for tsgo.
88
export const codegen: TaskFunction = series(iconCodegen)
99
export const codegenWatch: TaskFunction = markTaskNeedCleanup(
1010
series(getProcessLock.bind(null, 'codegen'), parallel(typescriptWatch, iconCodegenWatch)),
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { watchTask, shell, cleanupWhenExit } from '../utils/index.ts'
22

33
export function typescript() {
4-
return shell`pnpm exec tsc -b`
4+
return shell`pnpm exec tsgo -b`
55
}
66
export function typescriptWatch() {
77
cleanupWhenExit()
8-
return shell`pnpm exec tsc -b -w`
8+
return shell`pnpm exec tsgo -b -w`
99
}
1010
watchTask(typescript, typescriptWatch, 'typescript', 'Build TypeScript project reference')

packages/scripts/src/commands/changeset-release.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const packages = [
1313
new URL('../../../config/', import.meta.url),
1414
]
1515
export async function changesetRelease() {
16-
const tsc = awaitChildProcess(shell.cwd(ROOT_PATH)`pnpm exec tsc -b ./tsconfig.npm.json`)
16+
const tsgo = awaitChildProcess(shell.cwd(ROOT_PATH)`pnpm exec tsgo -b ./tsconfig.npm.json`)
1717
const buildTask: Array<Promise<any>> = packages.map((path) =>
1818
readFile(new URL('./package.json', path), 'utf-8')
1919
.then(JSON.parse)
@@ -22,7 +22,7 @@ export async function changesetRelease() {
2222
return undefined
2323
}),
2424
)
25-
await Promise.all(buildTask.concat(tsc))
25+
await Promise.all(buildTask.concat(tsgo))
2626
await awaitChildProcess(shell.cwd(ROOT_PATH)`pnpm exec changeset publish`)
2727
}
2828
task(changesetRelease, 'changeset-release', 'Release script run by changeset')

0 commit comments

Comments
 (0)