-
Notifications
You must be signed in to change notification settings - Fork 1
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
86byre0hx: Implemented sentry generator #23
base: main
Are you sure you want to change the base?
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.
@rbd2q Could you please address the following feedback?
|
||
Sentry.init({ | ||
// TODO replace with your DSN | ||
dsn: '', |
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.
@rbd2q Let's add one more question to the Sentry generator schema to prompt the user to enter the DSN, paste the provided DSN value here and remove the TODO
comment above.
|
||
Sentry.init({ | ||
// TODO replace with your DSN | ||
dsn: '', |
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.
@rbd2q Let's add one more question to the Sentry generator schema to prompt the user to enter the DSN, paste the provided DSN value here and remove the TODO
comment above.
import * as path from 'path'; | ||
import { SentryGeneratorSchema } from './schema'; | ||
|
||
const webDependencies = { |
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.
@rbd2q I'd suggest to rename this to nextAppDependencies
.
const webDependencies = { | |
const nextAppDependencies = { |
'@sentry/nextjs': '^8.21.0', | ||
}; | ||
|
||
const mobileDependencies = { |
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.
@rbd2q I'd suggest to rename this to expoAppDependencies
.
const mobileDependencies = { | |
const expoAppDependencies = { |
) { | ||
const projectRoot = `apps/${options.directory}`; | ||
|
||
if (tree.exists(`${projectRoot}/next.config.js`)) { |
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.
@rbd2q Let's create an utility function called isNextApp
and use it here.
}); | ||
|
||
generateFiles(tree, path.join(__dirname, 'files'), projectRoot, options); | ||
} else if (tree.exists(`${projectRoot}/metro.config.js`)) { |
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.
@rbd2q Let's create an utility function called isExpoApp
and use it here.
const nextConfigContent = tree | ||
.read(`${projectRoot}/next.config.js`) | ||
.toString() | ||
.replace( |
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.
@rbd2q Unfortunately, the method of replacing anchor strings is unreliable and will eventually fail without warning. This can happen if someone changes the anchors, e.g. by adding or rearranging imports.
Can we instead work directly with the Abstract Syntax Tree (AST)? This would make the generator more stable and less reliant on specific anchors.
For more details and an example, see: https://nx.dev/extending-nx/recipes/modifying-files#ast-manipulation.
|
||
Sentry.init({ | ||
// TODO replace with your DSN | ||
dsn: '', |
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.
@rbd2q Let's add one more question to the Sentry generator schema to prompt the user to enter the DSN, paste the provided DSN value here and remove the TODO
comment above.
No description provided.