cdk-appsync-typescript-resolver 0.0.25 → 0.0.26
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.
- package/.jsii +3 -3
- package/API.md +0 -60
- package/lib/AppsyncTypescriptFunction.js +1 -1
- package/lib/TSExpressPipelineResolver.js +1 -1
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +2 -2
- package/node_modules/esbuild/bin/esbuild +4 -5
- package/node_modules/esbuild/install.js +4 -6
- package/node_modules/esbuild/lib/main.d.ts +33 -7
- package/node_modules/esbuild/lib/main.js +259 -451
- package/node_modules/esbuild/package.json +26 -25
- package/package.json +24 -18
package/.jsii
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
]
|
|
8
8
|
},
|
|
9
9
|
"bundled": {
|
|
10
|
-
"esbuild": "^0.
|
|
10
|
+
"esbuild": "^0.24.0"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"aws-cdk-lib": "^2.67.0",
|
|
@@ -3788,6 +3788,6 @@
|
|
|
3788
3788
|
"symbolId": "src/TSExpressPipelineResolverProps:TSExpressPipelineResolverProps"
|
|
3789
3789
|
}
|
|
3790
3790
|
},
|
|
3791
|
-
"version": "0.0.
|
|
3792
|
-
"fingerprint": "
|
|
3791
|
+
"version": "0.0.26",
|
|
3792
|
+
"fingerprint": "3exlEYz6S8WrMf7YjdezVSb7tPrU0FmuqBDYXy9JGgU="
|
|
3793
3793
|
}
|
package/API.md
CHANGED
|
@@ -1,63 +1,3 @@
|
|
|
1
|
-
# cdk-appsync-typescript-resolver
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/cdk-appsync-typescript-resolver)
|
|
4
|
-
[](https://app.codacy.com/gh/sudokar/cdk-appsync-typescript-resolver/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
5
|
-
[](https://github.com/sudokar/cdk-appsync-typescript-resolver/actions/workflows/release.yml)
|
|
6
|
-
[](https://github.com/sudokar/cdk-appsync-typescript-resolver/releases)
|
|
7
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
8
|
-
[](https://github.com/sudokar/nx-serverless)
|
|
9
|
-

|
|
10
|
-
[](https://gitpod.io/#https://github.com/sudokar/cdk-appsync-typescript-resolver)
|
|
11
|
-
|
|
12
|
-
Constructs to transpile and bundle Typescript to valid AWS Appsync's JS resolvers
|
|
13
|
-
|
|
14
|
-
[](https://constructs.dev/packages/cdk-appsync-typescript-resolver)
|
|
15
|
-
|
|
16
|
-
# ✨ Constructs
|
|
17
|
-
|
|
18
|
-
- [AppsyncTypescriptFunction](src%2Flib%2FAppsyncTypescriptFunction.ts) - To transpile and bundle Typescript
|
|
19
|
-
- [TSExpressPipelineResolver](src%2Flib%2FJSExpressPipelineResolver.ts) - To use AppsyncTypescriptFunction with boilerplate code
|
|
20
|
-
|
|
21
|
-
# 🚀 Usage
|
|
22
|
-
|
|
23
|
-
- AppsyncTypescriptFunction
|
|
24
|
-
```typescript
|
|
25
|
-
import { AppsyncTypescriptFunction } from 'cdk-appsync-typescript-resolver'
|
|
26
|
-
...
|
|
27
|
-
const appsyncFunction = new AppsyncTypescriptFunction(stack, "TSDemoFunction", {
|
|
28
|
-
name: "TSDemoFunction",
|
|
29
|
-
api: new appsync.GraphqlApi(...),
|
|
30
|
-
path: path.join(__dirname, "path", "to", "file.ts"),
|
|
31
|
-
dataSource: new appsync.DynamoDbDataSource(...),
|
|
32
|
-
sourceMap: true,
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
- TSExpressPipelineResolver
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
import { TSExpressPipelineResolver } from 'cdk-appsync-typescript-resolver'
|
|
40
|
-
...
|
|
41
|
-
const resolver = new TSExpressPipelineResolver(testStack, "DemoResolver", {
|
|
42
|
-
api: new appsync.GraphqlApi(...),
|
|
43
|
-
typeName: "Query",
|
|
44
|
-
fieldName: "hello",
|
|
45
|
-
tsFunction: new AppsyncTypescriptFunction(...),
|
|
46
|
-
});
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
> Tip: Use [GraphQL Code Generator](https://the-guild.dev/graphql/codegen) to generate Typescript types from GraphQL schema(s) to use in resolvers
|
|
50
|
-
|
|
51
|
-
Checkout the demo project for examples [cdk-appsync-typescript-resolver-demo](https://github.com/sudokar/cdk-appsync-typescript-resolver-demo)
|
|
52
|
-
|
|
53
|
-
# References
|
|
54
|
-
|
|
55
|
-
[JavaScript resolvers overview](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-reference-overview-js.html)
|
|
56
|
-
|
|
57
|
-
[Bundling, TypeScript, and source maps](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-reference-overview-js.html#additional-utilities)
|
|
58
|
-
|
|
59
|
-
[GraphQL Code Generator](https://the-guild.dev/graphql/codegen)
|
|
60
|
-
|
|
61
1
|
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
62
2
|
|
|
63
3
|
## Constructs <a name="Constructs" id="Constructs"></a>
|
|
@@ -23,6 +23,6 @@ class AppsyncTypescriptFunction extends appsync.AppsyncFunction {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
_a = JSII_RTTI_SYMBOL_1;
|
|
26
|
-
AppsyncTypescriptFunction[_a] = { fqn: "cdk-appsync-typescript-resolver.AppsyncTypescriptFunction", version: "0.0.
|
|
26
|
+
AppsyncTypescriptFunction[_a] = { fqn: "cdk-appsync-typescript-resolver.AppsyncTypescriptFunction", version: "0.0.26" };
|
|
27
27
|
exports.AppsyncTypescriptFunction = AppsyncTypescriptFunction;
|
|
28
28
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9BcHBzeW5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VzY3JpcHQgdG8gQVdTIEFwcHN5bmMgSlMgZnVuY3Rpb25cbiAqL1xuZXhwb3J0IGNsYXNzIEFwcHN5bmNUeXBlc2NyaXB0RnVuY3Rpb24gZXh0ZW5kcyBhcHBzeW5jLkFwcHN5bmNGdW5jdGlvbiB7XG4gIGNvbnN0cnVjdG9yKFxuICAgIHNjb3BlOiBJQ29uc3RydWN0LFxuICAgIGlkOiBzdHJpbmcsXG4gICAgcHJvcHM6IEFwcHN5bmNUeXBlc2NyaXB0RnVuY3Rpb25Qcm9wcyxcbiAgKSB7XG4gICAgY29uc3QgeyBwYXRoLCBzb3VyY2VNYXAsIHJlcGxhY2VTdHJpbmdzIH0gPSBwcm9wcztcbiAgICBzdXBlcihzY29wZSwgaWQsIHtcbiAgICAgIC4uLnByb3BzLFxuICAgICAgY29kZTogYXBwc3luYy5Db2RlLmZyb21JbmxpbmUoXG4gICAgICAgIGJ1bmRsZSh7XG4gICAgICAgICAgZW50cnlQb2ludDogcGF0aCxcbiAgICAgICAgICBzb3VyY2VNYXA6IHNvdXJjZU1hcCA/PyBmYWxzZSxcbiAgICAgICAgICByZXBsYWNlU3RyaW5ncyxcbiAgICAgICAgfSksXG4gICAgICApLFxuICAgICAgcnVudGltZTogYXBwc3luYy5GdW5jdGlvblJ1bnRpbWUuSlNfMV8wXzAsXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -29,6 +29,6 @@ class TSExpressPipelineResolver extends appsync.Resolver {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
_a = JSII_RTTI_SYMBOL_1;
|
|
32
|
-
TSExpressPipelineResolver[_a] = { fqn: "cdk-appsync-typescript-resolver.TSExpressPipelineResolver", version: "0.0.
|
|
32
|
+
TSExpressPipelineResolver[_a] = { fqn: "cdk-appsync-typescript-resolver.TSExpressPipelineResolver", version: "0.0.26" };
|
|
33
33
|
exports.TSExpressPipelineResolver = TSExpressPipelineResolver;
|
|
34
34
|
//# sourceMappingURL=data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wcHN5bmNGdW5jdGlvbl0sXG4gICAgICBjb2RlOiBhcHBzeW5jLkNvZGUuZnJvbUlubGluZShkZWZhdWx0UGlwZWxpbmVDb2RlKSxcbiAgICAgIHJ1bnRpbWU6IGFwcHN5bmMuRnVuY3Rpb25SdW50aW1lLkpTXzFfMF8wLFxuICAgIH0pO1xuICB9XG59XG4iXX0=
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esbuild/linux-x64",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"preferUnplugged": true,
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=18"
|
|
13
13
|
},
|
|
14
14
|
"os": [
|
|
15
15
|
"linux"
|
|
@@ -53,6 +53,7 @@ var knownUnixlikePackages = {
|
|
|
53
53
|
"linux x64 LE": "@esbuild/linux-x64",
|
|
54
54
|
"linux loong64 LE": "@esbuild/linux-loong64",
|
|
55
55
|
"netbsd x64 LE": "@esbuild/netbsd-x64",
|
|
56
|
+
"openbsd arm64 LE": "@esbuild/openbsd-arm64",
|
|
56
57
|
"openbsd x64 LE": "@esbuild/openbsd-x64",
|
|
57
58
|
"sunos x64 LE": "@esbuild/sunos-x64"
|
|
58
59
|
};
|
|
@@ -87,16 +88,14 @@ function pkgForSomeOtherPlatform() {
|
|
|
87
88
|
for (const unixKey in knownUnixlikePackages) {
|
|
88
89
|
try {
|
|
89
90
|
const pkg = knownUnixlikePackages[unixKey];
|
|
90
|
-
if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
|
|
91
|
-
return pkg;
|
|
91
|
+
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
|
|
92
92
|
} catch {
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
for (const windowsKey in knownWindowsPackages) {
|
|
96
96
|
try {
|
|
97
97
|
const pkg = knownWindowsPackages[windowsKey];
|
|
98
|
-
if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
|
|
99
|
-
return pkg;
|
|
98
|
+
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
|
|
100
99
|
} catch {
|
|
101
100
|
}
|
|
102
101
|
}
|
|
@@ -200,7 +199,7 @@ for your current platform.`);
|
|
|
200
199
|
"node_modules",
|
|
201
200
|
".cache",
|
|
202
201
|
"esbuild",
|
|
203
|
-
`pnpapi-${pkg.replace("/", "-")}-${"0.
|
|
202
|
+
`pnpapi-${pkg.replace("/", "-")}-${"0.24.0"}-${path.basename(subpath)}`
|
|
204
203
|
);
|
|
205
204
|
if (!fs.existsSync(binTargetPath)) {
|
|
206
205
|
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
|
|
@@ -50,6 +50,7 @@ var knownUnixlikePackages = {
|
|
|
50
50
|
"linux x64 LE": "@esbuild/linux-x64",
|
|
51
51
|
"linux loong64 LE": "@esbuild/linux-loong64",
|
|
52
52
|
"netbsd x64 LE": "@esbuild/netbsd-x64",
|
|
53
|
+
"openbsd arm64 LE": "@esbuild/openbsd-arm64",
|
|
53
54
|
"openbsd x64 LE": "@esbuild/openbsd-x64",
|
|
54
55
|
"sunos x64 LE": "@esbuild/sunos-x64"
|
|
55
56
|
};
|
|
@@ -167,8 +168,7 @@ function extractFileFromTarGzip(buffer, subpath) {
|
|
|
167
168
|
let size = parseInt(str(offset + 124, 12), 8);
|
|
168
169
|
offset += 512;
|
|
169
170
|
if (!isNaN(size)) {
|
|
170
|
-
if (name === subpath)
|
|
171
|
-
return buffer.subarray(offset, offset + size);
|
|
171
|
+
if (name === subpath) return buffer.subarray(offset, offset + size);
|
|
172
172
|
offset += size + 511 & ~511;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -203,10 +203,8 @@ function removeRecursive(dir) {
|
|
|
203
203
|
} catch {
|
|
204
204
|
continue;
|
|
205
205
|
}
|
|
206
|
-
if (stats.isDirectory())
|
|
207
|
-
|
|
208
|
-
else
|
|
209
|
-
fs2.unlinkSync(entryPath);
|
|
206
|
+
if (stats.isDirectory()) removeRecursive(entryPath);
|
|
207
|
+
else fs2.unlinkSync(entryPath);
|
|
210
208
|
}
|
|
211
209
|
fs2.rmdirSync(dir);
|
|
212
210
|
}
|
|
@@ -125,7 +125,7 @@ export interface BuildOptions extends CommonOptions {
|
|
|
125
125
|
/** Documentation: https://esbuild.github.io/api/#external */
|
|
126
126
|
external?: string[]
|
|
127
127
|
/** Documentation: https://esbuild.github.io/api/#packages */
|
|
128
|
-
packages?: 'external'
|
|
128
|
+
packages?: 'bundle' | 'external'
|
|
129
129
|
/** Documentation: https://esbuild.github.io/api/#alias */
|
|
130
130
|
alias?: Record<string, string>
|
|
131
131
|
/** Documentation: https://esbuild.github.io/api/#loader */
|
|
@@ -340,6 +340,7 @@ export interface ResolveOptions {
|
|
|
340
340
|
resolveDir?: string
|
|
341
341
|
kind?: ImportKind
|
|
342
342
|
pluginData?: any
|
|
343
|
+
with?: Record<string, string>
|
|
343
344
|
}
|
|
344
345
|
|
|
345
346
|
/** Documentation: https://esbuild.github.io/plugins/#resolve-results */
|
|
@@ -379,6 +380,7 @@ export interface OnResolveArgs {
|
|
|
379
380
|
resolveDir: string
|
|
380
381
|
kind: ImportKind
|
|
381
382
|
pluginData: any
|
|
383
|
+
with: Record<string, string>
|
|
382
384
|
}
|
|
383
385
|
|
|
384
386
|
export type ImportKind =
|
|
@@ -664,16 +666,40 @@ export let version: string
|
|
|
664
666
|
|
|
665
667
|
// Call this function to terminate esbuild's child process. The child process
|
|
666
668
|
// is not terminated and re-created after each API call because it's more
|
|
667
|
-
// efficient to keep it around when there are multiple API calls.
|
|
668
|
-
//
|
|
669
|
-
//
|
|
669
|
+
// efficient to keep it around when there are multiple API calls.
|
|
670
|
+
//
|
|
671
|
+
// In node this happens automatically before the parent node process exits. So
|
|
672
|
+
// you only need to call this if you know you will not make any more esbuild
|
|
673
|
+
// API calls and you want to clean up resources.
|
|
670
674
|
//
|
|
671
|
-
//
|
|
672
|
-
//
|
|
673
|
-
//
|
|
675
|
+
// Unlike node, Deno lacks the necessary APIs to clean up child processes
|
|
676
|
+
// automatically. You must manually call stop() in Deno when you're done
|
|
677
|
+
// using esbuild or Deno will continue running forever.
|
|
674
678
|
//
|
|
675
679
|
// Another reason you might want to call this is if you are using esbuild from
|
|
676
680
|
// within a Deno test. Deno fails tests that create a child process without
|
|
677
681
|
// killing it before the test ends, so you have to call this function (and
|
|
678
682
|
// await the returned promise) in every Deno test that uses esbuild.
|
|
679
683
|
export declare function stop(): Promise<void>
|
|
684
|
+
|
|
685
|
+
// Note: These declarations exist to avoid type errors when you omit "dom" from
|
|
686
|
+
// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the
|
|
687
|
+
// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do
|
|
688
|
+
// with the browser DOM and is present in many non-browser JavaScript runtimes
|
|
689
|
+
// (e.g. node and deno). Declaring it here allows esbuild's API to be used in
|
|
690
|
+
// these scenarios.
|
|
691
|
+
//
|
|
692
|
+
// There's an open issue about getting this problem corrected (although these
|
|
693
|
+
// declarations will need to remain even if this is fixed for backward
|
|
694
|
+
// compatibility with older TypeScript versions):
|
|
695
|
+
//
|
|
696
|
+
// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826
|
|
697
|
+
//
|
|
698
|
+
declare global {
|
|
699
|
+
namespace WebAssembly {
|
|
700
|
+
interface Module {
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
interface URL {
|
|
704
|
+
}
|
|
705
|
+
}
|