@architect/inventory 3.6.0 → 3.6.2
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,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@architect/inventory",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
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:unit": "cross-env tape 'test/unit/**/*-test.js' | tap-
|
|
9
|
-
"test:integration": "cross-env tape 'test/integration/**/*-test.js' | tap-
|
|
8
|
+
"test:unit": "cross-env tape 'test/unit/**/*-test.js' | tap-arc",
|
|
9
|
+
"test:integration": "cross-env tape 'test/integration/**/*-test.js' | tap-arc",
|
|
10
10
|
"coverage": "nyc --reporter=lcov --reporter=text npm run test:unit",
|
|
11
11
|
"lint": "eslint . --fix",
|
|
12
12
|
"rc": "npm version prerelease --preid RC",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"eslint": "~8.42.0",
|
|
36
36
|
"mock-fs": "~5.2.0",
|
|
37
37
|
"nyc": "~15.1.0",
|
|
38
|
-
"tap-
|
|
38
|
+
"tap-arc": "^1.0.0",
|
|
39
39
|
"tape": "^5.6.3"
|
|
40
40
|
},
|
|
41
41
|
"eslintConfig": {
|
package/src/config/_upsert.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let { sep } = require('path')
|
|
1
|
+
let { basename, sep } = require('path')
|
|
2
2
|
let { deepFrozenCopy } = require('@architect/utils')
|
|
3
3
|
let read = require('../../../read')
|
|
4
4
|
let getLambda = require('./get-lambda')
|
|
@@ -132,7 +132,7 @@ function populate (type, pragma, inventory, errors, plugin) {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// Now we know the final source dir + runtime + handler: assemble handler props
|
|
135
|
-
let handlerProps = getHandler({ config,
|
|
135
|
+
let handlerProps = getHandler({ config, build, errors, src })
|
|
136
136
|
|
|
137
137
|
let lambda = {
|
|
138
138
|
name,
|
|
@@ -144,6 +144,14 @@ function populate (type, pragma, inventory, errors, plugin) {
|
|
|
144
144
|
configFile,
|
|
145
145
|
pragma: type !== 'customLambdas' ? type : null,
|
|
146
146
|
}
|
|
147
|
+
// Ensure the correct handler configuration is being used
|
|
148
|
+
// If the config is the same as the default, regenerate the setting based on the returned handlerFile, as Python / Ruby may have it set to `lambda.`
|
|
149
|
+
if (config.handler === defaultProjectConfig().handler) {
|
|
150
|
+
let { handlerFile } = handlerProps
|
|
151
|
+
let file = basename(handlerFile).split('.')[0]
|
|
152
|
+
config.handler = `${file}.handler`
|
|
153
|
+
}
|
|
154
|
+
|
|
147
155
|
// Final tidying of any undefined properties
|
|
148
156
|
Object.keys(lambda).forEach(k => !is.defined(lambda[k]) && delete lambda[k])
|
|
149
157
|
|