Skip to content
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: gitignore file as template within npm publish content #1111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxgaurav
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

Previously it was not possible to publish the gitignore file as npm has a black list files which will not be part of distribution. Now with renamed to be .template.gitignore and renaming action added to the application factory will allow the gitignore file to be part of the template.

This PR not only allows gitignore files but any file that the npm black list can be just renamed to .template.nameofile and the renaming action will recursively replace all names when creating the application template through the schematics but uploaded as the template name.

  • Bugfix
  • [ X ] Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Currently blacklisted files of npm like .gitignore cannot be published through the schematics. Currently this is solved through the nest-cli project by creating a sample .gitignore file through cli.

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • [ X ] No

Other information

Copy link
Member

@micalevisk micalevisk left a comment

Choose a reason for hiding this comment

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

@maxgaurav
Copy link
Author

Yep, We can drop the change and also remove the function createGitIgnoreFile in line
https://github.com/nestjs/nest-cli/blob/4a948c935b5b077598b54803f1eef2f4c8cbf24b/actions/new.action.ts#L59 as gitignore will be available through the template itself.

If we don't want to remove the createGitIgnore function the above change needs to stay as this pull request will be useless. the above change was introduced to fix the problem. The problem was that the function would override any content of the gitignore file provided through the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants