Files
orca/config/packaged-native-build-entries.cjs
Neil 9bd6272fdf refactor(tooling): organize build, CI, and test owners (#38130)
* refactor(tooling): organize test runtime and maintenance owners

* test(tooling): preserve relocated runtime fixture dependency edges

* refactor(tooling): preserve xterm routing owner checks

* ci(tooling): include routing owner in sparse checkout

* test(tooling): preserve copied workflow dependency closures

* fix(tooling): normalize hashed JSON assets in release parity

* fix(tooling): distinguish asset aliases from literal references

* fix(tooling): frame normalized asset reference payloads

* fix(tooling): normalize decoded JSON asset references

* refactor(tooling): organize build, CI and release owners

* fix(tooling): align moved generator and workflow path contracts

* fix(tooling): update generated plugin bundle owner banners

* test(tooling): create relocated mobile verifier fixture directories

* test(tooling): copy headless detector dependency closure

* test(tooling): align native batch policy fixtures with owner path

* fix(tooling): link moved reliability command to historical evidence

* fix(tooling): preserve nested sandbox owners and canonical guide source

* fix(tooling): target release version owners in checkout fixture
2026-11-04 21:08:19 -08:00

34 lines
1.3 KiB
JavaScript

const { existsSync, readdirSync, renameSync, rmSync } = require('node:fs')
const { join } = require('node:path')
const {
NATIVE_BUILD_PACKAGES,
isNativeBuildEntryName,
nativeBuildEntryName
} = require('./scripts/native-build/node-addons/native-build-entry.cjs')
// Normalize shared-store dev build/<entry> to packaged build/Release, matching CI and daemon/mac terminal/job-ownership consumers (scripts/native-build-entry.cjs).
function adoptPackagedNativeBuildEntries(resourcesDir, electronPlatformName, architecture) {
for (const moduleName of Object.keys(NATIVE_BUILD_PACKAGES)) {
const buildDir = join(resourcesDir, 'node_modules', ...moduleName.split('/'), 'build')
if (!existsSync(buildDir)) {
continue
}
const entryDir = join(
buildDir,
nativeBuildEntryName(moduleName, { platform: electronPlatformName, arch: architecture })
)
if (existsSync(entryDir)) {
rmSync(join(buildDir, 'Release'), { recursive: true, force: true })
renameSync(entryDir, join(buildDir, 'Release'))
}
// Other arches, plus any staging or quarantine leftovers, are dead weight in this slice.
for (const name of readdirSync(buildDir)) {
if (isNativeBuildEntryName(name)) {
rmSync(join(buildDir, name), { recursive: true, force: true })
}
}
}
}
module.exports = { adoptPackagedNativeBuildEntries }