@agoric/deploy-script-support 0.10.4-dev-35e67be.0 → 0.10.4-dev-872bb3b.0
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 +12 -12
- package/src/externalTypes.js +1 -1
- package/src/getBundlerMaker.js +3 -0
- package/src/writeCoreProposal.js +39 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/deploy-script-support",
|
|
3
|
-
"version": "0.10.4-dev-
|
|
3
|
+
"version": "0.10.4-dev-872bb3b.0+872bb3b",
|
|
4
4
|
"description": "Helpers and other support for writing deploy scripts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/helpers.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"test:xs": "exit 0",
|
|
14
14
|
"lint-fix": "yarn lint:eslint --fix",
|
|
15
15
|
"lint:eslint": "eslint .",
|
|
16
|
-
"lint:types": "tsc
|
|
16
|
+
"lint:types": "tsc",
|
|
17
17
|
"lint": "run-s --continue-on-error lint:*"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@agoric/assert": "0.6.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/import-manager": "0.3.12-dev-
|
|
40
|
-
"@agoric/internal": "0.3.3-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
37
|
+
"@agoric/assert": "0.6.1-dev-872bb3b.0+872bb3b",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-872bb3b.0+872bb3b",
|
|
39
|
+
"@agoric/import-manager": "0.3.12-dev-872bb3b.0+872bb3b",
|
|
40
|
+
"@agoric/internal": "0.3.3-dev-872bb3b.0+872bb3b",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-872bb3b.0+872bb3b",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-872bb3b.0+872bb3b",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-872bb3b.0+872bb3b",
|
|
44
|
+
"@agoric/zoe": "0.26.3-dev-872bb3b.0+872bb3b",
|
|
45
45
|
"@endo/base64": "^0.2.32",
|
|
46
46
|
"@endo/bundle-source": "^2.5.2",
|
|
47
47
|
"@endo/far": "^0.2.19",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@endo/zip": "^0.2.32"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@agoric/vats": "0.15.2-dev-
|
|
54
|
+
"@agoric/vats": "0.15.2-dev-872bb3b.0+872bb3b",
|
|
55
55
|
"@endo/init": "^0.5.57",
|
|
56
56
|
"ava": "^5.3.0",
|
|
57
57
|
"import-meta-resolve": "^2.2.1"
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "872bb3be25122001190a35d0155d942315c81238"
|
|
73
73
|
}
|
package/src/externalTypes.js
CHANGED
package/src/getBundlerMaker.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
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 */
|
|
17
|
+
|
|
16
18
|
export const makeGetBundlerMaker =
|
|
17
19
|
(homeP, { lookup, bundleSource }) =>
|
|
18
20
|
async ({
|
|
@@ -20,6 +22,7 @@ export const makeGetBundlerMaker =
|
|
|
20
22
|
log = console.log,
|
|
21
23
|
} = {}) => {
|
|
22
24
|
const { board: optionalBoard, zoe, scratch } = await homeP;
|
|
25
|
+
/** @type {() => Promise<BundleMaker>} */
|
|
23
26
|
const lookupOrCreate = async () => {
|
|
24
27
|
// Locate the bundler maker if any already exists at the given path.
|
|
25
28
|
let bundlerMaker = await lookup(JSON.parse(BUNDLER_MAKER_LOOKUP));
|
package/src/writeCoreProposal.js
CHANGED
|
@@ -7,6 +7,25 @@ import { createBundles } from '@agoric/internal/src/node/createBundles.js';
|
|
|
7
7
|
import { defangAndTrim, mergePermits, stringify } from './code-gen.js';
|
|
8
8
|
import { makeCoreProposalBehavior, permits } from './coreProposalBehavior.js';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @callback WriteCoreProposal
|
|
12
|
+
* @param {string} filePrefix
|
|
13
|
+
* @param {import('./externalTypes.js').ProposalBuilder} proposalBuilder
|
|
14
|
+
* @returns {Promise<void>}
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {*} homeP
|
|
20
|
+
* @param {*} endowments
|
|
21
|
+
* @param {{
|
|
22
|
+
* getBundlerMaker: () => Promise<import('./getBundlerMaker.js').BundleMaker>,
|
|
23
|
+
* getBundleSpec: (...args: *) => Promise<import('./externalTypes.js').ManifestBundleRef>,
|
|
24
|
+
* log?: typeof console.log,
|
|
25
|
+
* writeFile?: typeof fs.promises.writeFile
|
|
26
|
+
* }} io
|
|
27
|
+
* @returns {WriteCoreProposal}
|
|
28
|
+
*/
|
|
10
29
|
export const makeWriteCoreProposal = (
|
|
11
30
|
homeP,
|
|
12
31
|
endowments,
|
|
@@ -50,8 +69,18 @@ export const makeWriteCoreProposal = (
|
|
|
50
69
|
};
|
|
51
70
|
};
|
|
52
71
|
|
|
53
|
-
let mutex =
|
|
72
|
+
let mutex =
|
|
73
|
+
/** @type {Promise<import('./externalTypes.js').ManifestBundleRef | undefined>} */ (
|
|
74
|
+
Promise.resolve()
|
|
75
|
+
);
|
|
76
|
+
/** @type {WriteCoreProposal} */
|
|
54
77
|
const writeCoreProposal = async (filePrefix, proposalBuilder) => {
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param {string} entrypoint
|
|
81
|
+
* @param {string} [bundlePath]
|
|
82
|
+
* @returns {Promise<NodeModule>}
|
|
83
|
+
*/
|
|
55
84
|
const getBundle = async (entrypoint, bundlePath) => {
|
|
56
85
|
if (!bundlePath) {
|
|
57
86
|
return bundleSource(pathResolve(entrypoint));
|
|
@@ -62,7 +91,14 @@ export const makeWriteCoreProposal = (
|
|
|
62
91
|
return ns.default;
|
|
63
92
|
};
|
|
64
93
|
|
|
65
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Install an entrypoint.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} entrypoint
|
|
98
|
+
* @param {string} [bundlePath]
|
|
99
|
+
* @param [opts]
|
|
100
|
+
* @returns {Promise<import('./externalTypes.js').ManifestBundleRef>}
|
|
101
|
+
*/
|
|
66
102
|
const install = async (entrypoint, bundlePath, opts) => {
|
|
67
103
|
const bundle = getBundle(entrypoint, bundlePath);
|
|
68
104
|
|
|
@@ -71,6 +107,7 @@ export const makeWriteCoreProposal = (
|
|
|
71
107
|
// console.log('installing', { filePrefix, entrypoint, bundlePath });
|
|
72
108
|
return getBundleSpec(bundle, getBundler, opts);
|
|
73
109
|
});
|
|
110
|
+
// @ts-expect-error xxx mutex type narrowing
|
|
74
111
|
return mutex;
|
|
75
112
|
};
|
|
76
113
|
|