@architect/inventory 3.3.2 → 3.3.4-RC.0

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