-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Push Notifications command #34
Conversation
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.
This is looking great! Thank you for working on this 🙌 I'm still going through this but wanted to get a first round of feedback back.
This should be good for review again. |
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.
Thanks for all of this great work! It seems like it's getting close!
2ce91ff
to
9408e41
Compare
Hi @stevehanson, please let me know if there's anything left on this PR. |
6b7fe39
to
ae3b440
Compare
This includes the addNotifications command itself, an app.config.ts file to include the google service files without changing the contents of app.json directly and a requestNotificationPermission utility to be added separately
… and their imports into the App.tsx file
This will be necessary when dynamically adding imports to ensure the right order is kept.
This will help run linter after performing changes to app files
…ependency, this was causing tests to fail
We thought this was a bit too heavy handed and might interfere with projects that already have native changes being tracked
…or handling to commit actions
Co-authored-by: Stephen Hanson <[email protected]>
Co-authored-by: Stephen Hanson <[email protected]>
…import order in the boilerplate
We decided to discuss it further as part of the eslint-config project instead. For now organizing impots does not affect belt functionality.
84dfc19
to
5cf0a36
Compare
Removed the getProjectDir mock as it should be already covered by the fs-extra mock in __mocks__
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.
Great work!
This PR adds the ability to set up Push Notifications as an independent command to be used after the user executes the initial create setup. It performs the following changes in the project:
useNotifications
hook andrequestNotificationPermission
utilityApp.tsx
file to import and run the hook.gitignore
fileapp.json
file.To achieve some of these changes 3 new utility functions were added:
readAppJson
- returns theapp.json
file as a parsed json objectaddAppJsonConfig
- deep merges a provided ExpoConfig config with the existing content of theapp.json
fileinjectHooks
- takes a list of hooks and their imports, and injects them in theApp.tsx
fileAdditionally, this PR includes new rules for import organizations in the
.eslintrc.js.eta
template, this was necessary to give us the ability to reorganize imports when we inject code/imports in existing files. This will be a repeating scenario as we add more commands to Betl.Preview