Skip to content

Mark @fedify/fixture as external in test build configs#635

Merged
dahlia merged 5 commits intofedify-dev:2.0-maintenancefrom
dahlia:fix/externalize-fedify-fixture-in-tsdown
Mar 18, 2026
Merged

Mark @fedify/fixture as external in test build configs#635
dahlia merged 5 commits intofedify-dev:2.0-maintenancefrom
dahlia:fix/externalize-fedify-fixture-in-tsdown

Conversation

@dahlia
Copy link
Member

@dahlia dahlia commented Mar 18, 2026

Closes #634

Summary

pnpm pack --recursive fails because several packages' tsdown test build configurations try to bundle @fedify/fixture instead of treating it as an external dependency. Since @fedify/fixture is a private workspace package, its dist/ may not exist when parallel prepack builds run, causing UNLOADABLE_DEPENDENCY errors.

Changes

Added "@fedify/fixture" to the external array in the test build config of:

  • packages/webfinger/tsdown.config.ts
  • packages/vocab/tsdown.config.ts
  • packages/fedify/tsdown.config.ts
  • packages/vocab-runtime/tsdown.config.ts

This aligns them with @fedify/testing, which already correctly externalizes @fedify/fixture.

During `pnpm pack --recursive`, tsdown tried to bundle @fedify/fixture
in the test build configs of several packages.  Since @fedify/fixture is
a private workspace package, its dist/ may not exist when parallel
prepack builds run, causing UNLOADABLE_DEPENDENCY errors.

Add "@fedify/fixture" to the external array in the test build config of:

 -  @fedify/webfinger
 -  @fedify/vocab
 -  @fedify/fedify
 -  @fedify/vocab-runtime

This aligns them with @fedify/testing, which already correctly
externalizes @fedify/fixture.

Co-authored-by: Amp (https://ampcode.com)
Amp-Thread-ID: https://ampcode.com/threads/T-019d00c0-4bd0-70fe-b81f-82e3738959e9
Co-authored-by: Amp <amp@ampcode.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical build failure encountered during the pnpm pack --recursive process. The root cause was the incorrect bundling of the private workspace package @fedify/fixture within several test build configurations, leading to UNLOADABLE_DEPENDENCY errors. By explicitly marking @fedify/fixture as an external dependency in the affected tsdown.config.ts files, the build process is stabilized, ensuring proper package resolution and preventing future failures.

Highlights

  • Build Fix: Resolved an issue where pnpm pack --recursive failed due to @fedify/fixture being incorrectly bundled instead of treated as an external dependency in test build configurations.
  • Configuration Alignment: Updated the tsdown.config.ts files for packages/fedify, packages/vocab-runtime, packages/vocab, and packages/webfinger to explicitly mark @fedify/fixture as an external dependency, aligning them with the existing configuration of @fedify/testing.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dahlia
Copy link
Member Author

dahlia commented Mar 18, 2026

@codex review

@dahlia dahlia self-assigned this Mar 18, 2026
@dahlia dahlia added type/bug Something isn't working component/build Build system and packaging labels Mar 18, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a build issue where @fedify/fixture was being bundled by tsdown in test configurations, causing UNLOADABLE_DEPENDENCY errors. By marking @fedify/fixture as an external dependency in the tsdown.config.ts files for fedify, vocab-runtime, vocab, and webfinger, you ensure that the bundler does not try to include it in the build output.

My review found one related issue: the package.json for @fedify/vocab-runtime is missing @fedify/fixture in its devDependencies. While your change prevents the bundling error, the missing dependency declaration could cause runtime errors in Node.js or Bun environments. I've left a comment with details on how to resolve this to ensure consistency with the project's contribution guidelines.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f3576f3c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dahlia and others added 2 commits March 18, 2026 21:02
…e bundled

The cfworkers test harness imports dist/testing/mod.js, which re-exports
testDefinitions from @fedify/fixture.  Marking @fedify/fixture as
external in that build config would break test:cfworkers since the
private package would not be available at runtime in Wrangler.

Split the second defineConfig into two:

 -  One for src/testing/mod.ts (without @fedify/fixture external),
    so cfworkers can bundle it
 -  One for src/**/*.test.ts (with @fedify/fixture external),
    so pnpm pack --recursive does not try to resolve it

fedify-dev#635 (comment)

Co-authored-by: Amp (https://ampcode.com)
Amp-Thread-ID: https://ampcode.com/threads/T-019d00c0-4bd0-70fe-b81f-82e3738959e9
Co-authored-by: Amp <amp@ampcode.com>
@dahlia
Copy link
Member Author

dahlia commented Mar 18, 2026

@codex review

@dahlia
Copy link
Member Author

dahlia commented Mar 18, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly identifies and fixes a build issue where @fedify/fixture was being bundled during test builds, causing errors with pnpm pack. The changes across webfinger, vocab, and vocab-runtime correctly mark @fedify/fixture as an external dependency.

In packages/fedify/tsdown.config.ts, you've split the configuration, which is a good approach. However, it appears that @fedify/fixture was missed in the external array for the src/testing/mod.ts build configuration. Since this module re-exports from @fedify/fixture, it should also be treated as external to prevent bundling issues. I've added a suggestion to address this.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 484b5b45b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The previous approach of splitting src/testing/mod.ts into a separate
defineConfig caused the cfworkers build to fail because tsdown flattened
the single-entry output to dist/mod.js instead of dist/testing/mod.js,
breaking the import in src/cfworkers/server.ts.

Instead, keep src/testing/mod.ts and *.test.ts in a single defineConfig
(preserving directory structure in output), mark @fedify/fixture as
external, and use noExternal with a function to selectively bundle it
back in only when imported from src/testing/ files.  This way:

 -  The cfworkers build gets @fedify/fixture inlined in testing/mod.js
 -  Test files keep @fedify/fixture external, avoiding the
    UNLOADABLE_DEPENDENCY error during pnpm pack --recursive

https://github.com/fedify-dev/fedify/actions/runs/23243929108/job/67567201018

Co-authored-by: Amp (https://ampcode.com)
Amp-Thread-ID: https://ampcode.com/threads/T-019d00c0-4bd0-70fe-b81f-82e3738959e9
Co-authored-by: Amp <amp@ampcode.com>
@dahlia
Copy link
Member Author

dahlia commented Mar 18, 2026

@codex review

@dahlia
Copy link
Member Author

dahlia commented Mar 18, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a build failure with pnpm pack --recursive by marking the private workspace package @fedify/fixture as external in the test build configurations for several packages. The changes are logical and consistent across the modified files. However, I've identified a potential edge case in the noExternal logic for the @fedify/fedify package where the path matching could be too broad. My review includes a suggestion to make this logic more robust.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb6924c1f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Use "/src/testing/" instead of "/testing/" in the noExternal importer
path check to avoid false positives when the project itself is located
under a directory path containing "/testing/".

fedify-dev#635 (comment)

Co-authored-by: Amp (https://ampcode.com)
Amp-Thread-ID: https://ampcode.com/threads/T-019d00c0-4bd0-70fe-b81f-82e3738959e9
Co-authored-by: Amp <amp@ampcode.com>
@dahlia
Copy link
Member Author

dahlia commented Mar 18, 2026

@codex review

@dahlia
Copy link
Member Author

dahlia commented Mar 18, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a build issue by marking @fedify/fixture as an external dependency in the test build configurations for several packages. The changes in the tsdown.config.ts files are appropriate and should resolve the pnpm pack failure. I have one minor suggestion for the documentation to maintain consistency in heading capitalization.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd336d2a5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dahlia dahlia merged commit 50ac1c1 into fedify-dev:2.0-maintenance Mar 18, 2026
15 checks passed
@dahlia dahlia deleted the fix/externalize-fedify-fixture-in-tsdown branch March 18, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/build Build system and packaging type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm pack --recursive fails due to @fedify/fixture not marked as external in test build configs

1 participant