Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add featureFlags.future flags to the configuration files whenever the init command is ran #2379

Conversation

dextermb
Copy link
Contributor

@dextermb dextermb commented Sep 13, 2020

This PR implements the --future flag on the init command which then automatically fill-in and enables the current featureFlags.future.

This PR implements adding commented out featureFlags.future flags whenever init commend is ran. This could be expanded to fill out all sorts of data and remove the manual processes that once were.

This was previously mentioned in my previous PR (#2372) but I thought I'd take a shot at implementing it myself! Feedback welcome.

✅ Tests updated and passed
✅ Styles updated and passed

@adamwathan
Copy link
Member

Hey thanks for this! I am not 100% convinced we need to add a --future option that auto-enables all future flags but I would love if we could at least reuse a bunch of the work you've done here to automatically fill in the future key with the commented out future flags, so we don't have to keep that up to date manually.

Would you be open to modifying this PR to eliminate the --future option and instead just always add all future options but commented out, and in a programmatic way that avoids us needing to keep it in sync manually?

@dextermb
Copy link
Contributor Author

Would you be open to modifying this PR to eliminate the --future option and instead just always add all future options but commented out, and in a programmatic way that avoids us needing to keep it in sync manually?

Sure. I'll see if I can do that!

- Update replace regex

- Remove future CLI flag

- Update tests
@dextermb
Copy link
Contributor Author

@adamwathan I've implemented this based on your suggestion above. I was also thinking we could do this with the experimental flags, but I wasn't sure if you wanted it in the same PR or not.

Perhaps a PR title change would make sense.

@dextermb dextermb changed the title Add --future flag to CLI Automatically add featureFlags.future flags to the configuration files whenever the init command is ran Sep 15, 2020
@adamwathan
Copy link
Member

Awesome, thank you!

@adamwathan adamwathan merged commit 0221f2f into tailwindlabs:master Sep 20, 2020
@dextermb dextermb deleted the feature/automatically-add-feature-flags branch September 20, 2020 08:09
adamwathan pushed a commit that referenced this pull request Sep 28, 2020
…les 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
adamwathan pushed a commit that referenced this pull request Oct 6, 2020
…les 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
adamwathan pushed a commit that referenced this pull request Oct 7, 2020
…les 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
@adamwathan
Copy link
Member

Just a heads up, I need to revert this because it completely breaks tailwindcss init --full. By converting the config to JSON you lose all of the functions in the config file. The tests would have told you this but you changed them to stop comparing the output and just check if the file exists, which is why I didn't notice this :/

Next time please don't just change the test when you see it fail, make it pass instead :)

adamwathan added a commit that referenced this pull request Oct 16, 2020
…ation files whenever the `init` command is ran (#2379)"

This reverts commit f72158c.
adamwathan added a commit that referenced this pull request Oct 16, 2020
…ation files whenever the `init` command is ran (#2379)"

This reverts commit f72158c.
@dextermb
Copy link
Contributor Author

The tests would have told you this but you changed them to stop comparing the output and just check if the file exists, which is why I didn't notice this :/

Next time please don't just change the test when you see it fail, make it pass instead :)

Hey! Sorry, I wasn't aware of the full content within the complete config. I ended up changing to checking that the file exists as I couldn't figure out a nice way to generate the file with the automatically added future flags.

I suppose it would still output as true due to the conversion step when outputting the file content. Whoops!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants