Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
de0e5f1
feat: remove logic in compile.ts to flatten references to expressions
Aug 2, 2022
7b3b675
feat: remove flattening of ReferenceExpr in PropertyAccessExpression
Aug 2, 2022
5728ae1
Merge branch 'main' into remove-reference-flattening
Aug 2, 2022
cbef263
feat: update interpreters to use new findIntegration resolution algor…
Aug 3, 2022
5c18ed1
chore: improved documentation
Aug 3, 2022
fdbf6b8
chore: remove test code
Aug 3, 2022
3e81f2e
feat: closure serializer built off of the Functionless AST
Aug 3, 2022
3ad1977
Merge branch 'main' into serialize-closure-ast
Aug 3, 2022
26f5cfe
Merge branch 'main' into serialize-closure-ast
Aug 4, 2022
ac6d430
feat: setup @swc/register
Aug 4, 2022
f5c298c
feat: stash swc
Aug 4, 2022
27ae2a6
Merge branch 'main' into serialize-closure-ast
Aug 4, 2022
7c2571c
fix: remove duplicate plugin configuration
Aug 4, 2022
32db046
feat: fixes for rust parser
Aug 4, 2022
971bc4e
fix: various tests
Aug 5, 2022
d8be3a0
fix: api and validate tests
Aug 5, 2022
54f4a89
chore: remove serialize-closure code
Aug 5, 2022
51eb1bd
chore: add require-hook back in
Aug 5, 2022
543e07c
chore: remove ts-patch
Aug 5, 2022
0b9bc83
fix: configure jest from .projen
Aug 5, 2022
89627c1
feat: add isAwait to ForOfStmt and isRest to ParameterDecl
Aug 6, 2022
31a20df
chore: remove redundant clone functions and add ensure to declaration…
Aug 6, 2022
3640d72
chore: add synth-time errors for for-await and rest parameters
Aug 6, 2022
9ce03c9
feat: add VarDeclKind to VariableDecl
Aug 6, 2022
2951d85
fix: move VarDeclKind to VariableDeclList
Aug 6, 2022
bfac1e4
Merge remote-tracking branch 'origin/samg-missing-ast' into serialize…
Aug 6, 2022
5738dd2
fix: make expr in YieldExpr not optional
Aug 6, 2022
153ef3c
feat: remove normalization logic of operators, === and !==
Aug 6, 2022
87f3962
chore: self mutation
invalid-email-address Aug 6, 2022
d0bcba1
chore: feedback
Aug 7, 2022
834b506
feat: handle more cases in FunctionlessAST -> TSAST
Aug 7, 2022
bd6e801
feat: add missing BinaryOp and organize them how Mozzila does
Aug 7, 2022
3af3bc4
Merge branch 'samg-missing-ast' into serialize-closure-ast
Aug 7, 2022
7460811
Merge branch 'samg-missing-ast' into serialize-closure-ast
Aug 7, 2022
d5378ad
feat: remove QuasiString and add in TemplateHead, Middle, Tail, Span
Aug 8, 2022
417056b
Merge branch 'samg-missing-ast' into serialize-closure-ast
Aug 8, 2022
e4cfc11
feat: add label to BreakStmt and ContinueStmt, and fix parsing of Lab…
Aug 8, 2022
48d7d02
improvements to AST tranfsorm
Aug 8, 2022
bae7f3b
Merge branch 'samg-missing-ast' into serialize-closure-ast
Aug 8, 2022
365fd53
feat: add expr to SwitchStmt
Aug 8, 2022
880f9d9
Merge branch 'samg-missing-ast' into serialize-closure-ast
Aug 8, 2022
6938f19
feat: serialize all AST node types
Aug 8, 2022
76775b9
feat: update ReturnStmt.expr to be optional
Aug 8, 2022
547a436
Merge branch 'samg-missing-ast' into serialize-closure-ast
Aug 8, 2022
5b9a620
serialize array, primtiives and other improvements
Aug 8, 2022
c95f6d4
Merge branch 'main' into serialize-closure-ast
Aug 8, 2022
c211e12
fix: the build
Aug 8, 2022
dd025bc
chore: use npm version of ast-reflection
Aug 8, 2022
6890158
Merge branch 'main' into samg-swc-transformer
Aug 8, 2022
38fafea
chore: remove jest.config.ts
Aug 8, 2022
5029d71
fix: depend on @functionless/ast-reflection
Aug 8, 2022
178a89e
chore: remove experimental code
Aug 8, 2022
b1d0294
chore: clean up
Aug 8, 2022
3118414
Merge branch 'main' into samg-swc-transformer
Aug 8, 2022
a29627f
Merge branch 'samg-swc-transformer' into serialize-closure-ast
Aug 8, 2022
8cd27ef
chore: upgrade to 0.0.1 of ast-reflection
Aug 8, 2022
224b2c9
chore: update docs and fix some tests
Aug 9, 2022
3985881
chore: remove dead code
Aug 9, 2022
df8bb10
Merge branch 'samg-swc-transformer' into serialize-closure-ast
Aug 9, 2022
8213e43
Merge branch 'main' into serialize-closure-ast
Aug 9, 2022
5ec25e7
chore: revert unnecessary changes
Aug 9, 2022
dbb18ec
chore: cleanup
Aug 9, 2022
4f82a74
feat: fix YieldExpr
Aug 9, 2022
c162f1b
feat: add Span information to F-AST
Aug 9, 2022
ff32f48
feat: upgrade compile.ts to also include span information
Aug 9, 2022
b902eb2
feat: add id and filename to ReferenceExpr
Aug 9, 2022
8b89830
Merge branch 'main' into samg-ast-span
Aug 9, 2022
c951dae
Merge remote-tracking branch 'origin/samg-ast-span' into serialize-cl…
Aug 9, 2022
f8be24b
feat: root node
Aug 9, 2022
1e71d9d
Merge branch 'main' into serialize-closure-ast
Aug 9, 2022
6cdc203
feat: configure require-hook
Aug 10, 2022
eed69a4
feat: update ClassExpr and ClassDecl name tobe an Identifier
Aug 10, 2022
d6424de
feat: support serializing classes
Aug 10, 2022
6f512fd
chore: set up snapshot and runtime tests for serialize-closure.test.ts
Aug 10, 2022
916d174
feat: support monkey-patching functions on the prototype
Aug 11, 2022
3e27d7d
feat: add support for monkey-patched methods, getters and setters.
Aug 11, 2022
c5b0e91
feat: improved support for monkey-patching
Aug 11, 2022
fd5bf11
feat: support monkey patching of getter/setter even when only one is …
Aug 11, 2022
db9c29e
feat: support class hierarchies and super calls
Aug 11, 2022
c9d61d7
feat: avoid name collisions
Aug 11, 2022
d6d9a09
feat: run bundle through esbuild
Aug 11, 2022
1c44372
feat: support choosing between esbuild and not
Aug 11, 2022
cb20c2f
feat: favor importing modules via require
Aug 11, 2022
9d85580
feat: add test for importing AWS SDK v3
Aug 11, 2022
2210da1
feat: allow serializer to be chosen. Support more cases
Aug 12, 2022
6fd5475
chore: cleanup
Aug 13, 2022
5c85638
fix: all function.localstack tests passing
Aug 13, 2022
6fef6d0
feat: register all known globals and internal modules
Aug 13, 2022
d9fddba
fix: more cases and refactor
Aug 13, 2022
757521e
feat: symbols and workong on global registry
Aug 13, 2022
ba91cde
fix: lexical scope, singleton and various other bugs
Aug 16, 2022
3597e66
Merge branch 'main' into serialize-closure-ast
Aug 16, 2022
2725d9a
Merge branch 'main' into serialize-closure-ast
Aug 20, 2022
611e420
fix: regression
Aug 21, 2022
07127ba
Merge branch 'main' into serialize-closure-ast
Sep 2, 2022
9e0978f
Merge branch 'main' into serialize-closure-ast
Sep 7, 2022
f64f168
feat: support serializing bound functionsa
Sep 7, 2022
1c84416
feat: add support for serializing Proxies
Sep 7, 2022
38d2799
chore: update snapshot tests
Sep 7, 2022
4f3744a
feat: avoid generating free variable names that collide with closure …
Sep 8, 2022
0ae0893
Merge branch 'main' into serialize-closure-ast
Sep 8, 2022
114d5f3
feat: support source maps in serialized closures
Sep 9, 2022
4a0ea00
chore: add more tests
Sep 12, 2022
190a084
Merge branch 'main' into serialize-closure-ast
Sep 12, 2022
cb49555
feat: support class inheritance with super
Sep 12, 2022
c4a4734
Merge branch 'main' into serialize-closure-ast
Sep 12, 2022
6535b5a
chore: working on broad spectrum tests
Sep 12, 2022
deee162
chore: add comprehensive test of all syntax
Sep 13, 2022
78b7510
fix: feedback and pluck tokens
Sep 13, 2022
10156f1
fix: various syntax bugs
Sep 13, 2022
86638ab
fix: avoid serializing module._cache and always in-memory serialize f…
Sep 13, 2022
5c1a2d3
Merge branch 'main' into serialize-closure-ast
Sep 13, 2022
e1dbf17
fix: tests
Sep 14, 2022
a66a000
Merge branch 'main' into serialize-closure-ast
Sep 14, 2022
162cf17
fix: tests
Sep 15, 2022
8bf4dd3
fix: properly base64 encoded
Sep 15, 2022
377ba11
chore: remove redundant checks for isSuperKeyword
Sep 15, 2022
8fb289f
chore: enable snapshot tests for serialize-closure
Sep 15, 2022
4bee033
chore: move serialize-* into serialize-closure folder
Sep 15, 2022
9bc01e6
try running tests without serialzie
thantos Sep 15, 2022
baf294c
Merge remote-tracking branch 'upstream/main' into serialize-closure-ast
thantos Sep 15, 2022
633f980
run tests without serialize closure
thantos Sep 15, 2022
25a0389
all together now...
thantos Sep 15, 2022
9c97127
more memory
thantos Sep 15, 2022
af85097
jest no cache
thantos Sep 15, 2022
4cef4f9
do not hotswap on CI
thantos Sep 15, 2022
af79de5
force exit
thantos Sep 15, 2022
0f453dd
trying more things
thantos Sep 15, 2022
1c2828a
split test runs
thantos Sep 15, 2022
baba2db
switch test order
thantos Sep 15, 2022
72ca840
woops
thantos Sep 16, 2022
dbb2c8a
chore: self mutation
invalid-email-address Sep 16, 2022
8b464ff
woops again
thantos Sep 16, 2022
d242587
Merge branch 'serialize-closure-ast' of https://github.com/functionle…
thantos Sep 16, 2022
e203e77
Merge branch 'main' into serialize-closure-ast
thantos Sep 16, 2022
44c031a
chore: self mutation
invalid-email-address Sep 16, 2022
ed23579
chore: rename SerializerImpl enums to V1 and V2
Sep 15, 2022
99ce118
Merge branch 'main' into serialize-closure-ast
Sep 16, 2022
3d5b13f
fix: use default serializer in function.ts/serialize
Sep 16, 2022
1a98a96
chore: fix settings.json
Sep 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const project = new CustomTypescriptProject({
"@swc/cli",
"@swc/core@1.2.245",
"@swc/register",
"source-map",
],
devDeps: [
`@aws-cdk/aws-appsync-alpha@${MIN_CDK_VERSION}-alpha.0`,
Expand All @@ -118,6 +119,7 @@ const project = new CustomTypescriptProject({
/**
* For CDK Local Stack tests
*/
"@aws-sdk/client-dynamodb",
`@aws-cdk/cloud-assembly-schema@${MIN_CDK_VERSION}`,
`@aws-cdk/cloudformation-diff@${MIN_CDK_VERSION}`,
`@aws-cdk/cx-api@${MIN_CDK_VERSION}`,
Expand Down
29 changes: 22 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy"],
"args": ["./lib/message-board.js"],
"runtimeArgs": ["--nolazy", "-r", "./hook"],
"args": ["./src/message-board.ts"],
"outFiles": [
"${workspaceRoot}/lib/**/*.js",
"${workspaceRoot}/test-app/lib/**/*.js",
Expand Down Expand Up @@ -98,6 +98,7 @@
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/.bin/jest",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["--enable-source-maps"],
"args": [
"--runInBand",
"--watchAll=false",
Expand All @@ -108,19 +109,33 @@
"--coverage=false"
]
},

{
"name": ".projenrc.ts",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "@swc/register"],
"args": [".projenrc.ts"],
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"env": {
"TS_NODE_PROJECT": "${workspaceRoot}/test-app/tsconfig.json"
}
},
{
"name": "generate aws sdk types",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],

"args": ["scripts/sdk-gen.ts"],

"args": ["./src/serialize-globals.ts"],
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**", "node_modules/**"]
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"env": {
"TS_NODE_PROJECT": "${workspaceRoot}/tsconfig.json"
}
}
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"eslint.format.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"jest.jestCommandLine": "node_modules/.bin/jest",
"jest.autoRun": "off",
"cSpell.words": ["localstack", "stepfunctions", "typesafe"]
}
8 changes: 7 additions & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,13 @@ export class APIGatewayVTL extends VTL {
} else if (
isPropAccessExpr(node) &&
isIdentifier(node.name) &&
isInputBody(node.expr) &&
node.name.name === "data"
) {
// $input.data maps to `$input.path('$')`
// this returns a VTL object representing the root payload data
return `$input.path('$')`;
if (isInputBody(node.expr)) {
// $input.data maps to `$input.path('$')`
// this returns a VTL object representing the root payload data
return `$input.path('$')`;
}
}
return super.eval(node as any, returnVar);
}
Expand Down
4 changes: 2 additions & 2 deletions src/asl/synth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4111,6 +4111,7 @@ export class ASL {
`the 'callback' argument of map must be a function or arrow expression, found: ${callbackfn?.kindName}`
);
}

return this.evalExprToJsonPath(expr.expr.expr, (listOutput) => {
// we assume that an array literal or a call would return a variable.
if (
Expand Down Expand Up @@ -5654,7 +5655,7 @@ function toStateName(node?: FunctionlessNode): string {
} else if (isBooleanLiteralExpr(node)) {
return `${node.value}`;
} else if (isCallExpr(node) || isNewExpr(node)) {
if (isSuperKeyword(node.expr) || isImportKeyword(node.expr)) {
if (isImportKeyword(node.expr)) {
throw new Error(`calling ${node.expr.kindName} is unsupported in ASL`);
}
return `${isNewExpr(node) ? "new " : ""}${toStateName(
Expand Down Expand Up @@ -5689,7 +5690,6 @@ function toStateName(node?: FunctionlessNode): string {
`${prop.kindName} is not supported by Step Functions`
);
}

return toStateName(prop);
})
.join(", ")}}`;
Expand Down
Loading