From a4a65212963d9cf1adc5a6fdfc6ac28e35392676 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 21 Mar 2023 13:56:19 +0000 Subject: [PATCH 1/4] chore: add missing deps --- package.json | 9 ++++++++- pnpm-lock.yaml | 39 ++++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index e06cbf77..b38fa36d 100755 --- a/package.json +++ b/package.json @@ -30,14 +30,21 @@ "autoprefixer": "^10.4.14", "chokidar": "^3.5.3", "clear-module": "^4.1.2", + "colorette": "^2.0.19", + "cookie-es": "^0.5.0", "defu": "^6.1.2", + "destr": "^1.2.2", + "h3": "^1.6.2", + "iron-webcrypto": "^0.6.0", "pathe": "^1.1.0", "postcss": "^8.4.21", "postcss-custom-properties": "^13.1.4", "postcss-nesting": "^11.2.1", + "radix3": "^1.0.0", "tailwind-config-viewer": "^1.7.2", "tailwindcss": "^3.2.7", - "ufo": "^1.1.1" + "ufo": "^1.1.1", + "uncrypto": "^0.1.2" }, "devDependencies": { "@fontsource/inter": "^4.5.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 411a5930..34749b26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,17 +15,24 @@ specifiers: chokidar: ^3.5.3 clear-module: ^4.1.2 codecov: latest + colorette: ^2.0.19 + cookie-es: ^0.5.0 defu: ^6.1.2 + destr: ^1.2.2 eslint: latest + h3: ^1.6.2 + iron-webcrypto: ^0.6.0 jsdom: ^21.1.1 nuxt: ^3.3.1 pathe: ^1.1.0 postcss: ^8.4.21 postcss-custom-properties: ^13.1.4 postcss-nesting: ^11.2.1 + radix3: ^1.0.0 tailwind-config-viewer: ^1.7.2 tailwindcss: ^3.2.7 ufo: ^1.1.1 + uncrypto: ^0.1.2 vitest: ^0.29.7 dependencies: @@ -34,14 +41,21 @@ dependencies: autoprefixer: 10.4.14_postcss@8.4.21 chokidar: 3.5.3 clear-module: 4.1.2 + colorette: 2.0.19 + cookie-es: 0.5.0 defu: 6.1.2 + destr: 1.2.2 + h3: 1.6.2 + iron-webcrypto: 0.6.0 pathe: 1.1.0 postcss: 8.4.21 postcss-custom-properties: 13.1.4_postcss@8.4.21 postcss-nesting: 11.2.1_postcss@8.4.21 + radix3: 1.0.0 tailwind-config-viewer: 1.7.2_tailwindcss@3.2.7 tailwindcss: 3.2.7_postcss@8.4.21 ufo: 1.1.1 + uncrypto: 0.1.2 devDependencies: '@fontsource/inter': 4.5.15 @@ -1459,7 +1473,7 @@ packages: birpc: 0.2.7 consola: 2.15.3 execa: 7.1.0 - h3: 1.6.0 + h3: 1.6.2 hookable: 5.5.1 is-installed-globally: 0.4.0 launch-editor: 2.6.0 @@ -1725,7 +1739,7 @@ packages: externality: 1.0.0 fs-extra: 11.1.0 get-port-please: 3.0.1 - h3: 1.6.0 + h3: 1.6.2 knitwork: 1.0.0 magic-string: 0.30.0 mlly: 1.2.0 @@ -3304,7 +3318,6 @@ packages: /cookie-es/0.5.0: resolution: {integrity: sha512-RyZrFi6PNpBFbIaQjXDlFIhFVqV42QeKSZX1yQIl6ihImq6vcHNGMtqQ/QzY3RMPuYSkvsRwtnt5M9NeYxKt0g==} - dev: true /cookies/0.8.0: resolution: {integrity: sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==} @@ -4871,17 +4884,16 @@ packages: duplexer: 0.1.2 dev: true - /h3/1.6.0: - resolution: {integrity: sha512-MthVCNIGkFnywJcwaPe7BWB5Y5BQJmtddu0ABnn3TAjkCqa/EzPafIfwv+wajWxjepRGrVsmu4X0ld5IGtLDHQ==} + /h3/1.6.2: + resolution: {integrity: sha512-1v/clj/qCzWbuiG+DbpViuOVO789sEYNjlwRjekkmyLGsezIJk30gazbnjcWvF8L/ffUdRz2SwxE5HNgNx+Yjg==} dependencies: cookie-es: 0.5.0 defu: 6.1.2 destr: 1.2.2 - iron-webcrypto: 0.5.0 + iron-webcrypto: 0.6.0 radix3: 1.0.0 ufo: 1.1.1 uncrypto: 0.1.2 - dev: true /has-bigints/1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} @@ -5287,9 +5299,8 @@ packages: resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} dev: true - /iron-webcrypto/0.5.0: - resolution: {integrity: sha512-9m0tDUIo+GPwDYi1CNlAW3ToIFTS9y88lf41KsEwbBsL4PKNjhrNDGoA0WlB6WWaJ6pgp+FOP1+6ls0YftivyA==} - dev: true + /iron-webcrypto/0.6.0: + resolution: {integrity: sha512-WYgEQttulX/+JTv1BTJFYY3OsAb+ZnCuA53IjppZMyiRsVdGeEuZ/k4fJrg77Rzn0pp9/PgWtXUF+5HndDA5SQ==} /is-absolute-url/4.0.1: resolution: {integrity: sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==} @@ -6759,7 +6770,7 @@ packages: fs-extra: 11.1.0 globby: 13.1.3 gzip-size: 7.0.0 - h3: 1.6.0 + h3: 1.6.2 hookable: 5.5.1 http-proxy: 1.18.1 is-primitive: 3.0.1 @@ -7049,7 +7060,7 @@ packages: estree-walker: 3.0.3 fs-extra: 11.1.0 globby: 13.1.3 - h3: 1.6.0 + h3: 1.6.2 hash-sum: 2.0.0 hookable: 5.5.1 jiti: 1.17.2 @@ -8027,7 +8038,6 @@ packages: /radix3/1.0.0: resolution: {integrity: sha512-6n3AEXth91ASapMVKiEh2wrbFJmI+NBilrWE0AbiGgfm0xet0QXC8+a3K19r1UVYjUjctUgB053c3V/J6V0kCQ==} - dev: true /randombytes/2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -9317,7 +9327,6 @@ packages: /uncrypto/0.1.2: resolution: {integrity: sha512-kuZwRKV615lEw/Xx3Iz56FKk3nOeOVGaVmw0eg+x4Mne28lCotNFbBhDW7dEBCBKyKbRQiCadEZeNAFPVC5cgw==} - dev: true /unctx/2.1.2: resolution: {integrity: sha512-KK18aLRKe3OlbPyHbXAkIWSU3xK8GInomXfA7fzDMGFXQ1crX1UWrCzKesVXeUyHIayHUrnTvf87IPCKMyeKTg==} @@ -9509,7 +9518,7 @@ packages: anymatch: 3.1.3 chokidar: 3.5.3 destr: 1.2.2 - h3: 1.6.0 + h3: 1.6.2 ioredis: 5.3.1 listhen: 1.0.4 lru-cache: 7.18.3 From 0f42a849f8d3bf226b5199af21f879b5748a244d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 21 Mar 2023 13:56:26 +0000 Subject: [PATCH 2/4] Revert "Revert "chore: using tw default config (#636)"" This reverts commit 83ecb44bdf66e695f7edc8efaa4cd12729c45d5a. --- src/module.ts | 4 ++-- src/tailwind.config.ts | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 src/tailwind.config.ts diff --git a/src/module.ts b/src/module.ts index 8adf1742..cbc14d4d 100644 --- a/src/module.ts +++ b/src/module.ts @@ -17,10 +17,10 @@ import { isNuxt3, findPath, requireModule } from '@nuxt/kit' import type { Config } from 'tailwindcss' +import defaultTailwindConfig from 'tailwindcss/defaultConfig' // tailwindcss/stubs/simpleConfig.stub import { eventHandler, sendRedirect } from 'h3' import { name, version } from '../package.json' import vitePlugin from './hmr' -import defaultTailwindConfig from './tailwind.config' import { createTemplates, InjectPosition, resolveInjectPosition } from './utils' const logger = useLogger('nuxt:tailwindcss') @@ -70,7 +70,7 @@ export default defineNuxtModule({ defaults: nuxt => ({ configPath: 'tailwind.config', cssPath: join(nuxt.options.dir.assets, 'css/tailwind.css'), - config: defaultTailwindConfig(), + config: defaultTailwindConfig, viewer: true, exposeConfig: false, exposeLevel: 2, diff --git a/src/tailwind.config.ts b/src/tailwind.config.ts deleted file mode 100644 index 7b287494..00000000 --- a/src/tailwind.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Learn more at https://tailwindcss.com/docs/configuration -import { Config } from 'tailwindcss' - -export default (): Config => ({ - theme: { - extend: {} - }, - plugins: [], - content: [ - // TODO: This makes issues with import protection - // Split in two files to avoid watching issues (https://github.com/nuxt-community/tailwindcss-module/issues/359) - // `${rootDir}/nuxt.config.js`, - // `${rootDir}/nuxt.config.ts` - ] -}) From 806cc4b857d2126f7e87cde341bdaaffacf2c332 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 21 Mar 2023 13:56:49 +0000 Subject: [PATCH 3/4] fix: use file extension (for esm support) --- src/module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index cbc14d4d..490d1bf2 100644 --- a/src/module.ts +++ b/src/module.ts @@ -17,7 +17,7 @@ import { isNuxt3, findPath, requireModule } from '@nuxt/kit' import type { Config } from 'tailwindcss' -import defaultTailwindConfig from 'tailwindcss/defaultConfig' // tailwindcss/stubs/simpleConfig.stub +import defaultTailwindConfig from 'tailwindcss/defaultConfig.js' // tailwindcss/stubs/simpleConfig.stub import { eventHandler, sendRedirect } from 'h3' import { name, version } from '../package.json' import vitePlugin from './hmr' From 98071eea8789830dd7bbd731ec5451cc490edabf Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 21 Mar 2023 14:07:42 +0000 Subject: [PATCH 4/4] fix: use tailwind stub Co-authored-by: Inesh Bose <56732164+ineshbose@users.noreply.github.com> --- src/module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 490d1bf2..ad50d037 100644 --- a/src/module.ts +++ b/src/module.ts @@ -17,7 +17,8 @@ import { isNuxt3, findPath, requireModule } from '@nuxt/kit' import type { Config } from 'tailwindcss' -import defaultTailwindConfig from 'tailwindcss/defaultConfig.js' // tailwindcss/stubs/simpleConfig.stub +// @ts-expect-error +import defaultTailwindConfig from 'tailwindcss/stubs/simpleConfig.stub.js' import { eventHandler, sendRedirect } from 'h3' import { name, version } from '../package.json' import vitePlugin from './hmr'