-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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(create-remix): allow dots in nested folder names in GitHub repo shorthand #7277
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -384,10 +384,14 @@ function isValidGithubRepoUrl( | |
} | ||
|
||
function isGithubRepoShorthand(value: string) { | ||
if (isUrl(value)) { | ||
return false; | ||
} | ||
Comment on lines
+387
to
+389
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we'd get collisions for URLs with file extensions - but it felt safe to ensure that we short circuit exit on non-RULs when looking for a shorthand |
||
// This supports :owner/:repo and :owner/:repo/nested/path, e.g. | ||
// remix-run/remix | ||
// remix-run/remix/templates/express | ||
return /^[\w-]+\/[\w-]+(\/[\w-]+)*$/.test(value); | ||
// remix-run/examples/socket.io | ||
return /^[\w-]+\/[\w-]+(\/[\w-.]+)*$/.test(value); | ||
} | ||
|
||
function isGithubReleaseAssetUrl(url: string) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -317,7 +317,9 @@ async function copyTempDirToAppDirStep(ctx: Context) { | |
|
||
let files1 = await getDirectoryFilesRecursive(ctx.tempDir); | ||
let files2 = await getDirectoryFilesRecursive(ctx.cwd); | ||
let collisions = files1.filter((f) => files2.includes(f)); | ||
let collisions = files1 | ||
.filter((f) => files2.includes(f)) | ||
.sort((a, b) => a.localeCompare(b)); | ||
Comment on lines
-320
to
+322
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ran into a test failure due to these files being printed to the console in a different order, so sort the collisions list for stability |
||
|
||
if (collisions.length > 0) { | ||
let getFileList = (prefix: string) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the
nested-dir-repo.tar.gz
file and copied the existingstack/
directory tofolder.with-dots/
for this test