diff --git a/.github/workflows/ci-stable.yml b/.github/workflows/ci-stable.yml index 60d6abb9a0c8..80d19dca07c1 100644 --- a/.github/workflows/ci-stable.yml +++ b/.github/workflows/ci-stable.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: - node-version: [12, 18] + node-version: [14, 18] steps: - uses: actions/checkout@v3 @@ -50,7 +50,10 @@ jobs: run: npm run build - name: Test - run: npm run test + run: | + npm run test || \ + npm run test || \ + npm run test || exit 1 - name: Lint run: npm run style diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29b96700c8e8..3e2433d3b7ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,10 @@ jobs: run: npx turbo run build --filter=// - name: Test - run: npx turbo run test --filter=// + run: | + npx turbo run test --filter=// || \ + npx turbo run test --filter=// || \ + npx turbo run test --filter=// || exit 1 - name: Lint run: npx turbo run style --filter=// diff --git a/.github/workflows/integration-tests-oxide.yml b/.github/workflows/integration-tests-oxide.yml index b9b3e513d6f2..9da82b4b873b 100644 --- a/.github/workflows/integration-tests-oxide.yml +++ b/.github/workflows/integration-tests-oxide.yml @@ -78,4 +78,7 @@ jobs: run: npx turbo run build --filter=// - name: Test ${{ matrix.integration }} - run: npx turbo run test --filter=./integrations/${{ matrix.integration }} + run: | + npx turbo run test --filter=./integrations/${{ matrix.integration }} || \ + npx turbo run test --filter=./integrations/${{ matrix.integration }} || \ + npx turbo run test --filter=./integrations/${{ matrix.integration }} || exit 1 diff --git a/.github/workflows/integration-tests-stable.yml b/.github/workflows/integration-tests-stable.yml index 86329d4044bd..b2820719656b 100644 --- a/.github/workflows/integration-tests-stable.yml +++ b/.github/workflows/integration-tests-stable.yml @@ -77,4 +77,7 @@ jobs: run: npm run build - name: Test ${{ matrix.integration }} - run: npm run test --prefix ./integrations/${{ matrix.integration }} + run: | + npm run test --prefix ./integrations/${{ matrix.integration }} || \ + npm run test --prefix ./integrations/${{ matrix.integration }} || \ + npm run test --prefix ./integrations/${{ matrix.integration }} || exit 1 diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 4ec646df71c6..2ad36d3dd670 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -65,7 +65,10 @@ jobs: working-directory: standalone-cli - name: Test - run: npm test + run: | + npm test || \ + npm test || \ + npm test || exit 1 working-directory: standalone-cli - name: Release diff --git a/.github/workflows/release-insiders-oxide.yml b/.github/workflows/release-insiders-oxide.yml index 9e1dd9a0edc5..4130349ba190 100644 --- a/.github/workflows/release-insiders-oxide.yml +++ b/.github/workflows/release-insiders-oxide.yml @@ -170,7 +170,7 @@ jobs: include: - target: x86_64-unknown-linux-gnu strip: strip - image: docker.io/centos/nodejs-12-centos7 + image: docker.io/centos/nodejs-14-centos7 - target: aarch64-unknown-linux-gnu strip: aarch64-linux-gnu-strip image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian @@ -387,7 +387,10 @@ jobs: run: npm run build - name: Test - run: npm test + run: | + npm test || \ + npm test || \ + npm test || exit 1 - name: 'Version based on commit: 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }}' run: npm version 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }} --force --no-git-tag-version diff --git a/.github/workflows/release-insiders-stable.yml b/.github/workflows/release-insiders-stable.yml index 956473f696c2..f8bb322d412f 100644 --- a/.github/workflows/release-insiders-stable.yml +++ b/.github/workflows/release-insiders-stable.yml @@ -44,7 +44,10 @@ jobs: run: npm run build - name: Test - run: npm run test + run: | + npm run test || \ + npm run test || \ + npm run test || exit 1 - name: Resolve version id: vars diff --git a/.github/workflows/release-oxide.yml b/.github/workflows/release-oxide.yml index b352e6ef180a..ad71ec657ce9 100644 --- a/.github/workflows/release-oxide.yml +++ b/.github/workflows/release-oxide.yml @@ -138,7 +138,7 @@ jobs: include: - target: x86_64-unknown-linux-gnu strip: strip - image: docker.io/centos/nodejs-12-centos7 + image: docker.io/centos/nodejs-14-centos7 - target: aarch64-unknown-linux-gnu strip: aarch64-linux-gnu-strip image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian diff --git a/.github/workflows/release-stable.yml b/.github/workflows/release-stable.yml index dd4509f0ad82..23a3f2dc0d7c 100644 --- a/.github/workflows/release-stable.yml +++ b/.github/workflows/release-stable.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [12] + node-version: [14] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index b654143f46d2..fd899dc532aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,15 +9,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing yet! +## [3.3.2] - 2023-04-25 + +### Fixed + +- Donβt move unknown pseudo-elements to the end of selectors ([#10943](https://github.com/tailwindlabs/tailwindcss/pull/10943), [#10962](https://github.com/tailwindlabs/tailwindcss/pull/10962)) +- Inherit gradient stop positions when using variants ([#11002](https://github.com/tailwindlabs/tailwindcss/pull/11002)) +- Honor default `to` position of gradient when using implicit transparent colors ([#11002](https://github.com/tailwindlabs/tailwindcss/pull/11002)) +- Ensure `@tailwindcss/oxide` doesn't leak in the stable engine ([#10988](https://github.com/tailwindlabs/tailwindcss/pull/10988)) +- Ensure multiple `theme(spacing[5])` calls with bracket notation in arbitrary properties work ([#11039](https://github.com/tailwindlabs/tailwindcss/pull/11039)) +- Normalize arbitrary modifiers ([#11057](https://github.com/tailwindlabs/tailwindcss/pull/11057)) + +### Changed + +- Drop support for Node.js v12 ([#11089](https://github.com/tailwindlabs/tailwindcss/pull/11089)) + ## [3.3.1] - 2023-03-30 ### Fixed -- Try resolving `config.default` before `config` to ensure the config file is resolved correctly ([#10898](https://github.com/tailwindlabs/tailwindcss/pull/10898)) -- Pull pseudo elements outside of `:is` and `:has` when using `@apply` ([#10903](https://github.com/tailwindlabs/tailwindcss/pull/10903)) -- Update the types for the `safelist` config ([#10901](https://github.com/tailwindlabs/tailwindcss/pull/10901)) -- Fix `@tailwindcss/line-clamp` warning ([#10915](https://github.com/tailwindlabs/tailwindcss/pull/10915), [#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) -- Fix `process` is not defined error ([#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) +- Fix edge case bug when loading a TypeScript config file with webpack ([#10898](https://github.com/tailwindlabs/tailwindcss/pull/10898)) +- Fix variant, `@apply`, and `important` selectors when using `:is()` or `:has()` with pseudo-elements ([#10903](https://github.com/tailwindlabs/tailwindcss/pull/10903)) +- Fix `safelist` config types ([#10901](https://github.com/tailwindlabs/tailwindcss/pull/10901)) +- Fix build errors caused by `@tailwindcss/line-clamp` warning ([#10915](https://github.com/tailwindlabs/tailwindcss/pull/10915), [#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) +- Fix "process is not defined" error ([#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) ## [3.3.0] - 2023-03-27 @@ -2221,7 +2236,8 @@ No release notes - Everything! -[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.1...HEAD +[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.2...HEAD +[3.3.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.1...v3.3.2 [3.3.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.0...v3.3.1 [3.3.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.7...v3.3.0 [3.2.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.6...v3.2.7 diff --git a/integrations/content-resolution/package.json b/integrations/content-resolution/package.json index 2452c74eb00c..5587595d741b 100644 --- a/integrations/content-resolution/package.json +++ b/integrations/content-resolution/package.json @@ -18,7 +18,7 @@ } }, "devDependencies": { - "postcss": "^8.4.21", - "postcss-cli": "^9.1.0" + "postcss": "^8.4.23", + "postcss-cli": "^10.1.0" } } diff --git a/integrations/parcel/tests/integration.test.js b/integrations/parcel/tests/integration.test.js index 55e7f83a38b0..b86af727ecce 100644 --- a/integrations/parcel/tests/integration.test.js +++ b/integrations/parcel/tests/integration.test.js @@ -74,7 +74,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -85,7 +85,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -138,7 +138,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -149,7 +149,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -202,7 +202,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html`
`) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-red-500 { @@ -219,7 +219,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-red-500 { @@ -274,7 +274,7 @@ describe('watcher', () => { await appendToInputFile('glob/index.html', html``) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-red-500 { @@ -291,7 +291,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .bg-red-500 { @@ -445,7 +445,7 @@ describe('watcher', () => { ) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .btn { @@ -461,7 +461,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss( css` .btn { diff --git a/integrations/postcss-cli/package.json b/integrations/postcss-cli/package.json index 1a0b8fe71612..07967231d8bf 100644 --- a/integrations/postcss-cli/package.json +++ b/integrations/postcss-cli/package.json @@ -18,7 +18,7 @@ } }, "devDependencies": { - "postcss": "^8.4.21", - "postcss-cli": "^9.1.0" + "postcss": "^8.4.23", + "postcss-cli": "^10.1.0" } } diff --git a/integrations/postcss-cli/tests/integration.test.js b/integrations/postcss-cli/tests/integration.test.js index 36cfe7f4c4f5..46f5a61a6dc3 100644 --- a/integrations/postcss-cli/tests/integration.test.js +++ b/integrations/postcss-cli/tests/integration.test.js @@ -61,7 +61,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -78,7 +78,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -128,7 +128,7 @@ describe('watcher', () => { await appendToInputFile('glob/index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -145,7 +145,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -284,7 +284,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .btn { @@ -303,7 +303,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` /* prettier-ignore */ diff --git a/integrations/rollup-sass/package.json b/integrations/rollup-sass/package.json index bbe4f40fb730..b1eaa6e94be7 100644 --- a/integrations/rollup-sass/package.json +++ b/integrations/rollup-sass/package.json @@ -18,8 +18,8 @@ } }, "devDependencies": { - "rollup": "^3.20.0", + "rollup": "^3.21.0", "rollup-plugin-postcss": "^4.0.2", - "sass": "^1.59.3" + "sass": "^1.62.0" } } diff --git a/integrations/rollup-sass/tests/integration.test.js b/integrations/rollup-sass/tests/integration.test.js index 7d359577eea1..19a7695659d8 100644 --- a/integrations/rollup-sass/tests/integration.test.js +++ b/integrations/rollup-sass/tests/integration.test.js @@ -61,7 +61,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -78,7 +78,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -128,7 +128,7 @@ describe('watcher', () => { await appendToInputFile('glob/index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -145,7 +145,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -282,7 +282,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { @@ -298,7 +298,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { @@ -377,7 +377,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { @@ -393,7 +393,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { diff --git a/integrations/rollup/package.json b/integrations/rollup/package.json index e8a076e5322c..21da41dbdfc0 100644 --- a/integrations/rollup/package.json +++ b/integrations/rollup/package.json @@ -18,7 +18,7 @@ } }, "devDependencies": { - "rollup": "^3.20.0", + "rollup": "^3.21.0", "rollup-plugin-postcss": "^4.0.2" } } diff --git a/integrations/rollup/tests/integration.test.js b/integrations/rollup/tests/integration.test.js index dbbfcc8d11f1..c3209af6589a 100644 --- a/integrations/rollup/tests/integration.test.js +++ b/integrations/rollup/tests/integration.test.js @@ -62,7 +62,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-primary { @@ -73,7 +73,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-primary { @@ -120,7 +120,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-primary { @@ -131,7 +131,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-primary { @@ -175,7 +175,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -192,7 +192,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -242,7 +242,7 @@ describe('watcher', () => { await appendToInputFile('glob/index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -259,7 +259,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .bg-red-500 { @@ -396,7 +396,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { @@ -415,7 +415,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { diff --git a/integrations/tailwindcss-cli/tests/cli.test.js b/integrations/tailwindcss-cli/tests/cli.test.js index f30260b0b6de..0c42ce0cc506 100644 --- a/integrations/tailwindcss-cli/tests/cli.test.js +++ b/integrations/tailwindcss-cli/tests/cli.test.js @@ -19,6 +19,7 @@ let { }) let EXECUTABLE = 'node ../../lib/cli.js' +let testStable = env.ENGINE === 'stable' ? test : test.skip function dedent(input) { let lines = input.split('\n') @@ -97,7 +98,7 @@ describe('Build command', () => { expect(withoutMinify.length).toBeGreaterThan(withMinify.length) }) - test('--no-autoprefixer', async () => { + testStable('--no-autoprefixer', async () => { await writeInputFile('index.html', html``) await $(`${EXECUTABLE} --output ./dist/main.css`) @@ -183,7 +184,7 @@ describe('Build command', () => { ) }) - test('--postcss (postcss.config.js)', async () => { + testStable('--postcss (postcss.config.js)', async () => { await writeInputFile('index.html', html``) let customConfig = javascript` @@ -216,7 +217,7 @@ describe('Build command', () => { await $(`${EXECUTABLE} --output ./dist/main.css --postcss`) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .font-bold-after { @@ -235,7 +236,7 @@ describe('Build command', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .font-bold-after { @@ -254,7 +255,7 @@ describe('Build command', () => { } }) - test('--postcss (custom.postcss.config.js)', async () => { + testStable('--postcss (custom.postcss.config.js)', async () => { await writeInputFile('index.html', html``) let customConfig = javascript` @@ -287,7 +288,7 @@ describe('Build command', () => { await $(`${EXECUTABLE} --output ./dist/main.css --postcss ./custom.postcss.config.js`) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .font-bold-after { @@ -306,7 +307,7 @@ describe('Build command', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .font-bold-after { @@ -325,7 +326,7 @@ describe('Build command', () => { } }) - test('--postcss supports process options', async () => { + testStable('--postcss supports process options', async () => { await writeInputFile('index.html', html``) let customConfig = javascript` @@ -359,7 +360,7 @@ describe('Build command', () => { expect(contents).toContain(`/*# sourceMappingURL`) }) - test('--postcss supports process options with custom config', async () => { + testStable('--postcss supports process options with custom config', async () => { await writeInputFile('index.html', html``) let customConfig = javascript` @@ -480,7 +481,7 @@ describe('Build command', () => { return runningProcess.stop() }) - test('postcss-import is included when using a custom postcss configuration', async () => { + testStable('postcss-import is included when using a custom postcss configuration', async () => { cleanupFile('src/test.css') await writeInputFile('index.html', html``) @@ -508,26 +509,47 @@ describe('Build command', () => { test('--help', async () => { let { combined } = await $(`${EXECUTABLE} --help`) - expect(dedent(combined)).toEqual( - dedent(` - tailwindcss v${version} - - Usage: - tailwindcss build [options] - - Options: - -i, --input Input file - -o, --output Output file - -w, --watch Watch for changes and rebuild as needed - -p, --poll Use polling instead of filesystem events when watching - --content Content paths to use for removing unused classes - --postcss Load custom PostCSS configuration - -m, --minify Minify the output - -c, --config Path to a custom config file - --no-autoprefixer Disable autoprefixer - -h, --help Display usage information - `) - ) + if (env.ENGINE === 'oxide') { + expect(dedent(combined)).toEqual( + dedent(` + tailwindcss v${version} + + Usage: + tailwindcss build [options] + + Options: + -i, --input Input file + -o, --output Output file + -w, --watch Watch for changes and rebuild as needed + -p, --poll Use polling instead of filesystem events when watching + --content Content paths to use for removing unused classes + -m, --minify Minify the output + -c, --config Path to a custom config file + -h, --help Display usage information + `) + ) + } else if (env.ENGINE === 'stable') { + expect(dedent(combined)).toEqual( + dedent(` + tailwindcss v${version} + + Usage: + tailwindcss build [options] + + Options: + -i, --input Input file + -o, --output Output file + -w, --watch Watch for changes and rebuild as needed + -p, --poll Use polling instead of filesystem events when watching + --content Content paths to use for removing unused classes + --postcss Load custom PostCSS configuration + -m, --minify Minify the output + -c, --config Path to a custom config file + --no-autoprefixer Disable autoprefixer + -h, --help Display usage information + `) + ) + } }) }) @@ -589,7 +611,7 @@ describe('Init command', () => { expect((await readOutputFile('../full.config.js')).split('\n').length).toBeGreaterThan(50) }) - test('--postcss', async () => { + testStable('--postcss', async () => { expect(await fileExists('postcss.config.js')).toBe(true) await removeFile('postcss.config.js') expect(await fileExists('postcss.config.js')).toBe(false) @@ -609,21 +631,38 @@ describe('Init command', () => { test('--help', async () => { let { combined } = await $(`${EXECUTABLE} init --help`) - expect(dedent(combined)).toEqual( - dedent(` - tailwindcss v${version} + if (env.ENGINE === 'oxide') { + expect(dedent(combined)).toEqual( + dedent(` + tailwindcss v${version} - Usage: - tailwindcss init [options] + Usage: + tailwindcss init [options] - Options: - --esm Initialize configuration file as ESM - --ts Initialize configuration file as TypeScript - -p, --postcss Initialize a \`postcss.config.js\` file - -f, --full Include the default values for all options in the generated configuration file - -h, --help Display usage information - `) - ) + Options: + --esm Initialize configuration file as ESM + --ts Initialize configuration file as TypeScript + -f, --full Include the default values for all options in the generated configuration file + -h, --help Display usage information + `) + ) + } else if (env.ENGINE === 'stable') { + expect(dedent(combined)).toEqual( + dedent(` + tailwindcss v${version} + + Usage: + tailwindcss init [options] + + Options: + --esm Initialize configuration file as ESM + --ts Initialize configuration file as TypeScript + -p, --postcss Initialize a \`postcss.config.js\` file + -f, --full Include the default values for all options in the generated configuration file + -h, --help Display usage information + `) + ) + } }) test('ESM config is created by default in an ESM project', async () => { diff --git a/integrations/tailwindcss-cli/tests/integration.test.js b/integrations/tailwindcss-cli/tests/integration.test.js index 6efa9fdf5e44..75c9779af8f8 100644 --- a/integrations/tailwindcss-cli/tests/integration.test.js +++ b/integrations/tailwindcss-cli/tests/integration.test.js @@ -72,7 +72,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -92,7 +92,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -145,7 +145,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -156,7 +156,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -203,7 +203,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -214,7 +214,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -262,7 +262,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -273,7 +273,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -329,7 +329,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -340,7 +340,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -375,7 +375,7 @@ describe('static build', () => { env: { NODE_ENV: 'production' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -386,7 +386,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -430,7 +430,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -447,7 +447,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -497,7 +497,7 @@ describe('watcher', () => { await appendToInputFile('glob/index.html', html``) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -514,7 +514,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -703,7 +703,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .btn { @@ -722,7 +722,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .btn { @@ -800,7 +800,7 @@ describe('watcher', () => { let runningProcess = $('node ../../lib/cli.js -i ./src/index.css -o ./dist/main.css -w') await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -811,7 +811,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -832,7 +832,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -843,7 +843,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -876,7 +876,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { @@ -887,7 +887,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-yellow { diff --git a/integrations/vite/package.json b/integrations/vite/package.json index 4a818dac6bdf..4b9649cab430 100644 --- a/integrations/vite/package.json +++ b/integrations/vite/package.json @@ -21,6 +21,6 @@ }, "devDependencies": { "isomorphic-fetch": "^3.0.0", - "vite": "^4.2.1" + "vite": "^4.3.2" } } diff --git a/integrations/vite/tests/integration.test.js b/integrations/vite/tests/integration.test.js index a07a2a9a6efc..b1a8163b2b35 100644 --- a/integrations/vite/tests/integration.test.js +++ b/integrations/vite/tests/integration.test.js @@ -75,7 +75,7 @@ describe('static build', () => { env: { NODE_ENV: 'production', NO_COLOR: '1' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -86,7 +86,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -131,7 +131,7 @@ describe('static build', () => { env: { NODE_ENV: 'production', NO_COLOR: '1' }, }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -142,7 +142,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss( css` .bg-primary { @@ -194,7 +194,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) await runningProcess.onStdout((message) => message.includes('page reload')) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await fetchCSS()).toIncludeCss( css` .bg-red-500 { @@ -211,7 +211,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await fetchCSS()).toIncludeCss( css` .bg-red-500 { @@ -265,7 +265,7 @@ describe('watcher', () => { await appendToInputFile('glob/index.html', html``) await runningProcess.onStdout((message) => message.includes('page reload')) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await fetchCSS()).toIncludeCss( css` .bg-red-500 { @@ -282,7 +282,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await fetchCSS()).toIncludeCss( css` .bg-red-500 { @@ -435,7 +435,7 @@ describe('watcher', () => { ) await runningProcess.onStdout((message) => message.includes('hmr update /index.css')) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await fetchCSS()).toIncludeCss( css` .btn { @@ -454,7 +454,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await fetchCSS()).toIncludeCss( css` .btn { diff --git a/integrations/webpack-4/tests/integration.test.js b/integrations/webpack-4/tests/integration.test.js index a666721bbdc1..e2e24cf45cac 100644 --- a/integrations/webpack-4/tests/integration.test.js +++ b/integrations/webpack-4/tests/integration.test.js @@ -58,7 +58,7 @@ describe('static build', () => { await $('webpack --mode=production') - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -69,7 +69,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -114,7 +114,7 @@ describe('static build', () => { await $('webpack --mode=production') - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -125,7 +125,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -172,7 +172,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -189,7 +189,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -242,7 +242,7 @@ describe('watcher', () => { await appendToInputFile('glob/index.html', html``) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -259,7 +259,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -401,7 +401,7 @@ describe('watcher', () => { ) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .btn { @@ -420,7 +420,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .btn { diff --git a/integrations/webpack-5/package.json b/integrations/webpack-5/package.json index 713e7cbdfb9b..0e708f9dad79 100644 --- a/integrations/webpack-5/package.json +++ b/integrations/webpack-5/package.json @@ -21,10 +21,10 @@ } }, "devDependencies": { - "css-loader": "^6.7.1", - "mini-css-extract-plugin": "^2.7.2", - "postcss-loader": "^6.2.1", - "webpack": "^5.75.0", - "webpack-cli": "^5.0.1" + "css-loader": "^6.7.3", + "mini-css-extract-plugin": "^2.7.5", + "postcss-loader": "^7.2.4", + "webpack": "^5.80.0", + "webpack-cli": "^5.0.2" } } diff --git a/integrations/webpack-5/tests/integration.test.js b/integrations/webpack-5/tests/integration.test.js index ae493fbdbb66..83b42f5f867f 100644 --- a/integrations/webpack-5/tests/integration.test.js +++ b/integrations/webpack-5/tests/integration.test.js @@ -58,7 +58,7 @@ describe('static build', () => { await $('webpack --mode=production') - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -69,7 +69,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -114,7 +114,7 @@ describe('static build', () => { await $('webpack --mode=production') - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -125,7 +125,7 @@ describe('static build', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-primary { @@ -172,7 +172,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -189,7 +189,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -242,7 +242,7 @@ describe('watcher', () => { await appendToInputFile('index.html', html``) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -259,7 +259,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -401,7 +401,7 @@ describe('watcher', () => { ) }) - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .btn { @@ -420,7 +420,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .btn { @@ -464,7 +464,7 @@ describe('watcher', () => { await waitForOutputFileCreation('main.css') - if (!env.OXIDE) { + if (env.ENGINE === 'stable') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { @@ -484,7 +484,7 @@ describe('watcher', () => { ) } - if (env.OXIDE) { + if (env.ENGINE === 'oxide') { expect(await readOutputFile('main.css')).toIncludeCss( css` .bg-red-500 { diff --git a/jest/global-setup.js b/jest/global-setup.js index 65a8dd4dd32a..b28ac7377b86 100644 --- a/jest/global-setup.js +++ b/jest/global-setup.js @@ -1,6 +1,9 @@ let { execSync } = require('child_process') +let state = { ran: false } module.exports = function () { + if (state.ran) return execSync('npm run build:rust', { stdio: 'ignore' }) execSync('npm run generate:plugin-list', { stdio: 'ignore' }) + state.ran = true } diff --git a/jest/runInTempDirectory.js b/jest/runInTempDirectory.js index 8524dd6ee118..80807e4c5f4f 100644 --- a/jest/runInTempDirectory.js +++ b/jest/runInTempDirectory.js @@ -1,25 +1,26 @@ -import fs from 'fs' +import fs from 'fs/promises' import path from 'path' - -import rimraf from 'rimraf' +import { rimraf } from 'rimraf' let id = 0 -export default function (callback) { - return new Promise((resolve) => { - const workerId = `${process.env.JEST_WORKER_ID}-${id++}` - const tmpPath = path.resolve(__dirname, `../__tmp_${workerId}`) - const currentPath = process.cwd() +/** + * @template T + * @param {() => Promise