735 Commits

Author SHA1 Message Date
Jordan Pittman
11de06fd9d
Prepare v3.4.18 release (#19038) 2025-10-01 09:45:30 -04:00
Jordan Pittman
ba55a445cd
Fix native ESM config loading in v3 (#18938)
Unfortunately for backwards compatibility purposes (with `loadConfig` at
least) we can't switch things to use `import(…)` because there's baked
in knowledge that the config is loaded synchronously for v3.

This PR does two things:
- Defers to `require(…)` which allows newer versions that support
`require(esm)` to work natively. This works around the need to switch to
`import(…)` for those versions.
- Allows newer versions of `postcss-load-config` enabling better
ESM+TypeScript support for PostCSS configs in the CLI.

We support v4, v5, and v6 of `postcss-load-config` simultaneously so any
of those versions should work. I've verified that newer node versions
seem to install v6 while earlier ones like Node v14 install v4 of
`postcss-load-config`. So this should be a backwards compatible change.

- [x] needs tests for `import.meta.resolve(…)`
- [x] needs tests for ESM postcss configs

Fixes #14152
Fixes #14423
2025-09-16 14:03:09 -04:00
Jordan Pittman
02faa1529e v3.4.17 2024-12-17 13:46:50 -05:00
Jordan Pittman
8f91c27d3e v3.4.16 2024-12-03 14:22:00 -05:00
Andrew Powell
8c8c986e09
fix: update lilconfig for ESM and Windows support (#15289)
This PR updates `lilconfig` from v2.1.0 to v3.1.3. Significant
improvements to this package include Windows absolute path support as
well as ESM config files support. This supersedes
https://github.com/tailwindlabs/tailwindcss/pull/14029 which has fallen
behind and has conflicts with the upstream branch. This is a critical
update for Next.js apps running in development which have dependencies
on packages that use an updated version of `lilconfig`. I understand
that v4 will not be using `lilconfig` but it's an important update for
users on v3.x in the meantime.

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2024-12-03 14:19:29 -05:00
Jordan Pittman
6069a81187 v3.4.15 2024-11-14 13:35:09 -05:00
Robin Malfait
c8c3a22442
Bump dependencies to fix vulnerabilities (#14697)
This PR fixes some package vulnerabilities that you will see when
running `npm install`. This PR fixes that by bumping dependencies to get
rid of the vulnerabilities.
2024-10-17 06:41:15 -04:00
Robin Malfait
c616fb9562
3.4.14 2024-10-15 12:29:17 +02:00
Robin Malfait
ed3c5356b7
3.4.13 2024-09-23 16:56:58 +02:00
Robin Malfait
e8614a268d
3.4.12 2024-09-17 15:13:09 +02:00
Robin Malfait
818d10ab84
3.4.11 2024-09-11 19:25:41 +02:00
Jordan Pittman
f07dbff2a7 3.4.10 2024-08-13 16:24:27 -04:00
Robin Malfait
f65023efb9
3.4.9 2024-08-08 15:10:38 +02:00
Robin Malfait
1676118af9
3.4.8 2024-08-07 17:26:53 +02:00
Jordan Pittman
1f23c2e842
Bump to latest cssnano v6 (#14105)
We bundle cssnano in our CLI and it's on an older version that does not
handle nested CSS correctly. This PR updates it to the latest version of
v6.x

Fixes #14092
2024-08-02 08:57:14 -04:00
Adam Wathan
9824cb64a0 Update version in package.json 2024-07-25 09:20:52 -04:00
Jordan Pittman
9c29e47c5f 3.4.6 2024-07-16 09:37:15 -04:00
Jordan Pittman
10a1197989 3.4.5 2024-07-15 10:56:16 -04:00
Jordan Pittman
ff6f085da2 3.4.4 2024-06-05 12:55:54 -04:00
Jordan Pittman
f1f419a9ec 3.4.3 2024-03-27 15:18:37 -04:00
Jordan Pittman
8430d8b520 3.4.2 2024-03-27 11:25:32 -04:00
Jordan Pittman
b10b431d97
Transpile import.meta.url in config files (#13322)
* Use Babel to transpile configs when import.meta is present

* Update minimum jiti version

* Update changelog
2024-03-22 12:45:19 -04:00
Robin Malfait
44b3b429a8
Cleanup oxide — Part #2 (#13312)
* remove all oxide related code

* Update lightningcss to version 1.24.1

* update tests to match bumped Lightning CSS output

---------

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2024-03-22 17:12:14 +01:00
depfu[bot]
c28c718f72
Update esbuild to version 0.20.2 (#13315)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2024-03-22 14:56:21 +01:00
Robin Malfait
9b90c53bad
Cleanup oxide — Part #1 (#13304)
* swap engines

* remove all oxide related files

* drop swap engine step from CI

* drop oxide tests where we read from a `.oxide.*` file

* drop swap-engines.js file

* drop unused `oxide` variable

Let's make eslint happy!
2024-03-21 18:23:31 +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