-
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
#86c0b8vp3: Impement Sentry generator using ast #50
base: main
Are you sure you want to change the base?
Conversation
@dmitryusenko review please! FYI @ipakhomov |
plugin/src/generators/sentry/files/sentry.client.config.ts.template
Outdated
Show resolved
Hide resolved
plugin/src/generators/sentry/files/sentry.edge.config.ts.template
Outdated
Show resolved
Hide resolved
plugin/src/generators/sentry/files/sentry.server.config.ts.template
Outdated
Show resolved
Hide resolved
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.
@RuslanAktaev Looks good to me overall! I've provided the feedback above. Could you please address it?
@dmitryusenko fixed |
@RuslanAktaev Looks good to me, thanks! @ipakhomov Could you please take a look? |
@kerne1s could you please review? |
tree: Tree, | ||
options: SentryGeneratorSchema, | ||
) { | ||
const projectRoot = `apps/${options.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.
can't we use selectProject from utils? So we can remove x-prompt
for directory.
Example: https://github.com/RonasIT/nx-generators/blob/main/plugin/src/generators/react-lib/generator.ts#L22
const expoAppDependencies = { | ||
'@sentry/react-native': '~6.1.0', | ||
}; |
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.
please move it to our dependencies file (Example: sentry > expo > ['@sentry/react-native': '~6.1.0'])
const nextAppDependencies = { | ||
'@sentry/nextjs': '^8.35.0', | ||
}; |
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.
as above
export const isNextApp = (tree: Tree, projectRoot: string): boolean => { | ||
return 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.
let's combine these utils:
export const isNextApp = (tree: Tree, projectRoot: string): boolean => { | |
return tree.exists(`${projectRoot}/next.config.js`); | |
}; | |
export type AppFramework = 'expo' | 'next'; | |
export const isNextApp = (tree: Tree, projectRoot: string): boolean => { | |
return tree.exists(`${projectRoot}/next.config.js`); | |
}; | |
export const isExpoApp = (tree: Tree, projectRoot: string): boolean => { | |
return tree.exists(`${projectRoot}/metro.config.js`); | |
}; | |
export const getAppFrameworkName = (tree: Tree, projectRoot: string): AppFramework => { | |
return isNextApp(tree, projectRoot) ? 'next' : isExpoApp(tree, projectRoot) ? 'expo' : undefined; | |
}; |
@@ -0,0 +1,11 @@ | |||
import { Tree } from '@nx/devkit'; | |||
|
|||
export const updateFile = ( |
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.
we have a similar utility, can we modify it to use updateFile
?
No description provided.