@agoric/bundle-source
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -6,2 +6,14 @@ # Change Log | ||
## [1.1.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/bundle-source@1.1.5...@agoric/bundle-source@1.1.6) (2020-06-30) | ||
### Bug Fixes | ||
* **bundle-source:** tests use install-ses ([f793424](https://github.com/Agoric/agoric-sdk/commit/f793424ea4314f5cf0fe61c6e49590b2d78e13c6)) | ||
* handle circular module references in nestedEvaluate ([9790320](https://github.com/Agoric/agoric-sdk/commit/97903204fa1bd2fd4fec339d7e27e234148ca126)) | ||
## [1.1.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/bundle-source@1.1.4...@agoric/bundle-source@1.1.5) (2020-05-17) | ||
@@ -8,0 +20,0 @@ |
{ | ||
"name": "@agoric/bundle-source", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Create source bundles from ES Modules", | ||
@@ -8,3 +8,3 @@ "main": "src/index.js", | ||
"build": "exit 0", | ||
"test": "tape -r esm 'test/**/*.js'", | ||
"test": "tap --no-coverage --jobs=1 'test/**/*.js'", | ||
"lint-fix": "eslint --fix '**/*.js'", | ||
@@ -16,3 +16,4 @@ "lint-check": "eslint '**/*.js'", | ||
"devDependencies": { | ||
"tap-spec": "^5.0.0", | ||
"@agoric/install-ses": "^0.2.0", | ||
"tap": "^14.10.5", | ||
"tape": "^4.11.0", | ||
@@ -22,7 +23,6 @@ "tape-promise": "^4.0.0" | ||
"dependencies": { | ||
"@agoric/acorn-eventual-send": "^2.0.5", | ||
"@agoric/acorn-eventual-send": "^2.0.6", | ||
"@agoric/babel-parser": "^7.6.4", | ||
"@agoric/evaluate": "^2.2.6", | ||
"@agoric/harden": "^0.0.8", | ||
"@agoric/transform-eventual-send": "^1.3.0", | ||
"@agoric/transform-eventual-send": "^1.3.1", | ||
"@babel/generator": "^7.6.4", | ||
@@ -53,3 +53,3 @@ "@rollup/plugin-commonjs": "^11.0.2", | ||
}, | ||
"gitHead": "4cbbf2146ff4b47eaffd1bdf22f3fde8f184cc38" | ||
"gitHead": "d74ea289800c2fc52c005674a55b2412385f57d9" | ||
} |
@@ -51,3 +51,3 @@ import { rollup as rollup0 } from 'rollup'; | ||
preserveModules: moduleFormat === 'nestedEvaluate', | ||
external: ['@agoric/evaluate', '@agoric/harden', ...externals], | ||
external: ['@agoric/harden', ...externals], | ||
plugins: [ | ||
@@ -82,2 +82,6 @@ resolvePlugin({ preferBuiltins: true }), | ||
) { | ||
// TODO: Should parse the generated chunk with Babel. | ||
// We rearrange the generated chunk according to its sourcemap to move | ||
// its source lines back to the right place, like Babel generator's | ||
// `retainLines: true`. | ||
unmappedCode = ''; | ||
@@ -168,5 +172,4 @@ // eslint-disable-next-line no-await-in-loop | ||
return `\ | ||
(function getExport(require) { \ | ||
(function getExport(require, exports) { \ | ||
'use strict'; \ | ||
let exports = {}; \ | ||
const module = { exports }; \ | ||
@@ -187,3 +190,3 @@ \ | ||
}; | ||
function computeExports(filename, exportPowers) { | ||
function computeExports(filename, exportPowers, exports) { | ||
const { require: systemRequire, _log } = exportPowers; | ||
@@ -231,3 +234,10 @@ // This captures the endowed require. | ||
// log('evaluating', modPath); | ||
nsBundle[modPath] = computeExports(modPath, exportPowers); | ||
// Break cycles, but be tolerant of modules | ||
// that completely override their exports object. | ||
nsBundle[modPath] = {}; | ||
nsBundle[modPath] = computeExports( | ||
modPath, | ||
exportPowers, | ||
nsBundle[modPath], | ||
); | ||
} | ||
@@ -253,3 +263,3 @@ | ||
// log('evaluating', code); | ||
return nestedEvaluate(code)(contextRequire); | ||
return nestedEvaluate(code)(contextRequire, exports); | ||
} | ||
@@ -273,4 +283,4 @@ | ||
// Evaluate the entrypoint recursively. | ||
return computeExports(entrypoint, { require }); | ||
// Evaluate the entrypoint recursively, seeding the exports. | ||
return computeExports(entrypoint, { require }, {}); | ||
} | ||
@@ -277,0 +287,0 @@ ${sourceMap}`; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27292
11
258
4
- Removed@agoric/evaluate@^2.2.6
- Removed@agoric/default-evaluate-options@0.3.6(transitive)
- Removed@agoric/evaluate@2.2.6(transitive)