4365 Commits

Author SHA1 Message Date
Luke Warlow
51f71af62c
Add accent-color utilities (#5387)
* Add accent-color utilities

* Address comments
2021-09-07 21:07:54 -04:00
depfu[bot]
9371cce670
Update eslint-plugin-prettier to version 4.0.0 (#5409)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2021-09-07 21:04:48 -04:00
Robin Malfait
f99302c626
Support @apply for classes outside of a @layer (#5378)
* support `@apply` for classes outside of a `@layer`

* Add failing test for respecting source order

* sort rules when using `@apply`

The `layer` was not taken into account yet when we resolved the rules
from the applyCache. This is because we set the `classCache` to the
`matches` inside of the `generateRules` function. You can think of them
as "raw" rules I guess. However, it is later in that function that we
apply the `layerOrder` to the `sort`.

This does mean that when you `@apply font-bold text-red-500` that the
rules inside the `.target {}` will be in order of the "normal" css as
well.

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-09-07 21:03:46 -04:00
Robin Malfait
4142b3fbaf
setup npm registry url
The `NPM_TOKEN` name was also incorrect (surprise?). Found another
resource here that mentions the `registry-url` option and
`NODE_AUTH_TOKEN`. Let's see if that works...

https://docs.github.com/en/actions/guides/publishing-nodejs-packages
2021-09-07 15:58:32 +02:00
Robin Malfait
fac02f3de9
use the correct token name
I used `NODE_AUTH_TOKEN` in other projects but that doesn't seem to work
anymore for some reason 🤔

Found this resource that talks about `NPM_TOKEN`: https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow
2021-09-07 15:52:17 +02:00
Robin Malfait
4a70091262
trigger new release 2021-09-07 15:40:19 +02:00
Robin Malfait
016eaa5091
Add --no-git-tag-version flag (#5426)
When you run `npm version`, it also tries to make a git commit and a git
tag. However, we are not doing anything with this and CI doesn't know
who the committer is.
2021-09-07 14:45:03 +02:00
Robin Malfait
2b9c4fec1f
Force creating an npm version for insiders build (#5423)
This fails because we usually use node 14 or 16, which has a
package-lock.json version of `2`. However on node 12, this version is
`1`. This means that after an npm install the package-lock.json is
touched and thus `npm version` fails because git is in a dirty
directory.

Adding a `--force` is not ideal, but also not really an issue since the
only thing that could change is the package-lock.json and this is not
published to npm anyways.
2021-09-07 14:30:55 +02:00
Robin Malfait
d01091d44d
Improve release workflows part 2 (#5422)
* ensure we build before the tests

Our tests require that for now. Will probably improve this in the
future.

* improve insiders version name

This will make it consistent with previously published versions.
2021-09-07 14:18:22 +02:00
Robin Malfait
7c9bc49259
Add automated release/npm publish workflows (#5421) 2021-09-07 14:13:21 +02:00
Adam Wathan
a51aab9111 Changelog formatting 2021-09-06 15:35:25 -04:00
Adam Wathan
5b03d35cb4 Update changelog 2021-09-06 15:33:07 -04:00
Adam Wathan
4d9ff4c884 Merge branch 'update-changelog' 2021-09-06 15:07:36 -04:00
Adam Wathan
d995d5ef61 Update changelog 2021-09-06 15:07:23 -04:00
Adam Wathan
db8b449a67
Enable extended color palette (#5384)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-06 14:29:03 -04:00
Robin Malfait
920f21264c
Simplify negate value (#5389)
* simplify `negateValue`

Co-authored-by: Brad Cornes <bradlc41@gmail.com>

* ensure we have the exact same behaviour

* Simplify/loosen regex to be more future-proof

Co-authored-by: Brad Cornes <bradlc41@gmail.com>
Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-09-06 14:26:32 -04:00
Brad Cornes
f86c16b1ed
Update package files config (#5405) 2021-09-06 14:26:24 -04:00
Robin Malfait
a34bd62bb6
Remove lodash (#5390)
* remove `lodash` usage

* implement custom cloneDeep to replace lodash's

* drop lodash in processPlugins

* add `toPath` utility

* add `tap` utility

* add `cloneDeep` utility

* drop lodash in evaluateTailwindFunctions

* add `defaults` utility

* drop lodash from `resolveConfig`

* remove `lodash` dependency
2021-09-06 14:15:10 -04:00
Adam Wathan
a9e160cf9a Reintroduce universal selector optimization behind experimental flag 2021-09-06 13:58:02 -04:00
Robin Malfait
2dac5bb569
Add custom plugins tests (#5383)
* add tests for the plugin API

* make plugin invocation optional

It could be that an object has been passed as a plugin, in that case we
will use the `handler` function from the object. If it doesn't exist,
then we will only take the `config` section out of it.
2021-09-04 16:33:55 +02:00
Robin Malfait
c315db5f15
port @layer tests from AOT to JIT mode (#5379) 2021-09-03 17:46:15 +02:00
Jonathan Reinink
4f89215d88
Unify config helpers into single object (#5382)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-03 10:31:19 -04:00
Robin Malfait
e37931ba65
JIT by default - move tests and make them consistent (#5374)
* move `./tests/jit` to `./tests`

* make tests consistent

Abstracted a `run` function and some syntax highlighting helpers for
`html`, `css` and `javascript`.
2021-09-03 13:48:16 +02:00
depfu[bot]
776a5aea31 Update all of jest to version 27.1.0 2021-09-03 10:18:18 +00:00
depfu[bot]
a382cde7c5 Update jest-diff to version 27.1.0 2021-09-03 10:13:39 +00:00
Jonathan Reinink
e9cde3a070
Add native aspect ratio support (#5359) 2021-09-02 08:32:02 -04:00
Jonathan Reinink
154d99054b
Inline modern-normalize, consolidate with preflight (#5358) 2021-09-01 14:54:25 -04:00
Robin Malfait
7852d4f12f
Throw an error when applying the .group utility (#4666) 2021-09-01 18:08:35 +02:00
Dr. Derek Austin
36a02edf11
Remove duplicate prettier.config.js settings from .eslintrc.json (#5087)
* chore: remove duplicate prettier.config.js settings from .eslintrc.json

* chore: remove unnecessary brackets now that "prettier/prettier" rule is no longer an array -- this a purely cosmetic change
2021-09-01 17:41:43 +02:00
Robin Malfait
d5c87f9632
Merge branch 'hsl-spaces' 2021-09-01 17:29:52 +02:00
Hunter Tunnicliff
be4aa931b6
Fix handling of CSS variable declarations 2021-09-01 17:28:30 +02:00
Hunter Tunnicliff
721e57312b
Fix formatting 2021-09-01 17:28:30 +02:00
Hunter Tunnicliff
70787fc088
Add tests 2021-09-01 17:28:30 +02:00
Hunter Tunnicliff
ff9b06a95b
Use correct ESM import syntax 2021-09-01 17:28:30 +02:00
Hunter Tunnicliff
c52cd713b0
Replace color with culori 2021-09-01 17:28:25 +02:00
Robin Malfait
05e4ceee5b
Ensure purge.options.safelist is taken into account (#5356)
Also fixed a small typo 🤫
2021-09-01 17:23:32 +02:00
Robin Malfait
691ed02f63
Remove AOT (#5340)
* make `jit` mode the default when no mode is specified

* unify JIT and AOT codepaths

* ensure `Object.entries` on undefined doesn't break

It could be that sometimes you don't have values in your config (e.g.: `presets: []`), this in turn will break some plugins where we assume we have a value.

* drop AOT specific tests

These tests are all covered by JIT mode already and were AOT specific.

* simplify tests, and add a few

Some of the tests were written for AOT specifically, some were missing. We also updated the way we write those tests, essentially making Tailwind a blackbox, by testing against the final output.
Now that JIT mode is the default, this is super fast because we only generate what is used, instead of partially testing in a 3MB file or building it all, then purging.

* add some todo's to make sure we warn in a few cases

* make `darkMode: 'media'`, the default

This also includes moving dark mode tests to its own dedicated file.

* remove PostCSS 7 compat mode

* update CLI to be JIT-first

* fix integration tests

This is not a _real_ fix, but it does solve the broken test for now.

* warn when using @responsive or @variants

* remove the JIT preview warning

* remove AOT-only code paths

* remove all `mode: 'jit'` blocks

Also remove `variants: {}` since they are not useful in `JIT` mode
anymore.

* drop unused dependencies

* rename `purge` to `content`

* remove static CDN builds

* mark `--purge` as deprecated in the CLI

This will still work, but a warning will be printed and it won't show up
in the `--help` output.

* cleanup nesting plugin

We don't have to duplicate it anymore since there is no PostCSS 7
version anymore.

* make sure integration tests run in band

* cleanup folder structure

* make sure nesting folder is available

* simplify resolving of purge/content information
2021-09-01 17:13:59 +02:00
Nick
911e755056
fix: fix empty object error (#4903)
Co-authored-by: zhongcheng <zhongcheng@bytedance.com>
2021-09-01 11:01:15 -04:00
Robin Malfait
267f20c47e
2.2.9 v2.2.9 2021-08-30 13:01:08 +02:00
Robin Malfait
97804a8950
Pin clean css version (#5338)
* pin clean-css to version `5.1.4`

* update fixtures
2021-08-30 13:00:50 +02:00
depfu[bot]
442c6d0d27 Update cosmiconfig to version 7.0.1 2021-08-28 23:03:11 +00:00
depfu[bot]
9ccb280b6d Update autoprefixer to version 10.3.3 2021-08-28 18:47:53 +00:00
depfu[bot]
e316dcb184 Update eslint-plugin-prettier to version 3.4.1 2021-08-27 22:18:32 +00:00
Peter Etelej
65617085c1
Fix pathname parsing for tracked files (#5008)
The trackedModified call in the tracking logic has a bug that
incorrectly removes `null` from pathnames

Currently:
```
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')
```
Where if `parsed.hash` or `parsed.search` are missing (which is
mostly the case for FS files), the value is null
eg `{ hash: null, search: null}`
  - In which case, we essentially trim `null`
converting `/mypath/nulldir/file.js` -> `/mypath/dir/filejs` and
breaking builds (see #4920 ).

Fix checks if `hash` or `search` are set before replacing them

Fixes #4920
2021-08-27 16:12:06 +02:00
Robin Malfait
8218aa6251
Ensure integration tests are up to date (#5317)
* update (old) incorrect snapshots

The version changed, so it is save to update these.

* add `shadow` so that we can test `@tailwind base`

We were only using `font-bold`, but that doesn't require any base rules.
We try to only inject rules that are required, even for `base` related
rules.
Adding `shadow` will ensure that we can test that `base` rules have been
added.
2021-08-27 16:09:25 +02:00
Adam Wathan
476d445629
Fix missing !important when using @apply (#4854)
* Add failing test for #4823

* Fix important variant `@apply`

Co-authored-by: Brad Cornes <bradlc41@gmail.com>
2021-08-27 16:08:25 +02:00
Robin Malfait
96ef15039b
Ensure purge tests work even for version mismatches (#5316)
We applied the same treatment for the sanity tests, where we ignore the
first line (the tailwind header).

An odd issue I have found is that diffing of big css files is _very_
slow. When te tests pass, then the first test takes `3302 ms`, however,
when it fails it takes `477482 ms` on my machine. That's almost 8
minutes.
2021-08-27 15:47:39 +02:00
Robin Malfait
211f40b175
2.2.8 v2.2.8 2021-08-27 10:37:43 +02:00
Robin Malfait
baa8f6528b
Ensure nested [] is allowed (#5304)
This will allow us to write something like:

`grid-cols-[[linename],1fr,auto]`
2021-08-26 13:50:39 +02:00
depfu[bot]
5f02fe4811 Update clean-css to version 5.1.5 2021-08-26 10:03:09 +00:00