SOURCE / PINNED RELEASE
Made of little things.
Napplet Machines V8
- Release
- b3f614e739f0…
- Author-recorded commit
- 534f19acb4ba…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-b5572362d4a
Archive hash verified: 0f7feb97e2c3d336…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
// Copy only the public context generated by soyLI to a source-safe location.
// The publisher rejects tracked files under its private .napplet-space directory.
import { readFile, writeFile } from 'node:fs/promises';
const source = new URL('../.napplet-space/soy-backend.json', import.meta.url);
const target = new URL('../src/backend-context.json', import.meta.url);
let generated;
try {
generated = JSON.parse(await readFile(source, 'utf8'));
} catch (error) {
if (error.code !== 'ENOENT') throw error;
// Ordinary source builds retain the generated public reference. soyLI creates
// a fresh context before invoking build when preparing another creator's remix.
await readFile(target, 'utf8');
process.exit(0);
}
const { version, napplet, provider, boards } = generated;
if (
version !== 1 ||
typeof napplet !== 'string' ||
!napplet.startsWith('naddr1')
)
throw new Error('Run soyli backend init to generate a valid public context.');
const publicContext = {
version,
napplet,
...(provider
? { provider: { pubkey: provider.pubkey, relays: provider.relays } }
: {}),
boards: boards ?? [],
};
const content = JSON.stringify(publicContext, null, 2) + '\n';
if ((await readFile(target, 'utf8').catch(() => '')) !== content)
await writeFile(target, content);
