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: add t3app well-known playground routing #1800

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clever-numbers-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": minor
---

Add t3app well-known playground routing
2 changes: 2 additions & 0 deletions cli/src/helpers/createProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
selectIndexFile,
selectLayoutFile,
selectPageFile,
selectWellknown3AppFiles,
} from "~/helpers/selectBoilerplate.js";
import {
type DatabaseProvider,
Expand Down Expand Up @@ -69,6 +70,7 @@ export const createProject = async ({
);

selectLayoutFile({ projectDir, packages });
selectWellknown3AppFiles({ projectDir, packages });
selectPageFile({ projectDir, packages });
} else {
selectAppFile({ projectDir, packages });
Expand Down
12 changes: 12 additions & 0 deletions cli/src/helpers/selectBoilerplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ export const selectLayoutFile = ({
fs.copySync(appSrc, appDest);
};

// Adds the .well-known/t3app folder to the project
export const selectWellknown3AppFiles = ({
projectDir,
}: SelectBoilerplateProps) => {
const appSrc = path.join(
PKG_ROOT,
"template/extras/src/app/.well-known/t3app"
);
const appDest = path.join(projectDir, "src/app/.well-known/t3app");
fs.copySync(appSrc, appDest);
};

// This selects the proper index.tsx to be used that showcases the chosen tech
export const selectIndexFile = ({
projectDir,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Playground() {
return <h1>Hello, Playground!</h1>;
}
Loading