-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup local testing for PurchaseTester Typescript #326
Setup local testing for PurchaseTester Typescript #326
Conversation
d12cdf4
to
fef8eb9
Compare
resolver: { | ||
// Tells metro to look at for `react-native-purchases` | ||
// This fixes issues with referencing file in package.json which | ||
// creates a symlink and metro can't handle symlinks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 on the comment!
resolverMainFields: ['source', 'react-native', 'main'], // will first look the source then main | ||
}, | ||
|
||
// Metro will automatically update when something is changed in this path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😻
}, | ||
}; | ||
// IMPORTANT | ||
// Make sure `npm install` is run in this refernced package's directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Make sure `npm install` is run in this refernced package's directory | |
// Make sure `npm install` is run in this referenced package's directory |
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos are going to be my legacy at RevenueCat but I'll fix it this one time 🙃
@@ -408,7 +408,7 @@ DEPENDENCIES: | |||
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) | |||
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) | |||
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) | |||
- RNPurchases (from `../../../`) | |||
- RNPurchases (from `../../..`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this get set now that it's not in the podfile? is that what metro is doing 😅 sorry if this is a dumb question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah! Not dumb question at all. This is auto linked with the introduction of the new react-native.config.js
file. So whenever pod install
is run, RN looks inside of react-native.config.js
and will see this path and install it with cocoa pods
* Initial commit of purchaseTester typescript example * Made things a little prettier for offering detail * Removed console log * Typescript example using local RNPurchases pod * Fix some things were states weren't updating * Trying to fix CircleCI * This is it * name isn't a thing for the RN builds * name also isn't a thing for iOS RN builds * Add set attributes which isnt really working yet * Fix broken test * Fix broken test... again * Ignore package-lock.json, try using rn/yarn_install on circleci, move RC init to app.tsx * Trying to get yarn_install to run in the example directory * Change yarn cache folder * Try bringing in the yarn install from the orb for testing * Try yarn cwd before calling rn/yarn_install * That didn't work * This should fix android * This should fix macos symlink issue * Reset cache to see if fix worked * Lets start over on circleci * Add path for yarn pod * Experimenting * This should do it * --cwd doesnt work with yarn pods * Need to warn install both examples * Try with rn/yarn_install but copied over with path param * Forgot to replace cache path * Cleanup because things works :) * Need to put path to ios directory * Use conditional logic and use --cwd if not empty string * Rename to use standard revenuecat tester package and bundle id * Bump to react-native-community/[email protected] * Rename isSetup to hasKeys * Setup local testing for PurchaseTester Typescript (#326) * This works so much better for local testing * Updated comments to be more helpful * Fixed typo * Need to await the initial fetchData * Rename storekit config file and add second target that does not use sk config file Co-authored-by: Josh Holtz <[email protected]>
Follow up to #320
Motivation
Use local repo for
react-native-purchases
instead of pointing to published version to use for local developmentDescription
react-native.config.js
to define local decency for auto linkingmetro.config.js
to:package.json
withnodeModulesPath
andwatchFolders
resolverMainFields
to look atsource
soreact-native-purchases
doesn't use the compileddist
.circleci/config.yml
yarn install
(ornpm install
) in the root directory because this as local dependency needs its ownnode_modules