-
Notifications
You must be signed in to change notification settings - Fork 207
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: use default library prefix #1563
Merged
kamilmysliwiec
merged 5 commits into
nestjs:master
from
bejewel-kyoungmin:use-default-prefix-for-library
Jan 8, 2024
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
92bd04f
feat: use default library prefix
bejewel-kyoungmin 3443f7b
Update src/lib/library/schema.json
bejewel-kyoungmin 9c51de1
fix: missing escape
bejewel-kyoungmin 2f899b4
feat: use default library prefix
bejewel-kyoungmin d2369f7
feat: add file system reader
bejewel-kyoungmin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
at
@netjs/cli
repo we have this code to read the configuration file: https://github.com/nestjs/nest-cli/blob/d7c855ad3d8493bc5e43ebcb3199aab75232d7a4/lib/configuration/nest-configuration.loader.ts#L17I'm not sure if we should do the same here...
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 know that. There are a few json files.
But latest version of nestjs generates 'nest-cli.json' file. doesn't it?
This feature that I suggested is new, so I think supporting only 'nest-cli.json' is ok.
But becuase @micalevisk 's suggestion is very good idea and It is not that hard to fix, I don't care.
which is better?
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 should use the NestConfigurationLoader here
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.
@kamilmysliwiec
Thank you for your advice.
I have investigated whole code in schematics repo, but schematics project only care about these two files, 'nest-cli.json', 'nest.json'.
Only nest-cli project has NestConfigurationLoader. and it's FileSystemReader class read some json files.
Well, I just pushed new code that is checking both nest-cli.json and nest.json to get defaultLibraryPrefix.
If you want something else, give me any directions in more detail. I'm ready to willingly apply that.
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.
Could you add
FileSystemReader
class to this package (https://github.dev/nestjs/nest-cli/blob/ad212b1b4c6a7777f232ab6c93f83a5fa0bc5fac/lib/readers/file-system.reader.ts#L5) and use it instead?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.
done : )
I have just added
FileSystemReader
class to this package. test files, too.But the methods in
FileSystemReader
return Promise.If I use these methods that return promise, I have to add async keyword to a lot of function.
So I put new sync methods in
FileSystemReader