Skip to content

Commit 50ac1c1

Browse files
authored
Merge pull request #635 from dahlia/fix/externalize-fedify-fixture-in-tsdown
Mark `@fedify/fixture` as external in test build configs
2 parents 8014e61 + bd336d2 commit 50ac1c1

5 files changed

Lines changed: 17 additions & 9 deletions

File tree

docs/cli.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,19 @@ project. It will ask you a few questions to set up the project:
244244
Alternatively, you can specify the options in the command line to skip some of
245245
interactive prompts:
246246

247-
[npm]: https://www.npmjs.com/
248-
[pnpm]: https://pnpm.io/
249-
[Yarn]: https://yarnpkg.com/
250247
[Hono]: https://hono.dev/
251248
[Elysia]: https://elysiajs.com/
252249
[Express]: https://expressjs.com/
253250
[Nitro]: https://nitro.unjs.io/
254251
[Next.js]: https://nextjs.org/
252+
[npm]: https://www.npmjs.com/
253+
[pnpm]: https://pnpm.io/
254+
[Yarn]: https://yarnpkg.com/
255255
[Redis]: https://redis.io/
256256
[PostgreSQL]: https://www.postgresql.org/
257-
[Deno KV]: https://deno.com/kv
258257
[AMQP]: https://www.amqp.org/
259258
[RabbitMQ]: https://www.rabbitmq.com/
259+
[Deno KV]: https://deno.com/kv
260260
[`@fedify/lint`]: /manual/lint
261261
[`@fedify/create`]: https://www.npmjs.com/package/@fedify/create
262262

@@ -282,7 +282,7 @@ the `-w`/`--web-framework` option. The available options are:
282282
- `elysia`: [Elysia]
283283
- `express`: [Express]
284284

285-
### `-k`/`--kv-store`: Key–value store
285+
### `-k`/`--kv-store`: key–value store
286286

287287
You can specify the key–value store to use by using the `-k`/`--kv-store`
288288
option. The available options are:

packages/fedify/tsdown.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ export default [
4040
...(await Array.fromAsync(glob(`src/**/*.test.ts`)))
4141
.map((f) => f.replace(sep, "/")),
4242
],
43-
external: [/^node:/],
43+
external: [/^node:/, "@fedify/fixture"],
44+
// Bundle @fedify/fixture back in for src/testing/ files (needed for
45+
// cfworkers), while keeping it external for test files so that
46+
// pnpm pack --recursive does not try to resolve the private package:
47+
noExternal: (id: string, importer: string | undefined) => {
48+
if (id !== "@fedify/fixture") return false;
49+
const normalized = importer?.replaceAll(sep, "/");
50+
return normalized?.includes("/src/testing/") ?? false;
51+
},
4452
inputOptions: {
4553
onwarn(warning, defaultHandler) {
4654
if (

packages/vocab-runtime/tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ export default [
1616
.map((f) => f.replace(sep, "/")),
1717
format: ["esm", "cjs"],
1818
platform: "node",
19-
external: [/^node:/],
19+
external: [/^node:/, "@fedify/fixture"],
2020
}),
2121
];

packages/vocab/tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default [
2727
defineConfig({
2828
entry: (await Array.fromAsync(glob(`src/**/*.test.ts`)))
2929
.map((f) => f.replace(sep, "/")),
30-
external: [/^node:/],
30+
external: [/^node:/, "@fedify/fixture"],
3131
inputOptions: {
3232
onwarn(warning, defaultHandler) {
3333
if (

packages/webfinger/tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export default [
1515
.map((f) => f.replace(sep, "/")),
1616
format: ["esm", "cjs"],
1717
platform: "node",
18-
external: [/^node:/],
18+
external: [/^node:/, "@fedify/fixture"],
1919
}),
2020
];

0 commit comments

Comments
 (0)