release: bump version to 0.85.0
This commit is contained in:
1 parent
30b44ec00d
commit
1c0066edc6
223 files changed
+30277
-340
No files matched your search
@@ -14,6 +14,9 @@ const earthSourceDir = join(repoRoot, 'frontend/public/earth')
|
||||
const bundleEarthDir = join(desktopRoot, '.earth-bundle/earth')
|
||||
const require = createRequire(join(desktopRoot, 'package.json'))
|
||||
|
||||
const desktopRequire = createRequire(join(desktopRoot, 'package.json'))
|
||||
const frontendRequire = createRequire(join(repoRoot, 'frontend/package.json'))
|
||||
|
||||
const VENDOR_PACKAGES = [
|
||||
{ id: 'three', outFile: 'three.mjs' },
|
||||
{ id: 'pmtiles', outFile: 'pmtiles.mjs' },
|
||||
@@ -47,6 +50,16 @@ for (const pkg of VENDOR_PACKAGES) {
|
||||
importMapOverrides[pkg.id] = `./vendor/${pkg.outFile}`
|
||||
}
|
||||
|
||||
const maplibreDistDir = join(dirname(frontendRequire.resolve('maplibre-gl/package.json')), 'dist')
|
||||
for (const fileName of ['maplibre-gl.mjs', 'maplibre-gl-worker.mjs', 'maplibre-gl.css']) {
|
||||
const src = join(maplibreDistDir, fileName)
|
||||
if (existsSync(src)) {
|
||||
cpSync(src, join(bundleEarthDir, 'vendor', fileName))
|
||||
}
|
||||
}
|
||||
importMapOverrides['maplibre-gl'] = './vendor/maplibre-gl.mjs'
|
||||
void desktopRequire
|
||||
|
||||
const { assets, html } = await compileEarthRuntime({
|
||||
earthDir: earthSourceDir,
|
||||
importMapOverrides,
|
||||
@@ -76,14 +89,39 @@ if (!workerBuild.success) {
|
||||
|
||||
// Earth boundary PMTiles artifacts are served by the backend API
|
||||
// (/api/v1/earth/boundaries/...); legacy local builds must never ship in the
|
||||
// desktop installer.
|
||||
// desktop installer. Large card original images whose 640/1280 WebP variants
|
||||
// already live in previews/ are also omitted so the installer stays slim.
|
||||
const legacyBoundaryArtifacts = join(earthSourceDir, 'data', 'boundaries')
|
||||
const cardsDir = join(earthSourceDir, 'assets', 'cards')
|
||||
const skippedCardOriginals = new Set()
|
||||
try {
|
||||
const manifestPath = join(cardsDir, 'manifest.json')
|
||||
if (existsSync(manifestPath)) {
|
||||
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'))
|
||||
for (const item of manifest.assets || []) {
|
||||
const has640 = Boolean(item?.variants?.['640'])
|
||||
const has1280 = Boolean(item?.variants?.['1280'])
|
||||
if (has640 && has1280 && item?.file) {
|
||||
const preview640 = join(earthSourceDir, item.variants['640'].replace(/^\/earth\//, ''))
|
||||
const preview1280 = join(earthSourceDir, item.variants['1280'].replace(/^\/earth\//, ''))
|
||||
if (existsSync(preview640) && existsSync(preview1280)) {
|
||||
skippedCardOriginals.add(join(cardsDir, item.file))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Fall back to copying all card assets if manifest inspection fails.
|
||||
}
|
||||
for (const folder of ['css', 'assets', 'data']) {
|
||||
const srcFolder = join(earthSourceDir, folder)
|
||||
if (existsSync(srcFolder)) {
|
||||
cpSync(srcFolder, join(bundleEarthDir, folder), {
|
||||
recursive: true,
|
||||
filter: (src) => src !== legacyBoundaryArtifacts && !src.startsWith(`${legacyBoundaryArtifacts}${sep}`),
|
||||
filter: (src) =>
|
||||
src !== legacyBoundaryArtifacts &&
|
||||
!src.startsWith(`${legacyBoundaryArtifacts}${sep}`) &&
|
||||
!skippedCardOriginals.has(src),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user