@architect/inventory 4.0.4 → 4.0.5

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.
@@ -0,0 +1,11 @@
1
+ const arc = require('@architect/eslint-config')
2
+
3
+ module.exports = [
4
+ ...arc,
5
+ {
6
+ ignores: [
7
+ 'scratch',
8
+ 'test/mock/',
9
+ ],
10
+ },
11
+ ]
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@architect/inventory",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
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": ">=14"
17
+ "node": ">=16"
17
18
  },
18
19
  "repository": {
19
20
  "type": "git",
@@ -21,19 +22,19 @@
21
22
  },
22
23
  "license": "Apache-2.0",
23
24
  "dependencies": {
24
- "@architect/asap": "~7.0.8",
25
- "@architect/parser": "~6.0.3",
26
- "@architect/utils": "~4.0.4",
27
- "@aws-lite/client": "^0.20.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
30
  "lambda-runtimes": "~2.0.2"
30
31
  },
31
32
  "devDependencies": {
32
- "@architect/eslint-config": "~2.1.2",
33
+ "@architect/eslint-config": "~3.0.0",
33
34
  "cross-env": "~7.0.3",
34
35
  "dotenv": "~16.4.5",
35
- "eslint": "~8.57.0",
36
- "mock-tmp": "~0.0.3",
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",
@@ -59,7 +59,7 @@ module.exports = function configureHTTP ({ arc, inventory, errors }) {
59
59
  arcStaticAssetProxy: true,
60
60
  pragma: 'http',
61
61
  method: 'get',
62
- path: '/*'
62
+ path: '/*',
63
63
  }
64
64
  asap.config.shared = false
65
65
  asap.config.views = false
@@ -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
 
@@ -51,7 +51,6 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
51
51
  /* istanbul ignore next: idk why but for some reason nyc isn't picking up the catches; all cases are covered in tests, though! */
52
52
  if (type === 'plugin') {
53
53
  try {
54
- // eslint-disable-next-line
55
54
  plugins[name] = require(pluginPath)
56
55
  }
57
56
  catch (err) {
@@ -69,7 +68,6 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
69
68
  }
70
69
  // Remap @macros to deploy.start
71
70
  if (type === 'macro') {
72
- // eslint-disable-next-line
73
71
  plugins[name] = { deploy: { start: require(pluginPath) } }
74
72
  }
75
73
  // Walk each plugin and build the method tree
@@ -26,7 +26,7 @@ let get = {
26
26
  dayOfWeek: bits[4],
27
27
  year: bits[5],
28
28
  }
29
- }
29
+ },
30
30
  }
31
31
 
32
32
  module.exports = function populateScheduled (params) {
@@ -93,7 +93,7 @@ function getExt ({ runtime, src, errors }) {
93
93
  }
94
94
  }
95
95
 
96
- function findHandler (arr, src){
96
+ function findHandler (arr, src) {
97
97
  for (let handler of arr) {
98
98
  if (existsSync(join(src, handler))) {
99
99
  let bits = handler.split('.')
@@ -11,7 +11,7 @@ module.exports = function configureShared ({ arc, pragmas, inventory, errors })
11
11
  let src = join(projSrc, 'shared')
12
12
  let shared = {
13
13
  src: null,
14
- shared: []
14
+ shared: [],
15
15
  }
16
16
 
17
17
  let foundPluginSrc, foundArcSrc, required = false
@@ -31,7 +31,7 @@ module.exports = function configureTablesIndexes ({ arc, inventory, errors }) {
31
31
  plugins: indexesSetters,
32
32
  inventory,
33
33
  type: 'indexes',
34
- valid: { name: 'string' }
34
+ valid: { name: 'string' },
35
35
  })
36
36
  if (plugins) indexes.push(...plugins)
37
37
 
@@ -26,7 +26,7 @@ module.exports = function configureTables ({ arc, inventory, errors }) {
26
26
  plugins: tablesSetters,
27
27
  inventory,
28
28
  type: 'tables',
29
- valid: { name: 'string' }
29
+ valid: { name: 'string' },
30
30
  })
31
31
  if (plugins) tables.push(...plugins)
32
32
 
@@ -7,7 +7,7 @@ module.exports = function validateProxy (proxy, errors) {
7
7
  errors.push(`Invalid @proxy protocol: ${url}`)
8
8
  }
9
9
  }
10
- catch (e) {
10
+ catch {
11
11
  errors.push(`Invalid @proxy URL: ${url}`)
12
12
  }
13
13
  })
@@ -43,7 +43,7 @@ module.exports = function validateTablesAndIndexes (pragma, pragmaName, errors)
43
43
  deepStrictEqual(index, expect)
44
44
  return true
45
45
  }
46
- catch (err) {
46
+ catch {
47
47
  return false
48
48
  }
49
49
  })
@@ -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
  }
@@ -15,7 +15,7 @@ module.exports = function configureViews ({ arc, pragmas, inventory, errors }) {
15
15
  let src = join(projSrc, 'views')
16
16
  let views = {
17
17
  src: null,
18
- views: []
18
+ views: [],
19
19
  }
20
20
 
21
21
  let foundPluginSrc, foundArcSrc, required = false
@@ -87,6 +87,6 @@ module.exports = function getPrefs ({ scope, inventory, errors }) {
87
87
  _arc: prefs.arc,
88
88
  _raw: prefs.raw,
89
89
  },
90
- preferencesFile: prefs.filepath
90
+ preferencesFile: prefs.filepath,
91
91
  }
92
92
  }
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 */ // eslint-disable-next-line
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
  })
@@ -45,5 +45,5 @@ module.exports = {
45
45
  'jsonapi',
46
46
  'text',
47
47
  'xml',
48
- ]
48
+ ],
49
49
  }
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
 
@@ -67,7 +67,7 @@ function validateARN ({ layers, region, config }) {
67
67
  if (region !== layerRegion) {
68
68
  badRegions.push(
69
69
  ` - Layer ARN: ${arn}\n` +
70
- ` - Layer region: ${layerRegion}`
70
+ ` - Layer region: ${layerRegion}`,
71
71
  )
72
72
  }
73
73
  })
@@ -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 => {