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

Changed npmrc template name and updated gitignore content #91

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

revanth0212
Copy link
Contributor

@revanth0212 revanth0212 commented Oct 6, 2023

Description

Changed .npmrc to npmrc and updated gitignore file contents.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@@ -86,7 +93,7 @@ class InitCommand extends Command {
let shouldCreateGit = gitFlagOptions[flags.git];
let packageManagerChoice = flags.packageManager;
const packageJsonTemplate = `${getAppRootDir()}/src/templates/package.json`;
const dotNpmrcPath = `${getAppRootDir()}/src/templates/.npmrc`;
Copy link
Contributor

Choose a reason for hiding this comment

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

why change from .npmrc to npmrc?

Copy link
Contributor Author

@revanth0212 revanth0212 Oct 6, 2023

Choose a reason for hiding this comment

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

While publishing . files are not published. For instance, here is the latest published package on npm, as you can see none of the . files are published

image

Similarly, template/.npmrc is also missing which wont let the init command to complete the setup

image

Hence changing it to npmrc instead. But while writing it into the user's inited folder, it will be named as .npmrc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is from the npm docs, it says .npmrc along with a bunch of other files is always ignored https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files

image

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh. This requires a .npmignore file and you can then specify the files you want in it like so
{
"files": ["index.js", "/lib"]
}
This whitelists everything inside and you can test it out by running npm pack

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But .npmrc is always ignored irrespective of files array or .npmignore

@revanth0212 revanth0212 merged commit 014ad26 into develop Oct 6, 2023
4 checks passed
@revanth0212 revanth0212 deleted the revanth/change-npmrc-template-name branch October 6, 2023 18:02
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.

4 participants