Commit graph

4980 commits

Author SHA1 Message Date
Jordan Pittman
ee5da2e271
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
2023-01-05 16:01:45 +01:00
Robin Malfait
b643c9e669
fix range to include \n 2023-01-05 16:01:45 +01:00
Robin Malfait
cceb585777
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
2023-01-05 16:01:45 +01:00
Robin Malfait
0c211a8bd0
sort test output
This happened because the sorting happens in this branch, but changes
happened on the `master` branch.
2023-01-05 16:01:45 +01:00
Robin Malfait
efb6015641
improve CI for the Oxide build 2023-01-05 16:01:43 +01:00
Robin Malfait
531125def7
enable tracing based on DEBUG env 2023-01-05 16:01:13 +01:00
Jordan Pittman
30b7d3fcc2
wip 2023-01-05 16:01:13 +01:00
Robin Malfait
52edffba86
cargo fmt 2023-01-05 16:01:13 +01:00
Robin Malfait
208eeb99f5
remove into_par_iter where it doesn't make sense 2023-01-05 16:01:13 +01:00
Robin Malfait
b643d399db
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`
2023-01-05 16:01:11 +01:00
Robin Malfait
cc92ef53a6
add oxide
Our Rust related parts
2023-01-05 15:57:17 +01:00
Robin Malfait
e7135052ac
temporarily disable workflows 2023-01-05 15:57:16 +01: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
Robin Malfait
fde30c307e
use decl.prop instead of undefined decl.name
While working on TypeScript types in the oxide version, I noticed that
we used `decl.name`, which is not defined... oops!
2022-12-08 13:50:06 +01:00
Jordan Pittman
5d4949845a Update changelog 2022-12-05 12:40:57 -05:00
Michael J. Rasicci
9e8d37a8e2
Add standalone-cli build for Windows Arm64 platform (#10001)
* Add standalone-cli build for Windows ARM64

* Fix path to binary on windows

* Fix style

* Simplify Windows mapping in standalone CLI tests

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-12-05 12:39:04 -05:00
depfu[bot]
a92932f4cc Update @swc/core to version 1.3.21 2022-12-03 14:58:24 +00:00
Jordan Pittman
d620e5d8de Remove .only 2022-12-02 12:20:43 -05:00
Jordan Pittman
c515a91f58
Don’t reorder webkit scrollbar pseudo elements (#9991)
* Don’t reorder webkit scrollbar pseudo elements

In reality, we need to stop reordering pseudo elements completely as `::before:hover` and `::after:hover` are 100% valid and should work per the CSS selector spec even though no browser currently supports it.

* Update changelog
2022-12-02 12:18:23 -05:00
Adam Wathan
a1249779ec Make button show up 2022-12-01 10:41:28 -05:00
Adam Wathan
6f53bded9d Rename swcify script to build 2022-12-01 10:10:10 -05:00
Jordan Pittman
e8b036567d
Clip unbalanced closing brackets in arbitrary values (#9973)
* Properly clip when there are too many `]` characters

* Update changelog
2022-12-01 09:43:55 -05:00
Jonathan Reinink
8f49251c0f
Update CHANGELOG.md 2022-11-30 18:22:46 -05:00
Cameron Huntington
293ee902cf
Alphabetize theme keys in default config (#9953)
* alphabetize several theme properties

* Alphabetize all `theme` properties in default config

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2022-11-30 18:21:18 -05:00
Robin Malfait
4f92e2ff5e
Improve return value of resolveConfig, unwrap ResolvableTo (#9972)
* improve return value of `resolveConfig`, unwrap `ResolvableTo`

* update changelog
2022-11-30 14:26:15 +01:00
Robin Malfait
cac5a28c41 npm run style -- --fix 2022-11-30 11:38:37 +00:00
depfu[bot]
f43997de00 Update prettier to version 2.8.0 2022-11-30 11:38:37 +00:00
Adam Wathan
cbbfa827a4
Support variable shorthand for arbitrary modifiers (#9962)
* Support variable shorthand for arbitrary modifiers

* Update changelog

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2022-11-29 16:06:58 -05:00
Jordan Pittman
1d23dcbe92
Add --watch=always option to prevent exit when stdin closes (#9966)
* Support `--flag=value` syntax for manually-parsed CLI args

* Don’t exit when stdin closes if using `--watch=always`

* Update changelog
2022-11-29 14:57:07 -05:00