Skip to content

Commit

Permalink
chore(types): define CoreEvalDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 9, 2024
1 parent 5c93775 commit 16ca97e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/deploy-script-support/src/externalTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ export {};
* @returns {Promise<ManifestBundleRef>}
*/

/**
* @typedef CoreEvalDescriptor
* @property {string} sourceSpec import specifier for a module
* @property {[manifestGetterName: string, ...manifestGetterArgs: any[]]} getManifestCall
* the name of a function exported by the module and arguments to invoke it
* with in order to get a manifest (a Record that associates functions to be
* invoked and permits defining bootstrap-space powers they will have access
* to, see {@link ../README.md} and {@link runModuleBehaviors})
*/

/**
* @callback CoreEvalBuilder
* @param {{
Expand All @@ -35,5 +45,5 @@ export {};
* wrapInstall?: <T extends InstallEntrypoint>(f: T) => T }
* } powers
* @param {...any} args
* @returns {Promise<{sourceSpec: string, getManifestCall: [exportedGetManifest: string, ...manifestArgs: any[]]}>}
* @returns {Promise<CoreEvalDescriptor>}
*/
9 changes: 9 additions & 0 deletions packages/deploy-script-support/src/writeCoreEvalParts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import {
permits as defaultPermits,
} from './coreProposalBehavior.js';

/**
* @import {CoreEvalDescriptor} from './externalTypes.js';
*/

/**
* @callback WriteCoreEval write to disk the files needed for a CoreEval (js code to`${filePrefix}.js`, permits to `${filePrefix}-permit.json`, an overall
* summary to `${filePrefix}-plan.json), plus whatever bundles bundles the code loads)
Expand Down Expand Up @@ -54,6 +58,11 @@ export const makeWriteCoreEval = (
return bundlerCache;
};

/**
*
* @param {CoreEvalDescriptor} coreEval
* @param {*} additionalPermits
*/
const mergeEvalPermit = async (coreEval, additionalPermits) => {
const {
sourceSpec,
Expand Down

0 comments on commit 16ca97e

Please sign in to comment.