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!: new folder structure #934

Merged
merged 29 commits into from
Jan 2, 2023
Merged

feat!: new folder structure #934

merged 29 commits into from
Jan 2, 2023

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Dec 6, 2022

Ref: t3dotgg/rewire-t3-app#2

also restructured internally so the adding are now structured like a mirror of the generated project, instead of being grouped all in one per dep

TODO: Edit https://create.t3.gg/en/folder-structure

@changeset-bot
Copy link

changeset-bot bot commented Dec 6, 2022

🦋 Changeset detected

Latest commit: 0f503de

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

@vercel
Copy link

vercel bot commented Dec 6, 2022

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

1 Ignored Deployment
Name Status Preview Updated
create-t3-app ⬜️ Ignored (Inspect) Jan 2, 2023 at 7:07PM (UTC)

@github-actions github-actions bot added 📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App 📚 documentation Improvements or additions to documentation labels Dec 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟢 Best practices 100
🟠 SEO 86
🟠 PWA 54

Lighthouse ran on https://create-t3-app-git-folder-structure-t3-oss.vercel.app/

@juliusmarminge juliusmarminge added the 🚀 autorelease add this label to a pr to trigger a beta release label Dec 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

A new create-t3-app prerelease is available for testing. You can install this latest build in your project with:

@github-actions github-actions bot removed the 🚀 autorelease add this label to a pr to trigger a beta release label Dec 6, 2022
Copy link
Member

@c-ehrlich c-ehrlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do a thorough review later but noticed this while glancing over it

cli/template/extras/src/server/api/trpc/with-auth.ts Outdated Show resolved Hide resolved
@t3dotgg
Copy link
Member

t3dotgg commented Dec 6, 2022

Love this

My bad on the old comment for the private procedure, rewrite:

/**
 * Protected (authed) procedure
 *
 * If you want a query or mutation to ONLY be accessible to logged in users, use
 * this. It verifies the session is valid and guarantees ctx.session.user is not
 * null
 *
 * @see https://trpc.io/docs/procedures
 */
export const protectedProcedure = t.procedure.use(enforceUserIsAuthed);

@LucasAlda
Copy link

I posted this reply on theo's repo early today and just noticed this pull request on the ct3a repo. Just an observation based on my own experience modifying the t3 folder structure

Do you think it would be too much tree shaking to move db.ts and auth.ts to a new folder (utils or something) and remove the api/? 

server/
    utils/   other name?
        db.ts
        auth.ts
    routes/
        auth.ts
        example.ts
    root.ts
    trpc.ts

I always make this change to all my T3 scaffolded apps because I want server/ to focus on my api routes and have everything else as a complement. Your server is t3-focused in this approach, and if your utils/ folder is too complex, it's good advice to use a monorepo because you may have multiple packages inside. 

Originally posted by @LucasAlda in t3dotgg/rewire-t3-app#2 (comment)

@bai
Copy link
Contributor

bai commented Dec 19, 2022

Purely out of curiosity, when do you think this proposal might land in main, if at all?

@juliusmarminge
Copy link
Member Author

Purely out of curiosity, when do you think this proposal might land in main, if at all?

Might push it out during the holidays

.eslintrc.cjs Show resolved Hide resolved
cli/package.json Show resolved Hide resolved
cli/template/extras/src/server/api/trpc/base.ts Outdated Show resolved Hide resolved
@juliusmarminge juliusmarminge added the 🚀 autorelease add this label to a pr to trigger a beta release label Dec 26, 2022
@github-actions github-actions bot removed the 🚀 autorelease add this label to a pr to trigger a beta release label Dec 26, 2022
Copy link
Member

@c-ehrlich c-ehrlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

cli/template/extras/src/server/api/trpc/base.ts Outdated Show resolved Hide resolved
cli/template/extras/src/server/api/trpc/base.ts Outdated Show resolved Hide resolved
cli/template/extras/src/utils/api.ts Show resolved Hide resolved
Copy link
Member

@nexxeln nexxeln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIPPPPPPPPPPPP

@juliusmarminge juliusmarminge merged commit c20ec70 into next Jan 2, 2023
@juliusmarminge juliusmarminge deleted the folder-structure branch January 2, 2023 20:43
joachimjusth added a commit to joachimjusth/create-t3-app that referenced this pull request Jan 5, 2023
devvianto605 pushed a commit to devvianto605/create-devviantex-nextjs-app that referenced this pull request Jun 9, 2024
devvianto605 pushed a commit to devvianto605/create-devviantex-nextjs-app that referenced this pull request Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App 📚 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants