serverless-llrt-analyzer 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/index.js +21 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -49,6 +49,27 @@ class LlrtServerlessPlugin {
49
49
  'before:deploy:function:packageFunction': () => this.apply(),
50
50
  'before:package:function:package': () => this.apply(),
51
51
  }
52
+ // Register `llrt: true` + `custom.llrt` so Serverless config validation
53
+ // recognizes them (otherwise it warns "unrecognized property 'llrt'").
54
+ try {
55
+ const csh = serverless && serverless.configSchemaHandler
56
+ if (csh && typeof csh.defineFunctionProperties === 'function') {
57
+ csh.defineFunctionProperties('aws', { properties: { llrt: { type: 'boolean' } } })
58
+ }
59
+ if (csh && typeof csh.defineCustomProperties === 'function') {
60
+ csh.defineCustomProperties({
61
+ properties: {
62
+ llrt: {
63
+ type: 'object',
64
+ properties: { layerArn: { type: 'string' }, verify: { type: 'boolean' }, autoEsbuild: { type: 'boolean' } },
65
+ additionalProperties: false,
66
+ },
67
+ },
68
+ })
69
+ }
70
+ } catch (_) {
71
+ /* schema registration is best-effort — never block a deploy over it */
72
+ }
52
73
  }
53
74
 
54
75
  /** Resolve the core analyzer's analyzeFunction (injected in tests). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serverless-llrt-analyzer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Serverless Framework plugin to flip Lambda functions to AWS LLRT (llrt: true) for ~10x faster cold starts, with a deploy-time compatibility guard powered by llrt-analyzer.",
5
5
  "main": "index.js",
6
6
  "files": [