Skip to content

Conversation

@flavorjones
Copy link
Member

@flavorjones flavorjones commented Sep 3, 2022

This PR introduces CI pipeline test coverage for our documented user journey, which will exercise the rake tasks. It also closes #184.

After the first commit, we see the expected failure for #184:

Specified input file D:/a/tailwindcss-rails/tailwindcss-rails/Has\ does not exist.

Note that this is a pretty heavy refactoring, where code is being moved
from exe/tailwindcss to lib/tailwindcss/commands.rb where we can
more easily run unit tests on it.

Note also that we no longer use Shellwords to build command strings, a
library which does not generate correct strings on Windows
platforms. Instead we consistently use arrays of command arguments,
which can be passed to exec or system however we see fit.

The wrapper script conditionally uses system on windows platforms
because exec can't find the executable (see related issue at
rubys/sprockets-esbuild#4).

Finally, note that the rake tasks no longer use the exe/tailwindcss
wrapper script, and instead use the binary executable directly. We can
reverse this decision if we ever decide to support manually-installed
tailwindcss somewhere on the $PATH; but because previously the rake
tasks hardcoded the path/to/exe/tailwindcss, we're not introducing any
new constraints by skipping the wrapper.

@flavorjones flavorjones force-pushed the flavorjones-better-command-execution branch 3 times, most recently from f9eca84 to 978ae4c Compare September 3, 2022 15:39
primarily this is to exercise the rake tasks.
@flavorjones flavorjones force-pushed the flavorjones-better-command-execution branch from 978ae4c to a3f6e46 Compare September 3, 2022 15:46
Note that this is a pretty heavy refactoring, where code was moved
from `exe/tailwindcss` to `lib/tailwindcss/commands.rb` where we can
more easily run unit tests on it.

Note also that we no longer use Shellwords to build command strings, a
library which does not generate correct strings on Windows
platforms. Instead we consistently use arrays of command arguments,
which can be passed to `exec` or `system` however we see fit.

The wrapper script conditionally uses `system` on windows platforms
because `exec` can't find the executable (see related issue at
rubys/sprockets-esbuild#4).

Finally, note that the rake tasks no longer use the `exe/tailwindcss`
wrapper script, and instead use the binary executable directly. We can
reverse this decision if we ever decide to support manually-installed
tailwindcss somewhere on the $PATH; but because previously the rake
tasks hardcoded the path/to/exe/tailwindcss, we're not introducing any
new constraints by skipping the wrapper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants