Skip to content

Commit b308671

Browse files
authored
refactor(legacy adapter): add MIGRATION.md deeplinks (#892)
1 parent ba740e9 commit b308671

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/legacy/options-adapter.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export function legacyOptionsAdapter<TReq, TRes>(
3131
if (typeof legacyContext === 'string' && !!url.parse(legacyContext).host) {
3232
throw new Error(
3333
`Shorthand syntax is removed from legacyCreateProxyMiddleware().
34-
Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead.`
34+
Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead.
35+
36+
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-shorthand-usage
37+
`
3538
);
3639
}
3740

@@ -49,7 +52,7 @@ export function legacyOptionsAdapter<TReq, TRes>(
4952
pathFilter: '${legacyContext}',
5053
}
5154
52-
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md
55+
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-context-argument
5356
`
5457
);
5558
} else if (legacyContext && !legacyOptions) {
@@ -74,7 +77,7 @@ export function legacyOptionsAdapter<TReq, TRes>(
7477
},
7578
}
7679
77-
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md
80+
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#refactored-proxy-events
7881
`
7982
);
8083
}
@@ -97,7 +100,7 @@ export function legacyOptionsAdapter<TReq, TRes>(
97100
logger: console,
98101
}
99102
100-
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md
103+
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-logprovider-and-loglevel-options
101104
`
102105
);
103106
}

test/legacy/http-proxy-middleware.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ describe('legacyCreateProxyMiddleware()', () => {
1313
expect(() => legacyCreateProxyMiddleware(`http://localhost:${mockServer.port}`))
1414
.toThrowErrorMatchingInlineSnapshot(`
1515
"Shorthand syntax is removed from legacyCreateProxyMiddleware().
16-
Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead."
16+
Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead.
17+
18+
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-shorthand-usage
19+
"
1720
`);
1821
});
1922

0 commit comments

Comments
 (0)