8000 feat(nest): update nest generators to support name and directory format option by Cammisuli · Pull Request #19668 · nrwl/nx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(nest): update nest generators to support name and directory format option #19668

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

Merged

Conversation

Cammisuli
Copy link
Member

Current Behavior

No support for nameAndDirectoryFormat

Expected Behavior

Nest generators now support nameAndDirectoryFormat

Related Issue(s)

Fixes #

@Cammisuli Cammisuli requested review from a team as code owners October 17, 2023 19:34
@Cammisuli Cammisuli requested review from jaysoo and meeroslav October 17, 2023 19:34
@vercel
Copy link
vercel bot commented Oct 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Oct 17, 2023 9:37pm

"project": {
"description": "The Nest project to target.",
"type": "string",
"$default": { "$source": "projectName" },
"alias": "p",
"x-prompt": "What Nest project would you like to target?"
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v18."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to also remove project from the required array in schema.

};

console.log({ normalizedOptions });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

nameAndDirectoryFormat: options.nameAndDirectoryFormat ?? 'derived',
});

console.log({ directory, fileName });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@Cammisuli Cammisuli force-pushed the feature/nxp-94-update-nest-generators branch from 0dca254 to 525dea5 Compare October 17, 2023 20:42
callingGenerator,
artifactType,
name: options.name,
directory: options.directory,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also need to pass derivedDirectory: options.directory. The Nest generators are like the React ones where directory is relative to project's source root, so nx g class foo --project test --directory a/b will generate test/src/lib/a/b/foo.ts.

name: options.name,
directory: options.directory,
project: options.project,
flat: options.flat,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need flat: options.flat ?? true so programmatic usage of generators maintain the same behaviour.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm... it's never been required both in schema.json or the typescript types... and defaults to false so this should be fine?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's fine

@jaysoo
Copy link
Member
jaysoo commented Oct 17, 2023

Two changes needed to maintain same behavior for derived case, but rest LGTM.

@FrozenPandaz FrozenPandaz merged commit aa7625b into nrwl:master Oct 17, 2023
@Cammisuli Cammisuli deleted the feature/nxp-94-update-nest-generators branch October 18, 2023 10:54
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0