create-tnt-stack 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import
|
2
|
+
import xe from"path";import{execa as it}from"execa";import Ae from"fs-extra";import{confirm as O,input as ie,select as $}from"@inquirer/prompts";import{Command as We}from"commander";import z from"path";import{fileURLToPath as Ee}from"url";var Ne=Ee(import.meta.url),Oe=z.dirname(Ne),d=z.join(Oe,"../"),B=` ___ ___ ___ _ _____ ___ _____ _ _ _____ ___ _____ _ ___ _ __
|
3
3
|
/ __| _ \\ __| /_\\_ _| __| |_ _| \\| |_ _| / __|_ _/_\\ / __| |/ /
|
4
4
|
| (__| / _| / _ \\| | | _| | | | .\` | | | \\__ \\ | |/ _ \\ (__| ' <
|
5
5
|
\\___|_|_\\___/_/ \\_\\_| |___| |_| |_|\\_| |_| |___/ |_/_/ \\_\\___|_|\\_\\
|
6
|
-
`,
|
6
|
+
`,P="my-tnt-stack",D="create-tnt-stack";import T from"path";import R from"fs-extra";import H from"path";import K from"fs-extra";import Me from"sort-package-json";var F={"next-auth":"^4.24.11","@auth/prisma-adapter":"^2.8.0",prisma:"^6.5.0","@prisma/client":"^6.5.0","@t3-oss/env-nextjs":"^0.12.0",zod:"^3.24.2",prettier:"^3.5.3","prettier-plugin-tailwindcss":"^0.6.11","@ianvs/prettier-plugin-sort-imports":"^4.4.1"};var u=e=>{let{dependencies:t,devMode:i,projectDir:a}=e,n=K.readJsonSync(H.join(a,"package.json"));t.forEach(r=>{let l=F[r];i&&n.devDependencies?n.devDependencies[r]=l:n.dependencies&&(n.dependencies[r]=l)});let o=Me(n);K.writeJsonSync(H.join(a,"package.json"),o,{spaces:2})};var Y=({projectDir:e,scopedAppName:t,packages:i,databaseProvider:a})=>{let n=i?.envVariables.inUse,o=i?.nextAuth.inUse,r=i?.prisma.inUse,l=[];n&&(l.push("@t3-oss/env-nextjs"),l.push("zod")),u({projectDir:e,dependencies:l,devMode:!1});let c=r,m=je(!!o,!!r,t,a),p="";if(c?o?p="with-next-auth-db.js":p="with-db.js":o&&(p="with-next-auth.js"),p!==""){let Te=T.join(d,"template/packages/src/env",p),Ce=T.join(e,"src/env.js");R.copyFileSync(Te,Ce)}let g=T.join(e,".env"),w=T.join(e,".env.example"),j=De+m,Ie=Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString("base64"),Se=m.replace('AUTH_SECRET=""',`AUTH_SECRET="${Ie}" # Generated by create-tnt-stack`);R.writeFileSync(g,Se,"utf-8"),R.writeFileSync(w,j,"utf-8")};function je(e,t,i,a){let n=`
|
7
7
|
# When adding additional environment variables, the schema in "/src/env.js"
|
8
8
|
# should be updated accordingly.
|
9
9
|
`.trim().concat(`
|
10
10
|
`);return t&&(n+=`
|
11
11
|
# Prisma
|
12
12
|
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
|
13
|
-
`),t&&(
|
13
|
+
`),t&&(a==="mysql"?n+=`DATABASE_URL="mysql://root:password@localhost:3306/${i}"`:a==="postgresql"?n+=`DATABASE_URL="postgresql://postgres:password@localhost:5432/${i}"`:a==="sqlite"&&(n+='DATABASE_URL="file:./db.sqlite"'),n+=`
|
14
14
|
`),e&&(n+=`
|
15
15
|
# Next Auth
|
16
16
|
# You can generate a new secret on the command line with:
|
@@ -25,7 +25,7 @@ import ke from"path";import{execa as Ze}from"execa";import Pe from"fs-extra";imp
|
|
25
25
|
# Example:
|
26
26
|
# SERVERVAR="foo"
|
27
27
|
# NEXT_PUBLIC_CLIENTVAR="bar"
|
28
|
-
`),n}var
|
28
|
+
`),n}var De=`
|
29
29
|
# Since the ".env" file is gitignored, you can use the ".env.example" file to
|
30
30
|
# build a new ".env" file when you clone the repo. Keep this file up-to-date
|
31
31
|
# when you add new variables to \`.env\`.
|
@@ -35,19 +35,19 @@ import ke from"path";import{execa as Ze}from"execa";import Pe from"fs-extra";imp
|
|
35
35
|
# ".env" and populate it with your secrets.
|
36
36
|
`.trim().concat(`
|
37
37
|
|
38
|
-
`);import
|
38
|
+
`);import v from"path";import G from"fs-extra";var Q=({projectDir:e,packages:t})=>{let i=t?.prisma.inUse,a=["next-auth"];i&&a.push("@auth/prisma-adapter"),u({projectDir:e,dependencies:a,devMode:!1});let n=v.join(d,"template/packages"),o="src/app/api/auth/[...nextauth]/route.ts",r=v.join(n,o),l=v.join(e,o),c=v.join(n,"src/server/auth/config",i?"next-auth-with-prisma.ts":"next-auth.ts"),m=v.join(e,"src/server/auth/config.ts"),p=v.join(n,"src/server/auth/next-auth.ts"),g=v.join(e,"src/server/auth/index.ts");G.copySync(r,l),G.copySync(c,m),G.copySync(p,g)};import X from"path";import Re from"fs-extra";var Z=({projectDir:e,packages:t})=>{let i=t?.prettier.inUse,a=[];i&&(a.push("prettier"),a.push("prettier-plugin-tailwindcss"),a.push("@ianvs/prettier-plugin-sort-imports")),u({projectDir:e,dependencies:a,devMode:!0});let n=X.join(d,"template/packages/config","prettier.config.mjs"),o=X.join(e,"prettier.config.mjs");Re.copyFileSync(n,o)};import h from"path";import y from"fs-extra";var ee=({projectDir:e,packages:t,databaseProvider:i})=>{u({projectDir:e,dependencies:["prisma"],devMode:!0}),u({projectDir:e,dependencies:["@prisma/client"],devMode:!1});let a=h.join(d,"template/packages"),n=h.join(a,"prisma/schema",`${t?.nextAuth.inUse?"with-next-auth":"base"}.prisma`),o=y.readFileSync(n,"utf-8");i!=="sqlite"&&(o=o.replace('provider = "sqlite"',`provider = "${{mysql:"mysql",postgresql:"postgresql"}[i]}"`),["mysql"].includes(i)&&(o=o.replace("// @db.Text","@db.Text")));let r=h.join(e,"prisma/schema.prisma");y.mkdirSync(h.dirname(r),{recursive:!0}),y.writeFileSync(r,o);let l=h.join(a,"src/server/db/db-prisma.ts"),c=h.join(e,"src/server/db/index.ts");y.mkdirSync(h.dirname(c),{recursive:!0}),y.writeFileSync(c,y.readFileSync(l,"utf-8"));let m=h.join(e,"package.json"),p=y.readJSONSync(m);p.scripts={...p.scripts,postinstall:"prisma generate","db:push":"prisma db push","db:studio":"prisma studio","db:generate":"prisma migrate dev","db:migrate":"prisma migrate deploy"},y.writeJSONSync(m,p,{spaces:2})};var C=["sqlite","mysql","postgresql"],te=e=>({nextAuth:{inUse:e.includes("nextAuth"),installer:Q},prisma:{inUse:e.includes("prisma"),installer:ee},envVariables:{inUse:!0,installer:Y},prettier:{inUse:e.includes("prettier"),installer:Z}});import Ge from"path";import $e from"fs-extra";function k(){let e=Ge.join(d,"package.json");return $e.readJSONSync(e).version??"1.0.0"}var f=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":"npm":"npm"};var x=class extends Error{constructor(t){super(t)}};import E from"chalk";var s={error(...e){console.log(E.red(...e))},warn(...e){console.log(E.yellow(...e))},info(...e){console.log(E.cyan(...e))},success(...e){console.log(E.green(...e))}};var N=e=>(e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e);var Ue=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;function ne(e){let t=N(e),i=t.split("/"),a=i.findIndex(o=>o.startsWith("@")),n=i[i.length-1];return i.findIndex(o=>o.startsWith("@"))!==-1&&(n=i.slice(a).join("/")),t=="."||Ue.test(n??"")?!0:"App name must consist of only lowercase alphanumeric characters, '-', and '_'"}var ae=e=>e.startsWith(".")||e.startsWith("/")?"Import alias can't start with '.' or '/'":!0;var b={appName:P,packages:[],flags:{noGit:!1,noInstall:!1,default:!1,CI:!1,nextAuth:!1,prisma:!1,prettier:!1,importAlias:"@/",dbProvider:"sqlite"},databaseProvider:"sqlite"};async function oe(){let e=b,t=new We().name(D).description("CLI for scaffolding new web apps with the TNT-Powered stack").version(k(),"-v, --version","Output the current version of TNT").argument("[dir]","The name of the application, as well as the name of the directory to create").option("--noGit","Explicitly tell the CLI to not initialize a new git repo in the project",!1).option("--noInstall","Explicitly tell the CLI to not run the package manager's install command",!1).option("-y, --default","Bypass the CLI and use all default options to bootstrap a new tnt-stack",!1).option("--CI","Boolean value if we're running in CI",!1).option("--nextAuth [boolean]","Experimental: Boolean value if we should install NextAuth.js. Must be used in conjunction with `--CI`.",a=>!!a&&a!=="false").option("--prisma [boolean]","Experimental: Boolean value if we should install Prisma. Must be used in conjunction with `--CI`.",a=>!!a&&a!=="false").option("--prettier [boolean]","Experimental: Boolean value if we should install Prettier. Must be used in conjunction with `--CI`.",a=>!!a&&a!=="false").option("-i, --import-alias [alias]","Explicitly tell the CLI to use a custom import alias",b.flags.importAlias).option("--dbProvider [provider]",`Choose a database provider to use. Possible values: ${C.join(", ")}`,b.flags.dbProvider).parse(process.argv);process.env.npm_config_user_agent?.startsWith("yarn/3")&&s.warn(` WARNING: It looks like you are using Yarn 3. This is currently not supported,
|
39
39
|
and likely to result in a crash. Please run create-tnt-stack with another
|
40
40
|
package manager such as pnpm, npm, or Yarn Classic.
|
41
|
-
See: https://github.com/t3-oss/create-t3-app/issues/57`);let
|
41
|
+
See: https://github.com/t3-oss/create-t3-app/issues/57`);let i=t.args[0];if(i&&(e.appName=i),e.flags=t.opts(),e.flags.CI)return e.packages=[],e.flags.nextAuth&&e.packages.push("nextAuth"),e.flags.prisma&&e.packages.push("prisma"),e.flags.prettier&&e.packages.push("prettier"),C.includes(e.flags.dbProvider)===!1&&(s.warn(`Incompatible database provided. Use: ${C.join(", ")}. Exiting.`),process.exit(0)),e.databaseProvider=e.packages.includes("prisma")?e.flags.dbProvider:"sqlite",e;if(e.flags.default)return e;try{if(process.env.TERM_PROGRAM?.toLowerCase().includes("mintty"))throw s.warn(` WARNING: It looks like you are using MinTTY, which is non-interactive. This is most likely because you are
|
42
42
|
using Git Bash. If that's that case, please use Git Bash from another terminal, such as Windows Terminal. Alternatively, you
|
43
|
-
can provide the arguments from the CLI directly: https://create.tntstack.org/installation#experimental-usage to skip the prompts.`),new x("Non-interactive environment");let
|
44
|
-
Using: ${
|
45
|
-
`);let o=
|
46
|
-
`).start();if(A.existsSync(t))if(A.readdirSync(t).length===0)e!=="."&&o.info(`${
|
47
|
-
`);else{o.stopAndPersist();let l=await
|
48
|
-
`),A.emptyDirSync(t))}o.start(),A.copySync(n,t),A.renameSync(U.join(t,"_gitignore"),U.join(t,".gitignore"));let r=e==="."?"App":
|
49
|
-
`)}async function
|
50
|
-
`).start(),
|
43
|
+
can provide the arguments from the CLI directly: https://create.tntstack.org/installation#experimental-usage to skip the prompts.`),new x("Non-interactive environment");let a=f(),n={};i||(n.name=await ie({message:"What will your project be called?",default:P,validate:r=>ne(r)})),n.authentication=await $({message:"What authentication provider would you like to use?",choices:[{value:"none",name:"None"},{value:"nextAuth",name:"NextAuth.js"}],default:"none"}),n.database=await $({message:"What database ORM would you like to use?",choices:[{value:"none",name:"None"},{value:"prisma",name:"Prisma"}],default:"none"}),n.database!=="none"&&(n.databaseProvider=await $({message:"What database provider would you like to use?",choices:[{value:"sqlite",name:"SQLite"},{value:"mysql",name:"MySQL"},{value:"postgresql",name:"PostgreSQL"}],default:"sqlite"})),n.prettier=await O({message:"Should we install Prettier?",default:!b.flags.prettier}),e.flags.noGit||(n.noGit=await O({message:"Should we initialize a Git repository and stage the changes?",default:!b.flags.noGit})),e.flags.noInstall||(n.noInstall=await O({message:`Should we run '${a}`+(a==="yarn"?"'?":" install' for you?"),default:!b.flags.noInstall})),n.importAlias=await ie({message:"What import alias would you like to use?",default:b.flags.importAlias,validate:ae});let o=[];return n.authentication==="nextAuth"&&o.push("nextAuth"),n.database==="prisma"&&o.push("prisma"),n.prettier&&o.push("prettier"),{appName:n.name??e.appName,packages:o,flags:{...e.flags,noGit:!n.noGit||e.flags.noGit,noInstall:!n.noInstall||e.flags.noInstall,importAlias:n.importAlias??e.flags.importAlias},databaseProvider:n.databaseProvider||"sqlite"}}catch(a){if(a instanceof x)s.warn(`${D} needs an interactive terminal to run.`),await O({message:"Continue scaffolding with default options?",default:!0})||(s.info("Exiting..."),process.exit(0)),s.info(`Scaffolding default tnt app in ./${e.appName}`);else throw a}return e}import ze from"path";import se from"chalk";import Je from"ora";function re(e){let{packages:t}=e;s.info("Adding boilerplate...");for(let[i,a]of Object.entries(t))if(a.inUse){let n=Je(`Boilerplating ${i}...`).start();a.installer(e),n.succeed(se.green(`Successfully setup boilerplate for ${se.green.bold(i)}`))}s.info("")}import U from"path";import{confirm as qe,select as Le}from"@inquirer/prompts";import _ from"chalk";import A from"fs-extra";import Ve from"ora";async function le({projectName:e,projectDir:t,pkgManager:i,noInstall:a}){let n=U.join(d,"template/base");a?s.info(""):s.info(`
|
44
|
+
Using: ${_.cyan.bold(i)}
|
45
|
+
`);let o=Ve(`Scaffolding in: ${t}...
|
46
|
+
`).start();if(A.existsSync(t))if(A.readdirSync(t).length===0)e!=="."&&o.info(`${_.cyan.bold(e)} exists but is empty, continuing...
|
47
|
+
`);else{o.stopAndPersist();let l=await Le({message:`${_.redBright.bold("Warning:")} ${_.cyan.bold(e)} already exists and isn't empty. How would you like to proceed?`,choices:[{value:"abort",name:"Abort installation (recommended)"},{value:"clear",name:"Clear the directory and continue installation"},{value:"overwrite",name:"Continue installation and overwrite conflicting files"}],default:"abort"});l==="abort"&&(o.fail("Aborting installation..."),process.exit(1)),await qe({message:`Are you sure you want to ${l==="clear"?"clear the directory":"overwrite conflicting files"}`,default:!1})||(o.fail("Aborting installation..."),process.exit(1)),l==="clear"&&(o.info(`Emptying ${_.cyan.bold(e)} and creating tnt app...
|
48
|
+
`),A.emptyDirSync(t))}o.start(),A.copySync(n,t),A.renameSync(U.join(t,"_gitignore"),U.join(t,".gitignore"));let r=e==="."?"App":_.cyan.bold(e);o.succeed(`${r} ${_.green.bold("scaffolded successfully!")}
|
49
|
+
`)}async function pe({projectName:e,scopedAppName:t,packages:i,noInstall:a,databaseProvider:n}){let o=f(),r=ze.resolve(process.cwd(),e);return await le({projectName:e,projectDir:r,pkgManager:o,scopedAppName:t,noInstall:a,databaseProvider:n}),re({projectName:e,scopedAppName:t,projectDir:r,pkgManager:o,packages:i,noInstall:a,databaseProvider:n}),r}import{execSync as J}from"child_process";import W from"path";import{confirm as ce}from"@inquirer/prompts";import I from"chalk";import{execa as S}from"execa";import me from"fs-extra";import Be from"ora";function Fe(e){try{return J("git --version",{cwd:e}),!0}catch{return!1}}function q(e){return me.existsSync(W.join(e,".git"))}async function L(e){try{return await S("git",["rev-parse","--is-inside-work-tree"],{cwd:e,stdout:"ignore"}),!0}catch{return!1}}function He(){let t=J("git --version").toString().trim().split(" ")[2],i=t?.split(".")[0],a=t?.split(".")[1];return{major:Number(i),minor:Number(a)}}function Ke(){return J("git config --global init.defaultBranch || echo main").toString().trim()}async function de(e){if(s.info("Initializing Git..."),!Fe(e)){s.warn("Git is not installed. Skipping Git initialization.");return}let t=Be(`Creating a new git repo...
|
50
|
+
`).start(),i=q(e),a=await L(e),n=W.parse(e).name;if(a&&i){if(t.stop(),!await ce({message:`${I.redBright.bold("Warning:")} Git is already initialized in "${n}". Initializing a new git repository would delete the previous history. Would you like to continue anyways?`,default:!1})){t.info("Skipping Git initialization.");return}me.removeSync(W.join(e,".git"))}else if(a&&!i&&(t.stop(),!await ce({message:`${I.redBright.bold("Warning:")} "${n}" is already in a git worktree. Would you still like to initialize a new git repository in this directory?`,default:!1}))){t.info("Skipping Git initialization.");return}try{let o=Ke(),{major:r,minor:l}=He();r<2||r==2&&l<28?(await S("git",["init"],{cwd:e}),await S("git",["symbolic-ref","HEAD",`refs/heads/${o}`],{cwd:e})):await S("git",["init",`--initial-branch=${o}`],{cwd:e}),await S("git",["add","."],{cwd:e}),t.succeed(`${I.green("Successfully initialized and staged")} ${I.green.bold("git")}
|
51
51
|
`)}catch{t.fail(`${I.bold.red("Failed:")} could not initialize git. Update git to the latest version!
|
52
|
-
`)}}import
|
53
|
-
`))};var
|
52
|
+
`)}}import Ye from"chalk";import{execa as fe}from"execa";import ge from"ora";var V=async(e,t,i)=>{let{onDataHandle:a,args:n=["install"],stdout:o="pipe"}=i,r=ge(`Running ${t} install...`).start(),l=fe(t,n,{cwd:e,stdout:o});return await new Promise((c,m)=>{a&&l.stdout?.on("data",a(r)),l.on("error",p=>m(p)),l.on("close",()=>c())}),r},Qe=async(e,t)=>{switch(e){case"npm":return await fe(e,["install"],{cwd:t,stderr:"inherit"}),null;case"pnpm":return V(t,e,{onDataHandle:i=>a=>{let n=a.toString();n.includes("Progress")&&(i.text=n.includes("|")?n.split(" | ")[1]??"":n)}});case"yarn":return V(t,e,{onDataHandle:i=>a=>{i.text=a.toString()}});case"bun":return V(t,e,{stdout:"ignore"})}},ue=async({projectDir:e})=>{s.info("Installing dependencies...");let t=f();(await Qe(t,e)??ge()).succeed(Ye.green(`Successfully installed dependencies!
|
53
|
+
`))};var he=async({projectName:e=P,packages:t,noInstall:i,projectDir:a,databaseProvider:n})=>{let o=f();s.info("Next steps:"),e!=="."&&s.info(` cd ${e}`),i&&(o==="yarn"?s.info(` ${o}`):s.info(` ${o} install`)),["postgresql","mysql"].includes(n)&&s.info(" Add your database connection string to .env"),t?.nextAuth.inUse&&s.info(" Fill in your .env with necessary values. See https://create.tntstack.org/usage/first-steps for more info."),["npm"].includes(o)?s.info(` ${o} run dev`):s.info(` ${o} dev`),!await L(a)&&!q(a)&&s.info(" git init"),s.info(' git commit -m "initial commit"')};import M from"fs";import Xe from"path";function ye(e,t,i){M.readdirSync(e).forEach(n=>{let o=Xe.join(e,n);if(M.statSync(o).isDirectory())ye(o,t,i);else{let l=M.readFileSync(o,"utf8").replace(new RegExp(t,"g"),i);M.writeFileSync(o,l,"utf8")}})}function ve(e,t){let i=t.replace(/\*/g,"").replace(/[^\/]$/,"$&/");ye(e,"@/",i)}import be from"path";function _e(e){let i=N(e).split("/"),a=i[i.length-1];if(a==="."){let r=be.resolve(process.cwd());a=be.basename(r)}let n=i.findIndex(r=>r.startsWith("@"));i.findIndex(r=>r.startsWith("@"))!==-1&&(a=i.slice(n).join("/"));let o=i.filter(r=>!r.startsWith("@")).join("/");return[a,o]}import Ze from"gradient-string";var et={magenta:"#765bc8",pink:"#a48897",yellow:"#c7b561",green:"#8bb8a0",blue:"#4b97d5",cyan:"#22b6d2"};function we(){let e=Ze(Object.values(et)),t=f();(t==="yarn"||t==="pnpm")&&console.log(""),console.log(e.multiline(B))}import{execSync as tt}from"child_process";import nt from"https";function ke(e){let t=k();t.includes("beta")?(s.warn(" You are using a beta version of create-tnt-stack."),s.warn(" Please report any bugs you encounter.")):t!==e&&(s.warn(" You are using an outdated version of create-tnt-stack."),s.warn(" Your version:",t+".","Latest version in the npm registry:",e),s.warn(" Please run the CLI with @latest to get the latest updates.")),console.log("")}function at(){return new Promise((e,t)=>{nt.get("https://registry.npmjs.org/-/package/tnt-stack/dist-tags",i=>{if(i.statusCode===200){let a="";i.on("data",n=>a+=n),i.on("end",()=>{e(JSON.parse(a).latest)})}else t()}).on("error",()=>{t()})})}var Pe=()=>at().catch(()=>{try{return tt("npm view create-tnt-stack version").toString().trim()}catch{return null}});async function ot(){let e=await Pe(),t=f();we(),e&&ke(e);let{appName:i,packages:a,flags:{noGit:n,noInstall:o,importAlias:r},databaseProvider:l}=await oe(),c=te(a),[m,p]=_e(i),g=await pe({projectName:p,scopedAppName:m,packages:c,noInstall:o,databaseProvider:l}),w=Ae.readJsonSync(xe.join(g,"package.json"));w.name=m,w.ctntaMetadata={initVersion:k()};let{stdout:j}=await it(t,["-v"],{cwd:g});w.packageManager=`${t}@${j.trim()}`,Ae.writeJSONSync(xe.join(g,"package.json"),w,{spaces:2}),r!=="@/"&&ve(g,r),o||await ue({projectDir:g}),n||await de(g),await he({projectDir:g,projectName:p,packages:c,noInstall:o,databaseProvider:l}),process.exit(0)}ot().catch(e=>{s.error("Aborting installation..."),e instanceof Error?s.error(e.message):(s.error("An unknown error occurred. Please open an issue on GitHub with the below:"),console.error(e)),process.exit(1)});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-tnt-stack",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.8",
|
4
4
|
"description": "Create web application with the TNT-Powered stack",
|
5
5
|
"license": "MIT",
|
6
6
|
"repository": {
|
@@ -41,7 +41,6 @@
|
|
41
41
|
"release": "bun run clean build typecheck && npm version patch && npm publish --access public"
|
42
42
|
},
|
43
43
|
"dependencies": {
|
44
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
45
44
|
"@inquirer/prompts": "^7.3.3",
|
46
45
|
"chalk": "^5.4.1",
|
47
46
|
"commander": "^13.1.0",
|
@@ -53,6 +52,7 @@
|
|
53
52
|
},
|
54
53
|
"devDependencies": {
|
55
54
|
"@auth/prisma-adapter": "^2.8.0",
|
55
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
56
56
|
"@prisma/client": "^6.4.1",
|
57
57
|
"@t3-oss/env-nextjs": "^0.12.0",
|
58
58
|
"@types/fs-extra": "^11.0.4",
|
@@ -10,11 +10,9 @@
|
|
10
10
|
"lint": "next lint"
|
11
11
|
},
|
12
12
|
"dependencies": {
|
13
|
-
"@t3-oss/env-nextjs": "^0.12.0",
|
14
13
|
"react": "^19.0.0",
|
15
14
|
"react-dom": "^19.0.0",
|
16
|
-
"next": "15.2.2"
|
17
|
-
"zod": "^3.24.2"
|
15
|
+
"next": "15.2.2"
|
18
16
|
},
|
19
17
|
"devDependencies": {
|
20
18
|
"typescript": "^5",
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions &
|
3
|
+
* import("@ianvs/prettier-plugin-sort-imports").PluginConfig}
|
4
|
+
*/
|
5
|
+
const config = {
|
6
|
+
arrowParens: "always",
|
7
|
+
printWidth: 80,
|
8
|
+
singleQuote: false,
|
9
|
+
jsxSingleQuote: false,
|
10
|
+
semi: false,
|
11
|
+
trailingComma: "all",
|
12
|
+
tabWidth: 2,
|
13
|
+
proseWrap: "always",
|
14
|
+
plugins: [
|
15
|
+
"@ianvs/prettier-plugin-sort-imports",
|
16
|
+
"prettier-plugin-tailwindcss", // This MUST come last
|
17
|
+
],
|
18
|
+
importOrder: ["<THIRD_PARTY_MODULES>", "", "^@/", "", "^[.][.]/", "^[.]/"],
|
19
|
+
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
|
20
|
+
importOrderTypeScriptVersion: "5.0.0",
|
21
|
+
}
|
22
|
+
|
23
|
+
export default config
|