@architect/hydrate
Advanced tools
+11
-3
@@ -5,2 +5,10 @@ # Architect Hydrate changelog | ||
| ## [2.2.3] 2022-01-11 | ||
| ### Fixed | ||
| - Fix potential false tree shaking errors in ESM files that make use of `require()` (e.g. via `import { createRequire } from 'module'`) | ||
| --- | ||
| ## [2.2.2] 2022-01-10 | ||
@@ -10,3 +18,3 @@ | ||
| - Fix false positive treeshaking of `import`s from http(s) | ||
| - Fix false positive tree shaking of `import`s from http(s) | ||
@@ -19,3 +27,3 @@ --- | ||
| - Fixed treeshaking detection of CJS/ESM when strings `import` and `require` are present in the AST | ||
| - Fixed tree shaking detection of CJS/ESM when strings `import` and `require` are present in the AST | ||
@@ -28,3 +36,3 @@ --- | ||
| - Added support for Node.js 14 ESM Lambda treeshaking! | ||
| - Added support for Node.js 14 ESM Lambda tree shaking! | ||
@@ -31,0 +39,0 @@ --- |
+1
-1
| { | ||
| "name": "@architect/hydrate", | ||
| "version": "2.2.2", | ||
| "version": "2.2.3", | ||
| "description": "Architect dependency hydrator and shared file manager", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,11 +18,8 @@ let { readFileSync } = require('fs') | ||
| // Can't use both module systems in the same file | ||
| if (hasRequire && hasImport) throw Error(`Found both 'import' and 'require' statements in ${file}`) | ||
| let isESM = !!(hasImport) | ||
| let called = [] | ||
| let query = isESM | ||
| ? `ImportExpression, ImportDeclaration, ExpressionStatement[expression.type='ImportExpression'], Property[key.name='import']` | ||
| : `[callee.name='require']` | ||
| let esmQuery = `ImportExpression, ImportDeclaration, ExpressionStatement[expression.type='ImportExpression'], Property[key.name='import']` | ||
| let query = `[callee.name='require']` | ||
| if (isESM) query = query += ', ' + esmQuery | ||
| let imports = esquery.query(ast, query) | ||
@@ -42,5 +39,6 @@ | ||
| if (isESM) { | ||
| if (r.expression) arg = r.expression?.source | ||
| else if (r.source) arg = r.source | ||
| else if (r.value) arg = r.value?.params?.[0] | ||
| if (r.expression) arg = r.expression?.source | ||
| else if (r.source) arg = r.source | ||
| else if (r.value) arg = r.value?.params?.[0] | ||
| else if (r.arguments) arg = r?.arguments?.[0] | ||
| } | ||
@@ -47,0 +45,0 @@ else { |
@@ -8,3 +8,3 @@ let { join } = require('path') | ||
| module.exports = function getDirDeps ({ dir, update, inventory }) { | ||
| // Clean everything (except the root) out bebefore we get going jic | ||
| // Clean everything (except the root) out before we get going jic | ||
| let isRoot = dir === inventory.inv._project.src | ||
@@ -11,0 +11,0 @@ if (!isRoot) { |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
60239
0.21%941
-0.11%