fix(repo): add missing tslib dependency to core packages #1789
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.
Description
Fixes "Cannot find module 'tslib'" errors in Expo integration tests by adding
tslibas an explicit dependency to all core packages.Problem
All core packages (auth-js, functions-js, postgrest-js, realtime-js, storage-js) compile with
importHelpers: truein their TypeScript config, which generates code that callstslibhelper functions at runtime. However,tslibwas not declared as a dependency in any of these packages.This worked in most environments due to dependency hoisting (other packages providing
tslib), but failed in isolated environments like our CI Expo tests where packages are installed from tarballs with freshnpm install.Why use tslib in the first place
The monorepo uses
importHelpers: trueintsconfig.base.json, which instructs TypeScript to import helper functions fromtslibinstead of inlining them into every compiled file. This significantly reduces bundle size by avoiding duplication of helper code forasync/await, spread operators, and other TypeScript transformations across all modules. While this was already generatingrequire("tslib")calls in the compiled output, the dependency wasn't explicitly declared, causing it to work only whentslibwas coincidentally available through other packages' dependencies. This fix makes the implicit dependency explicit, ensuring reliability across all installation environments.Solution
Added
[email protected]as a direct dependency to all affected core packages.Type of Change
Related Issues
Fixes Expo Tests CI failure that started appearing in recent runs.
Related fix to the tests
Our tests failed to catch this error before making it to production. A fix is under way, more explanation here:
#1795