Skip to content

fix: web SDK build process#685

Merged
cabljac merged 7 commits intonextfrom
fix-web-sdk-deps
Jun 3, 2025
Merged

fix: web SDK build process#685
cabljac merged 7 commits intonextfrom
fix-web-sdk-deps

Conversation

@cabljac
Copy link
Copy Markdown
Collaborator

@cabljac cabljac commented May 30, 2025

This PR:

  1. migrates to tsup for multiple build outputs (ensuring broader bundler/syntax support)

  2. adds two simple examples to the SDK

  3. switches from a direct dependency on @firebase-scoped packages to a peerDependency on firebase, with the supported versions specified in the package.json
    (ideally should cause less conflicts with package versions)

  4. removes an outdated test

@cabljac cabljac requested a review from Copilot May 30, 2025 13:52
Copy link
Copy Markdown

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 migrates the SDK’s build to tsup with CommonJS and ESM outputs, aligns Firebase dependencies to a peerDependency, and adds both ESM (Vite) and CommonJS (Webpack) example apps.

  • Replace all @firebase/* imports with the officially supported firebase/* entry points and stream package outputs through exports in package.json.
  • Remove custom postbuild.js version replacer in favor of tsup, and update scripts/devDependencies accordingly.
  • Introduce two new example directories (examples/esm and examples/cjs) with full setup, build configs, and README.

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/product.ts, src/payment.ts, src/init.ts Switched imports/exports from @firebase/* to firebase/*.
postbuild.js Removed obsolete script for version replacement.
package.json Added module/exports, updated scripts, moved Firebase to peer deps and bumped devDeps.
examples/esm/** Added Vite-based ESM example app (config, source, HTML, README).
examples/cjs/** Added Webpack CommonJS example app (config, source, HTML, README).
.gitignore Ignored the generated .tgz and example config files.
Comments suppressed due to low confidence (1)

firestore-stripe-web-sdk/src/init.ts:19

  • The version placeholder __VERSION__ is no longer replaced after removing postbuild.js. Integrate version injection into the tsup build (for example via a define plugin) or restore a replacement step so the correct package version is registered at runtime.
registerVersion("firestore-stripe-payments", "__VERSION__");

Comment thread firestore-stripe-web-sdk/examples/cjs/index.html
Comment thread firestore-stripe-web-sdk/examples/esm/package.json Outdated
@cabljac cabljac force-pushed the fix-web-sdk-deps branch from 5719fd7 to 0583fac Compare May 30, 2025 14:30
@cabljac cabljac requested a review from HassanBahati May 30, 2025 15:57
@cabljac cabljac merged commit 898558b into next Jun 3, 2025
3 checks passed
cabljac added a commit that referenced this pull request Jun 5, 2025
* refactor: update sdk build process

* fix: use peerdep instead

* docs: add esm example

* test: remove outdated test

* chore: improve example dep setup

* docs: update example docs

* chore: simplify webpack config in example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants