@lafken/state-machine 0.12.28 → 0.13.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.
@@ -1,6 +1,6 @@
1
1
  import 'reflect-metadata';
2
2
  import { type DefaultMethod, type HandlerStateProps, type StateMachineBaseProps, type StateMachineResourceProps } from './state-machine.types';
3
- export declare const RESOURCE_TYPE: "STATE_MACHINE";
3
+ export declare const RESOURCE_TYPE: 'STATE_MACHINE';
4
4
  /**
5
5
  * Class decorator that registers a class as a **nested** state machine
6
6
  * definition.
@@ -34,7 +34,7 @@ export declare const RESOURCE_TYPE: "STATE_MACHINE";
34
34
  * export class OrderFlow {}
35
35
  * ```
36
36
  */
37
- export declare const NestedStateMachine: <T extends Function>(props: StateMachineBaseProps<keyof T["prototype"]>) => (constructor: T) => void;
37
+ export declare const NestedStateMachine: <T extends Function>(props: StateMachineBaseProps<keyof T['prototype']>) => (constructor: T) => void;
38
38
  /**
39
39
  * Class decorator that registers a class as an AWS Step Functions
40
40
  * state machine resource.
@@ -73,7 +73,7 @@ export declare const NestedStateMachine: <T extends Function>(props: StateMachin
73
73
  * export class DelayedFlow {}
74
74
  * ```
75
75
  */
76
- export declare const StateMachine: <T extends Function>(props: StateMachineResourceProps<keyof T["prototype"]>) => (constructor: T) => void;
76
+ export declare const StateMachine: <T extends Function>(props: StateMachineResourceProps<keyof T['prototype']>) => (constructor: T) => void;
77
77
  /**
78
78
  * Method decorator that registers a handler as a **Task** state inside
79
79
  * a `@StateMachine`.
@@ -11,16 +11,7 @@ class StateMachineResolver {
11
11
  const contextBundler = (0, resolver_1.getContextValueByScope)(module, 'bundler');
12
12
  const metadata = (0, common_1.getResourceMetadata)(resource);
13
13
  const handlers = (0, common_1.getResourceHandlerMetadata)(resource);
14
- resolver_1.lambdaAssets.initializeMetadata({
15
- foldername: metadata.foldername,
16
- filename: metadata.filename,
17
- className: metadata.originalName,
18
- methods: handlers.map((handler) => handler.name),
19
- bundler: {
20
- ...metadata.bundler,
21
- minify: metadata.bundler?.minify ?? contextBundler?.minify,
22
- },
23
- });
14
+ (0, resolver_1.initLambdaAssetMetadata)({ metadata, handlers, contextBundler });
24
15
  const stateMachine = new state_machine_1.StateMachine(module, metadata.name, {
25
16
  minify: metadata.bundler?.minify ?? contextBundler?.minify,
26
17
  classResource: resource,
@@ -67,15 +67,10 @@ class Schema {
67
67
  return acc;
68
68
  }, {});
69
69
  if (initializeAssets) {
70
- resolver_1.lambdaAssets.initializeMetadata({
71
- foldername: this.resourceMetadata.foldername,
72
- filename: this.resourceMetadata.filename,
73
- className: this.resourceMetadata.originalName,
74
- methods: handlers.map((handler) => handler.name),
75
- bundler: {
76
- ...this.resourceMetadata.bundler,
77
- minify: this.resourceMetadata.bundler?.minify ?? minify,
78
- },
70
+ (0, resolver_1.initLambdaAssetMetadata)({
71
+ metadata: this.resourceMetadata,
72
+ handlers,
73
+ contextBundler: { minify },
79
74
  });
80
75
  }
81
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lafken/state-machine",
3
- "version": "0.12.28",
3
+ "version": "0.13.0",
4
4
  "private": false,
5
5
  "description": "Build Step Functions workflows with TypeScript decorators - declarative orchestration with Lafken",
6
6
  "keywords": [
@@ -50,26 +50,26 @@
50
50
  ],
51
51
  "dependencies": {
52
52
  "reflect-metadata": "^0.2.2",
53
- "@lafken/resolver": "0.12.28"
53
+ "@lafken/resolver": "0.13.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@cdktn/provider-aws": "^24.4.0",
57
- "@swc/core": "^1.15.40",
56
+ "@cdktn/provider-aws": "^24.11.0",
57
+ "@swc/core": "^1.15.43",
58
58
  "@swc/helpers": "^0.5.23",
59
- "@vitest/runner": "^4.1.8",
60
- "cdktn": "^0.23.2",
59
+ "@vitest/runner": "^4.1.10",
60
+ "cdktn": "^0.23.4",
61
61
  "cdktn-vitest": "^1.0.0",
62
- "constructs": "^10.6.0",
63
- "typescript": "6.0.3",
62
+ "constructs": "^10.7.0",
63
+ "typescript": "7.0.2",
64
64
  "unplugin-swc": "^1.5.9",
65
- "vitest": "^4.1.8",
66
- "@lafken/common": "0.12.28"
65
+ "vitest": "^4.1.10",
66
+ "@lafken/common": "0.13.0"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@cdktn/provider-aws": ">=23.0.0",
70
70
  "cdktn": ">=0.22.0",
71
71
  "constructs": "^10.4.5",
72
- "@lafken/common": "0.12.28"
72
+ "@lafken/common": "0.13.0"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=20.19"