@lafken/common 0.12.13 → 0.12.15

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.
@@ -255,6 +255,16 @@ export interface LambdaProps {
255
255
  * { logFormat: 'JSON', applicationLogLevel: 'WARN', systemLogLevel: 'INFO' }
256
256
  */
257
257
  loggingConfig?: LoggingConfig;
258
+ /**
259
+ * Lambda layer ARNs to attach to the function.
260
+ *
261
+ * Specifies a list of Lambda layer ARNs that will be attached to the function.
262
+ * Layers from the app, module, and lambda levels are all merged together.
263
+ *
264
+ * @example
265
+ * ['arn:aws:lambda:us-east-1:123456789012:layer:my-layer:1']
266
+ */
267
+ layers?: string[];
258
268
  /**
259
269
  * Output configuration for the Lambda function.
260
270
  *
@@ -19,7 +19,7 @@ const createResourceDecorator = (decoratorProps) => (props) => (constructor) =>
19
19
  foldername: (0, node_path_1.dirname)(callerFile),
20
20
  filename: (0, node_path_1.basename)(callerFile).replace('.js', ''),
21
21
  originalName: constructor.name,
22
- minify: props?.minify,
22
+ bundler: props?.bundler,
23
23
  }, constructor);
24
24
  };
25
25
  exports.createResourceDecorator = createResourceDecorator;
@@ -1,6 +1,28 @@
1
1
  export declare enum ResourceReflectKeys {
2
2
  resource = "resource"
3
3
  }
4
+ export interface BundlerConfig {
5
+ /**
6
+ * Enables minification for this resource's Lambda bundle.
7
+ *
8
+ * When `true`, the bundled code will be minified to reduce deployment
9
+ * package size and improve cold start times.
10
+ */
11
+ minify?: boolean;
12
+ /**
13
+ * Additional packages to exclude from the rolldown bundle.
14
+ *
15
+ * Specifies extra package names or patterns that should be treated as
16
+ * external during bundling. The default externals (`@aws-sdk/*`, `aws-lambda`,
17
+ * `node:*`) are always included — this list is merged on top of them.
18
+ *
19
+ * Values from the app, module, and resource levels are all accumulated.
20
+ *
21
+ * @example
22
+ * externalPackages: ['my-shared-lib', /^@my-org\//]
23
+ */
24
+ externalPackages?: (string | RegExp)[];
25
+ }
4
26
  export interface ResourceProps {
5
27
  /**
6
28
  * Resource name.
@@ -10,20 +32,19 @@ export interface ResourceProps {
10
32
  */
11
33
  name?: string;
12
34
  /**
13
- * Resource minify
35
+ * Bundler configuration for this resource.
14
36
  *
15
- * Specifies whether the code should be minified when the resource is processed
16
- *
17
- * @default true
37
+ * Groups build-time settings that control how the Lambda code is bundled
38
+ * by rolldown. Includes minification and external package exclusions.
18
39
  */
19
- minify?: boolean;
40
+ bundler?: BundlerConfig;
20
41
  }
21
- export interface ResourceMetadata extends Required<Omit<ResourceProps, 'minify'>> {
42
+ export interface ResourceMetadata extends Required<Omit<ResourceProps, 'bundler'>> {
22
43
  type: string;
23
44
  filename: string;
24
45
  foldername: string;
25
46
  originalName: string;
26
- minify?: boolean;
47
+ bundler?: BundlerConfig;
27
48
  }
28
49
  export interface ResourceDecoratorProps<T> {
29
50
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lafken/common",
3
- "version": "0.12.13",
3
+ "version": "0.12.15",
4
4
  "private": false,
5
5
  "description": "Lafken utilities - TypeScript decorator factories and metadata reflection for infrastructure-as-code decorators",
6
6
  "keywords": [