@architect/inventory 4.0.5 → 4.0.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@architect/inventory",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "description": "Architect project resource enumeration utility",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "@architect/utils": "~4.0.6",
28
28
  "@aws-lite/client": "^0.21.1",
29
29
  "@aws-lite/ssm": "^0.2.3",
30
- "lambda-runtimes": "~2.0.2"
30
+ "lambda-runtimes": "~2.0.5"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@architect/eslint-config": "~3.0.0",
@@ -40,9 +40,6 @@
40
40
  "tap-arc": "^1.2.2",
41
41
  "tape": "^5.7.5"
42
42
  },
43
- "eslintConfig": {
44
- "extends": "@architect/eslint-config"
45
- },
46
43
  "nyc": {
47
44
  "check-coverage": true,
48
45
  "branches": 100,
@@ -21,6 +21,11 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
21
21
  if (arc?.plugins?.length) tagPlugins(arc.plugins, 'plugin')
22
22
  if (arc?.macros?.length) tagPlugins(arc.macros, 'macro')
23
23
 
24
+ let { node } = process.versions
25
+ let nodeVersionParts = node.split('.')
26
+ let nodeMajorVer = Number(nodeVersionParts[0])
27
+ let nodeMinorVer = Number(nodeVersionParts[1])
28
+
24
29
  for (let pluginItem of pluginItems) {
25
30
  let { plugin, type } = pluginItem
26
31
  let name
@@ -52,6 +57,10 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
52
57
  if (type === 'plugin') {
53
58
  try {
54
59
  plugins[name] = require(pluginPath)
60
+ // starting in node 20.19, you can now require() esm
61
+ if ((nodeMajorVer >= 22 || (nodeMajorVer >= 20 && nodeMinorVer >= 19)) && plugins[name].default) {
62
+ plugins[name] = plugins[name].default
63
+ }
55
64
  }
56
65
  catch (err) {
57
66
  if (hasEsmError(err)) {
@@ -152,6 +161,7 @@ function resolve (path, cwd) {
152
161
  }
153
162
 
154
163
  let esmErrors = [
164
+ 'require() cannot be used on an ESM graph with top-level await. Use import() instead.',
155
165
  'Cannot use import statement outside a module',
156
166
  `Unexpected token 'export'`,
157
167
  'require() of ES Module',