mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
fix: remove keyboardMapEntryPoints from desktop entry points and nls.messages.js generation
This commit is contained in:
@@ -135,7 +135,6 @@ function getEntryPointsForTarget(target: BuildTarget): string[] {
|
|||||||
...desktopWorkerEntryPoints,
|
...desktopWorkerEntryPoints,
|
||||||
...desktopEntryPoints,
|
...desktopEntryPoints,
|
||||||
...codeEntryPoints,
|
...codeEntryPoints,
|
||||||
...keyboardMapEntryPoints,
|
|
||||||
];
|
];
|
||||||
case 'server':
|
case 'server':
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -134,13 +134,6 @@ export async function finalizeNLS(
|
|||||||
path.join(dir, 'nls.metadata.json'),
|
path.join(dir, 'nls.metadata.json'),
|
||||||
JSON.stringify(nlsMetadataJson, null, '\t')
|
JSON.stringify(nlsMetadataJson, null, '\t')
|
||||||
),
|
),
|
||||||
fs.promises.writeFile(
|
|
||||||
path.join(dir, 'nls.messages.js'),
|
|
||||||
`/*---------------------------------------------------------
|
|
||||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
||||||
*--------------------------------------------------------*/
|
|
||||||
globalThis._VSCODE_NLS_MESSAGES=${JSON.stringify(allMessages)};`
|
|
||||||
)
|
|
||||||
]));
|
]));
|
||||||
|
|
||||||
console.log(`[nls] Extracted ${allMessages.length} messages from ${moduleToKeys.size} modules`);
|
console.log(`[nls] Extracted ${allMessages.length} messages from ${moduleToKeys.size} modules`);
|
||||||
|
|||||||
@@ -79,6 +79,24 @@ Two placeholders that need injection:
|
|||||||
- Removes `webEndpointUrlTemplate` from product config (see `tweakProductForServerWeb` in old build)
|
- Removes `webEndpointUrlTemplate` from product config (see `tweakProductForServerWeb` in old build)
|
||||||
- Uses `.build/extensions` for builtin extensions (not `.build/web/extensions`)
|
- Uses `.build/extensions` for builtin extensions (not `.build/web/extensions`)
|
||||||
|
|
||||||
|
### 5. Entry Point Parity with Old Build
|
||||||
|
|
||||||
|
**Problem:** The desktop target had `keyboardMapEntryPoints` as separate esbuild entry points, producing `layout.contribution.darwin.js`, `layout.contribution.linux.js`, and `layout.contribution.win.js` as standalone files in the output.
|
||||||
|
|
||||||
|
**Root cause:** In the old build (`gulpfile.vscode.ts`), `vscodeEntryPoints` does NOT include `buildfile.keyboardMaps`. These files are only separate entry points for server-web (`gulpfile.reh.ts`) and web (`gulpfile.vscode.web.ts`). For desktop, they're imported as dependencies of `workbench.desktop.main` and get bundled into it.
|
||||||
|
|
||||||
|
**Fix:** Removed `...keyboardMapEntryPoints` from the `desktop` case in `getEntryPointsForTarget()`. Keep for `server-web` and `web`.
|
||||||
|
|
||||||
|
**Lesson:** Always verify new build entry points against the old build's per-target definitions in `buildfile.ts` and the respective gulpfiles.
|
||||||
|
|
||||||
|
### 6. NLS Output File Parity
|
||||||
|
|
||||||
|
**Problem:** `finalizeNLS()` was generating `nls.messages.js` (with `globalThis._VSCODE_NLS_MESSAGES=...`) in addition to the standard `.json` files. The old build only produces `nls.messages.json`, `nls.keys.json`, and `nls.metadata.json`.
|
||||||
|
|
||||||
|
**Fix:** Removed `nls.messages.js` generation from `finalizeNLS()` in `nls-plugin.ts`.
|
||||||
|
|
||||||
|
**Lesson:** Don't add new output file formats that create parity differences with the old build. The old build is the reference.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Testing the Fix
|
## Testing the Fix
|
||||||
|
|||||||
Reference in New Issue
Block a user