-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(node): update CNW to support generating a node server with a framework #14313
feat(node): update CNW to support generating a node server with a framework #14313
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
789a0cb
to
1518632
Compare
1518632
to
01ad49d
Compare
@@ -96,6 +98,10 @@ const presetOptions: { name: Preset; message: string }[] = [ | |||
message: | |||
'react-native [a monorepo with a single React Native application]', | |||
}, | |||
{ | |||
name: Preset.NodeServer, | |||
message: 'node [a standalone repo with a single Node Server]', |
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 add e.g. Express
since it's the most popular choice and we can be make obvious which selection to pick.
})); | ||
if (options.framework && options?.bundler === 'esbuild') { | ||
// updatae tsconfig.app.json to typecheck default exports https://www.typescriptlang.org/tsconfig#esModuleInterop | ||
updateJson(tree, `${options.appProjectRoot}/tsconfig.app.json`, (json) => ({ |
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.
I think this may have been a mistake in the past. We should always update the compilerOptions
on tsconfig.json
not tsconfig.app.json
.
The reason is that other tsconfig files such as tsconfig.spec.json
will also need those options.
We should update it to be:
if (options.rootProject) {
// ...
} else {
// ...
}
I don't think need to check framework or bundler, unless the framework needs other entries in types, like types: ['node', 'express']
.
01ad49d
to
639d674
Compare
639d674
to
fa4e618
Compare
fa4e618
to
2e05b4a
Compare
2e05b4a
to
5ab101d
Compare
5ab101d
to
4caab22
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This PR updates
--preset
to also includenode-server
, such that you can useChanges
This will generate a node-server using one of the following user-decided frameworks:
It works in conjunction with the
@nrwl/node:app
generator.As such the
--framework
is also an optional tag which can be used to decide upfront which framework should be generated.If not provided the user will be asked during the creation of their workspace