Skip to content

Commit

Permalink
refactor: naming
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 9, 2024
1 parent 16ca97e commit 593361d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/deploy-script-support/src/writeCoreEvalParts.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import {
/**
*
* @param {*} homeP
* @param {*} endowments
* @param {{
* bundleSource: (path: string) => Promise<NodeModule>,
* pathResolve: (path: string) => string,
* }} endowments
* @param {{
* getBundlerMaker: () => Promise<import('./getBundlerMaker.js').BundleMaker>,
* getBundleSpec: (...args: *) => Promise<import('./externalTypes.js').ManifestBundleRef>,
Expand Down Expand Up @@ -69,10 +72,10 @@ export const makeWriteCoreEval = (
getManifestCall: [manifestGetterName, ...manifestGetterArgs],
} = coreEval;

const moduleRecord = await import(pathResolve(sourceSpec));
const moduleNamespace = await import(pathResolve(sourceSpec));

// We only care about the manifest, not any restoreRef calls.
const { manifest } = await moduleRecord[manifestGetterName](
const { manifest } = await moduleNamespace[manifestGetterName](
harden({ restoreRef: x => `restoreRef:${x}` }),
...manifestGetterArgs,
);
Expand Down Expand Up @@ -146,15 +149,15 @@ export const makeWriteCoreEval = (
};

// Create the eval structure.
const evalParts = await deeplyFulfilled(
const evalDescriptor = await deeplyFulfilled(
harden(builder({ publishRef, install })),
);
const { sourceSpec, getManifestCall } = evalParts;
const { sourceSpec, getManifestCall } = evalDescriptor;
// console.log('created', { filePrefix, sourceSpec, getManifestCall });

// Extract the top-level permit.
const { permits: evalPermits, manifest: customManifest } =
await mergeEvalPermit(evalParts, defaultPermits);
await mergeEvalPermit(evalDescriptor, defaultPermits);

// Get an install
const manifestBundleRef = await publishRef(install(sourceSpec));
Expand Down

0 comments on commit 593361d

Please sign in to comment.