@architect/inventory 4.0.4 → 4.0.6
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/eslint.config.js +11 -0
- package/package.json +11 -13
- package/src/config/pragmas/http.js +1 -1
- package/src/config/pragmas/index.js +0 -1
- package/src/config/pragmas/plugins.js +7 -2
- package/src/config/pragmas/populate-lambda/_scheduled.js +1 -1
- package/src/config/pragmas/populate-lambda/get-handler.js +1 -1
- package/src/config/pragmas/shared.js +1 -1
- package/src/config/pragmas/tables-indexes.js +1 -1
- package/src/config/pragmas/tables.js +1 -1
- package/src/config/pragmas/validate/_proxy.js +1 -1
- package/src/config/pragmas/validate/_tables.js +1 -1
- package/src/config/pragmas/validate/index.js +1 -2
- package/src/config/pragmas/views.js +1 -1
- package/src/config/project/prefs/index.js +1 -1
- package/src/env/index.js +2 -3
- package/src/index.js +2 -2
- package/src/lib/pragmas.js +1 -1
- package/src/read/index.js +1 -1
- package/src/validate/layers.js +1 -1
- package/src/validate/paths.js +1 -1
package/eslint.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@architect/inventory",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"description": "Architect project resource enumeration utility",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "npm run lint && npm run test:integration && npm run coverage",
|
|
8
|
+
"test:nolint": "npm run test:integration && npm run coverage",
|
|
8
9
|
"test:unit": "cross-env tape 'test/unit/**/*-test.js' | tap-arc",
|
|
9
10
|
"test:integration": "cross-env tape 'test/integration/**/*-test.js' | tap-arc",
|
|
10
11
|
"coverage": "nyc --reporter=lcov --reporter=text npm run test:unit",
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
"vendor": "scripts/vendor"
|
|
14
15
|
},
|
|
15
16
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
17
|
+
"node": ">=16"
|
|
17
18
|
},
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
@@ -21,27 +22,24 @@
|
|
|
21
22
|
},
|
|
22
23
|
"license": "Apache-2.0",
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@architect/asap": "~7.0.
|
|
25
|
-
"@architect/parser": "~
|
|
26
|
-
"@architect/utils": "~4.0.
|
|
27
|
-
"@aws-lite/client": "^0.
|
|
25
|
+
"@architect/asap": "~7.0.10",
|
|
26
|
+
"@architect/parser": "~7.0.1",
|
|
27
|
+
"@architect/utils": "~4.0.6",
|
|
28
|
+
"@aws-lite/client": "^0.21.1",
|
|
28
29
|
"@aws-lite/ssm": "^0.2.3",
|
|
29
|
-
"lambda-runtimes": "~2.0.
|
|
30
|
+
"lambda-runtimes": "~2.0.5"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@architect/eslint-config": "~
|
|
33
|
+
"@architect/eslint-config": "~3.0.0",
|
|
33
34
|
"cross-env": "~7.0.3",
|
|
34
35
|
"dotenv": "~16.4.5",
|
|
35
|
-
"eslint": "~
|
|
36
|
-
"mock-tmp": "~0.0.
|
|
36
|
+
"eslint": "~9.1.1",
|
|
37
|
+
"mock-tmp": "~0.0.4",
|
|
37
38
|
"nyc": "~15.1.0",
|
|
38
39
|
"proxyquire": "~2.1.3",
|
|
39
40
|
"tap-arc": "^1.2.2",
|
|
40
41
|
"tape": "^5.7.5"
|
|
41
42
|
},
|
|
42
|
-
"eslintConfig": {
|
|
43
|
-
"extends": "@architect/eslint-config"
|
|
44
|
-
},
|
|
45
43
|
"nyc": {
|
|
46
44
|
"check-coverage": true,
|
|
47
45
|
"branches": 100,
|
|
@@ -4,7 +4,6 @@ let { all: allPragmas } = pragmas
|
|
|
4
4
|
// Get all pragmas except special cases
|
|
5
5
|
let isSpecial = p => [ 'plugins', 'shared', 'views' ].includes(p)
|
|
6
6
|
let visitors = allPragmas.map(p => {
|
|
7
|
-
// eslint-disable-next-line
|
|
8
7
|
if (!isSpecial(p)) return require(`./${p}`)
|
|
9
8
|
}).filter(Boolean)
|
|
10
9
|
|
|
@@ -21,6 +21,9 @@ 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 nodeVer = Number(node.split('.')[0])
|
|
26
|
+
|
|
24
27
|
for (let pluginItem of pluginItems) {
|
|
25
28
|
let { plugin, type } = pluginItem
|
|
26
29
|
let name
|
|
@@ -51,8 +54,10 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
|
|
|
51
54
|
/* istanbul ignore next: idk why but for some reason nyc isn't picking up the catches; all cases are covered in tests, though! */
|
|
52
55
|
if (type === 'plugin') {
|
|
53
56
|
try {
|
|
54
|
-
// eslint-disable-next-line
|
|
55
57
|
plugins[name] = require(pluginPath)
|
|
58
|
+
if (nodeVer >= 22 && plugins[name].default) {
|
|
59
|
+
plugins[name] = plugins[name].default
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
catch (err) {
|
|
58
63
|
if (hasEsmError(err)) {
|
|
@@ -69,7 +74,6 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
|
|
|
69
74
|
}
|
|
70
75
|
// Remap @macros to deploy.start
|
|
71
76
|
if (type === 'macro') {
|
|
72
|
-
// eslint-disable-next-line
|
|
73
77
|
plugins[name] = { deploy: { start: require(pluginPath) } }
|
|
74
78
|
}
|
|
75
79
|
// Walk each plugin and build the method tree
|
|
@@ -154,6 +158,7 @@ function resolve (path, cwd) {
|
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
let esmErrors = [
|
|
161
|
+
'require() cannot be used on an ESM graph with top-level await. Use import() instead.',
|
|
157
162
|
'Cannot use import statement outside a module',
|
|
158
163
|
`Unexpected token 'export'`,
|
|
159
164
|
'require() of ES Module',
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable global-require */
|
|
2
1
|
module.exports = {
|
|
3
2
|
// Pragmas and project validation
|
|
4
3
|
aws: require('./_aws'),
|
|
@@ -15,5 +14,5 @@ module.exports = {
|
|
|
15
14
|
websockets: require('./_websockets'),
|
|
16
15
|
|
|
17
16
|
// Misc
|
|
18
|
-
validate: require('./_lib')
|
|
17
|
+
validate: require('./_lib'),
|
|
19
18
|
}
|
package/src/env/index.js
CHANGED
|
@@ -12,9 +12,8 @@ module.exports = function env (params, inventory, callback) {
|
|
|
12
12
|
let name = inventory.app
|
|
13
13
|
let { profile, region } = inventory.aws
|
|
14
14
|
let result = []
|
|
15
|
-
// eslint-disable-next-line
|
|
16
15
|
let awsLite = require('@aws-lite/client')
|
|
17
|
-
/* istanbul ignore next */
|
|
16
|
+
/* istanbul ignore next */
|
|
18
17
|
awsLite({ profile, region, plugins: [ import('@aws-lite/ssm') ] }).then(_aws => {
|
|
19
18
|
aws = _aws
|
|
20
19
|
|
|
@@ -24,7 +23,7 @@ module.exports = function env (params, inventory, callback) {
|
|
|
24
23
|
Recursive: true,
|
|
25
24
|
MaxResults: 10,
|
|
26
25
|
WithDecryption: true,
|
|
27
|
-
paginate: true
|
|
26
|
+
paginate: true,
|
|
28
27
|
}
|
|
29
28
|
aws.ssm.GetParametersByPath(params).then(data => {
|
|
30
29
|
// Tidy up the response
|
package/src/index.js
CHANGED
|
@@ -84,7 +84,7 @@ module.exports = function architectInventory (params = {}, callback) {
|
|
|
84
84
|
// Userland: fill out the pragmas, starting with @plugins
|
|
85
85
|
inventory = {
|
|
86
86
|
...inventory,
|
|
87
|
-
...config.pragmas(project)
|
|
87
|
+
...config.pragmas(project),
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// End here if first-pass validation failed
|
|
@@ -107,7 +107,7 @@ module.exports = function architectInventory (params = {}, callback) {
|
|
|
107
107
|
else {
|
|
108
108
|
callback(null, {
|
|
109
109
|
inv: inventory,
|
|
110
|
-
get: get(inventory)
|
|
110
|
+
get: get(inventory),
|
|
111
111
|
})
|
|
112
112
|
}
|
|
113
113
|
})
|
package/src/lib/pragmas.js
CHANGED
package/src/read/index.js
CHANGED
|
@@ -18,7 +18,7 @@ let functionConfig = {
|
|
|
18
18
|
|
|
19
19
|
// Local preferences
|
|
20
20
|
let preferences = {
|
|
21
|
-
arc: [ 'preferences.arc', 'prefs.arc', '.preferences.arc', '.prefs.arc'
|
|
21
|
+
arc: [ 'preferences.arc', 'prefs.arc', '.preferences.arc', '.prefs.arc' ],
|
|
22
22
|
// TODO add json, yaml later if folks want it?
|
|
23
23
|
}
|
|
24
24
|
|
package/src/validate/layers.js
CHANGED
package/src/validate/paths.js
CHANGED
|
@@ -8,7 +8,7 @@ module.exports = function checkFilePaths (inventory, errors) {
|
|
|
8
8
|
if (proj.build && !ascii.test(proj.build)) return err('Build')
|
|
9
9
|
|
|
10
10
|
let { lambdasBySrcDir } = inventory
|
|
11
|
-
if (lambdasBySrcDir){
|
|
11
|
+
if (lambdasBySrcDir) {
|
|
12
12
|
Object.values(lambdasBySrcDir).forEach(lambdae => {
|
|
13
13
|
if (!Array.isArray(lambdae)) lambdae = [ lambdae ] // Normalize possible multi-tenant Lambdas
|
|
14
14
|
lambdae.forEach(lambda => {
|