@agoric/deploy-script-support 0.10.4-other-dev-fbe72e7.0.fbe72e7 → 0.10.4-other-dev-d15096d.0.d15096d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/deploy-script-support",
3
- "version": "0.10.4-other-dev-fbe72e7.0.fbe72e7",
3
+ "version": "0.10.4-other-dev-d15096d.0.d15096d",
4
4
  "description": "Helpers and other support for writing deploy scripts",
5
5
  "type": "module",
6
6
  "main": "src/helpers.js",
@@ -34,14 +34,14 @@
34
34
  },
35
35
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
36
36
  "dependencies": {
37
- "@agoric/ertp": "0.16.3-other-dev-fbe72e7.0.fbe72e7",
38
- "@agoric/import-manager": "0.3.12-other-dev-fbe72e7.0.fbe72e7",
39
- "@agoric/internal": "0.3.3-other-dev-fbe72e7.0.fbe72e7",
40
- "@agoric/notifier": "0.6.3-other-dev-fbe72e7.0.fbe72e7",
41
- "@agoric/pola-io": "0.1.1-other-dev-fbe72e7.0.fbe72e7",
42
- "@agoric/store": "0.9.3-other-dev-fbe72e7.0.fbe72e7",
43
- "@agoric/time": "0.3.3-other-dev-fbe72e7.0.fbe72e7",
44
- "@agoric/zoe": "0.26.3-other-dev-fbe72e7.0.fbe72e7",
37
+ "@agoric/ertp": "0.16.3-other-dev-d15096d.0.d15096d",
38
+ "@agoric/import-manager": "0.3.12-other-dev-d15096d.0.d15096d",
39
+ "@agoric/internal": "0.3.3-other-dev-d15096d.0.d15096d",
40
+ "@agoric/notifier": "0.6.3-other-dev-d15096d.0.d15096d",
41
+ "@agoric/pola-io": "0.1.1-other-dev-d15096d.0.d15096d",
42
+ "@agoric/store": "0.9.3-other-dev-d15096d.0.d15096d",
43
+ "@agoric/time": "0.3.3-other-dev-d15096d.0.d15096d",
44
+ "@agoric/zoe": "0.26.3-other-dev-d15096d.0.d15096d",
45
45
  "@endo/base64": "^1.0.12",
46
46
  "@endo/bundle-source": "^4.1.2",
47
47
  "@endo/errors": "^1.2.13",
@@ -52,7 +52,7 @@
52
52
  "@endo/zip": "^1.0.11"
53
53
  },
54
54
  "devDependencies": {
55
- "@agoric/vats": "0.15.2-other-dev-fbe72e7.0.fbe72e7",
55
+ "@agoric/vats": "0.15.2-other-dev-d15096d.0.d15096d",
56
56
  "@endo/init": "^1.1.12",
57
57
  "ava": "^5.3.0",
58
58
  "import-meta-resolve": "^4.1.0"
@@ -73,7 +73,7 @@
73
73
  "access": "public"
74
74
  },
75
75
  "typeCoverage": {
76
- "atLeast": 83.26
76
+ "atLeast": 83.14
77
77
  },
78
- "gitHead": "fbe72e72107f9997f788674e668c660d92ec4492"
78
+ "gitHead": "d15096dc4ff8b96e9b6cd11954c20d3a9efbb393"
79
79
  }
@@ -1,13 +1,19 @@
1
1
  import { Fail } from '@endo/errors';
2
2
 
3
+ /**
4
+ * @import {promises} from 'fs';
5
+ * @import {resolve} from 'path';
6
+ * @import {BundleSourceResult} from '@endo/bundle-source';
7
+ */
8
+
3
9
  /**
4
10
  * @param {string} cacheDir
5
- * @param {{ now: typeof Date.now, fs: import('fs').promises, pathResolve: typeof import('path').resolve }} param1
11
+ * @param {{ now: typeof Date.now, fs: promises, pathResolve: typeof resolve }} param1
6
12
  */
7
13
  export const makeCacheAndGetBundleSpec =
8
14
  (cacheDir, { now, fs, pathResolve }) =>
9
15
  /**
10
- * @param {Promise<import('@endo/bundle-source').BundleSourceResult<'endoZipBase64'>>} bundleP
16
+ * @param {Promise<BundleSourceResult<'endoZipBase64'>>} bundleP
11
17
  */
12
18
  async bundleP => {
13
19
  const bundle = await bundleP;
@@ -3,6 +3,8 @@ const t = 'makeCoreProposalBehavior';
3
3
 
4
4
  /**
5
5
  * @import {Installation} from '@agoric/zoe/src/zoeService/utils.js';
6
+ * @import {E} from '@endo/far';
7
+ * @import {ManifestBundleRef} from './externalTypes.js';
6
8
  */
7
9
 
8
10
  /**
@@ -13,7 +15,6 @@ const t = 'makeCoreProposalBehavior';
13
15
  */
14
16
 
15
17
  /**
16
- * @import {ManifestBundleRef} from './externalTypes.js'
17
18
  * @typedef {[methodName: string, ...args: unknown[]]} FlatMethargs
18
19
  * @typedef {Record<string, Record<string, unknown>>} Manifest
19
20
  */
@@ -44,9 +45,9 @@ export const permits = {
44
45
  * @param {ManifestBundleRef} inputs.manifestBundleRef
45
46
  * @param {FlatMethargs} inputs.getManifestCall
46
47
  * @param {Manifest} [inputs.customManifest]
47
- * @param {typeof import('@endo/far').E} inputs.E
48
+ * @param {typeof E} inputs.E
48
49
  * @param {(...args: unknown[]) => void} [inputs.log]
49
- * @param {(ref: import('./externalTypes.js').ManifestBundleRef) => Promise<import('@agoric/zoe/src/zoeService/utils.js').Installation<unknown>>} [inputs.customRestoreRef]
50
+ * @param {(ref: ManifestBundleRef) => Promise<Installation<unknown>>} [inputs.customRestoreRef]
50
51
  * @returns {(vatPowers: unknown) => Promise<unknown>}
51
52
  */
52
53
  export const makeCoreProposalBehavior = ({
@@ -83,7 +84,7 @@ export const makeCoreProposalBehavior = ({
83
84
  };
84
85
 
85
86
  const makeRestoreRef = (vatAdminSvc, zoe) => {
86
- /** @type {(ref: import('./externalTypes.js').ManifestBundleRef) => Promise<Installation<unknown>>} */
87
+ /** @type {(ref: ManifestBundleRef) => Promise<Installation<unknown>>} */
87
88
  const defaultRestoreRef = async bundleRef => {
88
89
  // extract-proposal.js creates these records, and bundleName is
89
90
  // the optional name under which the bundle was installed into
@@ -193,7 +194,7 @@ export const makeCoreProposalBehavior = ({
193
194
  /**
194
195
  * @param {object} inputs
195
196
  * @param {Array<{ ref: ManifestBundleRef, call: FlatMethargs, customManifest?: Manifest }>} inputs.metadataRecords
196
- * @param {typeof import('@endo/far').E} inputs.E
197
+ * @param {typeof E} inputs.E
197
198
  */
198
199
  export const makeEnactCoreProposalsFromBundleRef = ({ metadataRecords, E }) => {
199
200
  /**
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @agoric/group-jsdoc-imports */
1
2
  // @ts-check
2
3
  export {};
3
4
 
@@ -70,7 +71,7 @@ export {};
70
71
  * }} CommonHome
71
72
  */
72
73
 
73
- // TODO wallet as import('@agoric/wallet-backend/src/types').WalletAdmin once it's a module
74
+ // TODO wallet as import('@agoric/wallet-backend/src/types.js').WalletAdmin once it's a module
74
75
  /**
75
76
  * @typedef {CommonHome & {
76
77
  * agoricNames: ERef<NameHub>,
@@ -11,6 +11,11 @@ import {
11
11
  makeEnactCoreProposalsFromBundleRef,
12
12
  } from './coreProposalBehavior.js';
13
13
 
14
+ /**
15
+ * @import {CoreEvalBuilder} from './externalTypes.js';
16
+ * @import {PublishBundleRef} from './externalTypes.js';
17
+ */
18
+
14
19
  /**
15
20
  * @typedef {string | {module: string, entrypoint?: string, args?: Array<unknown>}} ConfigProposal
16
21
  */
@@ -155,7 +160,7 @@ export const extractCoreProposalBundles = async (
155
160
  const thisProposalSequence = getSequenceForProposal(key);
156
161
  const initPath = findModule(dirname, module);
157
162
  const initDir = path.dirname(initPath);
158
- /** @type {Record<string, import('./externalTypes.js').CoreEvalBuilder>} */
163
+ /** @type {Record<string, CoreEvalBuilder>} */
159
164
  const ns = await import(initPath);
160
165
  const install = (srcSpec, bundlePath) => {
161
166
  const absoluteSrc = findModule(initDir, srcSpec);
@@ -181,7 +186,7 @@ export const extractCoreProposalBundles = async (
181
186
  );
182
187
  return bundleHandle;
183
188
  };
184
- /** @type {import('./externalTypes.js').PublishBundleRef} */
189
+ /** @type {PublishBundleRef} */
185
190
  const publishRef = async handleP => {
186
191
  const handle = await handleP;
187
192
  bundleHandleToAbsolutePaths.has(handle) ||
@@ -13,7 +13,7 @@
13
13
  import { E } from '@endo/far';
14
14
  import url from 'url';
15
15
 
16
- /** @typedef {ReturnType<import('./endo-pieces-contract.js')['start']>['publicFacet']} BundleMaker */
16
+ /** @typedef {ReturnType<typeof import('./endo-pieces-contract.js').start>['publicFacet']} BundleMaker */
17
17
  /** @typedef {ReturnType<BundleMaker['makeBundler']>} Bundler */
18
18
 
19
19
  export const makeGetBundlerMaker =
package/src/helpers.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @ts-check
2
2
 
3
- /// <reference path="../../zoe/exported.js" />
3
+ /// <reference types="@agoric/zoe/exported.js" />
4
4
 
5
5
  import { E } from '@endo/far';
6
6
  import bundleSource from '@endo/bundle-source';
@@ -19,6 +19,13 @@ import { assertOfferResult } from './assertOfferResult.js';
19
19
  import { installInPieces } from './installInPieces.js';
20
20
  import { makeWriteCoreEval } from './writeCoreEvalParts.js';
21
21
 
22
+ /**
23
+ * @import {CommonHome} from './externalTypes.js';
24
+ * @import {AgSoloHome} from './externalTypes.js';
25
+ * @import {DeployScriptEndownments} from './externalTypes.js';
26
+ * @import {WriteCoreEval} from './writeCoreEvalParts.js';
27
+ */
28
+
22
29
  export * from '@agoric/internal/src/node/createBundles.js';
23
30
  export { parseScriptArgs } from './parseCoreEvalArgs.js';
24
31
 
@@ -54,8 +61,8 @@ const makeLazyObject = sourceObject => {
54
61
  };
55
62
 
56
63
  /**
57
- * @param {Promise<import('./externalTypes.js').CommonHome | import('./externalTypes.js').AgSoloHome>} homePromise
58
- * @param {import('./externalTypes.js').DeployScriptEndownments} endowments
64
+ * @param {Promise<CommonHome | AgSoloHome>} homePromise
65
+ * @param {DeployScriptEndownments} endowments
59
66
  */
60
67
  export const makeHelpers = async (homePromise, endowments) => {
61
68
  // Endowments provided via `agoric run` or `agoric deploy`.
@@ -146,7 +153,7 @@ export const makeHelpers = async (homePromise, endowments) => {
146
153
  get getBundlerMaker() {
147
154
  return makeGetBundlerMaker(homePromise, { bundleSource, lookup });
148
155
  },
149
- /** @returns {import('./writeCoreEvalParts.js').WriteCoreEval} */
156
+ /** @returns {WriteCoreEval} */
150
157
  get writeCoreEval() {
151
158
  return makeWriteCoreEval(homePromise, endowments, {
152
159
  getBundleSpec: deps.cacheAndGetBundleSpec,
package/src/install.js CHANGED
@@ -3,13 +3,16 @@ import './externalTypes.js';
3
3
 
4
4
  import { E } from '@endo/far';
5
5
 
6
- /** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */
6
+ /**
7
+ * @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js'
8
+ * @import {InstallationManager} from './startInstance.js';
9
+ */
7
10
 
8
11
  // XXX board is Board but specifying that leads to type errors with imports which aren't worth fixing right now
9
12
  /**
10
13
  * @param {typeof import('@endo/bundle-source')['default']} bundleSource
11
14
  * @param {ERef<ZoeService>} zoe
12
- * @param {ERef<import('./startInstance.js').InstallationManager>} installationManager
15
+ * @param {ERef<InstallationManager>} installationManager
13
16
  * @param {ERef<any>} board
14
17
  * @param {(bundle: any) => any} [publishBundle]
15
18
  * @param {(path: string) => string} [pathResolve]
@@ -2,7 +2,7 @@
2
2
  * To customize proposals for multiple environments, we pass the "variant"
3
3
  * identifier in scriptArgs. The variant must match a knownVariant.
4
4
  *
5
- * @param {import('./externalTypes.js').DeployScriptEndownments} endowments
5
+ * @param {DeployScriptEndownments} endowments
6
6
  * @param {string} name a name to use in error messages or Usage suggestions.
7
7
  * @param {string[]} knownVariants
8
8
  */
@@ -12,6 +12,10 @@ export const parseScriptArgs = async (endowments, name, knownVariants) => {
12
12
  const variantOrConfig =
13
13
  scriptArgs && scriptArgs.length > 0 ? scriptArgs : undefined;
14
14
 
15
+ /**
16
+ * @import {DeployScriptEndownments} from './externalTypes.js';
17
+ */
18
+
15
19
  console.log(`${name}`, variantOrConfig);
16
20
 
17
21
  const Usage = `agoric run ${name}.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
package/src/saveIssuer.js CHANGED
@@ -4,12 +4,13 @@ import { E } from '@endo/far';
4
4
  /**
5
5
  * @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js';
6
6
  * @import {Amount, Brand, Issuer, Payment} from '@agoric/ertp';
7
+ * @import {IssuerManager} from './startInstance.js';
7
8
  */
8
9
 
9
10
  /**
10
11
  * @param {ERef<any>} walletAdmin - an internal type of the
11
12
  * wallet, not defined here
12
- * @param {ERef<import('./startInstance.js').IssuerManager>} issuerManager
13
+ * @param {ERef<IssuerManager>} issuerManager
13
14
  */
14
15
  export const makeSaveIssuer = (walletAdmin, issuerManager) => {
15
16
  /**
@@ -13,6 +13,8 @@ import {
13
13
  /**
14
14
  * @import {BundleSource, BundleSourceResult} from '@endo/bundle-source';
15
15
  * @import {AgSoloHome, CanonicalHome, CommonHome, CoreEvalBuilder, CoreEvalDescriptor, ManifestBundleRef} from './externalTypes.js';
16
+ * @import {BundleMaker} from './getBundlerMaker.js';
17
+ * @import {Bundler} from './getBundlerMaker.js';
16
18
  */
17
19
 
18
20
  /**
@@ -40,8 +42,8 @@ import {
40
42
  * pathResolve: (path: string) => string,
41
43
  * }} endowments
42
44
  * @param {{
43
- * getBundlerMaker: () => Promise<import('./getBundlerMaker.js').BundleMaker>,
44
- * getBundleSpec: (bundle: Promise<BundleSourceResult<'endoZipBase64'>>, getBundle: () => import('./getBundlerMaker.js').Bundler, opts?: any) => Promise<ManifestBundleRef>,
45
+ * getBundlerMaker: () => Promise<BundleMaker>,
46
+ * getBundleSpec: (bundle: Promise<BundleSourceResult<'endoZipBase64'>>, getBundle: () => Bundler, opts?: any) => Promise<ManifestBundleRef>,
45
47
  * log?: typeof console.log,
46
48
  * writeFile?: typeof fs.promises.writeFile
47
49
  * }} io
@@ -60,7 +62,7 @@ export const makeWriteCoreEval = (
60
62
  const { bundleSource, pathResolve } = endowments;
61
63
 
62
64
  let bundlerCache;
63
- /** @returns {import('./getBundlerMaker.js').Bundler} */
65
+ /** @returns {Bundler} */
64
66
  const getBundler = () => {
65
67
  if (!bundlerCache) {
66
68
  bundlerCache = E(getBundlerMaker()).makeBundler({