@architect/inventory 3.3.3 → 3.3.4

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": "3.3.3",
3
+ "version": "3.3.4",
4
4
  "description": "Architect project resource enumeration utility",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@architect/asap": "~5.0.2",
24
+ "@architect/asap": "~5.1.0",
25
25
  "@architect/parser": "~6.0.2",
26
26
  "@architect/utils": "~3.1.2",
27
- "lambda-runtimes": "~1.1.2"
27
+ "lambda-runtimes": "~1.1.3"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@architect/eslint-config": "~2.0.1",
@@ -32,7 +32,7 @@
32
32
  "aws-sdk-mock": "~5.8.0",
33
33
  "cross-env": "~7.0.3",
34
34
  "dotenv": "~16.0.3",
35
- "eslint": "~8.27.0",
35
+ "eslint": "~8.28.0",
36
36
  "mock-fs": "~5.2.0",
37
37
  "mock-require": "~3.0.3",
38
38
  "nyc": "~15.1.0",
@@ -55,7 +55,7 @@ module.exports = function setRuntimePlugins (params, project) {
55
55
  if (is.string(runtime.build)) build = runtime.build
56
56
  }
57
57
  if (type === 'transpiled' && !allRuntimes.includes(baseRuntime)) {
58
- return errors.push(`Runtime '${name}' must include a valid baseRuntime property corresponding to a valid Lambda runtime (e.g. 'nodejs14.x')`)
58
+ return errors.push(`Runtime '${name}' must include a valid baseRuntime property corresponding to a valid Lambda runtime (e.g. 'nodejs16.x')`)
59
59
  }
60
60
  runtimes.runtimes.push(name)
61
61
  runtimes[name] = runtime
@@ -5,7 +5,7 @@ module.exports = function createDefaultFunctionConfig () {
5
5
  return {
6
6
  timeout: 5,
7
7
  memory: 1152,
8
- runtime: 'nodejs14.x',
8
+ runtime: 'nodejs16.x',
9
9
  architecture: 'x86_64', // TODO [BREAKING]: default to 'arm64'
10
10
  handler: 'index.handler',
11
11
  state: 'n/a',
package/changelog.md DELETED
@@ -1,479 +0,0 @@
1
- # Architect Inventory changelog
2
-
3
- ---
4
-
5
- ## [3.3.3] 2022-11-15
6
-
7
- ### Fixed
8
-
9
- - Fixed issue where projects with plugins that define >1 transpiled Lambdas would all build to the same directory; thanks @Scorsi!
10
- - Fixed issue where plugins may not be found if attempted to be loaded from a subfolder in a monorepo; thanks @Scorsi!
11
-
12
- ---
13
-
14
- ## [3.3.2] 2022-10-19
15
-
16
- ### Fixed
17
-
18
- - Fixed issue where `@static spa true` setting wouldn't be respected when the root handler is not explicitly defined; thanks @oliverturner!
19
-
20
- ---
21
-
22
- ## [3.3.1] 2022-10-15
23
-
24
- ### Fixed
25
-
26
- - Fixed issue where `set.http` plugins would not have `config.views` respected if set to `false`
27
-
28
- ---
29
-
30
- ## [3.3.0] 2022-09-06
31
-
32
- ### Changed
33
-
34
- - Node 14+ Lambda handler selection now defaults to ESM (unless otherwise specified)
35
-
36
- ---
37
-
38
- ## [3.2.2] 2022-08-20
39
-
40
- ### Changed
41
-
42
- - Enabled `hydrate` plugin API support
43
-
44
- ---
45
-
46
- ## [3.2.1] 2022-08-10
47
-
48
- ### Changed
49
-
50
- - By default, when a `set.shared|views` plugin sets a `src` path, if it is not present on the filesystem, Inventory falls back to default paths (e.g. `src/shared|views`)
51
- - `set.shared|views` plugins now accept a `required` flag to enforce a validation error should a `src` path conflict with the project manifest (or not be found on the filesystem)
52
-
53
-
54
- ### Fixed
55
-
56
- - Fixed an obscure internal reference passing bug in `set.proxy|shared|static|views` plugins
57
-
58
- ---
59
-
60
- ## [3.2.0] 2022-07-24
61
-
62
- ### Added
63
-
64
- - Added support for new setter plugin APIs, specifically: `@proxy`, `@shared`, `@static`, `@tables`, `@tables-indexes`, `@views`
65
- - Added new `@static` setting: `compression`
66
-
67
-
68
- ### Changed
69
-
70
- - Lambdas defined in the userland Architect project manifest now override conflicting Lambdas returned by plugins (instead of throwing validation errors); fixes #1352
71
- - Plugin developers can now use a `required` flag to enforce a validation error should their plugin conflict with userland Lambdas
72
- - `@tables` and `@tables-indexes` can now accept lower case key types (e.g. `*string` instead of `*String`)
73
- - `@tables` and `@tables-indexes` can also accept `*` and `**` as a shortcut for string-type primary and sort keys
74
- - Changed plugin function property tags from `plugin|type` to `_plugin|_type` to indicate internal property namespacing
75
- - Added `@static` pragma validation
76
- - Fixed obscure case where `@static` `ignore` setting might only use the first list item
77
-
78
-
79
- ### Fixed
80
-
81
- - Fixed issue where Lambdas created by plugins that returned arrays did not have their `plugin` and `type` properties set
82
- - Fixed issue where an absolute path in `@shared|views` `src` would incorrectly resolve
83
- - Fixed issue where `@views` might incorrectly return a validation error when only HTTP setter plugins are used to define `@http` routes
84
-
85
- ---
86
-
87
- ## [3.1.1] 2022-05-09
88
-
89
- ### Changed
90
-
91
- - Updated dependencies; `lambda-runtimes` enables `nodejs16.x`
92
-
93
- ---
94
-
95
- ## [3.1.0] 2022-03-24
96
-
97
- ### Added
98
-
99
- - Added support for configuring Lambda's ephemeral storage feature
100
-
101
- ---
102
-
103
- ## [3.0.0] 2022-01-04
104
-
105
- ### Added
106
-
107
- - Architect 10 plugin API support! Specifically:
108
- - `plugins.set.runtimes` - custom runtime support (still in beta)
109
- - `plugins.set.env` - add environment variables to all Lambdas
110
- - `plugins.set.events|http|scheduled|tables-streams|ws` - generate or drop in Lambdas in Architect pragmas
111
- - `plugins.set.customLambdas` - generate or drop in unique Lambdas with custom event sources
112
- - More below...
113
- - Added `inv|get.plugins` tree + methods
114
- - What used to be `plugins` in the plugins beta is now `customLambdas` (see next item)
115
- - Added `inv|get.customLambdas`
116
- - Formerly `inv|get.plugins`
117
- - Added `inv._project.customRuntimes`
118
- - Added low-level support for `build` destinations to runtime plugins that register type `transpiled` or `compiled`
119
- - Added `handlerModuleSystem` property for `nodejs14.x` Lambdas, with a value of `cjs` or `esm` based on Lambda + Node.js conventions
120
- - Added `handlerFile` detection for `nodejs14.x` + `deno` Lambdas
121
- - This will detect the correct handler file on the filesystem, and fall back to a default handler file if none are found (e.g. `index.js` in `nodejs14.x`)
122
- - Added `inv._arc.deployStage` property, enabling Inventory to be aware of an intended deploy stage; (this property may change, consider it in beta!)
123
- - Added built-in support for reading `.env` files when enumerating local env var preferences
124
-
125
-
126
- ### Changed
127
-
128
- - Breaking change: changed `_project.src`, added `_project.cwd`, making both the pair significantly more literal and descriptive
129
- - `_project.src` is now the default source tree folder (eg `$cwd/src`)
130
- - `_project.cwd` refers to the current working directory of the project
131
- - Breaking change: `_project.env` is now by default an object populated by three properties: `local`, `plugins`, and `aws`, reflecting the env vars found for each environment
132
- - Breaking change: AWS region prioritizes a region passed via param over `AWS_REGION` env var; this should realistically have little or no effect in practice
133
- - Breaking change: legacy `@tables-streams` folders (`src/tables/...` and `src/streams/...`) are now deprecated
134
- - Existing functions can be simply moved to `src/tables-streams/{name}` (or use a custom `src` property)
135
- - Breaking change: renamed `lambda.handlerFunction` to `lambda.handlerMethod`
136
- - Breaking change: prioritize `mod.ts|js` handlers in Deno Lambdas
137
- - Breaking change: removed `toml` support
138
- - Breaking change: removed `get.macros` method; as `@macros` are now automatically mapped to the Architect plugins, you can simply use `get.plugins` instead
139
- - Performance improvements to building `inv.shared` + `inv.views`
140
- - Improved memory footprint of Inventory object by preserving references in `lambdaSrcDirs`, `lambdasBySrcDir`
141
- - Added `pragma` property to all Lambdas to aid in reference preservation
142
- - Tidy up order of enumerated properties in each Lambda
143
- Update CI
144
- - Stop publishing to the GitHub Package registry
145
-
146
-
147
- ### Fixed
148
-
149
- - Added file path validation because `aws-sdk` blows up on !ascii paths; fixes #1292, thanks @GustMartins!
150
- - Fixed env var validation from preference files
151
- - Fixed error bubbling when reading a preferences file with issues
152
-
153
- ---
154
-
155
- ## [2.2.1] 2021-11-22
156
-
157
- ### Fixed
158
-
159
- - Fixed HTTP route sorting; however you've organized your `@http` pragma, Sandbox should now behave much more like API Gateway; fixes #977
160
- - Fixed overly strict path parameter validation; allow `_`, `.`, `-`; thanks @jkarsrud!
161
-
162
- ---
163
-
164
- ## [2.2.0] 2021-11-16
165
-
166
- ### Added
167
-
168
- - Finally formalized `@tables-streams`, the fully customizable successor to `@tables` with `stream true`
169
- - Added `@tables-indexes` pragma
170
- - `@tables-indexes` has identical semantics as (and will eventually supersede) `@indexes`
171
- - Until Arc 10.0 + Inventory 3.0, consumers should now check both `inv.indexes` AND `inv.tables-indexes`
172
-
173
- ---
174
-
175
- ## [2.1.3] 2021-11-04
176
-
177
- ### Fixed
178
-
179
- - Hardened runtime validation by ensuring non-string values will fail gracefully
180
-
181
- ---
182
-
183
- ## [2.1.2] 2021-10-28
184
-
185
- ### Added
186
-
187
- - Added memory / timeout configuration validation
188
-
189
-
190
- ### Changed
191
-
192
- - Improved layer validation error formatting
193
-
194
- ---
195
-
196
- ## [2.1.1] 2021-10-13
197
-
198
- ### Added
199
-
200
- - Added `config.runtimeAlias` property to Lambdas whose `config.runtime` is interpolated by way of latest-runtime aliasing (e.g. `node` or `py`)
201
-
202
-
203
- ### Changed
204
-
205
- - Internal change: implement [Lambda runtimes module](https://www.npmjs.com/package/lambda-runtimes) instead of maintaining valid runtime list in Inventory
206
-
207
-
208
- ### Fixed
209
-
210
- - Fixed `@scheduled` parsing in `app.json` + `package.json` > `arc.scheduled`
211
-
212
- ---
213
-
214
- ## [2.1.0] 2021-10-11
215
-
216
- ### Added
217
-
218
- - Added latest-runtime version aliasing
219
- - Example: you want your app to always run the latest Lambda version of Python (instead of specifying `python3.9`(and changing it every time a new version of Python is released); now you can specify `python` or `py`
220
- - Valid shortcuts: Node.js: `node`, `nodejs`, `node.js`; Python: `python`, `py`; Ruby: `ruby`, `rb`; Java: `java`; Go: `go`, `golang`; .NET: `dotnet`, `.net`; and custom runtimes: `custom`
221
- - Added runtime validation
222
-
223
-
224
- ### Changed
225
-
226
- - Updated dependencies
227
-
228
- ---
229
-
230
- ## [2.0.7] 2021-09-30
231
-
232
- ### Added
233
-
234
- - Added support for AWS's new Lambda `arm64` architecture via `@aws architecture` setting; default remains `x86_64`
235
-
236
-
237
- ### Changed
238
-
239
- - Internal: removed unused `@tables` flag
240
-
241
- ---
242
-
243
- ## [2.0.6] 2021-09-14
244
-
245
- ### Changed
246
-
247
- - Internal: Updated Architect Parser to v5
248
-
249
- ---
250
-
251
- ## [2.0.5] 2021-09-03
252
-
253
- ### Changed
254
-
255
- - When a valid root handler is configured by the user, `inv._project.rootHandler` is no longer `configured`, and is instead the specific root handler's `name` property
256
- - Example: `@http get /` would result in `inventory._project.rootHandler` being `get /`
257
-
258
-
259
- ### Fixed
260
-
261
- - Fix `@aws` `policies` + `layers` where multiple policies or layers listed in one line would ignore all but the first
262
-
263
- ---
264
-
265
- ## [2.0.0 - 2.0.4] 2021-07-22
266
-
267
- ### Changed
268
-
269
- - Default runtime is now `nodejs14.x`, fixes #1164
270
- - Breaking change: removed support for Node.js 10.x (now EOL, and no longer available to created in AWS Lambda) and Node.js 12.x
271
- - Breaking change: removed support for Architect 5 WebSocket folder paths (prepended by `ws-`)
272
- - Updated ASAP to v4
273
- - Updated dependencies
274
-
275
- ---
276
-
277
- ## [1.4.2 - 1.4.4] 2021-06-20
278
-
279
- ### Added
280
-
281
- - Include registry of all Architect pragmas + Lambda pragmas in `inventory.inv._arc.pragmas` metadata
282
-
283
-
284
- ### Changed
285
-
286
- - Update deps
287
-
288
-
289
- ### Fixed
290
-
291
- - Fixed error reporting for missing function dirs
292
-
293
- ---
294
-
295
- ## [1.4.1] 2021-06-20
296
-
297
- ### Fixed
298
-
299
- - De-dupe `@shared` + `@views` items
300
- - Fixed `@shared` + `@views` errors
301
-
302
- ---
303
-
304
- ## [1.4.0] 2021-06-03
305
-
306
- ### Added
307
-
308
- - Adds comprehensive pragma-level validation
309
- - Added structured `ARC_ERRORS` property to returned Inventory errors
310
-
311
-
312
- ### Changed
313
-
314
- - Refactors error handling to support aggregation of multiple validation errors (instead of just one at a time, as before)
315
- - 💯% unit test coverage
316
- - Add support for @tables `pitr` option, start phasing out `PointInTimeRecovery` option (which is still supported for a while); fixes #1155
317
- - Removes `aws-sdk` from `peerDependencies` to resolve large Lambda dependency payloads when Arc is run on machines using npm 7
318
- - See also: readme > `aws-sdk` caveat
319
-
320
-
321
- ### Fixed
322
-
323
- - Fixed a bunch of smol bugs
324
-
325
- ---
326
-
327
- ## [1.3.3] 2021-05-24
328
-
329
- ### Added
330
-
331
- - Plugins may implement either `pluginFunctions` or `functions` interface
332
- methods; both will be used.
333
-
334
- ---
335
-
336
- ## [1.3.2] 2021-04-21
337
-
338
- ### Fixed
339
-
340
- - Fix weird behavior in `lambdasBySrcDir` when >2 functions are mapped to the same folder
341
-
342
- ---
343
-
344
- ## [1.3.1] 2021-03-22
345
-
346
- ### Changed
347
-
348
- - Bumped utils dependency to 2.0.5.
349
-
350
- ---
351
- ## [1.3.0] 2021-02-08
352
-
353
- ### Added
354
-
355
- - Added beta support for `plugins` pragma (see https://arc.codes/docs/en/guides/extend/architect-plugins)
356
- - `inventory.inv.plugins` houses all Lambdas created by plugins
357
- - `inventory._project.plugins` maps plugin names to plugin modules
358
- - Wired up plugin modules into `lambdasBySrcDir` and `lambdaSrcDirs`
359
- - First steps towards allowing plugin authors to add their own Lambdas to arc projects
360
-
361
- ---
362
-
363
- ## [1.2.3] 2021-01-22
364
-
365
- ### Added
366
-
367
- - Added `name` param for `@indexes` pragma to allow explict naming of GSIs; thanks @anatomic!
368
-
369
- ---
370
-
371
- ## [1.2.2] 2021-01-04
372
-
373
- ### Added
374
-
375
- - Added `@sandbox-startup` to preferences to replace the sometimes-wonky `@sandbox startup` setting, fixes #1032
376
- - Added ability for `@static` buckets – otherwise enabled by default – to be disabled with `@static false`
377
-
378
- ---
379
-
380
- ## [1.2.1] 2020-12-05
381
-
382
- ### Added
383
-
384
- - Adds `lambdasBySrcDir` param for looking up a Lambda by its source dir dir
385
- - Useful for when the only thing known about a Lambda is its source directory (see: hydration, direct deploys, etc.)
386
- - Adds `inv._project.asapSrc` shortcut for getting the configured ASAP dist path
387
-
388
- ---
389
-
390
- ## [1.2.0] 2020-12-02
391
-
392
- ### Added
393
-
394
- - Added new `@shared` pragma
395
- - Customizable shared + views folders
396
- - Added global preferences lookup (`~/.preferences.arc` + `~/.prefs.arc`, etc.) and global / local preference merging
397
-
398
-
399
- ### Changed
400
-
401
- - Breaking change: `inv.views` shape has now changed
402
- - Breaking change: `inv._project.preferencesFile` has been deprecated in favor of `inv._project.globalPreferencesFile` + `inv._project.localPreferencesFile`
403
- - Deprecates legacy `localPaths` array (which has since been moved over to `lambdaSrcDirs`)
404
-
405
- ---
406
-
407
- ## [1.1.1] 2020-11-25
408
-
409
- ### Added
410
-
411
- - Moved `@architect/asap` from Package into Inventory
412
- - Added test case
413
-
414
-
415
- ### Fixed
416
-
417
- - Fixed side effect of ASAP mutating default function configurations project-wide
418
-
419
- ---
420
-
421
- ## [1.1.0] 2020-11-23
422
-
423
- ### Added
424
-
425
- - Added `@proxy` support
426
- - Added `@views` support
427
- - Added `@cdn` support
428
- - Added `@http` `any`, `head`, and `options` method support
429
- - Added `@http` `*` (catchall) syntax support
430
- - Added async/await interface
431
- - Added `config.arc` (formerly `.arc-config`) support for `@arc` settings
432
- - Added `inventory._project.rootHandler` property for determining whether a user explicitly configured a root handler
433
- - Added local preferences via `preferences.arc` or `prefs.arc`
434
- - Added additional params to tables (`ttl`, `encrypt`, `PointInTimeRecovery`, `legacy`)
435
- - Added ability to pass raw Architect manifest string (`rawArc`) for stateless Inventory runs
436
- - Added ability to define JSON-formatted Architect manifest in `package.json` (via `arc` or `architect` param)
437
-
438
-
439
- ### Changed
440
-
441
- - Moved `inventory.arc` metadata to `inventory._arc` (should we need to use an Architect-specific `@arc` pragma)
442
- - Moved `inventory.project` metadata to `inventory._project` to better denote that it is indeed project metadata
443
- - Renamed primary inventory output to `inv`
444
- - Updated AWS SDK
445
- - Getter returns arrays for certain pragmas that may have duplicative names (e.g. `@indexes`)
446
-
447
-
448
- ### Fixed
449
-
450
- - Fixed issue with overwriting a Lambda's base config if Arc config is present
451
- - Fixed missing `handlerFile` extension for deno functions
452
- - Fixed legacy `@ws` folder pathing issue
453
- - Fixed ASAP behavior to only be defined when `@http` is present, not `@static`
454
- - Disabled shared files in ASAP
455
- - Fixed issue where ASAP was overtaking `@proxy`
456
- - Fixed manual override of queue fifo config
457
- - Added graceful failure when attempting to read an empty manifest or config file
458
-
459
- ---
460
-
461
- ## [1.0.1 - 1.0.3] 2020-09-08
462
-
463
- ### Fixed
464
-
465
- - Fixed issue where projects without `get /` would return an error during Lambda source dir population
466
- - Fixed inventory rules around @http + @static inferring each other
467
- - Fixed getter when accessing pragmas with null values
468
-
469
- ---
470
-
471
- ## [1.0.0] 2020-08-26
472
-
473
- ### Added
474
-
475
- Here we go!
476
-
477
- ---
478
-
479
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).