Merged
Conversation
Member
Author
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes a missing .npmrc configuration file in the CLI monorepo initialization process. The main issue was that the renameFiles function was being called after package manager setup, preventing the .npmrc file from being properly renamed and available during the initialization process.
- Move
renameFilescall to occur immediately after template copying - Add
.npmrcand.yarnrc.ymlto the rename files mapping - Add existence check before attempting file renames to prevent errors
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cecb798 to
1d6e4b2
Compare
This was referenced Sep 21, 2025
1d6e4b2 to
400129a
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
packages/global/src/new.ts:800
- The renameFiles function will throw an error if the source file doesn't exist. Based on the PR description mentioning 'Added existence check before attempting to rename files to prevent errors', this function should check if the source file exists before attempting to rename it using fs.existsSync().
function renameFiles(projectDir: string) {
for (const [from, to] of Object.entries(RENAME_FILES)) {
fs.renameSync(path.join(projectDir, from), path.join(projectDir, to));
}
}
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Brooooooklyn
approved these changes
Sep 22, 2025
Member
Author
This was referenced Sep 22, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

TL;DR
Fixed monorepo initialization by properly handling dotfiles during template creation.
What changed?
renameFiles()call before package manager setup to ensure dotfiles are renamed early in the initialization process.npmrcand.yarnrc.ymlto the list of files that need to be renamed_npmrc,_yarnrc.yml) to avoid git ignoring themHow to test?
.gitignore,.npmrc, and.yarnrc.ymlfiles are correctly createdWhy make this change?
Dotfiles like
.npmrcand.yarnrc.ymlare 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.