Skip to content

Conversation

@SgtPooki
Copy link
Collaborator

@SgtPooki SgtPooki commented Nov 21, 2025

  • add shared FilecoinPinAPI contract and mirror exports in index entries
  • consolidate type exports, fix missing dist/index.js
  • add isomorphic package import test covering createCarFromPath behavior
  • update vitest config to run all tests via multiple projects.
    • individual projects can still be ran via npm run test:unit,
      npm run test:integration, npm run test:browser
    • nodejs tests now run: src/test/unit/**/*.(?iso\.)test.js,
    • new browser tests run: src/test/**/*.(?iso\.)test.js
    • integration tests run: src/test/integration/**/*.test.ts (unchanged)
    • npx vitest run - now runs all three separate projects. Cleaned up npm run test script

Related to #182

- add shared FilecoinPinAPI contract and mirror exports in index entries
- consolidate type exports, fix missing dist/index.js
- add isomorphic package import test covering createCarFromPath behavior
- update vitest config to run all tests via multiple projects.
  - individual projects can still be ran via `npm run test:unit`,
    `npm run test:integration`, `npm run test:browser`

Related to #182
@FilOzzy FilOzzy added team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board. labels Nov 21, 2025
@FilOzzy FilOzzy added this to FS Nov 21, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Nov 21, 2025
Copy link
Collaborator Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

Copilot finished reviewing on behalf of SgtPooki November 21, 2025 20:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the main exports between Node.js and browser environments by introducing a shared FilecoinPinAPI contract that both entry points satisfy. The changes consolidate type exports, add an isomorphic package import test, and update the vitest configuration to run tests across multiple projects (unit, integration, and browser).

Key Changes:

  • Introduced shared FilecoinPinAPI interface with consistent exports across index.ts and index.browser.ts
  • Added multi-project vitest configuration supporting Node.js unit tests, integration tests, and browser tests
  • Created isomorphic test pattern (.iso.test.ts) that runs in both Node.js and browser environments

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.ts Configures three test projects (unit, integration, browser) with appropriate include patterns for each environment
src/test/unit/package-import.iso.test.ts Adds isomorphic test verifying package imports work correctly in both Node.js and browser environments
src/test/unit/core-data-set.test.ts Adds biome-ignore comment for vitest mock implementation style
src/index.ts New Node.js entry point exporting full API including createCarFromPath
src/index.browser.ts New browser entry point with stub for Node-only createCarFromPath function
src/index-types.ts Defines shared FilecoinPinAPI interface and re-exports all public types
package.json Adds browser export conditions, updates test scripts, and adds browser testing dependencies
README.md Documents the new test:browser npm script

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SgtPooki SgtPooki marked this pull request as ready for review November 21, 2025 20:40
@SgtPooki SgtPooki requested review from BigLep and rvagg November 21, 2025 20:40
Copy link
Collaborator Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

@SgtPooki SgtPooki merged commit 70dd804 into master Nov 24, 2025
12 checks passed
@SgtPooki SgtPooki deleted the fix/high-level-api branch November 24, 2025 21:23
@github-project-automation github-project-automation bot moved this from 📌 Triage to 🎉 Done in FS Nov 24, 2025
@rvagg
Copy link
Member

rvagg commented Nov 25, 2025

I think we should just pick a lane on this and not make it fit everyone's preferences, that's a losing game to play. I'm fine not using default exports, they struggled out of the gate with bad and inconsistent bundler support and I think most people have just got used to not using them. I like explicitness too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants