712 Commits

Author SHA1 Message Date
Robin Malfait
a68de1df27
introduce v4 codebase 2024-03-05 14:29:15 +01:00
Robin Malfait
32cf8aa0fb
remove v3 codebase 2024-03-05 13:29:12 +01:00
Jordan Pittman
7361468f77 3.4.1 2024-01-05 15:31:16 -05:00
Jordan Pittman
8350cffdad 3.4.0 2023-12-18 14:52:00 -05:00
Jordan Pittman
b01283cc9b 3.3.7 2023-12-18 13:53:08 -05:00
Jordan Pittman
3125829919 3.3.6 2023-12-04 12:09:32 -05:00
Robin Malfait
9db2d68295
3.3.5 2023-10-25 15:32:52 +02:00
Jordan Pittman
32a62b7bb1 3.3.4 2023-10-24 13:40:38 -04:00
Jordan Pittman
c15b187ae0 Bump jiti, fast-glob, and browserlist dependencies (#11550)
* bump dependencies

* update changelog
2023-10-24 12:59:59 -04:00
Robin Malfait
0bd81a06c4
3.3.3 2023-07-13 18:02:02 +02:00
Jordan Pittman
79b5b12af1 Fix parsing of theme() inside calc() when there are no spaces around operators (#11157)
* Refactor

* Don’t resolve functions for anything not using theme or screen

* Normalize math operators inside calc when handling functions

* Inline postcss-value-parser

* Treat all functions the same as calc

* Remove workaround for calc + operators without spaces

* Remove `postcss-value-parser` dependency

* Update lockfile

* Update sourcemaps

* Update changelog

* Update `value-parser` formatting

* Stop prettier from complaining
2023-07-13 11:48:34 -04:00
Jordan Pittman
1867744706 3.3.2 2023-04-25 18:09:57 -04:00
Robin Malfait
bd0497fc5d
Drop support for Node.js v12 (#11089)
* bump `postcss-load-config` in the oxide engine

* bump `postcss-load-config` in the stable engine

* update changelog

* Switch to stable

* Update Node to v14

* Update to latest dependency versions

* Update test helper for new version of `rimraf`

Co-Authored-By: Jordan Pittman <jordan@cryptica.me>

* Downgrade `lightningcss` to `v1.18.0`

Co-Authored-By: Jordan Pittman <jordan@cryptica.me>

* Switch back to oxide

* Update Github actions from Node 12 to Node 14

* Update oxide dependencies

* Update stable dependencies

* Update `content-resolution` integration test dependencies

* Update `postcss-cli` integration test dependencies

* Update `rollup` integration test dependencies

* Update `rollup-sass` integration test dependencies

* Update `vite` integration test dependencies

* Update `webpack-5` integration test dependencies

* Update changelog

* Remove `color-name` dependency

* Replace `quick-lru` dependency with `@alloc/quick-lru`

* Replace `quick-lru` dependency with `@alloc/quick-lru` in stable

* Fix standalone CLI test

---------

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-04-25 16:28:20 -04:00
Robin Malfait
72bc31867b
Replace __OXIDE__ at build time to prevent @tailwindcss/oxide leaks in the stable engine (#10988)
* replace `env.OXIDE` with global `__OXIDE__`

This will allow us to replace the `__OXIDE__` at build time, and fully
remove the branches from the final code so that there is not even any
reference to `@tailwindcss/oxide` on the stable engine.

* update changelog

* use `env.ENGINE` in integration tests

* drop oxide branching for the PostCSS plugin for now

This is currently a redirect to the same file, so doesn't hurt.

* Enable better dead-code elimination

* Update CLI tests

Fix indentation

* Fix indentation

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-04-18 12:19:20 +02:00
Robin Malfait
1e55b798d7 3.3.1 2023-03-30 15:06:45 -04:00
Robin Malfait
3809127a2c
3.3.0 2023-03-28 15:43:09 +02:00
depfu[bot]
94608fbd9e
Update prettier to version 2.8.7 2023-03-28 15:39:00 +02:00
depfu[bot]
7e91ea91a0
Update sucrase to version 3.31.0 2023-03-28 15:39:00 +02:00
depfu[bot]
0475ca9820
Update eslint-config-prettier to version 8.8.0 2023-03-28 15:39:00 +02:00
depfu[bot]
4b44daf3b5 Update esbuild to version 0.17.12 2023-03-24 07:45:03 +00:00
Robin Malfait
e046a37dbc
Improve bundle size by replacing detective-typescript (#10825)
* replace `detective-typescript` with our own implementation

We are not parsing the code but just trying to pluck out the
dependencies used via `import` and `require`.

* drop `detective-typescript`

* return a `Set` instead of an `Array`

* resolve rebuilds, but log errors in case they occur

This won't be the prettiest if it happens, but at least we are not
swallowing errors which should make bugs be easier to discover.

See previous commit for an example... 😅

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-03-20 18:30:47 +01:00
depfu[bot]
6a2c58acf8 Update @swc/core to version 1.3.41 2023-03-20 06:31:33 +00:00
depfu[bot]
2de0aa9d91 Update autoprefixer to version 10.4.14 2023-03-16 22:19:27 +00:00
Robin Malfait
ac1738e748
fix stubs glob in files of package.json 2023-03-15 22:31:12 +01:00
Robin Malfait
7e9a53f6cb
Enable ESM and TS based config files (#10785)
* add `jiti` and `detective-typescript` dependencies

* use `jiti` and `detective-typescript`

Instead of `detective`, this way we will be able to support
`tailwind.config.ts` files and `ESM` files.

* use `@swc/core` instead of the built-in `babel` form `jiti`

* update changelog

* add `jiti` and `detective-typescript` dependencies to `stable`

* use `sucrase` to transform the configs

* add `sucrase` dependency to `stable` engine

* make loading the config easier

* use abstracted loading config utils

* WIP: make `load` related files public API

* use new config loader in PostCSS plugin

* add list of default config files to look for

* cleanup unused arguments

* find default config path when using CLI

* improve `init` command

* make eslint happy

* keep all files in `stubs` folder

* add `tailwind.config.js` stub file

* Initialize PostCSS config using the same format as Tailwind config

* Rename config content stubs to config.*.js

* Improve option descriptions for init options

* Remove unused code, remove `constants` file

* Fix TS warning

* apply CLI changes to the Oxide version

* update `--help` output in CLI tests

* WIP: make tests work on CI

TODO: Test all combinations of `--full`, `--ts`, `--postcss`, and `--esm`.

* wip

* remove unused `fs`

* Fix init tests

Did you know you could pass an empty args to a command? No? Me neither. ¯\_(ツ)_/¯

* bump `napi-derive`

* list extensions we are interested in

* no-op the `removeFile` if file doesn't exist

* ensure all `init` flags work

* ensure we cleanup the new files

* test ESM/CJS generation based on package.json

* remove unnecessary test

We are not displaying output in the `--help` anymore based on whether
`type: module` is present or not.
Therefore this test is unneeded.

* only look for `TypeScript` files when the entryFile is `TypeScript` as well

* refactor `load` to be `loadConfig`

This will allow you to use:

```js
import loadConfig from 'tailwindcss/loadConfig'

let config = loadConfig("/Users/xyz/projects/my-app/tailwind.config.ts")
```

The `loadConfig` function will return the configuration object based on
the given absolute path of a tailwind configuration file.

The given path can be a CJS, an ESM or a TS file.

* use the `config.full.js` stub instead of the `defaultConfig.stub.js` file

The root `defaultConfig` is still there for backwards compatibilty
reasons. But the `module.exports = requrie('./config.full.js')` was
causing some problems when actually using tailwindcss.

So dropped it instead.

* apply `load` -> `loadConfig` changes to `Oxide` engine CLI

* ensure we write the config file in the Oxide engine

* improve type in Oxide engine CLI

* catch errors instead of checking if the file exists

A little smaller but just for tests so doesn't matter too much here 👍

* ensure we publish the correct stub files

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Nate Moore <nate@natemoo.re>
Co-authored-by: Enzo Innocenzi <enzo@innocenzi.dev>
2023-03-15 17:04:18 -04:00
depfu[bot]
c0da7bb0c5 Update rimraf to version 4.4.0 2023-03-15 18:02:13 +00:00
depfu[bot]
66fd0c9983 Update all of jest to version 29.5.0 2023-03-15 13:03:01 +00:00
depfu[bot]
c33c5234ef Update eslint-config-prettier to version 8.7.0 2023-03-13 11:23:35 +00:00
depfu[bot]
990398f52c Update eslint to version 8.35.0 2023-03-10 20:51:07 +00:00
depfu[bot]
5e9470c5cb Update lilconfig to version 2.1.0 2023-03-09 20:49:16 +00:00
depfu[bot]
a64ce192cc Update turbo to version 1.8.3 2023-03-08 00:32:06 +00:00
depfu[bot]
bfdf3a7d1f Update @swc/cli to version 0.1.62 2023-03-02 21:47:26 +00:00
depfu[bot]
0c9b3f9333 Update esbuild to version 0.17.10 2023-02-27 06:33:57 +00:00
depfu[bot]
b42e7d9b76 Update postcss-nested to version 6.0.1 2023-02-26 10:01:49 +00:00
depfu[bot]
261a8b42cb Update all of jest to version 29.4.3 2023-02-23 16:49:54 +00:00
depfu[bot]
0439d44ce0 Update cssnano to version 5.1.15 2023-02-22 22:32:04 +00:00
depfu[bot]
d6121f0ede Update eslint to version 8.34.0 2023-02-17 20:52:54 +00:00
depfu[bot]
316282d719 Update @swc/core to version 1.3.35 2023-02-17 07:30:59 +00:00
Adam Wathan
e7ae7f1931 Update version and changelog 2023-02-16 14:28:15 -05:00
Robin Malfait
66c640b735
Upgrade rimraf: 3.0.2 → 4.1.2 (major) (#10596)
* Update rimraf to version 4.1.2

* use rimraf sync API

Our `oxide` engine uses rimraf v4, our `stable` engine uses rimraf v3
and the API is different in both. However the tests are currently shared
for both engines so we have to use the correct API for the correct
version.

However, we can also just use the `sync` API.

More info: https://github.com/isaacs/rimraf#major-changes-from-v3-to-v4

---------

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-02-16 00:52:36 +01:00
depfu[bot]
59b7e70859 Update postcss-js to version 4.0.1 2023-02-15 16:00:51 +00:00
depfu[bot]
48c35b7d47 Update prettier to version 2.8.4 2023-02-15 03:50:36 +00:00
depfu[bot]
1c9b2d116d Update turbo to version 1.7.4 2023-02-15 00:31:31 +00:00
Robin Malfait
7f81849a43
3.2.6 2023-02-08 17:38:19 +01:00
Robin Malfait
abe5163116
3.2.5 2023-02-08 16:34:58 +01:00
depfu[bot]
16a002c571 Update @swc/cli to version 0.1.61 2023-02-07 03:31:33 +00:00
depfu[bot]
da52210dd2 Update browserslist to version 4.21.5 2023-02-06 13:33:00 +00:00
depfu[bot]
9e216e4347
Update all of jest to version 29.4.1 (#10453)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-01-31 11:43:36 -05:00
depfu[bot]
20c39a95b9 Update esbuild to version 0.17.4 2023-01-25 20:03:12 +00:00
Robin Malfait
8e60a3c7e8
Use Lightning CSS in the PostCSS Plugin (#10399)
* bump lightningcss

* use `lightningcss` in the main PostCss Plugin

* use lightningcss in our custom matchers

Now that we are using `lightningcss` and nesting in the new `oxide`
engine, the generated output _will_ be different in the majority of test
cases.

Using a combination of `prettier` and `lightningcss` will make the
output consistent.

The moment we are fully using the `oxide` engine, we can drop
`lightningcss` or `prettier` again to improve the performance of the
tests.

* update tests to apply `lightningcss` related changes

* update changelog

* add `lightningcss` and `browserslist` as dev dependencies to stable package.json

* only use `lightningcss` in tests (without prettier)

We will only fallback to prettier if lightningcss fails somehow.

* apply side effect chagnes due to only using lightningcss for tests

* make CI happy (integration tests)

Apply changes to integration tests now that we are using lightningcss

* transform `lightningcss` for Node 12 when running tests

* run prettier on failing tests for `toMatchFormattedCss`

This will result in better diffs because diffs are typically per block
and/or per line. But lightningcss will simplify certain selectors and
the diff won't be as clear.

We will only apply the prettier formatting for failing tests in the diff
view so that diffs are cleaner and we don't pay for the additional
prettier calls when tests pass.
2023-01-23 20:44:31 +01:00