tailwindcss/tests
Robin Malfait 2a403267d8
Oxide (#10252)
* temporarily disable workflows

* add oxide

Our Rust related parts

* use oxide

- Setup the codebase to be able to use the Rust parts based on an
  environment variable: `OXIDE=1`.
- Setup some tests that run both the non-Rust and Rust version in the
  same test.
- Sort the candidates in a consistent way, to guarantee the order for
  now (especially in tests).
- Reflect sorting related changes in tests.
- Ensure tests run in both the Rust and non-Rust version. (Some tests
  are explicitly skipped when using the Rust version since we haven't
  implemented those features yet. These include: custom prefix,
  transformers and extractors).
  - `jest`
  -`OXIDE=1 jest`

* remove into_par_iter where it doesn't make sense

* cargo fmt

* wip

* enable tracing based on `DEBUG` env

* improve CI for the Oxide build

* sort test output

This happened because the sorting happens in this branch, but changes
happened on the `master` branch.

* add failing tests

I noticed that some of the tests were failing, and while looking at
them, it happened because the tests were structured like this:

```html
    <div
      class="
        backdrop-filter
        backdrop-filter-none
        backdrop-blur-lg
        backdrop-brightness-50
        backdrop-contrast-0
        backdrop-grayscale
        backdrop-hue-rotate-90
        backdrop-invert
        backdrop-opacity-75
        backdrop-saturate-150
        backdrop-sepia
      "
    ></div>
```

This means that the class names themselves eventually end up like this: `backdrop-filter-none\n`
-> (Notice the `\n`)

/cc @thecrypticace

* fix range to include `\n`

* Include only unique values for tests

Really, what we care about most is that the list contains every expected candidate. Not necessarily how many times it shows up because while many candidates will show up A LOT in a source text we’ll unique them before passing them back to anything that needs them

* Fix failing tests

* Don’t match empty arbitrary values

* skip tests in oxide mode regarding custom separators in arbitrary variants

* re-enable workflows

* use `@tailwindcss/oxide` dependency

* publish `tailwindcss@oxide`

* drop prepublishOnly

I don't think we actually need this anymore (or even want because this
is trying to do things in CI that we don't want to happen. Aka, build
the Oxide Rust code, it is already a dependency).

* WIP

* Defer to existing CLI for Oxide

* Include new compiled typescript stuff when publishing

* Move TS to ./src/oxide

* Update scripts

* Clean up tests for TS

* copy `cli` to `oxide/cli`

* make CLI files TypeScript files

* drop --postcss flag

* setup lightningcss

* Remove autoprefixer and cssnano from oxide CLI

* cleanup Rust code a little bit

- Drop commented out code
- Drop 500 fixture templates

* sort test output

* re-add `prepublishOnly` script

* bump SWC dependencies in package-lock.json

* pin `@swc` dependencies

* ensure to install and build oxide

* update all GitHub Workflows to reflect Oxide required changes

* sort `content-resolution` integration tests

* add `Release Insiders — Oxide`

* setup turbo repo + remote caching

* use `npx` to invoke `turbo`

* setup unique/proper package names for integration tests

* add missing `isomorphic-fetch` dependency

* setup integration tests to use `turborepo`

* scope tailwind tasks to root workspace

* re-enable `node_modules` cache for integration tests

* re-enable `node_modules` cache for main CI workflow

* split cache for `main` and `oxide` node_modules

* fix indent

* split install dependencies so that they can be cached individually

* improve GitHub actions caching

* use correct path for oxide node_modules (crates/node)

* ensure that `cargo install` always succeeds

cargo install X, on CI will fail if it already exists.

* figure out integration tests with turbo

* tmp: use `npm` instead of `turbo`

* disable `fail-fast`

This will allow us to run integration tests so that it still caches the
succesful ones.

* YAML OH YAML, Y U WHITESPACE SENSITIVE

* copy the oxide-ci workflow to release-oxide

* make `oxide-ci` a normal CI workflow

Without publishing

* try to cache cargo and node_modules for the oxide build

* configure turbo to run scripts in the root

* explicitly skip failing test for the Oxide version

* run oxide tests in CI

* only use build script for root package

* sync package-lock.json

* do not cache node_modules for each individual integration

* look for hoisted `.bin`

* use turbo for caching build tailwind css in integration tests

* Robin...

* try to use the local binary first

* skip installing integration test dependencies

Should already be installed due to workspace usage

* Robin...

* drop `output.clean`

* explicitly add `mini-css-extract-plugin`

* drop oxide-ci, this is tested by proxy

* ensure oxide build is used in integration tests

This will ensure the `@tailwindcss/oxide` dependency is available
(whether we use it or not).

* setup Oxide shim in insiders release

* add browserslist dependency

* use `install:all` script name

Just using `install` as a script name will be called when running
`npm install`.
Now that we marked the repo as a `workspace`, `npm install` will run
install in all workspaces which is... not ideal.

* tmp: enable insiders release in PRs

Just to check if everything works before merging. Can be removed once
tested.

* don't cache node_modules?

I feel there is some catch 22 going on here.
We require `npm install` to build the `oxide/crates/node` version.
But we also require `oxide/crates/node` for the `npm install` becaus of
the dependency: `"@tailwindcss/oxide": "file:oxide/creates/node"`

* try to use `oxide/crates/node` as part of the workspace

* let's think about this

Let's try and cache the `node_modules` and share as much as possible.
However, some scripts still need to be installed specific to the OS.

Running `npm install` locally doesn't throw away your `node_modules`,
so if we just cache `node_modules` but also run `npm install` that
should keep as much as possible and still improve install times since
`node_modules` is already there.

I think.

* ensure generated `index.js` and `index.d.ts` files are considered outputs

* use `npx napi` instead of `napi` directly

* include all `package-lock.json` files

* normalize caching further in all workflows

* drop nested `package-lock.json` files

* `npm uninstall mini-css-extract-plugin && npm install mini-css-extract-plugin --save-dev`

* bump webpack-5 integration tests dependencies

* only release insiders on `master` branch

* tmp: let's figure out release insiders oxide

* fix little typo

* use Node 18 for Oxide Insiders

* syncup package-lock.json

* let's try node 16

Node 18 currently fails on `Build x86_64-unknown-linux-gnu (OXIDE)`
Workflow.

Install Node.JS output:

```
Environment details
Warning: /__t/node/18.13.0/x64/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /__t/node/18.13.0/x64/bin/node)
/__t/node/18.13.0/x64/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /__t/node/18.13.0/x64/bin/node)

Warning: node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
```

* bump some Node versions

* only release oxide insiders on `master` branch

* don't cache `npm`

* bump napi-rs

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-01-13 12:22:00 +01:00
..
__snapshots__ Ensure configured font-feature-settings are included in Preflight (#9707) 2022-11-01 17:52:59 +00:00
fixtures remove unused fixture files 2021-12-15 18:13:09 +01:00
plugins Oxide (#10252) 2023-01-13 12:22:00 +01:00
postcss-plugins/nesting Prevent nesting plugin from breaking other plugins (#7563) 2022-02-21 10:12:39 -05:00
util Don't rewrite source maps for @layer rules (#8971) 2022-07-27 12:19:08 -04:00
animations.test.js Correctly parse and prefix animation names with dots (#7163) 2022-03-01 14:08:43 -05:00
any-type.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
apply.test.css Change how we handle defaults (optimized or not) (#6926) 2022-01-07 11:39:45 -05:00
apply.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
apply.test.js Only sort pseudo elements after classes when using @apply and variants (#9765) 2022-11-09 16:41:16 -05:00
arbitrary-properties.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
arbitrary-values.test.css Oxide (#10252) 2023-01-13 12:22:00 +01:00
arbitrary-values.test.html Oxide (#10252) 2023-01-13 12:22:00 +01:00
arbitrary-values.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
arbitrary-variants.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
basic-usage.test.css Oxide (#10252) 2023-01-13 12:22:00 +01:00
basic-usage.test.html Add support for visibility: collapse with new collapsed utility (#9181) 2022-09-09 13:19:24 -04:00
basic-usage.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
blocklist.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
collapse-adjacent-rules.test.css Split ::backdrop into separate defaults group (#8567) 2022-06-09 16:26:18 -04:00
collapse-adjacent-rules.test.html Recursively collapse adjacent rules (#7565) 2022-02-21 12:58:12 -05:00
collapse-adjacent-rules.test.js Handle duplicate atrules without children (#8122) 2022-04-15 12:24:27 -04:00
collapse-duplicate-declarations.test.js Improve collapsing of duplicate declarations (#6856) 2022-01-03 15:41:49 +01:00
color-opacity-modifiers.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
color.test.js Allow for custom properties in rgb, rgba, hsl and hsla colors (#7933) 2022-03-24 12:43:21 +01:00
combined-selectors.test.js Change how we handle defaults (optimized or not) (#6926) 2022-01-07 11:39:45 -05:00
configurePlugins.test.js Use safelist 2022-07-18 09:31:45 -04:00
containerPlugin.test.js Partially revert tuple syntax PR for screens: #6104 (#6289) 2021-12-07 18:49:40 +01:00
context-reuse.test.html Invalidate context when main css changes (#7626) 2022-02-25 13:12:45 -05:00
context-reuse.test.js Invalidate context when main css changes (#7626) 2022-02-25 13:12:45 -05:00
custom-extractors.test.css Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
custom-extractors.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-extractors.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
custom-plugins.test.js Change how we handle defaults (optimized or not) (#6926) 2022-01-07 11:39:45 -05:00
custom-separator.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-separator.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-separator.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-transformers.test.html Use real files for custom transformer test 2021-12-04 13:38:40 -05:00
custom-transformers.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
custom-transformers.test.php Use real files for custom transformer test 2021-12-04 13:38:40 -05:00
customConfig.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
dark-mode.test.js Re-enable new features 2022-04-12 14:13:04 -04:00
default-extractor.test.js Match arbitrary properties even when followed by square bracketed text (#10212) 2023-01-02 09:43:07 -05:00
defaultConfig.test.js Improve public API (#5526) 2021-09-26 12:44:13 +02:00
defaultTheme.test.js Improve public API (#5526) 2021-09-26 12:44:13 +02:00
detect-nesting.test.js Allow direct nesting in root or @layer nodes (#10229) 2023-01-03 12:38:30 +01:00
escapeClassName.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
evaluateTailwindFunctions.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
experimental.test.js Expose context.sortClassList(classes) (#7412) 2022-02-10 18:06:41 +01:00
extractor-edge-cases.test.js Improve before and after variants (#5820) 2021-10-18 18:11:34 +02:00
flattenColorPalette.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
format-variant-selector.test.js Don't prefix classes in arbitrary variants (#10214) 2023-01-03 09:40:47 -05:00
generate-rules.test.js Increase strictness when using applyVariant on illegale candidates (#9599) 2022-10-18 12:03:41 +02:00
getClassList.test.js Ignore unset values (like null or undefined) when resolving the classList for intellisense (#9385) 2022-09-21 14:31:08 +02:00
getSortOrder.test.js Implement getClassOrder instead of sortClassList (#7459) 2022-02-16 11:03:00 +01:00
getVariants.test.js expose hasDash for the intellisense plugin (#9594) 2022-10-17 17:13:33 +02:00
import-syntax.test.css Split ::backdrop into separate defaults group (#8567) 2022-06-09 16:26:18 -04:00
import-syntax.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
import-syntax.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-boolean.test.css Split ::backdrop into separate defaults group (#8567) 2022-06-09 16:26:18 -04:00
important-boolean.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-boolean.test.js Re-use existing entries in the rule cache (#9208) 2022-08-29 14:13:32 -04:00
important-modifier-prefix.test.css Split ::backdrop into separate defaults group (#8567) 2022-06-09 16:26:18 -04:00
important-modifier-prefix.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier-prefix.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier.test.js Exclude non-relevant selectors when generating rules with the important modifier. Fixes #9677. (#9704) 2022-11-01 09:06:03 -04:00
important-selector.test.css Split ::backdrop into separate defaults group (#8567) 2022-06-09 16:26:18 -04:00
important-selector.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-selector.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
kitchen-sink.test.css Oxide (#10252) 2023-01-13 12:22:00 +01:00
kitchen-sink.test.html Add variants for orientation media feature (#6046) 2021-11-23 14:59:25 -05:00
kitchen-sink.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
layer-at-rules.test.js Expose context.sortClassList(classes) (#7412) 2022-02-10 18:06:41 +01:00
layer-without-tailwind.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
layer-without-tailwind.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
layer-without-tailwind.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
match-components.test.js Change how we handle defaults (optimized or not) (#6926) 2022-01-07 11:39:45 -05:00
match-utilities.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
match-variants.test.js Fix cannot read properties of undefined (reading 'modifier') (#9656) 2022-11-03 15:10:45 +01:00
min-max-screen-variants.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
minimum-impact-selector.test.js Enable optimize universal defaults by default (#5635) 2021-10-06 17:45:26 +02:00
modify-selectors.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
modify-selectors.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
modify-selectors.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
mutable.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
mutable.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
mutable.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
negated-content-ignore.test.html Fix using negated content globs (#5625) 2021-09-29 11:15:31 +01:00
negated-content-include.test.html Fix using negated content globs (#5625) 2021-09-29 11:15:31 +01:00
negated-content.test.js Change how we handle defaults (optimized or not) (#6926) 2022-01-07 11:39:45 -05:00
negateValue.test.js Make negative values a first-class feature, rather than theme-driven (#5709) 2021-10-06 13:42:05 -04:00
negative-prefix.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
normalize-config.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
normalize-data-types.test.js Don’t add spaces around raw / that are preceded by numbers (#8688) 2022-06-20 10:49:55 -04:00
normalize-screens.test.js Add new min and max variants (#9558) 2022-10-14 14:25:25 -04:00
opacity.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
oxide-svelte.test.css Oxide (#10252) 2023-01-13 12:22:00 +01:00
oxide.test.css Oxide (#10252) 2023-01-13 12:22:00 +01:00
oxide.test.html Oxide (#10252) 2023-01-13 12:22:00 +01:00
oxide.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
oxide.test.svelte Oxide (#10252) 2023-01-13 12:22:00 +01:00
parallel-variants.test.js Remove text opacity CSS variables from ::marker (#8622) 2022-06-14 10:09:09 -04:00
parseAnimationValue.test.js ensure we don't override the name (#5602) 2021-09-26 07:44:41 -04:00
parseObjectStyles.test.js Preserve case of css variables added by plugins (#6888) 2022-01-04 23:03:41 -05:00
prefers-contrast.test.js Fix parallel variant ordering clash (#9282) 2022-09-09 13:12:43 -04:00
prefix.test.css Split ::backdrop into separate defaults group (#8567) 2022-06-09 16:26:18 -04:00
prefix.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
prefix.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
prefixSelector.test.js Remove prefix as a function (#5829) 2021-10-19 15:22:49 +02:00
preflight.test.js Fix preflight border color fallback (#7288) 2022-02-01 11:27:42 -05:00
raw-content.test.css Oxide (#10252) 2023-01-13 12:22:00 +01:00
raw-content.test.html Add support for visibility: collapse with new collapsed utility (#9181) 2022-09-09 13:19:24 -04:00
raw-content.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
relative-purge-paths.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
relative-purge-paths.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
resolve-defaults-at-rules.test.js Split ::backdrop into separate defaults group (#8567) 2022-06-09 16:26:18 -04:00
resolveConfig.test.js Fix merging of arrays during config resolution (#9706) 2022-11-01 16:29:47 +00:00
responsive-and-variants-atrules.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
responsive-and-variants-atrules.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
responsive-and-variants-atrules.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
safelist.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
screenAtRule.test.js Refactor internals to decouple watch strategies and extract IO 2021-05-26 09:43:05 -04:00
shared-state.test.js Improve DEBUG parsing: only take care of tailwindcss and not tailwind (#6804) 2021-12-30 16:41:23 +01:00
source-maps.test.js Don't rewrite source maps for @layer rules (#8971) 2022-07-27 12:19:08 -04:00
syntax-lit-html.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
syntax-svelte.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
syntax-svelte.test.svelte Rename svelte tests 2021-09-21 12:37:49 -04:00
tailwind-screens.test.js Partially revert tuple syntax PR for screens: #6104 (#6289) 2021-12-07 18:49:40 +01:00
to-path.test.js Support square bracket notation in paths (#6519) 2021-12-15 11:09:29 -05:00
variant-grouping.test.skip.js npm run style -- --fix 2022-11-30 11:38:37 +00:00
variants.test.css Remove text opacity CSS variables from ::marker (#8622) 2022-06-14 10:09:09 -04:00
variants.test.html Add optional variant (#8486) 2022-06-01 08:39:43 -04:00
variants.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
warnings.test.js Oxide (#10252) 2023-01-13 12:22:00 +01:00
withAlphaVariable.test.js Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00