diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/next.config.js b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/next.config.js deleted file mode 100644 index 8b61df4e50f8a..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/next.config.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {import('next').NextConfig} */ -module.exports = { - reactStrictMode: true, -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/_app.tsx b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/_app.tsx deleted file mode 100644 index 3f5c9d5485860..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/_app.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import '../styles/globals.css' -import type { AppProps } from 'next/app' - -function MyApp({ Component, pageProps }: AppProps) { - return -} - -export default MyApp diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/api/hello.ts b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/api/hello.ts deleted file mode 100644 index f8bcc7e5caed1..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/api/hello.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next' - -type Data = { - name: string -} - -export default function handler( - req: NextApiRequest, - res: NextApiResponse -) { - res.status(200).json({ name: 'John Doe' }) -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/index.jsx b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/index.jsx deleted file mode 100644 index 217eb8e63055e..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/pages/index.jsx +++ /dev/null @@ -1,95 +0,0 @@ -import Head from 'next/head' -import Image from 'next/image' -import { useTestHarness } from '@turbo/pack-test-harness' - -const Home = () => { - useTestHarness(runTests) - return ( -
- - Create Next App - - - -
-

- Welcome to{' '} - - Next.js! - -

- -

- Get started by editing{' '} - - pages/index.tsx - -

- -
- -

Documentation →

-

- Find in-depth information about Next.js features and its API. -

-
- - -

Learn →

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

Examples →

-

- Discover and deploy boilerplate example Next.js projects. -

-
- - -

Deploy →

-

- Instantly deploy your Next.js site to a public URL with Vercel. -

-
-
-
- - -
- ) -} - -export default Home - -function runTests() { - console.log(document.querySelectorAll('footer')) - it('it should apply tailwind styles', function () { - const footer = document.querySelector('footer') - expect(getComputedStyle(footer).alignItems).toBe('center') - }) -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/postcss.config.js b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/postcss.config.js deleted file mode 100644 index 33ad091d26d8a..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/public/favicon.ico b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/public/favicon.ico deleted file mode 100644 index 4965832f2c9b0..0000000000000 Binary files a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/public/favicon.ico and /dev/null differ diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/public/vercel.svg b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/public/vercel.svg deleted file mode 100644 index fbf0e25a651c2..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/public/vercel.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/styles/globals.css b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/styles/globals.css deleted file mode 100644 index b5c61c956711f..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/styles/globals.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/tailwind.config.js b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/tailwind.config.js deleted file mode 100644 index 95b7c46ff8ab9..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/tailwind.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - './pages/**/*.{js,ts,jsx,tsx}', - './components/**/*.{js,ts,jsx,tsx}', - './app/**/*.{js,ts,jsx,tsx}', - ], - theme: { - extend: {}, - }, - plugins: [], -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/tsconfig.json b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/tsconfig.json deleted file mode 100644 index 61365f3fa7c03..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/input/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "paths": { - "@turbo/pack-test-harness": ["../../../../../../test-harness"] - } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "pages/index.jsx"], - "exclude": ["node_modules"] -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.existsSync(__q____q____q____star__0-55e40b.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.existsSync(__q____q____q____star__0-55e40b.txt deleted file mode 100644 index 004c2a51e57ae..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.existsSync(__q____q____q____star__0-55e40b.txt +++ /dev/null @@ -1,15 +0,0 @@ -warning - [parse] [project]/node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js /node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js:88:8 lint TP1004 fs.existsSync(???*0*) is very dynamic - 84 | } - 85 | - 86 | loadFile(path) { - 87 | this.root = dirname(path) - + v - 88 + if (existsSync(path)) { - + ^ - 89 | this.mapFile = path - 90 | return readFileSync(path, 'utf-8').toString().trim() - 91 | } - 92 | } - - - *0* arguments[0] - ⚠️ function calls are not analysed yet \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.existsSync(__q____q____q____star__0-bbe67b.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.existsSync(__q____q____q____star__0-bbe67b.txt deleted file mode 100644 index 004c2a51e57ae..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.existsSync(__q____q____q____star__0-bbe67b.txt +++ /dev/null @@ -1,15 +0,0 @@ -warning - [parse] [project]/node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js /node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js:88:8 lint TP1004 fs.existsSync(???*0*) is very dynamic - 84 | } - 85 | - 86 | loadFile(path) { - 87 | this.root = dirname(path) - + v - 88 + if (existsSync(path)) { - + ^ - 89 | this.mapFile = path - 90 | return readFileSync(path, 'utf-8').toString().trim() - 91 | } - 92 | } - - - *0* arguments[0] - ⚠️ function calls are not analysed yet \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-50ea93.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-50ea93.txt deleted file mode 100644 index fb6ae7c8a4cbe..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-50ea93.txt +++ /dev/null @@ -1,15 +0,0 @@ -warning - [parse] [project]/node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js /node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js:90:13 lint TP1004 fs.readFileSync(???*0*, "utf-8") is very dynamic - 86 | loadFile(path) { - 87 | this.root = dirname(path) - 88 | if (existsSync(path)) { - 89 | this.mapFile = path - + v - 90 + return readFileSync(path, 'utf-8').toString().trim() - + ^ - 91 | } - 92 | } - 93 | - 94 | loadMap(file, prev) { - - - *0* arguments[0] - ⚠️ function calls are not analysed yet \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-a3cd71.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-a3cd71.txt deleted file mode 100644 index fb6ae7c8a4cbe..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-a3cd71.txt +++ /dev/null @@ -1,15 +0,0 @@ -warning - [parse] [project]/node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js /node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/previous-map.js:90:13 lint TP1004 fs.readFileSync(???*0*, "utf-8") is very dynamic - 86 | loadFile(path) { - 87 | this.root = dirname(path) - 88 | if (existsSync(path)) { - 89 | this.mapFile = path - + v - 90 + return readFileSync(path, 'utf-8').toString().trim() - + ^ - 91 | } - 92 | } - 93 | - 94 | loadMap(file, prev) { - - - *0* arguments[0] - ⚠️ function calls are not analysed yet \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1006 path.resolve(__q____q____q____star__0_-820338.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1006 path.resolve(__q____q____q____star__0_-820338.txt deleted file mode 100644 index 745e0fe32d777..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1006 path.resolve(__q____q____q____star__0_-820338.txt +++ /dev/null @@ -1,17 +0,0 @@ -warning - [parse] [project]/node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/input.js /node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/input.js:44:20 lint TP1006 path.resolve(???*0*) is very dynamic - 40 | isAbsolute(opts.from) - 41 | ) { - 42 | this.file = opts.from - 43 | } else { - + v - 44 + this.file = resolve(opts.from) - + ^ - 45 | } - 46 | } - 47 | - 48 | if (pathAvailable && sourceMapAvailable) { - - - *0* ???*1*["from"] - ⚠️ unknown object - - *1* opts - ⚠️ pattern without value \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1006 path.resolve(__q____q____q____star__0_-c23a56.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1006 path.resolve(__q____q____q____star__0_-c23a56.txt deleted file mode 100644 index 745e0fe32d777..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/tailwind/basic/issues/lint TP1006 path.resolve(__q____q____q____star__0_-c23a56.txt +++ /dev/null @@ -1,17 +0,0 @@ -warning - [parse] [project]/node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/input.js /node_modules/.pnpm/postcss@8.4.14/node_modules/postcss/lib/input.js:44:20 lint TP1006 path.resolve(???*0*) is very dynamic - 40 | isAbsolute(opts.from) - 41 | ) { - 42 | this.file = opts.from - 43 | } else { - + v - 44 + this.file = resolve(opts.from) - + ^ - 45 | } - 46 | } - 47 | - 48 | if (pathAvailable && sourceMapAvailable) { - - - *0* ???*1*["from"] - ⚠️ unknown object - - *1* opts - ⚠️ pattern without value \ No newline at end of file diff --git a/test/development/basic/tailwind-jit.test.ts b/test/development/basic/tailwind-jit.test.ts index 1852ba9d73628..533cd10ebc94d 100644 --- a/test/development/basic/tailwind-jit.test.ts +++ b/test/development/basic/tailwind-jit.test.ts @@ -1,30 +1,30 @@ import { join } from 'path' import webdriver from 'next-webdriver' -import { createNext, FileRef } from 'e2e-utils' -import { NextInstance } from 'test/lib/next-modes/base' -import { check } from 'next-test-utils' +import { FileRef, nextTestSetup } from 'e2e-utils' +import { check, shouldRunTurboDevTest } from 'next-test-utils' -describe('TailwindCSS JIT', () => { - let next: NextInstance +// [TODO]: It is unclear why turbopack takes longer to run this test +// remove once it's fixed +if (shouldRunTurboDevTest()) { + jest.setTimeout(1000 * 60 * 5) +} - beforeAll(async () => { - next = await createNext({ - files: { - 'postcss.config.js': new FileRef( - join(__dirname, 'tailwind-jit/postcss.config.js') - ), - 'tailwind.config.js': new FileRef( - join(__dirname, 'tailwind-jit/tailwind.config.js') - ), - pages: new FileRef(join(__dirname, 'tailwind-jit/pages')), - }, - dependencies: { - tailwindcss: '2.2.19', - postcss: '8.3.5', - }, - }) +describe('TailwindCSS JIT', () => { + const { next } = nextTestSetup({ + files: { + 'postcss.config.js': new FileRef( + join(__dirname, 'tailwind-jit/postcss.config.js') + ), + 'tailwind.config.js': new FileRef( + join(__dirname, 'tailwind-jit/tailwind.config.js') + ), + pages: new FileRef(join(__dirname, 'tailwind-jit/pages')), + }, + dependencies: { + tailwindcss: '2.2.19', + postcss: '8.3.5', + }, }) - afterAll(() => next.destroy()) it('works with JIT enabled', async () => { let browser diff --git a/test/integration/css-fixtures/with-tailwindcss/package.json b/test/integration/css-fixtures/with-tailwindcss/package.json deleted file mode 100644 index 50375a78eb20b..0000000000000 --- a/test/integration/css-fixtures/with-tailwindcss/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "postcss": { - "plugins": { - "tailwindcss": {} - } - } -} diff --git a/test/integration/css-fixtures/with-tailwindcss/pages/_app.js b/test/integration/css-fixtures/with-tailwindcss/pages/_app.js deleted file mode 100644 index 0bd950249faeb..0000000000000 --- a/test/integration/css-fixtures/with-tailwindcss/pages/_app.js +++ /dev/null @@ -1,5 +0,0 @@ -import '../styles/global.css' - -export default function MyApp({ Component, pageProps }) { - return -} diff --git a/test/integration/css-fixtures/with-tailwindcss/pages/index.js b/test/integration/css-fixtures/with-tailwindcss/pages/index.js deleted file mode 100644 index b3ba78da2d5e1..0000000000000 --- a/test/integration/css-fixtures/with-tailwindcss/pages/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function Home() { - return
-} diff --git a/test/integration/css-fixtures/with-tailwindcss/styles/global.css b/test/integration/css-fixtures/with-tailwindcss/styles/global.css deleted file mode 100644 index b5c61c956711f..0000000000000 --- a/test/integration/css-fixtures/with-tailwindcss/styles/global.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/test/turbopack-tests-manifest.js b/test/turbopack-tests-manifest.js index fdae633aef0a4..19a43fb62de76 100644 --- a/test/turbopack-tests-manifest.js +++ b/test/turbopack-tests-manifest.js @@ -12,6 +12,7 @@ const enabledTests = [ 'test/development/basic/legacy-decorators.test.ts', 'test/development/basic/misc.test.ts', 'test/development/basic/next-rs-api.test.ts', + 'test/development/basic/tailwind-jit.test.ts', 'test/development/basic/theme-ui.test.ts', 'test/development/client-dev-overlay/index.test.ts', 'test/development/correct-tsconfig-defaults/index.test.ts', @@ -158,7 +159,6 @@ module.exports = { enabledTests } 'test/development/basic/emotion-swc.test.ts', 'test/development/basic/legacy-decorators.test.ts', 'test/development/basic/project-directory-rename.test.ts', - 'test/development/basic/tailwind-jit.test.ts', 'test/development/basic/theme-ui.test.ts', 'test/development/dotenv-default-expansion/index.test.ts', 'test/development/jsconfig-path-reloading/index.test.ts',