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

My First Contribution to make the T3 stack better. #1588

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions cli/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export const runCli = async (): Promise<CliResults> => {
{ value: "next-auth", label: "NextAuth.js" },
// Maybe later
// { value: "clerk", label: "Clerk" },
// {value:"kinde" , label:"Kinde"},
],
initialValue: "none",
});
Expand Down
2 changes: 1 addition & 1 deletion cli/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const PKG_ROOT = path.join(distPath, "../");

//export const PKG_ROOT = path.dirname(require.main.filename);

export const TITLE_TEXT = ` ___ ___ ___ __ _____ ___ _____ ____ __ ___ ___
export const TITLE_TEXT = ` ___ ___ ___ __ _____ ___ _____ ____ __ __ ___ ___
/ __| _ \\ __| / \\_ _| __| |_ _|__ / / \\ | _ \\ _ \\
| (__| / _| / /\\ \\| | | _| | | |_ \\ / /\\ \\| _/ _/
\\___|_|_\\___|_/‾‾\\_\\_| |___| |_| |___/ /_/‾‾\\_\\_| |_|
Expand Down
4 changes: 2 additions & 2 deletions cli/src/helpers/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const initializeGit = async (projectDir: string) => {
const dirName = path.parse(projectDir).name; // skip full path for logging

if (isInside && isRoot) {
// Dir is a root git repo
// Directory is a root git repo
spinner.stop();
const overwriteGit = await p.confirm({
message: `${chalk.redBright.bold(
Expand All @@ -86,7 +86,7 @@ export const initializeGit = async (projectDir: string) => {
// Deleting the .git folder
fs.removeSync(path.join(projectDir, ".git"));
} else if (isInside && !isRoot) {
// Dir is inside a git worktree
// Directory is inside a git worktree
spinner.stop();
const initializeChildGitRepo = await p.confirm({
message: `${chalk.redBright.bold(
Expand Down
2 changes: 1 addition & 1 deletion cli/src/helpers/installPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type InstallPackagesOptions = InstallerOptions & {
// This runs the installer for all the packages that the user has selected
export const installPackages = (options: InstallPackagesOptions) => {
const { packages } = options;
logger.info("Adding boilerplate...");
logger.info("Adding Boilerplate...");

for (const [name, pkgOpts] of Object.entries(packages)) {
if (pkgOpts.inUse) {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/helpers/scaffoldProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const scaffoldProject = async ({

if (overwriteDir === "clear") {
spinner.info(
`Emptying ${chalk.cyan.bold(projectName)} and creating t3 app..\n`
`Emptying ${chalk.cyan.bold(projectName)} and creating T3 app..\n`
);
fs.emptyDirSync(projectDir);
}
Expand All @@ -94,6 +94,6 @@ export const scaffoldProject = async ({
projectName === "." ? "App" : chalk.cyan.bold(projectName);

spinner.succeed(
`${scaffoldedName} ${chalk.green("scaffolded successfully!")}\n`
`${scaffoldedName} ${chalk.green("Scaffolded Successfully!")}\n`
);
};
2 changes: 1 addition & 1 deletion cli/src/helpers/setImportAlias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export const setImportAlias = (projectDir: string, importAlias: string) => {
.replace(/\*/g, "") // remove any wildcards (~/* -> ~/)
.replace(/[^\/]$/, "$&/"); // ensure trailing slash (@ -> ~/)

// update import alias in any files if not using the default
// update the import alias in any files if not using the default
replaceTextInFiles(projectDir, `~/`, normalizedImportAlias);
};
2 changes: 1 addition & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const main = async () => {
};

main().catch((err) => {
logger.error("Aborting installation...");
logger.error("Aborting Installation...");
if (err instanceof Error) {
logger.error(err);
} else {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/installers/dependencyVersionMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const dependencyVersionMap = {
"@auth/drizzle-adapter": "^0.3.2",

// Prisma
prisma: "^5.1.1",
"@prisma/client": "^5.1.1",
prisma: "^5.4.0",
"@prisma/client": "^5.4.0",

// Drizzle
"drizzle-orm": "^0.28.5",
Expand Down
18 changes: 9 additions & 9 deletions cli/src/utils/renderTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import gradient from "gradient-string";
import { TITLE_TEXT } from "~/consts.js";
import { getUserPkgManager } from "~/utils/getUserPkgManager.js";

// colors brought in from vscode poimandres theme
const poimandresTheme = {
blue: "#add7ff",
cyan: "#89ddff",
green: "#5de4c7",
magenta: "#fae4fc",
red: "#d0679d",
yellow: "#fffac2",
// I don't know yet if this is the best way to do this but it works
const $t3theme = {
blue: "#428ed6",
cyan: "#5a98a6",
green: "#34cfad",
magenta: "#c362cc",
red: "#d95096",
yellow: "#bfb760",
};

export const renderTitle = () => {
const t3Gradient = gradient(Object.values(poimandresTheme));
const t3Gradient = gradient(Object.values($t3theme));

// resolves weird behavior where the ascii is offset
const pkgManager = getUserPkgManager();
Expand Down
Loading