dsh 0.2.0-rc.2: in-container update (experimental channel), path-agnostic compose, upstream patches adapted to 0.1.x/0.2.x

This commit is contained in:
hermes committed 2026-10-01 19:21:19 +00:00
commit e6dcef9bf5
302 files changed
+75178

No files matched your search

@@ -0,0 +1,30 @@
import { mkdir, writeFile } from 'node:fs/promises'
import { join } from 'node:path'
export async function writeDshEntrypointFixture(packageRoot) {
await mkdir(join(packageRoot, 'lib'), { recursive: true })
await writeFile(join(packageRoot, 'lib/bin.js'), `#!/usr/bin/env node
const invocation = parseDshArgs(process.argv.slice(2), readVersion());
switch (invocation.mode) {
case "profile": {
const { runProfile } = await import("./profile-boot-fixture.js");
}
}
`)
await writeFile(join(packageRoot, 'lib/profile-boot-fixture.js'), 'import { r as runProfile } from "./profile-boot-implementation.js";\nexport { runProfile };\n')
await writeFile(join(packageRoot, 'lib/profile-boot-implementation.js'), `async function runProfile(options) {
\tprocess.on("SIGTERM", () => {
\t\tinterrupt(0);
\t});
\tprocess.on("SIGINT", () => { interrupt(130); });
\tconst ctx = await boot(NAME, rootConfig, patches, (hostCtx) => {
\t\thostCtx.provide(DSH_LAUNCH_ENVIRONMENT_KEY, options.environment);
\t});
\treturn {
\t\tctx,
\t\tshutdown
\t};
}
export { runProfile as r };
`)
}