Skip to content

Commit

Permalink
feat: 20 update tailwind (#26)
Browse files Browse the repository at this point in the history
* feat: updating version of tailwind

* fix: updating config to match new standards

* adding in changeset
  • Loading branch information
gfidder authored Oct 19, 2023
1 parent 5b7ad1f commit 3fe6b8c
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 92 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-ducks-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3nuxt-app": patch
---

Updating tailwind to latest version
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@types/fs-extra": "^11.0.1",
"@types/gradient-string": "^1.1.2",
"@types/inquirer": "^9.0.3",
"@types/node": "^18.18.5",
"@types/node": "^20.2.5",
"eslint-plugin-isaacscript": "^2.3.2",
"eslint-plugin-nuxt": "^4.0.0",
"next-auth": "4.18.8",
Expand Down
6 changes: 3 additions & 3 deletions cli/src/installers/dependencyVersionMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const dependencyVersionMap = {
autoprefixer: "^10.4.7",
postcss: "^8.4.14",
prettier: "^3.0.1",
"prettier-plugin-tailwindcss": "^0.2.1",
"@types/prettier": "^2.7.2",
"@nuxtjs/tailwindcss": "^6.3.1",
"prettier-plugin-tailwindcss": "^0.5.6",
"@types/prettier": "^3.0.0",
"eslint-plugin-prettier": "^5.0.0",

// tRPC
"@trpc/client": "^10.9.0",
Expand Down
5 changes: 0 additions & 5 deletions cli/src/installers/tailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const tailwindInstaller: Installer = ({ projectDir }) => {
"prettier",
"prettier-plugin-tailwindcss",
"@types/prettier",
"@nuxtjs/tailwindcss",
],
devMode: true,
});
Expand All @@ -25,17 +24,13 @@ export const tailwindInstaller: Installer = ({ projectDir }) => {
const twCfgSrc = path.join(extrasDir, "config/tailwind.config.ts");
const twCfgDest = path.join(projectDir, "tailwind.config.ts");

const postcssCfgSrc = path.join(extrasDir, "config/postcss.config.cjs");
const postcssCfgDest = path.join(projectDir, "postcss.config.cjs");

const prettierSrc = path.join(extrasDir, "config/prettier.config.cjs");
const prettierDest = path.join(projectDir, "prettier.config.cjs");

const cssSrc = path.join(extrasDir, "src/assets/global.css");
const cssDest = path.join(projectDir, "assets/global.css");

fs.copySync(twCfgSrc, twCfgDest);
fs.copySync(postcssCfgSrc, postcssCfgDest);
fs.copySync(cssSrc, cssDest);
fs.copySync(prettierSrc, prettierDest);
};
8 changes: 4 additions & 4 deletions cli/template/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"lint": "eslint . --ext .vue,.js,.ts,.tsx --ignore-path .gitignore"
},
"devDependencies": {
"@types/node": "^18.13.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"@types/node": "^20.2.5",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint": "^8.33.0",
"eslint-plugin-nuxt": "^4.0.0",
"nuxt": "^3.1.2",
"nuxt": "^3.7.0",
"typescript": "^4.9.5",
"vite-plugin-eslint": "^1.8.1"
}
Expand Down
10 changes: 7 additions & 3 deletions cli/template/extras/config/nuxt-config/with-auth-trpc-tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import eslintPlugin from "vite-plugin-eslint";

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ["@nuxtjs/tailwindcss", "@sidebase/nuxt-auth"],
modules: ["@sidebase/nuxt-auth"],
css: ["~/assets/global.css"],
typescript: {
shim: false,
},
Expand All @@ -12,7 +13,10 @@ export default defineNuxtConfig({
vite: {
plugins: [eslintPlugin()],
},
tailwindcss: {
cssPath: "~/assets/global.css",
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
});
10 changes: 7 additions & 3 deletions cli/template/extras/config/nuxt-config/with-auth-tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import eslintPlugin from "vite-plugin-eslint";

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ["@nuxtjs/tailwindcss", "@sidebase/nuxt-auth"],
modules: ["@sidebase/nuxt-auth"],
css: ["~/assets/global.css"],
typescript: {
shim: false,
},
vite: {
plugins: [eslintPlugin()],
},
tailwindcss: {
cssPath: "~/assets/global.css",
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
});
9 changes: 6 additions & 3 deletions cli/template/extras/config/nuxt-config/with-trpc-tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import eslintPlugin from "vite-plugin-eslint";

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ["@nuxtjs/tailwindcss"],
css: ["~/assets/global.css"],
typescript: {
shim: false,
},
Expand All @@ -12,7 +12,10 @@ export default defineNuxtConfig({
vite: {
plugins: [eslintPlugin()],
},
tailwindcss: {
cssPath: "~/assets/global.css",
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
});
9 changes: 6 additions & 3 deletions cli/template/extras/config/nuxt-config/with-tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import eslintPlugin from "vite-plugin-eslint";

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ["@nuxtjs/tailwindcss"],
css: ["~/assets/global.css"],
typescript: {
shim: false,
},
vite: {
plugins: [eslintPlugin()],
},
tailwindcss: {
cssPath: "~/assets/global.css",
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
});
6 changes: 0 additions & 6 deletions cli/template/extras/config/postcss.config.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@manypkg/cli": "^0.20.0",
"@types/node": "^18.18.5",
"@types/node": "^20.2.5",
"@typescript-eslint/eslint-plugin": "6.0.0",
"@typescript-eslint/parser": "6.0.0",
"eslint": "^8.40.0",
Expand Down
Loading

0 comments on commit 3fe6b8c

Please sign in to comment.