Skip to content

Commit 3ec92ac

Browse files
committed
chore: update
1 parent a811c95 commit 3ec92ac

File tree

5 files changed

+43
-21
lines changed

5 files changed

+43
-21
lines changed

tests/integration/redirect/dts.test.ts

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,27 @@ test('redirect.dts default', async () => {
2222
import type { LoggerOptions } from './types';
2323
import { defaultOptions } from './types.js';
2424
export { logRequest, logger, type LoggerOptions, defaultOptions };
25-
export type { Foo } from './logger';
25+
export type { Foo } from './types';
26+
export type { Bar } from './types';
2627
export * from './types';
2728
export * from '../../../compile/rslog';
2829
export * from './logger';
2930
",
3031
"<ROOT>/tests/integration/redirect/dts/dist/default/esm/logger.d.ts": "import type { Request } from 'express';
3132
import type { LoggerOptions } from './types';
3233
export declare function logRequest(req: Request, options: LoggerOptions): void;
33-
export interface Foo {
34-
bar: string;
35-
}
3634
",
3735
"<ROOT>/tests/integration/redirect/dts/dist/default/esm/types.d.ts": "export interface LoggerOptions {
3836
logLevel: 'info' | 'debug' | 'warn' | 'error';
3937
logBody: boolean;
4038
}
4139
export declare const defaultOptions: LoggerOptions;
40+
export interface Foo {
41+
foo: string;
42+
}
43+
export interface Bar {
44+
bar: string;
45+
}
4246
",
4347
}
4448
`);
@@ -57,23 +61,27 @@ test('redirect.dts.path false', async () => {
5761
import type { LoggerOptions } from './types';
5862
import { defaultOptions } from './types.js';
5963
export { logRequest, logger, type LoggerOptions, defaultOptions };
60-
export type { Foo } from '@src/logger';
64+
export type { Foo } from '@src/types';
65+
export type { Bar } from 'types';
6166
export * from './types';
6267
export * from 'rslog';
6368
export * from '@src/logger';
6469
",
6570
"<ROOT>/tests/integration/redirect/dts/dist/path-false/esm/logger.d.ts": "import type { Request } from 'express';
6671
import type { LoggerOptions } from './types';
6772
export declare function logRequest(req: Request, options: LoggerOptions): void;
68-
export interface Foo {
69-
bar: string;
70-
}
7173
",
7274
"<ROOT>/tests/integration/redirect/dts/dist/path-false/esm/types.d.ts": "export interface LoggerOptions {
7375
logLevel: 'info' | 'debug' | 'warn' | 'error';
7476
logBody: boolean;
7577
}
7678
export declare const defaultOptions: LoggerOptions;
79+
export interface Foo {
80+
foo: string;
81+
}
82+
export interface Bar {
83+
bar: string;
84+
}
7785
",
7886
}
7987
`);
@@ -92,23 +100,27 @@ test('redirect.dts.extension true', async () => {
92100
import type { LoggerOptions } from './types.js';
93101
import { defaultOptions } from './types.js';
94102
export { logRequest, logger, type LoggerOptions, defaultOptions };
95-
export type { Foo } from './logger.js';
103+
export type { Foo } from './types.js';
104+
export type { Bar } from './types.js';
96105
export * from './types.js';
97106
export * from '../../../compile/rslog';
98107
export * from './logger.js';
99108
",
100109
"<ROOT>/tests/integration/redirect/dts/dist/extension-true/esm/logger.d.ts": "import type { Request } from 'express';
101110
import type { LoggerOptions } from './types.js';
102111
export declare function logRequest(req: Request, options: LoggerOptions): void;
103-
export interface Foo {
104-
bar: string;
105-
}
106112
",
107113
"<ROOT>/tests/integration/redirect/dts/dist/extension-true/esm/types.d.ts": "export interface LoggerOptions {
108114
logLevel: 'info' | 'debug' | 'warn' | 'error';
109115
logBody: boolean;
110116
}
111117
export declare const defaultOptions: LoggerOptions;
118+
export interface Foo {
119+
foo: string;
120+
}
121+
export interface Bar {
122+
bar: string;
123+
}
112124
",
113125
}
114126
`);
@@ -127,23 +139,27 @@ test('redirect.dts.extension true with dts.autoExtension true', async () => {
127139
import type { LoggerOptions } from './types.mjs';
128140
import { defaultOptions } from './types.mjs';
129141
export { logRequest, logger, type LoggerOptions, defaultOptions };
130-
export type { Foo } from './logger.mjs';
142+
export type { Foo } from './types.mjs';
143+
export type { Bar } from './types.mjs';
131144
export * from './types.mjs';
132145
export * from '../../../compile/rslog';
133146
export * from './logger.mjs';
134147
",
135148
"<ROOT>/tests/integration/redirect/dts/dist/auto-extension-true/esm/logger.d.mts": "import type { Request } from 'express';
136149
import type { LoggerOptions } from './types.mjs';
137150
export declare function logRequest(req: Request, options: LoggerOptions): void;
138-
export interface Foo {
139-
bar: string;
140-
}
141151
",
142152
"<ROOT>/tests/integration/redirect/dts/dist/auto-extension-true/esm/types.d.mts": "export interface LoggerOptions {
143153
logLevel: 'info' | 'debug' | 'warn' | 'error';
144154
logBody: boolean;
145155
}
146156
export declare const defaultOptions: LoggerOptions;
157+
export interface Foo {
158+
foo: string;
159+
}
160+
export interface Bar {
161+
bar: string;
162+
}
147163
",
148164
}
149165
`);

tests/integration/redirect/dts/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { defaultOptions } from './types.js';
55

66
export { logRequest, logger, type LoggerOptions, defaultOptions };
77

8-
export type { Foo } from '@src/logger';
8+
export type { Foo } from '@src/types';
9+
export type { Bar } from 'types';
910
export * from './types';
1011
export * from 'rslog';
1112
export * from '@src/logger';

tests/integration/redirect/dts/src/logger.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@ export function logRequest(req: Request, options: LoggerOptions): void {
2323
console.log('Request body:', req.body);
2424
}
2525
}
26-
27-
export interface Foo {
28-
bar: string;
29-
}

tests/integration/redirect/dts/src/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ export const defaultOptions: LoggerOptions = {
77
logLevel: 'info',
88
logBody: false,
99
};
10+
11+
export interface Foo {
12+
foo: string;
13+
}
14+
15+
export interface Bar {
16+
bar: string;
17+
}

tests/integration/redirect/dts/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"strict": true,
44
"skipLibCheck": true,
55
"paths": {
6+
"*": ["./src/*"],
67
"@src/*": ["./src/*"],
78
"rslog": ["./compile/rslog"]
89
}

0 commit comments

Comments
 (0)