25 Commits

Author SHA1 Message Date
Jordan Pittman
8fe6f4868e
Don't emit utilities containing invalid theme fn keys (#9319)
* Don't emit utilities containing invalid theme keys

* Update changelog
2022-09-14 13:27:01 -04:00
Robin Malfait
c6b3f96f85
ensure generated types are published as well
In my testing, I was publishing using a node 16 install, but on CI we
are using Node 12. It seems that the NPM that shipped with Node 12
ignores all files for publishing if they are mentioned in `.gitignore`
which I could reproduce locally.

Doing a bit of testing, I used this solution which I think we also used
in v2 when generating `dist/` files. The `npm publish --dry-run` now
_does_ include the generated types as well and they are still ignored
for version control.
2022-03-22 10:46:38 +01:00
Oscar Lee-Vermeren
70853bafe2
Ignore .DS_Store (#6005) 2021-11-23 15:23:18 -05: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
Sachin Raja
c0ee52060c
Generate plugin list file (#4725)
* Generate plugin list file

Removes the importing of all plugins in src/util/resolveConfig to avoid importing CSS.
Import the built plugin list file instead.

* Use `process.cwd()` instead of `__dirname` to resolve path

Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>

* Import core plugin list in resolveConfig test

* Generate plugin list prebabelify and on install

* Move generation from install to postinstall

Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>

Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
2021-06-23 14:13:03 -04:00
Robin Malfait
f63b4531f5
Add tailwindcss/nesting plugin (#4673)
* add nesting plugin

* rename @tailwindcss/nesting to tailwindcss/nesting

* ignore the built `nesting` plugin

* add a postcss7 compat version

* include `nesting` plugin when publishing

* add `build-plugins` script

This will allow us to keep the plugins in their dedicated folders +
tests + postcss7 compatibility files. However, when we copy over the
plugins to the root. For example `plugins/nesting/` -> `nesting/` we
skip files like `.test.js` and `.postcss7.js`.

* build plugins when running `prepublishOnly`

* improve compat mode

We will use a glob so that we can move all *.postcss7.* files to just
*.* likewise we will also backup to *.* to *.postcss8.* for restoring
purposes.

Concrete example:

- Current state:
  - index.js            // PostCSS 8 implementation
  - index.postcss7.js   // PostCSS 7 implementation

- Run "compat"
  - index.js            // PostCSS 7 implementation
  - index.postcss7.js   // PostCSS 7 implementation
  - index.postcss8.js   // PostCSS 8 implementation (Backup of original)

- Run "compat:restore"
  - index.js            // PostCSS 8 implementation
  - index.postcss7.js   // PostCSS 7 implementation
  - X index.postcss8.js // PostCSS 8 implementation (Removed)

* Update README.md

* ensure we `npm install` before publishing

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-06-17 09:43:52 -04:00
Adam Wathan
746a12602e
Improve new JIT-compatible CLI (#4558)
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2021-06-04 10:28:09 -04:00
Robin Malfait
4528bdc2d8
Start of new CLI (#4526)
* Ignore workspace settings

* Parameterize setting up the context

* WIP

* WIP

* WIP

* WIP

* wip

* WIP

Co-Authored-By: Jesse Katsumata <niconico.clarinet@gmail.com>

* WIP

Co-Authored-By: Jesse Katsumata <niconico.clarinet@gmail.com>

* WIP

Co-Authored-By: Jesse Katsumata <niconico.clarinet@gmail.com>

* Update some comments

Co-Authored-By: Jesse Katsumata <niconico.clarinet@gmail.com>

* Fix bug

* WIP

* WIP'

* more things

* log console.time calls conditionally based on process.env.DEBUG

* add `init` command

* clean up when using --jit

* Make config file optional

* cleanup path.resolve calls

path.resolve('.') is the same as path.resolve(process.cwd(), '.')

* implement `--help`

* shush eslint

* drop unnecessary file

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
Co-authored-by: Jesse Katsumata <niconico.clarinet@gmail.com>
2021-06-01 14:02:23 +02:00
Adam Wathan
73683d8795 Compile CLI to single file to avoid peer dependency issues 2021-05-14 17:02:15 -04:00
Robin Malfait
789b0452b5 swap yarn.lock for package-lock.json 2021-04-02 15:13:21 -04:00
Adam Wathan
3c9c46c9a8 Ignore coverage folder 2020-10-25 15:42:17 -04:00
Adam Wathan
08431100a3 Ignore any tailwind.config.js files 2020-10-07 14:12:41 -04:00
Robin Malfait
4b15b90f21 add perf utils 2020-08-18 08:21:33 -04:00
Adam Wathan
c2d022a8a1 Fix extension in gitignore 2019-03-12 10:58:59 -04:00
Adam Wathan
0fc69edcd5 Remove package-lock.json
I develop Tailwind using Yarn, so this file is never up to date.
2019-03-05 08:23:45 -05:00
Adam Wathan
0d93dc8d54 Ignore index.html
I use this file with live-server for random testing when developing
locally. Totally worth cluttering up the .gitignore for the
convenience. #sorrynotsorry
2019-02-27 13:31:13 -05:00
Adam Wathan
ca366ee12d Include dist folder, but exclude contents 2017-11-06 15:11:48 -05:00
Adam Wathan
9210b7f747 gitignore dist files, but still publish to npm 2017-11-06 11:26:20 -05:00
Adam Wathan
a77d879db6 Remove sublime project file 2017-11-03 09:59:10 -04:00
David Hemphill
8863065b97 Rework Babel setup to be more node-y less browser-y 2017-09-09 10:23:53 -04:00
David Hemphill
c1b57db972 Ignore example folder I use to test the CLI 2017-08-28 15:01:31 -05:00
Adam Wathan
7bd480a40f Only ignore /lib, not all lib folders 2017-08-28 08:23:06 -04:00
David Hemphill
e375d9caae Add a sublime project file to hide /lib from searches 2017-08-27 18:02:41 -04:00
David Hemphill
2ef01837a9 Convert new stuff to use ES6 modules 2017-08-27 18:02:41 -04:00
Adam Wathan
d1e6f472a7 Remove node_modules whoops 2017-08-01 10:19:43 -04:00