@locker/rollup-plugin
Advanced tools
Comparing version 0.12.2 to 0.12.3
36
index.js
@@ -10,21 +10,35 @@ 'use strict'; | ||
const DEFAULT_OPTIONS = { | ||
endowmentsName: '$lockerEvalContext$', | ||
modulesOnly: false, | ||
namespaceName: 'untrusted', | ||
sandboxSourceName: '@locker/sandbox', | ||
sandboxSpecifierName: 'evaluateInSandbox', | ||
remapDynamicImport: false, | ||
sandboxEvalContext: '$lockerEvalContext$', | ||
sandboxKey: 'untrusted', | ||
sandboxPackage: '@locker/sandbox', | ||
sandboxSpecifier: 'evaluateInSandbox', | ||
sourcemap: null, | ||
}; | ||
module.exports = function lockerRollupPlugin(options = {}) { | ||
const mergedOptions = mergeOptions(DEFAULT_OPTIONS, options); | ||
module.exports = function lockerRollupPlugin(providedOptions = {}) { | ||
const clonedOptions = Object.assign({}, providedOptions); | ||
const mergedOptions = mergeOptions.call( | ||
{ ignoreUndefined: true }, | ||
DEFAULT_OPTIONS, | ||
clonedOptions, | ||
// Support legacy option names for a bit longer. | ||
{ | ||
sandboxEvalContext: clonedOptions.endowmentsName, | ||
sandboxKey: clonedOptions.namespaceName, | ||
sandboxPackage: clonedOptions.sandboxSourceName, | ||
sandboxSpecifier: clonedOptions.sandboxSpecifierName, | ||
} | ||
); | ||
const filter = pluginUtils.createFilter(mergedOptions.include, mergedOptions.exclude); | ||
const compilerOptions = Compiler.createOptions({ | ||
filename: '<placeholder>', | ||
namespaceName: mergedOptions.namespaceName, | ||
remap: { | ||
dynamicImport: mergedOptions.remapDynamicImport, | ||
}, | ||
sandboxSourceName: mergedOptions.sandboxSourceName, | ||
sandboxSpecifierName: mergedOptions.sandboxSpecifierName, | ||
sandboxEvalContext: mergedOptions.sandboxEvalContext, | ||
sandboxKey: mergedOptions.sandboxKey, | ||
sandboxPackage: mergedOptions.sandboxPackage, | ||
sandboxSpecifier: mergedOptions.sandboxSpecifier, | ||
sourcemap: mergedOptions.sourcemap, | ||
@@ -64,4 +78,6 @@ }); | ||
if (typeof mergedOptions.reportCallback === 'function') { | ||
const { sandboxKey } = compilerOptions; | ||
mergedOptions.reportCallback({ | ||
namespace: compilerOptions.namespaceName, | ||
namespace: sandboxKey, | ||
sandboxKey, | ||
srcpath: id, | ||
@@ -68,0 +84,0 @@ }); |
{ | ||
"name": "@locker/rollup-plugin", | ||
"version": "0.12.2", | ||
"version": "0.12.3", | ||
"license": "Salesforce Developer Agreement", | ||
@@ -12,4 +12,4 @@ "author": "Salesforce UI Security Team", | ||
"dependencies": { | ||
"@locker/compiler": "0.12.2", | ||
"@locker/is-module": "0.12.2", | ||
"@locker/compiler": "0.12.3", | ||
"@locker/is-module": "0.12.3", | ||
"@rollup/pluginutils": "4.0.0", | ||
@@ -26,3 +26,3 @@ "merge-options": "3.0.3" | ||
}, | ||
"gitHead": "738fe1b33d349d389394370359044c1d5ee968c4" | ||
"gitHead": "04a89b8ef9516c8ebc5f38a1bb2d93b04deba348" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7103
88
0
+ Added@locker/ast-lib-maker@0.12.3(transitive)
+ Added@locker/compiler@0.12.3(transitive)
+ Added@locker/is-module@0.12.3(transitive)
+ Added@locker/shared@0.12.3(transitive)
- Removed@locker/ast-lib-maker@0.12.2(transitive)
- Removed@locker/compiler@0.12.2(transitive)
- Removed@locker/is-module@0.12.2(transitive)
- Removed@locker/shared@0.12.2(transitive)
Updated@locker/compiler@0.12.3
Updated@locker/is-module@0.12.3