@agoric/bundle-source
Advanced tools
Comparing version 1.1.10 to 1.2.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.2.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/bundle-source@1.1.10...@agoric/bundle-source@1.2.0) (2020-12-10) | ||
### Features | ||
* **import-bundle:** Preliminary support Endo zip hex bundle format ([#1983](https://github.com/Agoric/agoric-sdk/issues/1983)) ([983681b](https://github.com/Agoric/agoric-sdk/commit/983681bfc4bf512b6bd90806ed9220cd4fefc13c)) | ||
## [1.1.10](https://github.com/Agoric/agoric-sdk/compare/@agoric/bundle-source@1.1.10-dev.0...@agoric/bundle-source@1.1.10) (2020-11-07) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@agoric/bundle-source", | ||
"version": "1.1.10", | ||
"version": "1.2.0", | ||
"description": "Create source bundles from ES Modules", | ||
"parsers": { | ||
"js": "mjs" | ||
}, | ||
"main": "src/index.js", | ||
@@ -16,3 +19,3 @@ "scripts": { | ||
"devDependencies": { | ||
"@agoric/install-ses": "^0.4.0", | ||
"@agoric/install-ses": "^0.5.0", | ||
"ava": "^3.12.1", | ||
@@ -22,5 +25,7 @@ "nyc": "^15.1.0" | ||
"dependencies": { | ||
"@agoric/acorn-eventual-send": "^2.0.10", | ||
"@agoric/acorn-eventual-send": "^2.1.0", | ||
"@agoric/babel-parser": "^7.6.4", | ||
"@agoric/transform-eventual-send": "^1.3.5", | ||
"@agoric/base64": "^0.1.0", | ||
"@agoric/compartment-mapper": "^0.2.3", | ||
"@agoric/transform-eventual-send": "^1.4.0", | ||
"@babel/generator": "^7.6.4", | ||
@@ -60,3 +65,12 @@ "@babel/traverse": "^7.8.3", | ||
}, | ||
"gitHead": "20bc9a904a3f3768943ed51323ce14a4f609a233" | ||
"eslintConfig": { | ||
"extends": [ | ||
"@agoric" | ||
] | ||
}, | ||
"prettier": { | ||
"trailingComma": "all", | ||
"singleQuote": true | ||
}, | ||
"gitHead": "f9fab94b70ed22d7fcccb261af11ed8dd6348614" | ||
} |
@@ -0,1 +1,2 @@ | ||
import fs from 'fs'; | ||
import { rollup as rollup0 } from 'rollup'; | ||
@@ -9,2 +10,4 @@ import path from 'path'; | ||
import { makeTransform } from '@agoric/transform-eventual-send'; | ||
import { makeArchive } from '@agoric/compartment-mapper'; | ||
import { encodeBase64 } from '@agoric/base64'; | ||
@@ -15,3 +18,3 @@ import { SourceMapConsumer } from 'source-map'; | ||
const DEFAULT_FILE_PREFIX = '/bundled-source'; | ||
const SUPPORTED_FORMATS = ['getExport', 'nestedEvaluate']; | ||
const SUPPORTED_FORMATS = ['getExport', 'nestedEvaluate', 'endoZipBase64']; | ||
@@ -22,2 +25,4 @@ const IMPORT_RE = new RegExp('\\b(import)(\\s*(?:\\(|/[/*]))', 'sg'); | ||
const read = async location => fs.promises.readFile(new URL(location).pathname); | ||
export function tildotPlugin() { | ||
@@ -43,2 +48,14 @@ const transformer = makeTransform(babelParser, babelGenerate); | ||
} | ||
if (moduleFormat === 'endoZipBase64') { | ||
// TODO endoZipBase64 format does not yet support the tildot transform, as | ||
// Compartment Mapper does not yet reveal a pre-archive transform facility. | ||
// Such a facility might be better served by a transform specified in | ||
// individual package.jsons and driven by the compartment mapper. | ||
const base = new URL(`file://${process.cwd()}`).toString(); | ||
const entry = new URL(startFilename, base).toString(); | ||
const bytes = await makeArchive(read, entry); | ||
const endoZipBase64 = encodeBase64(bytes); | ||
return { endoZipBase64, moduleFormat }; | ||
} | ||
const { | ||
@@ -45,0 +62,0 @@ commonjsPlugin = commonjs0, |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
32362
307
13
1
+ Added@agoric/base64@^0.1.0
+ Added@agoric/babel-standalone@7.17.7(transitive)
+ Added@agoric/base64@0.1.4(transitive)
+ Added@agoric/compartment-mapper@0.2.4(transitive)
+ Added@agoric/make-hardener@0.1.3(transitive)
+ Added@agoric/transform-module@0.4.1(transitive)
+ Addedses@0.12.7(transitive)