Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deploy-script-support): Write out bundle file names in machine r… #8559

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 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,18 @@ const overrideManifest = ${stringify(overrideManifest, true)};
log(`creating ${proposalJsFile}`);
await writeFile(proposalJsFile, trimmed);

const plan = {
name: filePrefix,
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];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this change do? is it compatible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not change behavior. When I added --cache-json, I also back-filled --cache-js to replace the less-specific --to. The usage states bundle-source [--cache-json | --cache-js] <etc>, so this just brings usage into alignment.

args.push(srcPath, bundle);
cacheToArgs.set(cache, args);
}
Expand Down
Loading