4996 Commits

Author SHA1 Message Date
Adam Wathan
937ac139a1
Include outline-color in default color properties to transition (#10385)
Co-Authored-By: Dilshod <28673719+deebov@users.noreply.github.com>

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Dilshod <28673719+deebov@users.noreply.github.com>
2023-01-21 14:52:55 -05:00
Adam Wathan
c8e484c68b Add script for running integration tests 2023-01-21 11:28:24 -05:00
Adam Wathan
ff2c25f340
Update CHANGELOG.md 2023-01-21 10:55:51 -05:00
Adam Wathan
ed8ff92b03
Always sort candidates (#10382)
* Always sort candidates

* Sort candidates in Rust in Oxide engine

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-01-21 10:52:02 -05:00
Robin Malfait
e17855b4d4
Fine-tune turbo.json config to improve cache hits (#10377)
* play with turbo configuration

* tmp: random change, let's test caches

* remove unnecessary inputs

Inputs are implicit via the `"dependsOn": ["//#build"],`

* use `inputs` instead of `outputs` for `//#style`

* Revert "tmp: random change, let's test caches"

This reverts commit 77e9be6dc41bc432bee7589f77d8b9fc02369e2a.

* remove empty `outputs` configs
2023-01-21 01:06:41 +01:00
Robin Malfait
371b6ea83d
include matrix.target in cache key
There was a collision that I only noticed once we rand this exact
workflow. Including the matrix.target should resolve the incorrect cache
key.
2023-01-20 23:06:37 +01:00
Robin Malfait
f9d0c1e7df
Cache the oxide targets (#10374)
* cache the `oxide` targets

This will cache the oxide related build files to hopefully minimize the
amount of Rust compiling.

* tmp: drop turbo

* cache `./oxide/target/`

Thanks @thecrypticace!

* no need to cache `oxide` files

This will already be cached by GitHub actions. This should save us many
GBs on Vercel.com and Rust (or Cargo) is way better in using existing
cached information so this mix of caches between Turbo and GitHub
actions is kind of nice.

* Revert "tmp: drop turbo"

This reverts commit 22761d3a6669205a65695c6887bc9fda5f495adf.

* improve caching for integration tests and insiders release
2023-01-20 22:50:32 +01:00
Adam Wathan
42136e94ce
Run test suite against both engines (#10373)
* Run test suite against both engines

* make eslint happy

* only run `stable` tests on Node 12

* use normal expectation instead of snapshot file

When we run the tests only against `stable` (for node 12), then the
snapshots exists for the `Oxide` build. They are marked as `obsolete`
and will cause the `npm run test` script to fail. Sadly.

Inlined them for now, but ideally we make those tests more blackbox-y so
that we test that we get source maps and that we can map the sourcemap
back to the input files (without looking at the actual annotations).

* properly indent inline css

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-01-20 18:45:04 +01:00
Robin Malfait
7d1491449e
fix build status in README 2023-01-20 18:34:29 +01:00
Robin Malfait
019fddb32b
Bump dependencies (#10368)
* bump dependencies

* update changelog
2023-01-20 13:28:26 +01:00
Robin Malfait
5b078d9f83
use Node 16
We used this before, but I thought "why not bump it", so let's not bump
it yet...
2023-01-19 18:21:25 +01:00
Robin Malfait
73f86b1d43
use Node 18 for oxide release 2023-01-19 18:17:00 +01:00
Robin Malfait
b1f4da70d1
Separate stable and oxide engines (#10359)
* separate `stable` and `oxide` mode (package.json in this case)

* drop `install` script (we use a workspace now)

* change required engine to 16

* enable OXIDE by default

* ignore generated `oxide` files

* splitup package.json scripts into "public" and "private" scripts

Not ideal of course, but this should make it a tiny bit easier to know
which scripts _you_ as a developer / contributor have to run.

* drop `workspaces` from the `stable` engine

* drop `oxide` related build files from the `stable` engine

* drop `oxide` engine specific dependencies from the `stable` engine

* use the `oxide-node-api-shim` for the `stable` engine

* add little script to swap the engines

* drop `oxide:build` from `turbo` config

* configure `ci` for `stable` and `oxide` engines

- rename `nodejs.yml` -> `ci.yml`
- add `ci-stable.yml` (for stable mode and Node 12)
- ensure to use the `stable` engine in the `ci-stable.yml` workflow
- drop `oxide:___` specific scripts

* rename `release-insiders` to `release-insiders-stable`

This way we will be able to remove all files that contain `stable` once
we are ready.

* rename `release-insiders-oxide` to just `release-insiders`

* cleanup insider related workflows

* rename `release` -> `release-stable`

* rename `release-oxide` -> `release`

* change names of release workflows

* drop `oxide-` prefix from jobs

* inline node versions

* do not use `turbo` for the stable build

Can't use it because we don't have a workspace in the stable build.

* re-rename CI workflow

* encode default engine in relevant `package.json` files

* make Node 12 work

* increase `node-version` matrix

* make release workflows explicit (per engine)

* add `Oxide` to workflow name

* add integration tests for the `oxide` engine

* add integration tests for the `stable` engine

* run `oxide` integrations against node `18`

* run `stable` integration tests against node 18

We should test node 12 for tailwindcss, but integrations itself can run
against a newer version. In fact, we always ran them against node 16.

* use `localhost` instead of `0.0.0.0`

* ensure `webpack-4` works on Node 18

* run relese scripst directly

Instead of going via `npm`. It's a bit nicer and quicker!

* drop unused scripts

* sync package-lock.json

* ensure to generate the plugin list before running `jest`

We _could_ use an `npm run pretest`, but then you can't run `jest`
directly anymore (which is required for some tools like vscode
extensions).

* cleanup npm scripts

* drop pretend comments

* fix typo

* add `build:rust` as a pre-jest run script
2023-01-19 11:58:25 -05:00
depfu[bot]
07fe8bfe2b
Upgrade rollup: 2.79.1 → 3.10.0 (major) (#10360)
* Update rollup to version 3.10.0

* Update Rollup integrations for Rollup 3

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2023-01-19 08:23:02 -05:00
Jonathan Reinink
377bac20b5 Update Vite integrations lock file 2023-01-19 08:05:53 -05:00
depfu[bot]
0149027cf8
Update vite to version 4.0.4 (#10356)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-01-19 08:03:33 -05:00
Robin Malfait
1454190ea0
inline tests (#10362)
This will reduce the amount of different test "implementations" and
should further unify/normalise the tests. Some tests are very large and
can be split up more but this is a start in the right direction.

One of the biggest benefits is that changes in the tests file re-trigger
a jest run in watch mode. A change in the HTML/CSS file won't.
2023-01-19 11:42:52 +01:00
depfu[bot]
b4833a9de9 Update turbo to version 1.7.0 2023-01-18 07:01:44 +00:00
Jordan Pittman
91b4b93866
Allow variants with slashes in the name (#10336)
* Check for full variant before checking for modifier

* Update changelog
2023-01-16 14:41:34 -05:00
Adam Wathan
9e34619dd6
Add logical properties support for inline direction (#10166)
* ensure we use `npm@7` for older versions of Node.js

This is important so that we can guarantee that `workspaces` are
supported which we depend on right now (just for install purposes).

* tmp: trigger CI build (GitHub is doing funky things and not working right now)

* drop Node.js 12 from Node.js CI workflow

* focus on Node.js 16 for now

* Revert "tmp: trigger CI build (GitHub is doing funky things and not working right now)"

This reverts commit a3deed472da498f8a52404b2e8ccbc16f0e93101.

* WIP

* Add support for logical properties in inline direction

* Add scroll-margin/scroll-padding utilities

* Update CHANGELOG

* Rename inset-s/e to start/end

* Update sort order in test

* Use logical properties for space/divide in Oxide

* run non-oxide and OXIDE tests

+ fix oxide version tests

* drop oxide specific test job

The normal `npm run test` will already include the non-oxide and oxide
version when running tests.

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-01-16 18:57:42 +01:00
depfu[bot]
d0ecd29886 Update eslint to version 8.31.0 2023-01-13 23:51:23 +00:00
depfu[bot]
6e40a8ea80 Update postcss to version 8.4.21 2023-01-13 21:19:46 +00:00
Robin Malfait
2a403267d8
Oxide (#10252)
* temporarily disable workflows

* add oxide

Our Rust related parts

* use oxide

- Setup the codebase to be able to use the Rust parts based on an
  environment variable: `OXIDE=1`.
- Setup some tests that run both the non-Rust and Rust version in the
  same test.
- Sort the candidates in a consistent way, to guarantee the order for
  now (especially in tests).
- Reflect sorting related changes in tests.
- Ensure tests run in both the Rust and non-Rust version. (Some tests
  are explicitly skipped when using the Rust version since we haven't
  implemented those features yet. These include: custom prefix,
  transformers and extractors).
  - `jest`
  -`OXIDE=1 jest`

* remove into_par_iter where it doesn't make sense

* cargo fmt

* wip

* enable tracing based on `DEBUG` env

* improve CI for the Oxide build

* sort test output

This happened because the sorting happens in this branch, but changes
happened on the `master` branch.

* add failing tests

I noticed that some of the tests were failing, and while looking at
them, it happened because the tests were structured like this:

```html
    <div
      class="
        backdrop-filter
        backdrop-filter-none
        backdrop-blur-lg
        backdrop-brightness-50
        backdrop-contrast-0
        backdrop-grayscale
        backdrop-hue-rotate-90
        backdrop-invert
        backdrop-opacity-75
        backdrop-saturate-150
        backdrop-sepia
      "
    ></div>
```

This means that the class names themselves eventually end up like this: `backdrop-filter-none\n`
-> (Notice the `\n`)

/cc @thecrypticace

* fix range to include `\n`

* Include only unique values for tests

Really, what we care about most is that the list contains every expected candidate. Not necessarily how many times it shows up because while many candidates will show up A LOT in a source text we’ll unique them before passing them back to anything that needs them

* Fix failing tests

* Don’t match empty arbitrary values

* skip tests in oxide mode regarding custom separators in arbitrary variants

* re-enable workflows

* use `@tailwindcss/oxide` dependency

* publish `tailwindcss@oxide`

* drop prepublishOnly

I don't think we actually need this anymore (or even want because this
is trying to do things in CI that we don't want to happen. Aka, build
the Oxide Rust code, it is already a dependency).

* WIP

* Defer to existing CLI for Oxide

* Include new compiled typescript stuff when publishing

* Move TS to ./src/oxide

* Update scripts

* Clean up tests for TS

* copy `cli` to `oxide/cli`

* make CLI files TypeScript files

* drop --postcss flag

* setup lightningcss

* Remove autoprefixer and cssnano from oxide CLI

* cleanup Rust code a little bit

- Drop commented out code
- Drop 500 fixture templates

* sort test output

* re-add `prepublishOnly` script

* bump SWC dependencies in package-lock.json

* pin `@swc` dependencies

* ensure to install and build oxide

* update all GitHub Workflows to reflect Oxide required changes

* sort `content-resolution` integration tests

* add `Release Insiders — Oxide`

* setup turbo repo + remote caching

* use `npx` to invoke `turbo`

* setup unique/proper package names for integration tests

* add missing `isomorphic-fetch` dependency

* setup integration tests to use `turborepo`

* scope tailwind tasks to root workspace

* re-enable `node_modules` cache for integration tests

* re-enable `node_modules` cache for main CI workflow

* split cache for `main` and `oxide` node_modules

* fix indent

* split install dependencies so that they can be cached individually

* improve GitHub actions caching

* use correct path for oxide node_modules (crates/node)

* ensure that `cargo install` always succeeds

cargo install X, on CI will fail if it already exists.

* figure out integration tests with turbo

* tmp: use `npm` instead of `turbo`

* disable `fail-fast`

This will allow us to run integration tests so that it still caches the
succesful ones.

* YAML OH YAML, Y U WHITESPACE SENSITIVE

* copy the oxide-ci workflow to release-oxide

* make `oxide-ci` a normal CI workflow

Without publishing

* try to cache cargo and node_modules for the oxide build

* configure turbo to run scripts in the root

* explicitly skip failing test for the Oxide version

* run oxide tests in CI

* only use build script for root package

* sync package-lock.json

* do not cache node_modules for each individual integration

* look for hoisted `.bin`

* use turbo for caching build tailwind css in integration tests

* Robin...

* try to use the local binary first

* skip installing integration test dependencies

Should already be installed due to workspace usage

* Robin...

* drop `output.clean`

* explicitly add `mini-css-extract-plugin`

* drop oxide-ci, this is tested by proxy

* ensure oxide build is used in integration tests

This will ensure the `@tailwindcss/oxide` dependency is available
(whether we use it or not).

* setup Oxide shim in insiders release

* add browserslist dependency

* use `install:all` script name

Just using `install` as a script name will be called when running
`npm install`.
Now that we marked the repo as a `workspace`, `npm install` will run
install in all workspaces which is... not ideal.

* tmp: enable insiders release in PRs

Just to check if everything works before merging. Can be removed once
tested.

* don't cache node_modules?

I feel there is some catch 22 going on here.
We require `npm install` to build the `oxide/crates/node` version.
But we also require `oxide/crates/node` for the `npm install` becaus of
the dependency: `"@tailwindcss/oxide": "file:oxide/creates/node"`

* try to use `oxide/crates/node` as part of the workspace

* let's think about this

Let's try and cache the `node_modules` and share as much as possible.
However, some scripts still need to be installed specific to the OS.

Running `npm install` locally doesn't throw away your `node_modules`,
so if we just cache `node_modules` but also run `npm install` that
should keep as much as possible and still improve install times since
`node_modules` is already there.

I think.

* ensure generated `index.js` and `index.d.ts` files are considered outputs

* use `npx napi` instead of `napi` directly

* include all `package-lock.json` files

* normalize caching further in all workflows

* drop nested `package-lock.json` files

* `npm uninstall mini-css-extract-plugin && npm install mini-css-extract-plugin --save-dev`

* bump webpack-5 integration tests dependencies

* only release insiders on `master` branch

* tmp: let's figure out release insiders oxide

* fix little typo

* use Node 18 for Oxide Insiders

* syncup package-lock.json

* let's try node 16

Node 18 currently fails on `Build x86_64-unknown-linux-gnu (OXIDE)`
Workflow.

Install Node.JS output:

```
Environment details
Warning: /__t/node/18.13.0/x64/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /__t/node/18.13.0/x64/bin/node)

Warning: node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
```

* bump some Node versions

* only release oxide insiders on `master` branch

* don't cache `npm`

* bump napi-rs

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-01-13 12:22:00 +01:00
Robin Malfait
9b6a04e6a8
trigger fresh release build
Can't re-run the previous failed one, because it also tries to publish
to NPM which it already succesfully did which means that it will fail
right now.
2023-01-12 11:58:43 +01:00
Adam Wathan
2d40d0b30a
Add delay-0 and duration-0 by default (#10294)
* Add `delay-0` by default

* Update defaultConfig.stub.js

* update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-01-11 11:12:19 +01:00
Jordan Pittman
6f45428cc1
Consider earlier variants before sorting functions (#10288)
* Consider earlier variants before sorting functions

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>

* Update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-01-10 09:57:11 -05:00
depfu[bot]
b05918ab75 Update eslint-config-prettier to version 8.6.0 2023-01-09 17:28:13 +00:00
Jordan Pittman
6ad3945fe7
Escape group names in selectors (#10276)
* Handle escaped selector characters in parseVariantFormatString

* Escape group names in selectors

Otherwise special characters would break O_O

* Update changelog
2023-01-09 11:14:16 -05:00
Justin Wong
7b3de616e9
Fix missing blocklist type (#10239)
* Fix missing `blocklist` type

* Update changelog
2023-01-04 11:53:07 +01:00
Jordan Pittman
5d828248bc Update changelog 2023-01-03 15:46:56 -05:00
Jordan Pittman
ec5136c19a
Fix perf regression when checking for changed content (#10234)
* Commit changes to mod time cache all at once

This allows us to track changes in files that are both a context and content dependency in a way that preserves file mod checking optimizations

* fixup
2023-01-03 15:45:51 -05:00
Jordan Pittman
7d8eb21de6
Don't prefix classes in arbitrary variants (#10214)
* Add tests

* Refactor

refactor

* Allow `prefixSelector` to take an AST

* Consider multiple formats in `finalizeSelector`

The functions `finalizeSelector` and `formatVariantSelector` together were using a mix for AST and string-based parsing. This now does the full transformation using the selector AST. This also parses the format strings AST as early as possible and is set up to parse them only once for a given set of rules.

All of this will allow considering metadata per format string. For instance, we now know if the format string `.foo &` was produced by a normal variant or by an arbitrary variant. We use this information to control the prefixing behavior for individual format strings.

* Update changelog

* Cleanup code a bit
2023-01-03 09:40:47 -05:00
Robin Malfait
2b885ef252
Allow direct nesting in root or @layer nodes (#10229)
* hide nesting warnings in `root` or `@layer` nodes

* update changelog
2023-01-03 12:38:30 +01:00
Jordan Pittman
3a8e95d848
Match arbitrary properties even when followed by square bracketed text (#10212)
* Match arbitrary properties even when followed by square bracketed text

* Update changelog
2023-01-02 09:43:07 -05:00
depfu[bot]
5594c3bec9 Update @swc/cli to version 0.1.59 2023-01-01 05:27:44 +00:00
depfu[bot]
8b13ecfe16 Update eslint to version 8.30.0 2022-12-30 22:14:46 +00:00
depfu[bot]
dc26c5e3f8 Update @swc/core to version 1.3.24 2022-12-28 12:13:11 +00:00
Adam Wathan
941ef21774
Update CHANGELOG.md 2022-12-27 10:21:31 -05:00
depfu[bot]
a795e4554f
Update esbuild to version 0.16.10 (#10178)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2022-12-27 10:20:36 -05:00
depfu[bot]
8462d6708b Update prettier to version 2.8.1 2022-12-22 06:55:34 +00:00
Nikolai Grushkovsky
41e655dd0b
Fix GitHub workflow badge (#10120)
See badges/shields#8671
2022-12-19 10:44:47 +01:00
depfu[bot]
6998ca418a Update postcss to version 8.4.20 2022-12-18 17:58:58 +00:00
depfu[bot]
03d2a04b3e Update @swc/jest to version 0.2.24 2022-12-17 00:28:32 +00:00
Jordan Pittman
51b6224e6a
Update list of length units (#10100)
* Update length units

* Update changelog
2022-12-16 10:16:12 -05:00
Nikolai Grushkovsky
c834da4e80
Fix missing string[] in the dropShadow type (#10072)
* Fix missing `string[]` in the `dropShadow` type

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-12-14 09:48:49 -05:00
sibbng
ce7ac96e88
Properly handle subtraction followed by a variable in arbitrary values (#10074)
* fix normalizing subtraction followed by a variable

* Add test

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-12-14 09:27:34 -05:00
Jordan Pittman
25d17db78c
Prevent invalid arbitrary variant selectors from failing the build (#10059)
* Refactor

* Prevent invalid arbitrary variant selectors from failing the build

* Update changelog

* Fix CS
2022-12-12 11:03:53 -05:00
depfu[bot]
40c0cbe272 Update eslint to version 8.29.0 2022-12-09 22:36:47 +00:00
Quentin
4b5ab1ae97
Add data key to theme types (#10023)
* Add "data" type in tailwind.config

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-12-09 10:37:42 -05:00
Jordan Pittman
cea08380dc
Sort arbitrary variants deterministically regardless of content order (#10016)
* Fix off-by-one error in variant sort mapping

This didn’t actually have any negative effect because of how it was implemented. But it only happened to work right :D

* Make arbitrary variant sorting deterministic

* Update changelog

* Use faster byte-order comparison

We really only care that the order is _always_ the same. localeCompare is still locale dependent based on environment. This ensures it’s dependent on content only.

* Fix CS
2022-12-08 09:05:46 -05:00