Skip to content

Commit f2b3339

Browse files
chore: bump typescript from 6.0.3 to 7.0.2 (#388)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 6.0.3 to 7.0.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Commits](https://github.com/microsoft/TypeScript/commits) --- updated-dependencies: - dependency-name: typescript dependency-version: 7.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent d09276c commit f2b3339

9 files changed

Lines changed: 910 additions & 1662 deletions

package-lock.json

Lines changed: 838 additions & 1622 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,28 @@
66
"name": "the native web GmbH",
77
"email": "hello@thenativeweb.io"
88
},
9+
"type": "module",
910
"exports": {
1011
".": {
11-
"import": {
12-
"types": "./dist/index.d.mts",
13-
"default": "./dist/index.mjs"
14-
},
15-
"require": {
16-
"types": "./dist/index.d.cts",
17-
"default": "./dist/index.cjs"
18-
}
12+
"types": "./dist/index.d.ts",
13+
"default": "./dist/index.js"
1914
}
2015
},
21-
"types": "./dist/index.d.cts",
16+
"types": "./dist/index.d.ts",
17+
"files": ["dist"],
2218
"dependencies": {
2319
"testcontainers": "12.0.4"
2420
},
2521
"devDependencies": {
2622
"@biomejs/biome": "2.5.3",
2723
"@types/node": "26.1.1",
2824
"get-port": "7.2.0",
29-
"tsdown": "0.22.4",
3025
"tsx": "4.23.0",
31-
"typescript": "6.0.3"
26+
"typescript": "7.0.2"
3227
},
3328
"scripts": {
3429
"analyze": "npx tsc --noEmit && npx biome check --error-on-warnings .",
35-
"build": "npx tsc --noEmit && npx tsdown --format cjs,esm --dts --minify --out-dir ./dist ./src/index.ts",
30+
"build": "npx tsc -p tsconfig.build.json",
3631
"format": "npx biome check --write .",
3732
"qa": "npm run analyze && npm run test",
3833
"test": "node --test --import tsx \"./src/**/*.test.ts\""

src/Event.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ suite('Event', { timeout: 30_000 }, () => {
3636
assert.equal(writtenEvents.length, 1);
3737

3838
const writtenEvent = writtenEvents[0];
39+
assert.ok(writtenEvent);
3940

4041
assert.doesNotThrow((): void => {
4142
writtenEvent.verifyHash();
@@ -59,6 +60,7 @@ suite('Event', { timeout: 30_000 }, () => {
5960
assert.equal(writtenEvents.length, 1);
6061

6162
const writtenEvent = writtenEvents[0];
63+
assert.ok(writtenEvent);
6264

6365
const invalidHash = crypto.createHash('sha256').update('invalid hash').digest('hex');
6466
writtenEvent.hash = invalidHash;
@@ -87,6 +89,7 @@ suite('Event', { timeout: 30_000 }, () => {
8789
assert.equal(writtenEvents.length, 1);
8890

8991
const writtenEvent = writtenEvents[0];
92+
assert.ok(writtenEvent);
9093
assert.equal(writtenEvent.signature, null);
9194

9295
const { publicKey: verificationKey } = crypto.generateKeyPairSync('ed25519');
@@ -118,6 +121,7 @@ suite('Event', { timeout: 30_000 }, () => {
118121
assert.equal(writtenEvents.length, 1);
119122

120123
const writtenEvent = writtenEvents[0];
124+
assert.ok(writtenEvent);
121125
assert.notEqual(writtenEvent.signature, null);
122126

123127
const invalidHash = crypto.createHash('sha256').update('invalid hash').digest('hex');
@@ -152,6 +156,7 @@ suite('Event', { timeout: 30_000 }, () => {
152156
assert.equal(writtenEvents.length, 1);
153157

154158
const writtenEvent = writtenEvents[0];
159+
assert.ok(writtenEvent);
155160
assert.notEqual(writtenEvent.signature, null);
156161

157162
writtenEvent.signature += '0123456789abcdef';
@@ -185,6 +190,7 @@ suite('Event', { timeout: 30_000 }, () => {
185190
assert.equal(writtenEvents.length, 1);
186191

187192
const writtenEvent = writtenEvents[0];
193+
assert.ok(writtenEvent);
188194
assert.notEqual(writtenEvent.signature, null);
189195

190196
const verificationKey = container.getVerificationKey();

src/getImageVersionFromDockerfile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ const getImageVersionFromDockerfile = (): string => {
88
const data = fs.readFileSync(dockerfile, 'utf-8');
99

1010
const matches = data.match(versionRegex);
11+
const version = matches?.[1];
1112

12-
if (!matches) {
13+
if (version === undefined) {
1314
throw new Error('Failed to find image version in Dockerfile.');
1415
}
1516

16-
return matches[1];
17+
return version;
1718
};
1819

1920
export { getImageVersionFromDockerfile };

src/observeEvents.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ suite('observeEvents', { timeout: 30_000 }, () => {
168168
}
169169

170170
assert.equal(eventsObserved.length, 1);
171-
assert.equal(eventsObserved[0].data.value, 42);
171+
const [eventObserved] = eventsObserved;
172+
assert.ok(eventObserved);
173+
assert.equal(eventObserved.data.value, 42);
172174
});
173175

174176
test('observes from latest event.', async (): Promise<void> => {
@@ -217,6 +219,8 @@ suite('observeEvents', { timeout: 30_000 }, () => {
217219
}
218220

219221
assert.equal(eventsObserved.length, 1);
220-
assert.equal(eventsObserved[0].data.value, 42);
222+
const [eventObserved] = eventsObserved;
223+
assert.ok(eventObserved);
224+
assert.equal(eventObserved.data.value, 42);
221225
});
222226
});

src/readEvents.test.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,11 @@ suite('readEvents', { timeout: 30_000 }, () => {
129129
}
130130

131131
assert.equal(eventsRead.length, 2);
132-
assert.equal(eventsRead[0].data.value, 23);
133-
assert.equal(eventsRead[1].data.value, 42);
132+
const [firstEventRead, secondEventRead] = eventsRead;
133+
assert.ok(firstEventRead);
134+
assert.ok(secondEventRead);
135+
assert.equal(firstEventRead.data.value, 23);
136+
assert.equal(secondEventRead.data.value, 42);
134137
});
135138

136139
test('reads anti-chronologically.', async (): Promise<void> => {
@@ -165,8 +168,11 @@ suite('readEvents', { timeout: 30_000 }, () => {
165168
}
166169

167170
assert.equal(eventsRead.length, 2);
168-
assert.equal(eventsRead[0].data.value, 42);
169-
assert.equal(eventsRead[1].data.value, 23);
171+
const [firstEventRead, secondEventRead] = eventsRead;
172+
assert.ok(firstEventRead);
173+
assert.ok(secondEventRead);
174+
assert.equal(firstEventRead.data.value, 42);
175+
assert.equal(secondEventRead.data.value, 23);
170176
});
171177

172178
test('reads with lower bound.', async (): Promise<void> => {
@@ -201,7 +207,9 @@ suite('readEvents', { timeout: 30_000 }, () => {
201207
}
202208

203209
assert.equal(eventsRead.length, 1);
204-
assert.equal(eventsRead[0].data.value, 42);
210+
const [eventRead] = eventsRead;
211+
assert.ok(eventRead);
212+
assert.equal(eventRead.data.value, 42);
205213
});
206214

207215
test('reads with upper bound.', async (): Promise<void> => {
@@ -236,7 +244,9 @@ suite('readEvents', { timeout: 30_000 }, () => {
236244
}
237245

238246
assert.equal(eventsRead.length, 1);
239-
assert.equal(eventsRead[0].data.value, 23);
247+
const [eventRead] = eventsRead;
248+
assert.ok(eventRead);
249+
assert.equal(eventRead.data.value, 23);
240250
});
241251

242252
test('reads from latest event.', async (): Promise<void> => {
@@ -275,6 +285,8 @@ suite('readEvents', { timeout: 30_000 }, () => {
275285
}
276286

277287
assert.equal(eventsRead.length, 1);
278-
assert.equal(eventsRead[0].data.value, 42);
288+
const [eventRead] = eventsRead;
289+
assert.ok(eventRead);
290+
assert.equal(eventRead.data.value, 42);
279291
});
280292
});

src/writeEvents.test.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ suite('writeEvents', { timeout: 30_000 }, () => {
3636
const writtenEvents = await client.writeEvents([event]);
3737

3838
assert.equal(writtenEvents.length, 1);
39-
assert.equal(writtenEvents[0].id, '0');
39+
const [writtenEvent] = writtenEvents;
40+
assert.ok(writtenEvent);
41+
assert.equal(writtenEvent.id, '0');
4042
});
4143

4244
test('writes multiple events.', async (): Promise<void> => {
@@ -63,11 +65,15 @@ suite('writeEvents', { timeout: 30_000 }, () => {
6365
const writtenEvents = await client.writeEvents([firstEvent, secondEvent]);
6466
assert.equal(writtenEvents.length, 2);
6567

66-
assert.equal(writtenEvents[0].id, '0');
67-
assert.equal(writtenEvents[0].data.value, 23);
68+
const [firstWrittenEvent, secondWrittenEvent] = writtenEvents;
69+
assert.ok(firstWrittenEvent);
70+
assert.ok(secondWrittenEvent);
6871

69-
assert.equal(writtenEvents[1].id, '1');
70-
assert.equal(writtenEvents[1].data.value, 42);
72+
assert.equal(firstWrittenEvent.id, '0');
73+
assert.equal(firstWrittenEvent.data.value, 23);
74+
75+
assert.equal(secondWrittenEvent.id, '1');
76+
assert.equal(secondWrittenEvent.data.value, 42);
7177
});
7278

7379
test('supports the isSubjectPristine precondition.', async (): Promise<void> => {
@@ -148,8 +154,10 @@ suite('writeEvents', { timeout: 30_000 }, () => {
148154
const writtenEvents = await client.writeEvents([secondEvent], [isSubjectPopulated('/test')]);
149155

150156
assert.equal(writtenEvents.length, 1);
151-
assert.equal(writtenEvents[0].id, '1');
152-
assert.equal(writtenEvents[0].data.value, 42);
157+
const [writtenEvent] = writtenEvents;
158+
assert.ok(writtenEvent);
159+
assert.equal(writtenEvent.id, '1');
160+
assert.equal(writtenEvent.data.value, 42);
153161
});
154162

155163
test('supports the isSubjectOnEventId precondition.', async (): Promise<void> => {

tsconfig.build.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["./src/**/*.test.ts"]
4+
}

tsconfig.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"compilerOptions": {
3-
"declaration": true,
4-
"esModuleInterop": true,
5-
"lib": ["ES2023"],
6-
"module": "esnext",
7-
"moduleResolution": "bundler",
3+
"module": "nodenext",
4+
"target": "esnext",
5+
"lib": ["esnext"],
6+
"types": ["node"],
7+
"noUncheckedIndexedAccess": true,
8+
"noImplicitOverride": true,
9+
"verbatimModuleSyntax": true,
10+
"isolatedModules": true,
11+
"erasableSyntaxOnly": true,
812
"outDir": "dist",
9-
"resolveJsonModule": true,
10-
"strict": true,
11-
"target": "ES2023"
13+
"rootDir": "./src",
14+
"declaration": true
1215
},
13-
"include": ["./src/**/*.ts"],
14-
"exclude": ["./dist"]
16+
"include": ["./src/**/*.ts"]
1517
}

0 commit comments

Comments
 (0)