Skip to content

Commit a009003

Browse files
committed
fix(types): clean up some app types
1 parent f84cf0f commit a009003

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@commitlint/cli": "^17.8.0",
5454
"@commitlint/config-conventional": "^17.8.0",
5555
"@openapi-typescript-infra/coconfig": "^4.2.1",
56-
"@openapi-typescript-infra/service": "^3.0.2",
56+
"@openapi-typescript-infra/service": "^3.0.3",
5757
"@semantic-release/changelog": "^6.0.3",
5858
"@semantic-release/commit-analyzer": "^11.0.0",
5959
"@semantic-release/exec": "^6.0.3",

src/index.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import type {
1616
ServiceExpress,
1717
ServiceLocals,
1818
ServiceStartOptions,
19+
AnyServiceLocals,
20+
ConfigurationSchema,
1921
} from '@openapi-typescript-infra/service';
2022

2123
let app: ServiceExpress | undefined;
@@ -47,7 +49,7 @@ async function getRootDirectory(cwd: string, root?: string) {
4749
}
4850

4951
async function readOptions<
50-
SLocals extends ServiceLocals = ServiceLocals,
52+
SLocals extends AnyServiceLocals = ServiceLocals<ConfigurationSchema>,
5153
RLocals extends RequestLocals = RequestLocals,
5254
>(
5355
cwd: string,
@@ -110,20 +112,23 @@ class RequestTestingHelpers {
110112
}
111113
}
112114

113-
export interface ServiceUnderTest<SLocals extends ServiceLocals = ServiceLocals>
114-
extends ServiceExpress<SLocals> {
115+
export interface ServiceUnderTest<
116+
SLocals extends AnyServiceLocals = ServiceLocals<ConfigurationSchema>,
117+
> extends ServiceExpress<SLocals> {
115118
test: RequestTestingHelpers;
116119
}
117120

118-
export function getExistingApp<SLocals extends ServiceLocals = ServiceLocals>() {
121+
export function getExistingApp<
122+
SLocals extends AnyServiceLocals = ServiceLocals<ConfigurationSchema>,
123+
>() {
119124
if (!app) {
120125
throw new Error('getExistingApp requires a running app, and there is not one available.');
121126
}
122127
return app as ServiceUnderTest<SLocals>;
123128
}
124129

125130
export async function getReusableApp<
126-
SLocals extends ServiceLocals = ServiceLocals,
131+
SLocals extends AnyServiceLocals = ServiceLocals<ConfigurationSchema>,
127132
RLocals extends RequestLocals = RequestLocals,
128133
>(
129134
initialOptions?:

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ __metadata:
669669
"@commitlint/cli": ^17.8.0
670670
"@commitlint/config-conventional": ^17.8.0
671671
"@openapi-typescript-infra/coconfig": ^4.2.1
672-
"@openapi-typescript-infra/service": ^3.0.2
672+
"@openapi-typescript-infra/service": ^3.0.3
673673
"@semantic-release/changelog": ^6.0.3
674674
"@semantic-release/commit-analyzer": ^11.0.0
675675
"@semantic-release/exec": ^6.0.3
@@ -700,9 +700,9 @@ __metadata:
700700
languageName: unknown
701701
linkType: soft
702702

703-
"@openapi-typescript-infra/service@npm:^3.0.2":
704-
version: 3.0.2
705-
resolution: "@openapi-typescript-infra/service@npm:3.0.2"
703+
"@openapi-typescript-infra/service@npm:^3.0.3":
704+
version: 3.0.3
705+
resolution: "@openapi-typescript-infra/service@npm:3.0.3"
706706
dependencies:
707707
"@godaddy/terminus": ^4.12.1
708708
"@opentelemetry/api": ^1.6.0
@@ -740,7 +740,7 @@ __metadata:
740740
read-pkg-up: ^7.0.1
741741
bin:
742742
start-service: build/bin/start-service.js
743-
checksum: 1a622c790a8c4dcaba609ff92dab602b1372acab7c54a1547f4ecc43e4444fa9cd86f1d157ca46b3dd10efaca0767478f76b53d692554e94932fd7442bc1b04b
743+
checksum: bb4a6ca2a33326815a021916cfd19598fe36322888eb735cf8fd3071fc36652330943a7d41ddca376dd7f6b6f6ff02772ccfc49dc8622f51b4596e4e6abe2dae
744744
languageName: node
745745
linkType: hard
746746

0 commit comments

Comments
 (0)