Skip to content

Commit 4e45bfb

Browse files
committed
small fixes
1 parent 4b84ab5 commit 4e45bfb

File tree

12 files changed

+257
-30
lines changed

12 files changed

+257
-30
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ jobs:
3535
env:
3636
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3737

38+
- name: Publish @simplesteps/local
39+
run: npm publish --workspace packages/local --provenance --access public
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
3843
- name: Publish @simplesteps/cdk
3944
run: npm publish --workspace packages/cdk --provenance --access public
4045
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ build/
77

88
# testing
99
coverage/
10+
junit.xml
1011

1112
# misc
1213
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ npx simplesteps compile workflow.ts -o output/ --query-language jsonpath
206206
## Compiler Features
207207

208208
- **Dual query language support** — JSONata (default) and JSONPath, switchable via `--query-language`
209-
- **64+ JS method → JSONata mappings** — string, math, array, type conversion, higher-order functions, and operators compile directly
209+
- **65+ JS method → JSONata mappings** — string, math, array, type conversion, higher-order functions, and operators compile directly
210210
- **Lambda expression analysis** — pure callbacks in `.map()`, `.filter()`, `.reduce()` auto-compile to JSONata higher-order functions
211211
- **Whole-program data flow analysis** with constant propagation lattice across modules
212212
- **Cross-file import resolution** with demand-driven analysis and cycle detection

packages/cdk/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 SimpleSteps Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/core/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 SimpleSteps Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ This produces a complete ASL state machine — a Parallel state for the concurre
118118
import { Lambda, DynamoDB, SQS, SNS, S3, EventBridge } from '@simplesteps/core/runtime/services';
119119
```
120120

121-
16 services have optimized integrations (Lambda, DynamoDB, SQS, SNS, EventBridge, S3, Secrets Manager, SSM, ECS, Bedrock, Glue, CodeBuild, Athena, Batch, StepFunction, HttpEndpoint), 48 have SDK-generated bindings with full type signatures, and `Steps.awsSdk()` covers anything else.
121+
17 services have optimized integrations (Lambda, DynamoDB, SQS, SNS, EventBridge, S3, Secrets Manager, SSM, ECS, Bedrock, Glue, CodeBuild, Athena, Batch, StepFunction, HttpEndpoint, Activity), 48 have SDK-generated bindings with full type signatures, and `Steps.awsSdk()` covers anything else.
122122

123123
## CDK
124124

packages/core/src/compiler/generation/expressionMapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ function serializeJsonataOperand(resolved: ReturnType<typeof resolveExpression>)
388388
function serializeJsonataValue(value: unknown): string {
389389
if (typeof value === 'string') {
390390
// Single-quote strings in JSONata, escape single quotes
391-
return `'${value.replace(/'/g, "\\'")}'`;
391+
return `'${value.replace(/\\/g, '\\\\').replace(/'/g, "\\'")}'`;
392392
}
393393
if (typeof value === 'number' || typeof value === 'boolean') {
394394
return String(value);

packages/local/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 SimpleSteps Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/local/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# @simplesteps/local
2+
3+
[![npm](https://img.shields.io/npm/v/@simplesteps/local)](https://www.npmjs.com/package/@simplesteps/local)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/DevNamedZed/simplesteps/blob/main/LICENSE)
5+
6+
Local execution runtime for [SimpleSteps](https://github.com/DevNamedZed/simplesteps). Compile TypeScript workflows to ASL with `@simplesteps/core`, then run and test them locally with mock services — no AWS account needed.
7+
8+
## Install
9+
10+
```bash
11+
npm install @simplesteps/local
12+
```
13+
14+
## Usage
15+
16+
```typescript
17+
import { compile } from '@simplesteps/core';
18+
import { LocalRunner } from '@simplesteps/local';
19+
20+
// Compile your workflow
21+
const result = compile({ sourceFiles: ['workflow.ts'] });
22+
const asl = result.stateMachines[0].asl;
23+
24+
// Execute locally with mock services
25+
const runner = new LocalRunner(asl, {
26+
services: {
27+
'arn:aws:lambda:us-east-1:123456789:function:MyFn': async (input) => {
28+
return { status: 'ok' };
29+
},
30+
},
31+
});
32+
33+
const output = await runner.execute({ orderId: '123' });
34+
console.log(output);
35+
```
36+
37+
### Execution Traces
38+
39+
Use `executeWithTrace` to inspect the full state-by-state execution path:
40+
41+
```typescript
42+
const { output, trace } = await runner.executeWithTrace({ orderId: '123' });
43+
44+
for (const entry of trace.states) {
45+
console.log(`${entry.name} (${entry.type})`);
46+
}
47+
```
48+
49+
## Features
50+
51+
- Supports all 8 ASL state types (Task, Pass, Choice, Wait, Succeed, Fail, Parallel, Map)
52+
- Both JSONata and JSONPath query languages
53+
- All 18 `States.*` intrinsic functions
54+
- Choice state comparison operators and compound rules
55+
- Full data flow pipeline (InputPath, Parameters, ResultSelector, ResultPath, OutputPath)
56+
- Error handling (Catch/Retry)
57+
- Execution tracing for test assertions
58+
59+
## Documentation
60+
61+
- [Getting Started](https://github.com/DevNamedZed/simplesteps/blob/main/docs/getting-started.md)
62+
- [Language Reference](https://github.com/DevNamedZed/simplesteps/blob/main/docs/language-reference.md)
63+
64+
[Playground](https://devnamedzed.github.io/simplesteps/) | [GitHub](https://github.com/DevNamedZed/simplesteps)
65+
66+
## License
67+
68+
MIT

packages/local/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
".": {
2424
"types": "./dist/index.d.ts",
2525
"default": "./dist/index.js"
26+
},
27+
"./runner": {
28+
"types": "./dist/runner.d.ts",
29+
"default": "./dist/runner.js"
2630
}
2731
},
2832
"scripts": {

0 commit comments

Comments
 (0)