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

feat(cli): add 'no src directory' option #1939

Closed
wants to merge 5 commits into from

Conversation

chrisdadev13
Copy link

✅ Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

Changelog

  • CLI option: Would you like to use 'src' directory? yes/no
  • If yes, create the project with the src directory (current and default option at this moment)
  • If not, create the project without the src directory (I always do it manually 😭😭)

Screenshots

Screenshot 2024-07-07 at 11 17 14 PM

💯

Copy link

changeset-bot bot commented Jul 8, 2024

🦋 Changeset detected

Latest commit: 0507eaa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-t3-app Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-t3-app ✅ Ready (Inspect) Visit Preview 💬 1 unresolved
✅ 1 resolved
Jul 8, 2024 3:56am

Copy link

vercel bot commented Jul 8, 2024

@chrisdadev13 is attempting to deploy a commit to the t3-oss Team on Vercel.

A member of the Team first needs to authorize it.

@chrisdadev13
Copy link
Author

chrisdadev13 commented Jul 8, 2024

This PR was an exploration, I think it would be better to maybe just add this logic as a function moveProjectSrc in the index.ts file with the logic to move all the folders in the src to outside of it and then delete the src directory from the project. Just like this:

Current create-t3-app/cli/index.ts

  if (importAlias !== "~/") {
    setImportAlias(projectDir, importAlias);
  }

  if (!noInstall) {
    await installDependencies({ projectDir });
  }

  if (!noGit) {
    await initializeGit(projectDir);
  }

To add: create-t3-app/cli/index.ts

if (!srcDirectory){
    await moveProjectSrc({projectName, packages}) // mv [folderName] .. and then rm -r src
}

@chrisdadev13
Copy link
Author

I think I did a better PR: #1941

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.

1 participant