Commit 0db0d37
authored
fix(cli): add missing .npmrc (#175)
### TL;DR
Fixed monorepo initialization by properly handling dotfiles during template creation.
### What changed?
- Moved `renameFiles()` call before package manager setup to ensure dotfiles are renamed early in the initialization process
- Added `.npmrc` and `.yarnrc.yml` to the list of files that need to be renamed
- Renamed template files to use underscore prefix (`_npmrc`, `_yarnrc.yml`) to avoid git ignoring them
- Added existence check before attempting to rename files to prevent errors
- Updated file renaming logic to handle cases where source files might not exist
### How to test?
1. Create a new monorepo using the CLI
2. Verify that `.gitignore`, `.npmrc`, and `.yarnrc.yml` files are correctly created
3. Test with different package managers (npm, yarn, pnpm) to ensure proper initialization
### Why make this change?
Dotfiles like `.npmrc` and `.yarnrc.yml` are essential for proper package manager configuration in monorepos. The previous implementation didn't properly handle these files during template creation, which could lead to missing configuration files. This change ensures all necessary dotfiles are correctly created during monorepo initialization.1 parent 0fb43d9 commit 0db0d37
7 files changed
Lines changed: 27 additions & 11 deletions
File tree
- packages/global
- snap-tests
- new-monorepo
- new-singlerepo
- src
- templates/monorepo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
62 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| |||
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
95 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
96 | 106 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| 758 | + | |
758 | 759 | | |
759 | 760 | | |
760 | 761 | | |
| |||
784 | 785 | | |
785 | 786 | | |
786 | 787 | | |
787 | | - | |
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| 792 | + | |
| 793 | + | |
792 | 794 | | |
793 | 795 | | |
794 | 796 | | |
| |||
File renamed without changes.
File renamed without changes.
0 commit comments