mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-11 04:59:07 +01:00
* nls: precompute translation cache identity during packaging Stamp the commit and NLS table fingerprint in product metadata and pass it through bootstrap. Reuse cached translations without reading or hashing default tables, while isolating different target tables and preserving legacy product compatibility. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * build: remove legacy compilation from standalone web packaging Replace the redundant local compile/mangle prerequisite with explicit API proposal generation and build-date setup. Route both standalone web modes through the shared esbuild wrapper while preserving CI packaging and existing bundle flags. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * build: use esbuild for local server and server-web packaging Route local server builds through the existing esbuild pipeline with explicit API, codicon, extension and date preparation. Avoid shipping a redundant server-web workbench bundle. Keep NLS cache protection in the independent #336109; the known same-commit localized local-target-switch limitation is accepted for this migration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * build: remove obsolete production build infrastructure Remove retired compile, mangle, bundle, and minify task chains and their exclusive helpers. Preserve current esbuild production transforms, Gulp orchestration, Monaco/development compilation, and translation routes. Share bootstrap entry definitions with packaging, drop unused mangling arguments, and prune exclusive dependencies and stale npm commands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
56 lines
1.9 KiB
TypeScript
56 lines
1.9 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import path from 'path';
|
|
import fs from 'fs';
|
|
import { execSync } from 'child_process';
|
|
|
|
const root = path.join(import.meta.dirname, '..', '..');
|
|
|
|
/**
|
|
* Get the ISO date for the build. Uses the git commit date of HEAD
|
|
* so that independent builds on different machines produce the same
|
|
* timestamp (required for deterministic builds, e.g. macOS Universal).
|
|
*/
|
|
export function getGitCommitDate(): string {
|
|
try {
|
|
return execSync('git log -1 --format=%cI HEAD', { cwd: root, encoding: 'utf8' }).trim();
|
|
} catch {
|
|
return new Date().toISOString();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Writes a `outDir/date` file with the contents of the build
|
|
* so that other tasks during the build process can use it and
|
|
* all use the same date.
|
|
*/
|
|
export function writeISODate(outDir: string) {
|
|
const result = () => new Promise<void>((resolve, _) => {
|
|
const outDirectory = path.join(root, outDir);
|
|
fs.mkdirSync(outDirectory, { recursive: true });
|
|
|
|
const date = getGitCommitDate();
|
|
fs.writeFileSync(path.join(outDirectory, 'date'), date, 'utf8');
|
|
|
|
resolve();
|
|
});
|
|
result.taskName = 'build-date-file';
|
|
return result;
|
|
}
|
|
|
|
export function readISODate(outDir: string): string {
|
|
const outDirectory = path.join(root, outDir);
|
|
try {
|
|
return fs.readFileSync(path.join(outDirectory, 'date'), 'utf8');
|
|
} catch {
|
|
// Packaging can also use the shared date recorded by the build orchestration.
|
|
if (outDir !== 'out-build') {
|
|
return fs.readFileSync(path.join(root, 'out-build', 'date'), 'utf8');
|
|
}
|
|
throw new Error(`Could not find date file in ${outDir}`);
|
|
}
|
|
}
|