diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..03ae872 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,130 @@ +name: ci +concurrency: + group: "${{github.workflow}}-${{github.ref}}" + cancel-in-progress: true +on: + workflow_dispatch: + push: + branches: + - main + tags: + - v*.*.* + pull_request: + types: [opened, synchronize] + branches: + - '*' + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4", "head"] + steps: + - uses: actions/checkout@v4 + - run: rm Gemfile.lock + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + bundler: latest + bundler-cache: true + - name: Run tests + run: bundle exec rake test + + package: + needs: [ "test" ] + name: "package (${{ matrix.platform }})" + strategy: + fail-fast: false + matrix: + platform: + - "ruby" + - "aarch64-linux-gnu" + - "aarch64-linux-musl" + - "arm64-darwin" + - "x64-mingw-ucrt" + - "x64-mingw32" + - "x86_64-darwin" + - "x86_64-linux-gnu" + - "x86_64-linux-musl" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rm Gemfile.lock + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + bundler: latest + bundler-cache: true + - run: "bundle exec rake gem:${{matrix.platform}}" + - uses: actions/upload-artifact@v4 + with: + name: gem-${{matrix.platform}} + path: pkg + retention-days: 1 + + install-ruby: + name: "install (ruby)" + needs: [ "package" ] + runs-on: ubuntu-latest + steps: + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + - uses: actions/download-artifact@v4 + with: + name: gem-ruby + path: pkg + - run: "gem install pkg/tailwindcss-ruby-*.gem" + - run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'" + + install-native: + name: "install (${{ matrix.platform }})" + needs: [ "package" ] + strategy: + fail-fast: false + matrix: + ruby: [ "3.4" ] + platform: + - "aarch64-linux-gnu" + - "aarch64-linux-musl" + - "arm64-darwin" + - "x64-mingw-ucrt" + # - "x64-mingw32" # because it's on a different version of ruby, we just add it in an "include" below + - "x86_64-darwin" + - "x86_64-linux-gnu" + - "x86_64-linux-musl" + include: + - { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64/v8" } + - { platform: aarch64-linux-musl, docker_tag: "-alpine", docker_platform: "--platform=linux/arm64/v8", bootstrap: "apk add build-base &&" } + - { platform: arm64-darwin, runs_on: macos-14 } + - { platform: x64-mingw-ucrt, runs_on: windows-latest } + - { platform: x64-mingw32, runs_on: windows-latest, ruby: "3.0" } + - { platform: x86_64-darwin, runs_on: macos-13 } + - { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add build-base &&" } + runs-on: ${{ matrix.runs_on || 'ubuntu-latest' }} + steps: + - uses: actions/download-artifact@v4 + with: + name: gem-${{ matrix.platform }} + path: pkg + - if: ${{ matrix.runs_on }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - if: ${{ matrix.runs_on }} + run: "gem install pkg/tailwindcss-ruby-*.gem" + - if: ${{ matrix.runs_on }} + run: "tailwindcss --help" + - if: ${{ (! matrix.runs_on) && matrix.docker_platform }} + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - if: ${{ ! matrix.runs_on }} + run: | + docker run --rm -v $PWD:/tailwindcss-ruby -w /tailwindcss-ruby \ + ${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \ + sh -c " + ${{ matrix.bootstrap }} + gem install pkg/tailwindcss-ruby-*.gem + tailwindcss --help + " diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 6d32d4f..573bf98 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -9,7 +9,6 @@ on: push: branches: - main - - v*.*.x tags: - v*.*.* pull_request: @@ -25,21 +24,30 @@ jobs: matrix: include: - url: https://github.com/rails/tailwindcss-rails - name: tailwindcss-rails + name: rails-unit command: "bin/test" - ruby: "3.3" + ruby: "3.4" + - url: https://github.com/rails/tailwindcss-rails + name: rails-install + command: "env TAILWINDCSSOPTS=--path=../../.. test/integration/user_install_test.sh" + ruby: "3.4" + - url: https://github.com/rails/tailwindcss-rails + name: rails-upgrade + command: "env TAILWINDCSSOPTS=--path=../../.. test/integration/user_upgrade_test.sh" + ruby: "3.4" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} - - run: gem install bundler -v ">= 2.3.22" # for "add --path" - run: bundle install --local || bundle install + - run: bundle exec rake download - run: git clone --depth=1 ${{matrix.url}} ${{matrix.name}} - name: ${{matrix.name}} test suite working-directory: ${{matrix.name}} run: | + rm -f Gemfile.lock bundle remove tailwindcss-ruby || true bundle add tailwindcss-ruby --path=".." bundle install --local || bundle install diff --git a/.github/workflows/gem-install.yml b/.github/workflows/gem-install.yml deleted file mode 100644 index bab88e5..0000000 --- a/.github/workflows/gem-install.yml +++ /dev/null @@ -1,153 +0,0 @@ -name: packaging -concurrency: - group: "${{github.workflow}}-${{github.ref}}" - cancel-in-progress: true -on: - workflow_dispatch: - push: - branches: - - main - tags: - - v*.*.* - pull_request: - types: [opened, synchronize] - branches: - - '*' - -jobs: - package: - strategy: - fail-fast: false - matrix: - platform: ["ruby", "x64-mingw32", "x64-mingw-ucrt", "x86_64-darwin", "arm64-darwin", "x86_64-linux", "arm-linux"] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: rm Gemfile.lock - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - bundler: latest - bundler-cache: true - - run: "bundle exec rake gem:${{matrix.platform}}" - - uses: actions/upload-artifact@v4 - with: - name: gem-${{matrix.platform}} - path: pkg - retention-days: 1 - - vanilla-install: - needs: ["package"] - runs-on: ubuntu-latest - steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - - uses: actions/download-artifact@v4 - with: - name: gem-ruby - path: pkg - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'" - - linux-install: - needs: ["package"] - runs-on: ubuntu-latest - steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - - uses: actions/download-artifact@v4 - with: - name: gem-x86_64-linux - path: pkg - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss --help" - - linux-musl-install: - needs: ["package"] - runs-on: ubuntu-latest - container: - image: ruby:3.2-alpine - steps: - - uses: actions/download-artifact@v4 - with: - name: gem-x86_64-linux - path: pkg - - run: "apk add build-base" # to compile racc, etc. - - run: "gem update --system" # let's make sure the latest is working for us (upstream test, see #200) - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss --help" - - linux-arm-install: - needs: ["package"] - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v4 - with: - name: gem-arm-linux - path: pkg - - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker run --rm -v "$(pwd):/test" -w /test --platform=linux/arm/v7 ruby:3.2 \ - /bin/bash -c " - set -ex - gem install pkg/tailwindcss-ruby-*.gem - tailwindcss --help - " - - darwin-x86_64-install: - needs: ["package"] - runs-on: macos-13 - steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - - uses: actions/download-artifact@v4 - with: - name: gem-x86_64-darwin - path: pkg - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss --help" - - darwin-arm64-install: - needs: ["package"] - runs-on: macos-14 - steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - - uses: actions/download-artifact@v4 - with: - name: gem-arm64-darwin - path: pkg - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss --help" - - windows-install: - needs: ["package"] - runs-on: windows-latest - steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.0" - - uses: actions/download-artifact@v4 - with: - name: gem-x64-mingw32 - path: pkg - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss --help" - - windows-ucrt-install: - needs: ["package"] - runs-on: windows-2022 - steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - - uses: actions/download-artifact@v4 - with: - name: gem-x64-mingw-ucrt - path: pkg - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss --help" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index e2545da..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: ci -concurrency: - group: "${{github.workflow}}-${{github.ref}}" - cancel-in-progress: true -on: - workflow_dispatch: - push: - branches: - - main - tags: - - v*.*.* - pull_request: - types: [opened, synchronize] - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - ruby: ["3.0", "3.1", "3.2", "3.3", "head"] - steps: - - uses: actions/checkout@v4 - - run: rm Gemfile.lock - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{matrix.ruby}} - bundler: latest - bundler-cache: true - - name: Run tests - run: bundle exec rake test diff --git a/CHANGELOG.md b/CHANGELOG.md index be5c0d4..354d40a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,286 @@ -## [Unreleased] +# tailwindcss-ruby changelog -## first / unreleased +## v4.1.8 + +* Update to [Tailwind CSS v4.1.8](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.1.8) @flavorjones + + +## v4.1.7 + +* Update to [Tailwind CSS v4.1.7](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.1.7) @flavorjones + + +## v4.1.6 + +* Update to [Tailwind CSS v4.1.6](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.1.6) @flavorjones + + +## v4.1.5 + +* Update to [Tailwind CSS v4.1.5](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.1.5) @flavorjones + + +## v4.1.4 + +* Update to [Tailwind CSS v4.1.4](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.1.4) @flavorjones + + +## v4.1.3 + +* Update to [Tailwind CSS v4.1.3](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.1.3) @flavorjones + + +## v4.0.17 + +* Update to [Tailwind CSS v4.0.17](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.17) @flavorjones + + +## v4.0.16 + +* Update to [Tailwind CSS v4.0.16](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.16) @flavorjones + + +## v4.0.15 + +* Update to [Tailwind CSS v4.0.15](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.15) @flavorjones + + +## v4.0.14 + +* Update to [Tailwind CSS v4.0.14](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.14) @flavorjones + + +## v4.0.12 + +* Update to [Tailwind CSS v4.0.12](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.12) @flavorjones + + +## v4.0.9 + +* Update to [Tailwind CSS v4.0.9](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.9) @flavorjones + + +## v4.0.8 + +* Update to [Tailwind CSS v4.0.8](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.8) @flavorjones + + +## v4.0.7 + +* Update to [Tailwind CSS v4.0.7](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.7) @flavorjones + + +## v4.0.6 + +* Update to [Tailwind CSS v4.0.6](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.6) @flavorjones + + Upgrade guide at https://tailwindcss.com/docs/upgrade-guide + + +## v4.0.5 + +* Update to [Tailwind CSS v4.0.5](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.5) @flavorjones + + Upgrade guide at https://tailwindcss.com/docs/upgrade-guide + + +## v4.0.4 + +* Update to [Tailwind CSS v4.0.4](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.4) @flavorjones + + Upgrade guide at https://tailwindcss.com/docs/upgrade-guide + + +## v4.0.3 + +* Update to [Tailwind CSS v4.0.3](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.3) @flavorjones + + Upgrade guide at https://tailwindcss.com/docs/upgrade-guide + + +## v4.0.2 + +* Update to [Tailwind CSS v4.0.2](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.2) @flavorjones + + Upgrade guide at https://tailwindcss.com/docs/upgrade-guide + + +## v4.0.1 + +* Update to [Tailwind CSS v4.0.1](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.1) @flavorjones + + Upgrade guide at https://tailwindcss.com/docs/upgrade-guide + + +## v4.0.0 + +* Update to [Tailwind CSS v4.0.0](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0) @flavorjones + + The upstream upgrade guide is at https://tailwindcss.com/docs/upgrade-guide. + + For Rails users, if you want to upgrade you may want to check out [TailwindCSS v4 - upgrade experience report · rails/tailwindcss-rails · Discussion #450](https://github.com/rails/tailwindcss-rails/discussions/450). If you're not ready to upgrade, then pin your project to the 3.x releases: + + ```ruby + # If you're not ready to upgrade yet! + gem "tailwindcss-ruby", "~> 3.4" + ``` + + +## v4.0.0.beta.10 + +* Update to [Tailwind CSS v4.0.0-beta.10](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.10) @excid3 + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release finally includes linux-musl binaries, and so the native gem platforms are now specialized to `{x86_64,aarch64}-linux-{gnu,musl}`. You may need to update the platforms in your Gemfile.lock using `bundle lock --add-platform`. + + However, there are still no upstream armv7 binaries. + +## v4.0.0.beta.9 + +* Update to [Tailwind CSS v4.0.0-beta.9](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.9) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release finally includes linux-musl binaries, and so the native gem platforms are now specialized to `{x86_64,aarch64}-linux-{gnu,musl}`. You may need to update the platforms in your Gemfile.lock using `bundle lock --add-platform`. + + However, there are still no upstream armv7 binaries. + + +## v4.0.0.beta.8 + +* Update to [Tailwind CSS v4.0.0-beta.8](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.8) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.beta.6 + +* Update to [Tailwind CSS v4.0.0-beta.6](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.6) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.beta.5 + +* Update to [Tailwind CSS v4.0.0-beta.5](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.5) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.beta.4 + +* Update to [Tailwind CSS v4.0.0-beta.4](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.4) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.beta.3 + +* Update to [Tailwind CSS v4.0.0-beta.3](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.3) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.beta.2 + +* Update to [Tailwind CSS v4.0.0-beta.2](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.2) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.beta.1 + +* Update to [Tailwind CSS v4.0.0-beta.1](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-beta.1) (#26) @flavorjones + + Prerelease documentation at https://tailwindcss.com/docs/v4-beta + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.36 + +* Update to [Tailwind CSS v4.0.0-alpha.36](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.36). Also see release notes for [Tailwind CSS v4.0.0-alpha.35](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.35) (#25) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.34 + +* Update to [Tailwind CSS v4.0.0-alpha.34](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.34) (#18) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.33 + +* Update to [Tailwind CSS v4.0.0-alpha.33](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.33). Also see release notes for [Tailwind CSS v4.0.0-alpha.32](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.32) (#17) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.31 + +* Update to [Tailwind CSS v4.0.0-alpha.31](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.31) (#16) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.30 + +* Update to [Tailwind CSS v4.0.0-alpha.30](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.30) (#15) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.29 + +* Update to [Tailwind CSS v4.0.0-alpha.29](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.29) (#14) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.28 + +* Update to [Tailwind CSS v4.0.0-alpha.28](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.28) (#10) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.27 + +* Update to [Tailwind CSS v4.0.0-alpha.27](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.27) (#9) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.26 / 2024-10-03 + +* Update to [Tailwind CSS v4.0.0-alpha.26](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.26) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v4.0.0.alpha.25 / 2024-09-26 + +* Update to [Tailwind CSS v4.0.0-alpha.25](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.25) @flavorjones + + Note that this upstream release does not provide an armv7 release, nor a musl-compatible binary. + + +## v3.4.13 / 2023-09-26 * This gem was extracted from `tailwindcss-rails`. @@ -8,4 +288,5 @@ from the Rails integration. This will allow users to upgrade TailwindCSS at a time of their choosing, and allow early adopters to start using the beta releases. - It should also make it easier for non-Rails Ruby projects to use tailwindcss (e.g., Jekyll and other web frameworks). + It should also make it easier for non-Rails Ruby projects to use tailwindcss (e.g., Jekyll and + other web frameworks). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a0bbc0..e4332fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,20 +4,26 @@ This doc is a brief introduction on modifying and maintaining this gem. ## Updating to the latest upstream tailwindcss version -Update `lib/tailwindcss/ruby/upstream.rb` with the upstream version. +Please don't submit PRs to the maintainer with an upstream bump. -Run `bundle exec rake clobber` then `bundle exec rake download` to ensure the tailwindcss binaries can be downloaded, and that you have the correct versions on local disk. +- [ ] run `bin/bump-upstream` +- [ ] push the branch, create a PR ## Cutting a release of tailwindcss-ruby -- bump the version +- if it's just bumping the upstream: + - [ ] follow the steps above + - [ ] when the PR is green, merge the PR + - [ ] create a git tag (after updating local `main`) +- else if the gem is being changed in some other way: - [ ] update `lib/tailwindcss/ruby/version.rb` - [ ] update `CHANGELOG.md` - - [ ] commit and create a git tag + - [ ] `git commit` + - [ ] `git tag` - build the native gems: - - [ ] `bundle exec rake clobber` if needed to clean up possibly-old tailwindcss executables + - [ ] `bundle exec rake clobber` (if needed to clean up old tailwindcss executables) - [ ] `bundle exec rake package` -- push +- push source and gems: - [ ] `for g in pkg/*.gem ; do gem push $g ; done` - [ ] `git push && git push --tags` - announce diff --git a/Gemfile.lock b/Gemfile.lock index b6295e5..db7a499 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,55 +1,55 @@ PATH remote: . specs: - tailwindcss-ruby (0.1.0) + tailwindcss-ruby (4.1.8) GEM remote: https://rubygems.org/ specs: ast (2.4.2) - json (2.7.2) - language_server-protocol (3.17.0.3) + json (2.10.2) + language_server-protocol (3.17.0.4) lint_roller (1.1.0) - minitest (5.25.1) + minitest (5.25.4) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.7.1) ast (~> 2.4.1) racc racc (1.8.1) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.2) - rexml (3.3.7) - rubocop (1.65.1) + regexp_parser (2.10.0) + rubocop (1.71.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) - rubocop-performance (1.21.1) + rubocop-performance (1.23.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) - standard (1.40.0) + standard (1.45.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.65.0) + rubocop (~> 1.71.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.4) + standard-performance (~> 1.6) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.4.0) + standard-performance (1.6.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.21.0) - unicode-display_width (2.6.0) + rubocop-performance (~> 1.23.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) PLATFORMS ruby diff --git a/LICENSE-DEPENDENCIES b/LICENSE-DEPENDENCIES index 93a3402..a1359d9 100644 --- a/LICENSE-DEPENDENCIES +++ b/LICENSE-DEPENDENCIES @@ -1,4 +1,4 @@ -tailwindcss-rails may redistribute executables from the https://github.com/tailwindlabs/tailwindcss project +tailwindcss-ruby may redistribute executables from the https://github.com/tailwindlabs/tailwindcss project The license for that software can be found at https://github.com/tailwindlabs/tailwindcss/blob/master/LICENSE which is reproduced here for your convenience: diff --git a/README.md b/README.md index 51e9a8d..debfdce 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,23 @@ A self-contained `tailwindcss` executable, wrapped up in a ruby gem. That's it. If you're looking to leverage tailwindcss in your Rails project, please see https://github.com/rails/tailwindcss-rails for integration that is supported by the Rails team. +## ⚠ Upgrade note ⚠ + +To upgrade an existing application from v3 to v4, I strongly urge you to read the upstream upgrade guide: https://tailwindcss.com/docs/upgrade-guide. + +For Rails users, if you want to upgrade you may want to check out [TailwindCSS v4 - upgrade experience report · rails/tailwindcss-rails · Discussion #450](https://github.com/rails/tailwindcss-rails/discussions/450). + +In any case, if you're not ready to upgrade to v4, then pin your project to the 3.x releases: + +```ruby +# If you're not ready to upgrade yet! +gem "tailwindcss-ruby", "~> 3.4" +``` + + ## Installation -This gem wraps [the standalone executable version](https://tailwindcss.com/blog/standalone-cli) of the Tailwind CSS v3 framework. These executables are platform specific, so there are actually separate underlying gems per platform, but the correct gem will automatically be picked for your platform. +This gem wraps [the standalone executable version](https://tailwindcss.com/blog/standalone-cli) of the Tailwind CSS v4 framework. These executables are platform specific, so there are actually separate underlying gems per platform, but the correct gem will automatically be picked for your platform. Supported platforms are: @@ -33,7 +47,7 @@ gem install tailwindcss-ruby ### Using a local installation of `tailwindcss` -If you are not able to use the vendored standalone executables (for example, if you're on an unsupported platform), you can use a local installation of the `tailwindcss` executable by setting an environment variable named `TAILWINDCSS_INSTALL_DIR` to the directory path containing the executable. +If you are not able to use the vendored standalone executables (for example, if you're on an unsupported platform), you can use a [local installation](https://tailwindcss.com/docs/installation) of the `tailwindcss` executable by setting an environment variable named `TAILWINDCSS_INSTALL_DIR` to the directory path containing the executable. For example, if you've installed `tailwindcss` so that the executable is found at `/path/to/node_modules/bin/tailwindcss`, then you should set your environment variable like so: @@ -79,28 +93,20 @@ $ bundle exec which tailwindcss # run the actual executable through the shim $ bundle exec tailwindcss --help -["/path/to/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/tailwindcss-rails-2.6.0-x86_64-linux/exe/x86_64-linux/tailwindcss", "--help"] - -tailwindcss v3.4.3 +["/path/to/installs/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/tailwindcss-ruby-4.0.12-x86_64-linux-gnu/exe/x86_64-linux-gnu/tailwindcss", "--help"] +≈ tailwindcss v4.0.12 Usage: - tailwindcss [--input input.css] [--output output.css] [--watch] [options...] - tailwindcss init [--full] [--postcss] [options...] - -Commands: - init [options] + tailwindcss [--input input.css] [--output output.css] [--watch] [options…] Options: - -i, --input Input file - -o, --output Output file - -w, --watch Watch for changes and rebuild as needed - -p, --poll Use polling instead of filesystem events when watching - --content Content paths to use for removing unused classes - --postcss Load custom PostCSS configuration - -m, --minify Minify the output - -c, --config Path to a custom config file - --no-autoprefixer Disable autoprefixer - -h, --help Display usage information + -i, --input ··········· Input file + -o, --output ·········· Output file [default: `-`] + -w, --watch ··········· Watch for changes and rebuild as needed + -m, --minify ·········· Optimize and minify the output + --optimize ········ Optimize the output without minifying + --cwd ············· The current working directory [default: `.`] + -h, --help ············ Display usage information ``` diff --git a/bin/bump-upstream b/bin/bump-upstream new file mode 100755 index 0000000..cb698e0 --- /dev/null +++ b/bin/bump-upstream @@ -0,0 +1,91 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +if [[ $# -lt 1 ]] ; then + echo "Usage: $(basename $0) " + echo + echo "Where is the tag name of the Tailwind CSS release." + exit 1 +fi + +PAGER="" # we don't want gh to use a pager +git_cmd=$(command -v git) +gh_cmd=$(command -v gh) +sed_cmd=$(command -v sed) + +fail() { + echo "Error: $*" >&2 + exit 1 +} + +upstream_tag=$1 +gem_version=$(echo $upstream_tag | $sed_cmd -E 's/^v//' | sed -E 's/-/./') +gem_tag="v${gem_version}" + +github_user=$($git_cmd config github.user || true) +if [[ -z "$github_user" ]]; then + fail "github.user is not set in git config" +fi + +# view the release. will fail if the release does not exist +$gh_cmd release view ${upstream_tag} --repo tailwindlabs/tailwindcss + +# get on the right starting branch +if [[ -n "$($git_cmd status --porcelain --untracked-files=no)" ]]; then + fail "found uncommitted changes" +fi + +if [[ $upstream_tag =~ ^v4 ]] ; then + base_branch="main" +elif [[ $upstream_tag =~ ^v3 ]] ; then + base_branch="v3.x" +else + fail "Whoa! A new major version? Need to update the ${0} script." +fi + +$git_cmd switch $base_branch + +if ! $git_cmd rev-parse --abbrev-ref @{push} >/dev/null 2>&1; then + fail "current branch is not tracking a remote branch" +fi + +# +# modify the upstream version and gem version +# +$sed_cmd -E -i "s/^(\s+)VERSION\s+=.*/\1VERSION = \"${upstream_tag}\"/" lib/tailwindcss/ruby/upstream.rb +$sed_cmd -E -i "s/^(\s+)VERSION\s+=.*/\1VERSION = \"${gem_version}\"/" lib/tailwindcss/ruby/version.rb + +bundle install + +# +# modify the changelog +# +replacement_text=$(cat < upstream release filename NATIVE_PLATFORMS = { @@ -9,9 +9,10 @@ module Upstream "x64-mingw32" => "tailwindcss-windows-x64.exe", "x64-mingw-ucrt" => "tailwindcss-windows-x64.exe", "x86_64-darwin" => "tailwindcss-macos-x64", - "x86_64-linux" => "tailwindcss-linux-x64", - "aarch64-linux" => "tailwindcss-linux-arm64", - "arm-linux" => "tailwindcss-linux-armv7", + "x86_64-linux-gnu" => "tailwindcss-linux-x64", + "x86_64-linux-musl" => "tailwindcss-linux-x64-musl", + "aarch64-linux-gnu" => "tailwindcss-linux-arm64", + "aarch64-linux-musl" => "tailwindcss-linux-arm64-musl", } end end diff --git a/lib/tailwindcss/ruby/version.rb b/lib/tailwindcss/ruby/version.rb index 8941fde..3a9e190 100644 --- a/lib/tailwindcss/ruby/version.rb +++ b/lib/tailwindcss/ruby/version.rb @@ -2,6 +2,6 @@ module Tailwindcss module Ruby - VERSION = "0.1.0" + VERSION = "4.1.8" end end diff --git a/sig/tailwindcss/ruby.rbs b/sig/tailwindcss/ruby.rbs deleted file mode 100644 index c4f115d..0000000 --- a/sig/tailwindcss/ruby.rbs +++ /dev/null @@ -1,6 +0,0 @@ -module Tailwindcss - module Ruby - VERSION: String - # See the writing guide of rbs: https://github.com/ruby/rbs#guides - end -end diff --git a/tailwindcss-ruby.gemspec b/tailwindcss-ruby.gemspec index da29ce7..6e52fea 100644 --- a/tailwindcss-ruby.gemspec +++ b/tailwindcss-ruby.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.metadata["changelog_uri"] = "https://github.com/flavorjones/tailwindcss-ruby/blob/main/CHANGELOG.md" spec.metadata["rubygems_mfa_required"] = "true" - spec.files = Dir["{app,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] + spec.files = Dir["lib/**/*", "LICENSE.txt", "LICENSE-DEPENDENCIES", "README.md"] spec.bindir = "exe" spec.executables << "tailwindcss" spec.require_paths = ["lib"]