Commit graph

46 commits

Author SHA1 Message Date
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
nakajima a.k.a. nazomikan
705d21397c
Support renaming of output files by PostCSS plugin. (#9944)
* Support for rename of output files by postcss plugin.

* update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-11-29 11:17:39 +01:00
Jordan Pittman
4ccc0fa12a
Make sure errors are always displayed when watching for changes (#9810)
* Make sure errors are always displayed when watching for changes

* Update changelog
2022-11-11 10:14:14 -05:00
Jordan Pittman
1482c7512a
Fix watching of files on Linux when renames are involved (#9796)
* Fix watching files on Linux

* Update changelog
2022-11-10 12:33:42 -05:00
Will Cosgrove
1f5d117cf9
Fix shadowed variable when using raw content (#9773)
* Fix shadowed variable when using raw content

* Add test

* Update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-11-08 17:02:10 -05:00
Imran Khan
0a4ae7730d
Fix not rebuilding files when rename event is emit (#9689)
* Fix CLI not rebuilding files when `rename` event is emit

* Refactor watching code

* Simplify

* Add rebuild timer

* Move timer into `recordChangedFile`

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-11-03 09:00:38 -04:00
Robin Malfait
40f6b4ff64
Fix missing PostCSS dependencies in the CLI (#9617)
* Record and watch PostCSS dependencies in the CLI

* ensure `changedContent` gets cleared

Otherwise this list gets bigger and bigger, not only that there is a
subtle bug. The moment you save a `.css` file we want to create a new
context and start from scratch. However, since the list was never
cleared, it meant that every subsequent save to *any* file (not only
config / css files) creates a new context...

By clearing the least we should work around this problem.

* add test that verifies an odd bug

The story goes like this:

1. add `underline` to html file
  -> css contains `underline` rule
2. add `font-bold` to html file
  -> css contains `underline` and `font-bold`
3. remove `underline` from html file
  -> css still contains `underline` and `font-bold` for performance reasons
4. Save a css file (! RED FLAG)
  -> css contains `font-bold` because we started from scratch
5. add `underline` to html file
  -> css contains `underline` and `font-bold`
6. remove `underline` from html file
  -> css only contains `font-bold`... (UH OH)

This is because the moment we did step 4, every single save in any file created a new context. Every. Single. Time.

* use a property that doesn't require `autoprefixer`

* update changelog

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2022-10-20 18:01:39 +02:00
Robin Malfait
4041c863b8
Ensure --content is used in the CLI when passed (#9587)
* update changelog

* ensure `--content` is taken into account

* cleanup tests

- Use `rm` instead of deprecated `rmdir`
- Type the returnType correctly

* use a file not included in `content` of your tailwind.config.js file
2022-10-17 16:40:50 +02:00
Jordan Pittman
5ea752e85c
Add @config support (#9405)
* Refactor CLI

* Add `@config` support

* Update changelog

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2022-09-23 13:48:17 -04:00
Adam Wathan
cb48248552 Remove existing CLI 2021-06-04 11:44:28 -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
Robin Malfait
6ed835cb71
Fix invalid arg type (#3978)
* default to `tailwind.css` file when no input is given

* skip undefined files

* update forgotten test fixtures
2021-04-06 00:12:52 +02:00
Nate Moore
e86b586f4b
Adds support for tailwind.config.cjs files (#3181)
* feat: automatically init and resolve tailwind.config.cjs files

* test: add tests for default tailwind.config.cjs resolution

* fix `cjsConfigFile` constant

* Fix JSDoc type of isModule
2021-02-07 14:50:21 -05:00
Adam Wathan
fd8bacd7ae
Add new color palette (#2623)
* Add new color palette

* Replace local require when scaffolding config

* Remove unused import
2020-10-19 20:18:53 -04:00
Adam Wathan
38b4eeb288 Prettier likes parens a lot now
git blame is now broken forever.
2020-10-16 15:39:44 -04:00
Adam Wathan
9065404f4d Revert "Automatically add featureFlags.future flags to the configuration files whenever the init command is ran (#2379)"
This reverts commit f72158c87f.
2020-10-16 14:53:21 -04:00
Dexter Marks-Barber
f72158c87f Automatically add featureFlags.future flags to the configuration files whenever the init command is ran (#2379)
* Add --future flag to CLI

* Remove early exit

* Always add future flags but commented out

- Update replace regex

- Remove future CLI flag

- Update tests
2020-10-07 14:12:41 -04:00
Adam Wathan
1bc2fed3bd Tweak help text 2020-08-22 08:40:24 -04:00
Robin Malfait
939346d8b3
add tailwind -p init option to generate a postcss file 2020-08-22 01:43:47 +02:00
Adam Wathan
8b08814103 Remove unused code 2020-07-28 08:23:01 -04:00
Adam Wathan
46dab3b0d4 Clearer messaging on building with no input file 2020-07-28 08:22:53 -04:00
Owen Melbourne
3febffdb55 Fixed some styling 2020-05-30 17:59:54 +01:00
Owen Melbourne
d833174b4e Allowed the 'build' cli command to fallback to some defaults if no input file is specified. 2020-05-30 17:53:30 +01:00
Adam Wathan
ab52a8c082 Support purge: false, add more info to console warning 2020-05-01 08:25:45 -04:00
mattstypa
26e4007428 Few CLI tweaks 2019-03-20 08:17:56 -05:00
mattstypa
6d65dfb058 Removed no-comments option from init command 2019-03-15 09:15:16 -05:00
Matt Stypa
6c461706c6 Moved constants and used it for hardcoded paths 2019-03-15 07:08:34 -05:00
Matt Stypa
7ec4b11d73 Ripped out the code no longer needed 2019-03-14 20:24:31 -05:00
Matt Stypa
9e835e4546 Fixed failing tests and added additional coverage 2019-03-14 16:51:36 -05:00
mattstypa
92b3b0c0a1 Updated CLI init commend 2019-03-14 15:51:21 -05:00
Adam Wathan
db7f1e6728 Merge branch 'master' into next 2019-02-22 10:05:31 -05:00
Matt Stypa
84a571235c Refactored the CLI build process to use configuration object instead of many arguments. 2019-02-04 21:42:27 -06:00
Adam Wathan
3d2a598c0e Don't test for presence of defaultConfig in defaultConfig 2019-02-01 12:32:50 -05:00
Adam Wathan
2ee98f226a Update fucking doc blocks 2018-11-05 08:53:51 -05:00
Adam Wathan
d8df647fa0 Add option to disable autoprefixer in CLI 2018-11-05 08:53:51 -05:00
mattstypa
34ad504a46 Added tests for CLI utils 2018-09-25 11:09:20 -05:00
Matt Stypa
dbeeea4dbb Added ability to protect comments when --no-comments options is use for CLI init command 2018-09-24 21:12:07 -05:00
Matt Stypa
48387a8f8a Switched to use strip-comments instead of Babel for CLI init command 2018-09-24 21:00:30 -05:00
mattstypa
9e26fd84e3 CLI. Added --no-comments option to init commend 2018-09-24 15:44:36 -05:00
Matt Stypa
eb4da80ede Code style updates 2018-09-24 07:55:24 -05:00
Matt Stypa
1b1ae8abc9 When no output file is specified for the build command, the result will be piped to stdout 2018-09-23 22:00:50 -05:00
mattstypa
d91eea88fb Reverted changes to processTailwindFeatures that would impact Webpack watch ability. As a result all commands also became Promise based 2018-09-14 11:07:23 -05:00
mattstypa
933b557e87 Code style fixes 2018-09-14 08:28:03 -05:00
Matt Stypa
6e448ea70a Config stub path was incorrect 2018-09-14 06:46:16 -05:00
Matt Stypa
ad695e9c13 CLI tool will now print the correct usage information 2018-09-14 06:42:33 -05:00
Matt Stypa
b71cfe711e CLI tool rewrite 2018-09-13 21:37:10 -05:00