Skip to content

Commit

Permalink
feat: add npmrc to file mapping (#86)
Browse files Browse the repository at this point in the history
<!--
Thank you for your pull request. Please review below requirements.
Bug fixes and new features should include tests and possibly benchmarks.
Contributors guide:
https://github.sheincorp.cn/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。
Bug 修复和新功能必须包含测试,必要时请附上性能测试。
Contributors guide:
https://github.sheincorp.cn/eggjs/egg/blob/master/CONTRIBUTING.md
-->

##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to
[x]. -->

- [x] `npm test` passes
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [x] commit message follows commit guidelines

##### Affected core subsystem(s)
<!-- Provide affected core subsystem(s). -->

- tests

##### Description of change
<!-- Provide a description of the change below this comment. -->

add `.npmrc` to file mapping
  • Loading branch information
thonatos authored Feb 23, 2024
1 parent 89b7ec8 commit 66e35e4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/init_command.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = class Command {
'_package.json': 'package.json',
'_.eslintrc': '.eslintrc',
'_.eslintignore': '.eslintignore',
_npmrc: '.npmrc',
'_.npmignore': '.npmignore',
};
}
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/simple-test/boilerplate/_npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registry=https://registry.npmjs.org/
always-auth=false
strict-ssl=false
1 change: 1 addition & 0 deletions test/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('test/init.test.js', () => {

assert(fs.existsSync(path.join(command.targetDir, '.gitignore')));
assert(fs.existsSync(path.join(command.targetDir, '.eslintrc')));
assert(fs.existsSync(path.join(command.targetDir, '.npmrc')));
assert(fs.existsSync(path.join(command.targetDir, '.npmignore')));
assert(fs.existsSync(path.join(command.targetDir, 'package.json')));
assert(fs.existsSync(path.join(command.targetDir, 'simple-app')));
Expand Down

0 comments on commit 66e35e4

Please sign in to comment.