Skip to content

Commit

Permalink
feat(deploy-script-support): Write out bundle file names in machine r…
Browse files Browse the repository at this point in the history
…eadable file
  • Loading branch information
kriskowal committed Dec 2, 2023
1 parent 5dc325b commit d2cd757
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
27 changes: 25 additions & 2 deletions packages/deploy-script-support/src/writeCoreProposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export const makeWriteCoreProposal = (
return ns.default;
};

const bundles = [];

/**
* Install an entrypoint.
*
Expand All @@ -103,9 +105,14 @@ export const makeWriteCoreProposal = (
const bundle = getBundle(entrypoint, bundlePath);

// Serialise the installations.
mutex = E.when(mutex, () => {
mutex = E.when(mutex, async () => {
// console.log('installing', { filePrefix, entrypoint, bundlePath });
return getBundleSpec(bundle, getBundler, opts);
const spec = await getBundleSpec(bundle, getBundler, opts);
bundles.push({
entrypoint,
...spec,
});
return spec;
});
// @ts-expect-error xxx mutex type narrowing
return mutex;
Expand Down Expand Up @@ -162,6 +169,22 @@ const overrideManifest = ${stringify(overrideManifest, true)};
log(`creating ${proposalJsFile}`);
await writeFile(proposalJsFile, trimmed);

const plan = {
name: filePrefix,
evals: [
{
script: proposalJsFile,
permit: proposalPermitJsonFile,
},
],
bundles,
};

await writeFile(
`${filePrefix}-plan.json`,
`${JSON.stringify(plan, null, 2)}\n`,
);

log(`\
You can now run a governance submission command like:
agd tx gov submit-proposal swingset-core-eval ${proposalPermitJsonFile} ${proposalJsFile} \\
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/src/node/createBundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const createBundlesFromAbsolute = async sourceBundles => {
}
const bundle = match[1];

const args = cacheToArgs.get(cache) || ['--to', cache];
const args = cacheToArgs.get(cache) || ['--cache-js', cache];
args.push(srcPath, bundle);
cacheToArgs.set(cache, args);
}
Expand Down

0 comments on commit d2cd757

Please sign in to comment.