@reventlessdev/reventless-aws 3.0.0-alpha.247 → 3.0.0-alpha.249
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/CHANGELOG.md +15 -0
- package/package.json +13 -12
- package/rescript.json +1 -0
- package/src/adapter/Api/AppSyncEventsSigner_Ops.res +11 -29
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +2 -3
- package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +1 -2
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +2 -3
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Ops.res +1 -2
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +1 -2
- package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +5 -7
- package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +1 -2
- package/src/adapter/Runtime/HeartbeatEntryPoint.res +3 -4
- package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +1 -2
- package/src/adapter/Runtime/PgMigrationEntryPoint.res +1 -2
- package/src/adapter/Runtime/PluginExtensionPointEntryPoint.res +3 -4
- package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +2 -3
- package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +4 -5
- package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +2 -3
- package/src/adapter/Upload/Upload_Presign_S3.res +9 -1
- package/src/adapter/Upload/Upload_Presign_S3.res.mjs +4 -1
- package/src/adapter/Upload/Upload_Presign_S3_Ops.res +2 -5
- package/src/components/Api/AppSync_Adapter.res +1 -6
- package/src/util/Util_Bundle.res +24 -50
- package/src/util/Util_Bundle.res.mjs +20 -20
- package/src/util/Util_LocalConfig.res +7 -14
- package/src/util/Util_LocalConfig.res.mjs +8 -8
- package/src/util/Util_SQS_Runtime.res +1 -5
- package/src/util/Util_StaticBundle.res +12 -29
- package/src/util/Util_StaticBundle.res.mjs +11 -11
- package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -2
- package/tests/PgChangeFeedRelay_IntegrationTest.res +1 -2
- package/tests/PgMigrationEntryPoint_IntegrationTest.res +1 -2
- package/tests/PgPipeline_IntegrationTest.res +1 -2
- package/tests/TaskBucketEntryPoint_OpsTest.res +2 -3
- package/tests/Util_BundleResolveTest.res +12 -18
- package/tests/Util_BundleResolveTest.res.mjs +8 -8
- package/tests/Util_StaticBundleTest.res +28 -35
- package/tests/Util_StaticBundleTest.res.mjs +31 -31
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
3
|
+
import * as Nodefs from "node:fs";
|
|
4
|
+
import * as Nodeos from "node:os";
|
|
5
|
+
import * as Nodepath from "node:path";
|
|
6
6
|
import * as Util_Bundle$ReventlessAws from "../src/util/Util_Bundle.res.mjs";
|
|
7
7
|
|
|
8
8
|
function makeProject(pkgName) {
|
|
9
|
-
let project =
|
|
10
|
-
let pkgDir =
|
|
11
|
-
|
|
9
|
+
let project = Nodefs.realpathSync(Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "pulumi-project-")));
|
|
10
|
+
let pkgDir = Nodepath.join(Nodepath.join(project, "node_modules"), pkgName);
|
|
11
|
+
Nodefs.mkdirSync(pkgDir, {
|
|
12
12
|
recursive: true
|
|
13
13
|
});
|
|
14
|
-
|
|
14
|
+
Nodefs.writeFileSync(Nodepath.join(pkgDir, "package.json"), `{"name":"","version":"9.9.9"}`, "utf8");
|
|
15
15
|
return [
|
|
16
16
|
project,
|
|
17
17
|
pkgDir
|
|
@@ -31,7 +31,7 @@ globalThis.describe("Util_Bundle.resolvePackageRoot", () => {
|
|
|
31
31
|
});
|
|
32
32
|
globalThis.afterAll(() => {
|
|
33
33
|
process.chdir(originalCwd);
|
|
34
|
-
|
|
34
|
+
Nodefs.rmSync(project, {
|
|
35
35
|
recursive: true,
|
|
36
36
|
force: true
|
|
37
37
|
});
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
open JestGlobals
|
|
2
2
|
|
|
3
|
-
@module("fs") external mkdtempSync: string => string = "mkdtempSync"
|
|
4
|
-
@module("fs") external mkdirSync: (string, {"recursive": bool}) => unit = "mkdirSync"
|
|
5
|
-
@module("fs") external writeFileSync: (string, string) => unit = "writeFileSync"
|
|
6
|
-
@module("fs") external rmSync: (string, {"recursive": bool, "force": bool}) => unit = "rmSync"
|
|
7
|
-
@module("path") external join2: (string, string) => string = "join"
|
|
8
|
-
@module("os") external tmpdir: unit => string = "tmpdir"
|
|
9
|
-
|
|
10
3
|
let makeFixture = (): string => {
|
|
11
|
-
let base = mkdtempSync(
|
|
12
|
-
writeFileSync(
|
|
13
|
-
writeFileSync(
|
|
14
|
-
writeFileSync(
|
|
15
|
-
writeFileSync(
|
|
16
|
-
let assets =
|
|
17
|
-
mkdirSync(assets, {
|
|
18
|
-
writeFileSync(
|
|
19
|
-
writeFileSync(
|
|
4
|
+
let base = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
|
|
5
|
+
NodeFs.writeFileSync(NodePath.join([base, "index.html"]), "<html></html>")
|
|
6
|
+
NodeFs.writeFileSync(NodePath.join([base, "app.js"]), "console.log('x')")
|
|
7
|
+
NodeFs.writeFileSync(NodePath.join([base, "app.css"]), "body{color:red}")
|
|
8
|
+
NodeFs.writeFileSync(NodePath.join([base, ".DS_Store"]), "ignored")
|
|
9
|
+
let assets = NodePath.join([base, "assets"])
|
|
10
|
+
NodeFs.mkdirSync(assets, {recursive: true})
|
|
11
|
+
NodeFs.writeFileSync(NodePath.join([assets, "logo.svg"]), "<svg/>")
|
|
12
|
+
NodeFs.writeFileSync(NodePath.join([assets, "favicon.ico"]), "ico")
|
|
20
13
|
base
|
|
21
14
|
}
|
|
22
15
|
|
|
@@ -86,14 +79,14 @@ describe("Util_StaticBundle.walk", () => {
|
|
|
86
79
|
"assets/logo.svg",
|
|
87
80
|
"index.html",
|
|
88
81
|
])
|
|
89
|
-
rmSync(dir, {
|
|
82
|
+
NodeFs.rmSync(dir, {recursive: true, force: true})
|
|
90
83
|
})
|
|
91
84
|
|
|
92
85
|
testSync("computes a non-empty content hash for each entry", () => {
|
|
93
86
|
let dir = makeFixture()
|
|
94
87
|
let entries = Util_StaticBundle.walk(dir)
|
|
95
88
|
entries->Array.forEach(e => expect(e.contentHash->String.length > 0)->toBe(true))
|
|
96
|
-
rmSync(dir, {
|
|
89
|
+
NodeFs.rmSync(dir, {recursive: true, force: true})
|
|
97
90
|
})
|
|
98
91
|
|
|
99
92
|
testSync("identical contents produce identical hashes", () => {
|
|
@@ -102,29 +95,29 @@ describe("Util_StaticBundle.walk", () => {
|
|
|
102
95
|
let indexEntry =
|
|
103
96
|
entries->Array.find(e => e.relativePath == "index.html")->Option.getUnsafe
|
|
104
97
|
let indexHash = indexEntry.contentHash
|
|
105
|
-
let dir2 = mkdtempSync(
|
|
106
|
-
writeFileSync(
|
|
98
|
+
let dir2 = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
|
|
99
|
+
NodeFs.writeFileSync(NodePath.join([dir2, "index.html"]), "<html></html>")
|
|
107
100
|
let entries2 = Util_StaticBundle.walk(dir2)
|
|
108
101
|
let indexHash2 = (entries2->Array.getUnsafe(0)).contentHash
|
|
109
102
|
expect(indexHash)->toBe(indexHash2)
|
|
110
|
-
rmSync(dir, {
|
|
111
|
-
rmSync(dir2, {
|
|
103
|
+
NodeFs.rmSync(dir, {recursive: true, force: true})
|
|
104
|
+
NodeFs.rmSync(dir2, {recursive: true, force: true})
|
|
112
105
|
})
|
|
113
106
|
|
|
114
107
|
testSync("different contents produce different hashes", () => {
|
|
115
|
-
let dirA = mkdtempSync(
|
|
116
|
-
writeFileSync(
|
|
117
|
-
let dirB = mkdtempSync(
|
|
118
|
-
writeFileSync(
|
|
108
|
+
let dirA = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
|
|
109
|
+
NodeFs.writeFileSync(NodePath.join([dirA, "f.txt"]), "AAA")
|
|
110
|
+
let dirB = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
|
|
111
|
+
NodeFs.writeFileSync(NodePath.join([dirB, "f.txt"]), "BBB")
|
|
119
112
|
let hashA = (Util_StaticBundle.walk(dirA)->Array.getUnsafe(0)).contentHash
|
|
120
113
|
let hashB = (Util_StaticBundle.walk(dirB)->Array.getUnsafe(0)).contentHash
|
|
121
114
|
expect(hashA == hashB)->toBe(false)
|
|
122
|
-
rmSync(dirA, {
|
|
123
|
-
rmSync(dirB, {
|
|
115
|
+
NodeFs.rmSync(dirA, {recursive: true, force: true})
|
|
116
|
+
NodeFs.rmSync(dirB, {recursive: true, force: true})
|
|
124
117
|
})
|
|
125
118
|
|
|
126
119
|
testSync("throws when assetsDir does not exist", () => {
|
|
127
|
-
let missing =
|
|
120
|
+
let missing = NodePath.join([NodeOs.tmpdir(), "static-bundle-does-not-exist-xyz123"])
|
|
128
121
|
let threw = try {
|
|
129
122
|
let _ = Util_StaticBundle.walk(missing)
|
|
130
123
|
false
|
|
@@ -137,9 +130,9 @@ describe("Util_StaticBundle.walk", () => {
|
|
|
137
130
|
|
|
138
131
|
describe("Util_StaticBundle.readJsonFileVerbatim", () => {
|
|
139
132
|
let writeTmp = (contents: string): string => {
|
|
140
|
-
let dir = mkdtempSync(
|
|
141
|
-
let path =
|
|
142
|
-
writeFileSync(path, contents)
|
|
133
|
+
let dir = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "ui-hints-"]))
|
|
134
|
+
let path = NodePath.join([dir, "ui-hints.json"])
|
|
135
|
+
NodeFs.writeFileSync(path, contents)
|
|
143
136
|
path
|
|
144
137
|
}
|
|
145
138
|
|
|
@@ -148,7 +141,7 @@ describe("Util_StaticBundle.readJsonFileVerbatim", () => {
|
|
|
148
141
|
let raw = "{\n \"dashboards\": [ ] \n}\n"
|
|
149
142
|
let path = writeTmp(raw)
|
|
150
143
|
expect(Util_StaticBundle.readJsonFileVerbatim(~path, ~label="test"))->toBe(raw)
|
|
151
|
-
rmSync(path, {
|
|
144
|
+
NodeFs.rmSync(path, {recursive: true, force: true})
|
|
152
145
|
})
|
|
153
146
|
|
|
154
147
|
testSync("throws on malformed JSON", () => {
|
|
@@ -160,11 +153,11 @@ describe("Util_StaticBundle.readJsonFileVerbatim", () => {
|
|
|
160
153
|
| _ => true
|
|
161
154
|
}
|
|
162
155
|
expect(threw)->toBe(true)
|
|
163
|
-
rmSync(path, {
|
|
156
|
+
NodeFs.rmSync(path, {recursive: true, force: true})
|
|
164
157
|
})
|
|
165
158
|
|
|
166
159
|
testSync("throws when the file does not exist", () => {
|
|
167
|
-
let missing =
|
|
160
|
+
let missing = NodePath.join([NodeOs.tmpdir(), "ui-hints-missing-xyz123.json"])
|
|
168
161
|
let threw = try {
|
|
169
162
|
let _ = Util_StaticBundle.readJsonFileVerbatim(~path=missing, ~label="test")
|
|
170
163
|
false
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
3
|
+
import * as Nodefs from "node:fs";
|
|
4
|
+
import * as Nodeos from "node:os";
|
|
5
|
+
import * as Nodepath from "node:path";
|
|
6
6
|
import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
|
|
7
7
|
import * as Util_StaticBundle$ReventlessAws from "../src/util/Util_StaticBundle.res.mjs";
|
|
8
8
|
|
|
9
9
|
function makeFixture() {
|
|
10
|
-
let base =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let assets =
|
|
16
|
-
|
|
10
|
+
let base = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
|
|
11
|
+
Nodefs.writeFileSync(Nodepath.join(base, "index.html"), "<html></html>", "utf8");
|
|
12
|
+
Nodefs.writeFileSync(Nodepath.join(base, "app.js"), "console.log('x')", "utf8");
|
|
13
|
+
Nodefs.writeFileSync(Nodepath.join(base, "app.css"), "body{color:red}", "utf8");
|
|
14
|
+
Nodefs.writeFileSync(Nodepath.join(base, ".DS_Store"), "ignored", "utf8");
|
|
15
|
+
let assets = Nodepath.join(base, "assets");
|
|
16
|
+
Nodefs.mkdirSync(assets, {
|
|
17
17
|
recursive: true
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Nodefs.writeFileSync(Nodepath.join(assets, "logo.svg"), "<svg/>", "utf8");
|
|
20
|
+
Nodefs.writeFileSync(Nodepath.join(assets, "favicon.ico"), "ico", "utf8");
|
|
21
21
|
return base;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -78,7 +78,7 @@ globalThis.describe("Util_StaticBundle.walk", () => {
|
|
|
78
78
|
"assets/logo.svg",
|
|
79
79
|
"index.html"
|
|
80
80
|
]);
|
|
81
|
-
|
|
81
|
+
Nodefs.rmSync(dir, {
|
|
82
82
|
recursive: true,
|
|
83
83
|
force: true
|
|
84
84
|
});
|
|
@@ -89,7 +89,7 @@ globalThis.describe("Util_StaticBundle.walk", () => {
|
|
|
89
89
|
entries.forEach(e => {
|
|
90
90
|
globalThis.expect(e.contentHash.length > 0).toBe(true);
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
Nodefs.rmSync(dir, {
|
|
93
93
|
recursive: true,
|
|
94
94
|
force: true
|
|
95
95
|
});
|
|
@@ -99,39 +99,39 @@ globalThis.describe("Util_StaticBundle.walk", () => {
|
|
|
99
99
|
let entries = Util_StaticBundle$ReventlessAws.walk(dir);
|
|
100
100
|
let indexEntry = entries.find(e => e.relativePath === "index.html");
|
|
101
101
|
let indexHash = indexEntry.contentHash;
|
|
102
|
-
let dir2 =
|
|
103
|
-
|
|
102
|
+
let dir2 = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
|
|
103
|
+
Nodefs.writeFileSync(Nodepath.join(dir2, "index.html"), "<html></html>", "utf8");
|
|
104
104
|
let entries2 = Util_StaticBundle$ReventlessAws.walk(dir2);
|
|
105
105
|
let indexHash2 = entries2[0].contentHash;
|
|
106
106
|
globalThis.expect(indexHash).toBe(indexHash2);
|
|
107
|
-
|
|
107
|
+
Nodefs.rmSync(dir, {
|
|
108
108
|
recursive: true,
|
|
109
109
|
force: true
|
|
110
110
|
});
|
|
111
|
-
|
|
111
|
+
Nodefs.rmSync(dir2, {
|
|
112
112
|
recursive: true,
|
|
113
113
|
force: true
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
globalThis.test("different contents produce different hashes", () => {
|
|
117
|
-
let dirA =
|
|
118
|
-
|
|
119
|
-
let dirB =
|
|
120
|
-
|
|
117
|
+
let dirA = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
|
|
118
|
+
Nodefs.writeFileSync(Nodepath.join(dirA, "f.txt"), "AAA", "utf8");
|
|
119
|
+
let dirB = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
|
|
120
|
+
Nodefs.writeFileSync(Nodepath.join(dirB, "f.txt"), "BBB", "utf8");
|
|
121
121
|
let hashA = Util_StaticBundle$ReventlessAws.walk(dirA)[0].contentHash;
|
|
122
122
|
let hashB = Util_StaticBundle$ReventlessAws.walk(dirB)[0].contentHash;
|
|
123
123
|
globalThis.expect(hashA === hashB).toBe(false);
|
|
124
|
-
|
|
124
|
+
Nodefs.rmSync(dirA, {
|
|
125
125
|
recursive: true,
|
|
126
126
|
force: true
|
|
127
127
|
});
|
|
128
|
-
|
|
128
|
+
Nodefs.rmSync(dirB, {
|
|
129
129
|
recursive: true,
|
|
130
130
|
force: true
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
133
|
globalThis.test("throws when assetsDir does not exist", () => {
|
|
134
|
-
let missing =
|
|
134
|
+
let missing = Nodepath.join(Nodeos.tmpdir(), "static-bundle-does-not-exist-xyz123");
|
|
135
135
|
let threw;
|
|
136
136
|
try {
|
|
137
137
|
Util_StaticBundle$ReventlessAws.walk(missing);
|
|
@@ -145,16 +145,16 @@ globalThis.describe("Util_StaticBundle.walk", () => {
|
|
|
145
145
|
|
|
146
146
|
globalThis.describe("Util_StaticBundle.readJsonFileVerbatim", () => {
|
|
147
147
|
let writeTmp = contents => {
|
|
148
|
-
let dir =
|
|
149
|
-
let path =
|
|
150
|
-
|
|
148
|
+
let dir = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "ui-hints-"));
|
|
149
|
+
let path = Nodepath.join(dir, "ui-hints.json");
|
|
150
|
+
Nodefs.writeFileSync(path, contents, "utf8");
|
|
151
151
|
return path;
|
|
152
152
|
};
|
|
153
153
|
globalThis.test("returns the file's exact bytes for valid JSON (verbatim, not re-serialised)", () => {
|
|
154
154
|
let raw = "{\n \"dashboards\": [ ] \n}\n";
|
|
155
155
|
let path = writeTmp(raw);
|
|
156
156
|
globalThis.expect(Util_StaticBundle$ReventlessAws.readJsonFileVerbatim(path, "test")).toBe(raw);
|
|
157
|
-
|
|
157
|
+
Nodefs.rmSync(path, {
|
|
158
158
|
recursive: true,
|
|
159
159
|
force: true
|
|
160
160
|
});
|
|
@@ -169,13 +169,13 @@ globalThis.describe("Util_StaticBundle.readJsonFileVerbatim", () => {
|
|
|
169
169
|
threw = true;
|
|
170
170
|
}
|
|
171
171
|
globalThis.expect(threw).toBe(true);
|
|
172
|
-
|
|
172
|
+
Nodefs.rmSync(path, {
|
|
173
173
|
recursive: true,
|
|
174
174
|
force: true
|
|
175
175
|
});
|
|
176
176
|
});
|
|
177
177
|
globalThis.test("throws when the file does not exist", () => {
|
|
178
|
-
let missing =
|
|
178
|
+
let missing = Nodepath.join(Nodeos.tmpdir(), "ui-hints-missing-xyz123.json");
|
|
179
179
|
let threw;
|
|
180
180
|
try {
|
|
181
181
|
Util_StaticBundle$ReventlessAws.readJsonFileVerbatim(missing, "test");
|