fixes
Release rolling / release (push) Successful in 7m16s

This commit is contained in:
Raven Scott
2026-07-31 12:08:11 -04:00
parent 6105b8d4ac
commit 33937db11c
6 changed files with 55 additions and 14 deletions
+7 -7
View File
@@ -1,5 +1,8 @@
/** /**
* bare-os-booter entry for Bare standalone binaries (and `bare bin/…` dev). * bare-os-booter entry for Bare standalone binaries (and `bare bin/…` dev).
*
* OTA metadata comes from bin/meta/booter.mjs (JS — packable). Do not require
* package.json here; bare-pack does not embed JSON via createRequire.
*/ */
const isBare = typeof globalThis.Bare !== 'undefined' const isBare = typeof globalThis.Bare !== 'undefined'
@@ -13,10 +16,7 @@ function pathBasename(p) {
return i >= 0 ? s.slice(i + 1) : s return i >= 0 ? s.slice(i + 1) : s
} }
const { createRequire } = await import('module') const meta = await import('./meta/booter.mjs')
const require = createRequire(import.meta.url)
const pkg = require('../packages/bare-os-booter/package.json')
const { startPearOta, parseOtaFlags } = await import('../lib/bare-os-ota.mjs') const { startPearOta, parseOtaFlags } = await import('../lib/bare-os-ota.mjs')
const argv = isBare const argv = isBare
@@ -26,9 +26,9 @@ const argv = isBare
const { updates, storage } = parseOtaFlags(argv) const { updates, storage } = parseOtaFlags(argv)
const ota = await startPearOta({ const ota = await startPearOta({
upgrade: pkg.upgrade, upgrade: meta.upgrade,
version: pkg.version, version: meta.version,
name: 'bare-os-booter', name: meta.name || 'bare-os-booter',
updates, updates,
storage, storage,
}) })
+7 -7
View File
@@ -1,5 +1,8 @@
/** /**
* bare-os-seeder entry for Bare standalone binaries (and `bare bin/…` dev). * bare-os-seeder entry for Bare standalone binaries (and `bare bin/…` dev).
*
* OTA metadata comes from bin/meta/seeder.mjs (JS — packable). Do not require
* package.json here; bare-pack does not embed JSON via createRequire.
*/ */
const isBare = typeof globalThis.Bare !== 'undefined' const isBare = typeof globalThis.Bare !== 'undefined'
@@ -13,10 +16,7 @@ function pathBasename(p) {
return i >= 0 ? s.slice(i + 1) : s return i >= 0 ? s.slice(i + 1) : s
} }
const { createRequire } = await import('module') const meta = await import('./meta/seeder.mjs')
const require = createRequire(import.meta.url)
const pkg = require('../packages/bare-os-seeder/package.json')
const { startPearOta, parseOtaFlags } = await import('../lib/bare-os-ota.mjs') const { startPearOta, parseOtaFlags } = await import('../lib/bare-os-ota.mjs')
const argv = isBare const argv = isBare
@@ -26,9 +26,9 @@ const argv = isBare
const { updates, storage } = parseOtaFlags(argv) const { updates, storage } = parseOtaFlags(argv)
const ota = await startPearOta({ const ota = await startPearOta({
upgrade: pkg.upgrade, upgrade: meta.upgrade,
version: pkg.version, version: meta.version,
name: 'bare-os-seeder', name: meta.name || 'bare-os-seeder',
updates, updates,
storage, storage,
}) })
+4
View File
@@ -0,0 +1,4 @@
/** Auto-generated by scripts/sync-bin-meta.mjs — do not edit. */
export const name = "bare-os-booter"
export const version = "0.1.0"
export const upgrade = "pear://khtauzttriz8dpgrphj79rfy98iwoatqm59fnogtsdqk5f1kg6ao"
+4
View File
@@ -0,0 +1,4 @@
/** Auto-generated by scripts/sync-bin-meta.mjs — do not edit. */
export const name = "bare-os-seeder"
export const version = "0.1.0"
export const upgrade = "pear://1ycyj65xxgn6c5cirhtnm8aokkrpe9dzibriszyfkmfggc3opjzy"
+1
View File
@@ -72,6 +72,7 @@ function preparePkg(pkgDir, { withKernel = false, withSsh2 = false } = {}) {
} }
const which = process.argv[2] || 'both' const which = process.argv[2] || 'both'
run(process.execPath, [path.join(root, 'scripts', 'sync-bin-meta.mjs')])
if (which === 'seeder' || which === 'both') { if (which === 'seeder' || which === 'both') {
preparePkg(SEEDER, { withKernel: true }) preparePkg(SEEDER, { withKernel: true })
} }
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env node
/**
* Write bin/meta/{seeder,booter}.mjs from package.json (bare-pack cannot require .json).
*/
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
const outDir = path.join(root, 'bin', 'meta')
const PRODUCTS = [
{ id: 'seeder', pkgRel: 'packages/bare-os-seeder/package.json' },
{ id: 'booter', pkgRel: 'packages/bare-os-booter/package.json' },
]
fs.mkdirSync(outDir, { recursive: true })
for (const { id, pkgRel } of PRODUCTS) {
const pkg = JSON.parse(fs.readFileSync(path.join(root, pkgRel), 'utf8'))
const name = pkg.name || `bare-os-${id}`
const version = pkg.version || '0.0.0'
const upgrade = pkg.upgrade || ''
const body = `/** Auto-generated by scripts/sync-bin-meta.mjs — do not edit. */
export const name = ${JSON.stringify(name)}
export const version = ${JSON.stringify(version)}
export const upgrade = ${JSON.stringify(upgrade)}
`
const out = path.join(outDir, `${id}.mjs`)
fs.writeFileSync(out, body)
console.log('[sync-bin-meta]', path.relative(root, out), name, version)
}