Agoric / dapp-orchestration-basics

Agoric Orchestration Sample dApp
4 stars 4 forks source link

chore: simplify rollup config #2

Open dckc opened 5 months ago

dckc commented 5 months ago

With this tweak, yarn build:deployer gives me...

  const {
    // must be supplied by caller or template-replaced
    bundleID = "b1-cfc44b6338eceb9fd63439998109892d0f862197292f28558eb1ef3221a13ad9bc4af82f8a99fdd47b47ea4067fc91fe9b0a338d0def6345dd82d2ee9b1298ea",
  } = config?.options?.[contractName] ?? {};
dckc commented 5 months ago

rollup version?

strange... I seem to be using v2.79

$ yarn run -s rollup -v
rollup v2.79.1

but...

$ yarn why rollup
...
=> Found "rollup@4.18.0"
info Has been hoisted to "rollup"
info Reasons this module exists
   - "workspace-aggregator-2e176e86-1227-491c-b164-825ed94c212b" depends on it
   - Hoisted from "_project_#dapp-agoric-orca-contract#rollup"
   - Hoisted from "_project_#dapp-agoric-orca-ui#vite#rollup"
...
=> Found "@agoric/rpc#rollup@3.29.4"
info Reasons this module exists
   - "_project_#dapp-agoric-orca-ui#@agoric#react-components#@agoric#rpc#vite" depends on it
   - Hoisted from "_project_#dapp-agoric-orca-ui#@agoric#react-components#@agoric#rpc#vite#rollup"
Done in 0.42s.
Jovonni commented 5 months ago

eureka!

const {
    // must be supplied by caller or template-replaced
    bundleID = "b1-b889067978e04b511921fadd1a333ae3009eccb17b54faefa0ea33e3a467aebb191a7abf8d0c152be6e073b5680b7d94264ad23102a80f1858d95ce346a7ceb5"
  } = config?.options?.[contractName] ?? {};

just reverted everything

contract/tools/rollup-plugin-core-eval.js

const pattern = new RegExp(`bundleID\\b = Fail.*`);
...
const revised = code.replace(
    pattern,
    `bundleID = ${JSON.stringify(`b1-${bundle.endoZipBase64Sha512}`)}`,
);

same config as you show above