Skip to content

Commit

Permalink
feat: add t3app well-known playground routing
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Mar 13, 2024
1 parent 04660f2 commit cf0139a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
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 @@
*

0 comments on commit cf0139a

Please sign in to comment.