Conversation
There was a problem hiding this comment.
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 supportedfirebase/*entry points and stream package outputs throughexportsinpackage.json. - Remove custom
postbuild.jsversion replacer in favor of tsup, and update scripts/devDependencies accordingly. - Introduce two new example directories (
examples/esmandexamples/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 removingpostbuild.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__");
HassanBahati
approved these changes
May 30, 2025
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
migrates to tsup for multiple build outputs (ensuring broader bundler/syntax support)
adds two simple examples to the SDK
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)
removes an outdated test