Commit graph

5485 commits

Author SHA1 Message Date
Philipp Spiess
5040fb1dcd Cleanups 2024-09-02 15:26:51 +02:00
Philipp Spiess
b54b270dae Update changelog 2024-09-02 15:26:51 +02:00
Philipp Spiess
b881613ee8 Revert changelog changes 2024-09-02 15:26:51 +02:00
Philipp Spiess
9ccdf87576 Adding watch files in renderStart doesn't make sense 2024-09-02 15:26:51 +02:00
Philipp Spiess
822f17381d Whoopsie 2024-09-02 15:26:51 +02:00
Philipp Spiess
ed1dead554 Revert playground changes 2024-09-02 15:26:51 +02:00
Philipp Spiess
8395e3f036 Add a test case for moving a file from being a Tailwind root back to a normal CSS file and back 2024-09-02 15:26:51 +02:00
Philipp Spiess
e452c721ee Use a seperate global scanner for module graph candidates 2024-09-02 15:26:51 +02:00
Philipp Spiess
f642a41b1c WIP 2024-09-02 15:26:51 +02:00
Philipp Spiess
ae344ecf81 Revert playground changes 2024-09-02 15:26:51 +02:00
Philipp Spiess
629b8b9efb Rever concurrent changes as there are still race conditions 2024-09-02 15:26:51 +02:00
Philipp Spiess
19c3ef65a2 Remove debug steps 2024-09-02 15:26:51 +02:00
Philipp Spiess
d7393f95bc Support vite build --watch mode 2024-09-02 15:26:51 +02:00
Philipp Spiess
a36ca437db Speed up integretion tests by running all tests inside a single suite in parallel 2024-09-02 15:26:51 +02:00
Philipp Spiess
f0f7418785 Simplify Vite plugin and handle all CSS transforms in pre-transform hook 2024-09-02 15:26:49 +02:00
Philipp Spiess
5789eb789d Do not register ESM hook in Bun 2024-09-02 15:26:31 +02:00
Philipp Spiess
c42664cc6f Add change log and improve error messages 2024-09-02 15:26:31 +02:00
Philipp Spiess
dcb452a0a8 Rename resolveInternal to extractConfigs 2024-09-02 15:26:31 +02:00
Philipp Spiess
9939d344e4 Rename to applyConfigToTheme 2024-09-02 15:26:31 +02:00
Philipp Spiess
8c43650798 Don't block on module dependency resolution 2024-09-02 15:26:31 +02:00
Jordan Pittman
85d6da4884 Make the ESM cache hook ESM-only 2024-09-02 15:26:30 +02:00
Jordan Pittman
1b848f38b0 Make getModuleDependencies async 2024-09-02 15:26:30 +02:00
Philipp Spiess
61429d0d3b Add the same workaround for postcss esm 2024-09-02 15:26:30 +02:00
Philipp Spiess
3666a98a6a Only reset the require cache for build dependencies 2024-09-02 15:26:30 +02:00
Philipp Spiess
266d0184b7 Fix esm cache hook for esm usage with vitest 2024-09-02 15:26:30 +02:00
Philipp Spiess
b8fd2e704f Revert change to integrations/postcss/index.test.ts 2024-09-02 15:26:30 +02:00
Philipp Spiess
f37565de7a Fix js config file and plugin dependnecy rebuilds for vite 2024-09-02 15:26:30 +02:00
Philipp Spiess
a72ca61f26 WIP 2024-09-02 15:26:30 +02:00
Philipp Spiess
a5c379386b Add the @tailwindcss/node module to handle shared node specific dependencies between our clients 2024-09-02 15:26:28 +02:00
Philipp Spiess
d607f0a40e Detect changes to the config file and plugins for the CLI 2024-09-02 15:26:04 +02:00
Jordan Pittman
3a7feb7930 wip 2024-09-02 15:26:04 +02:00
Jordan Pittman
7e9db364c9 update test 2024-09-02 15:26:04 +02:00
Jordan Pittman
882c39dd0c Add integration tests 2024-09-02 15:26:04 +02:00
Jordan Pittman
faf98b364a Upgrade merged theme keys from colors.* to color-* 2024-09-02 15:26:04 +02:00
Jordan Pittman
c13d221d58 Update tests 2024-09-02 15:26:04 +02:00
Jordan Pittman
ea54594515 Handle inline theme keys in resolveWith 2024-09-02 15:26:04 +02:00
Jordan Pittman
5078ccdc9f wip 2024-09-02 15:26:04 +02:00
Jordan Pittman
b44c4f90dc prettier 2024-09-02 15:26:04 +02:00
Jordan Pittman
8ffe833f40 Format code 2024-09-02 15:26:04 +02:00
Jordan Pittman
73b5dfa9e7 Ensure CSS variants and utilities always take precedence 2024-09-02 15:26:04 +02:00
Jordan Pittman
bb89c7c6df Work on theme value merging 2024-09-02 15:26:04 +02:00
Jordan Pittman
f2b7fbae6b Add config test 2024-09-02 15:26:04 +02:00
Jordan Pittman
67efbfe628 Allow configuring dark mode from configs 2024-09-02 15:26:04 +02:00
Jordan Pittman
cc353d310b Merge sources from config files 2024-09-02 15:26:04 +02:00
Jordan Pittman
73ab0a61d7 Load config files via @config directive 2024-09-02 15:26:04 +02:00
Jordan Pittman
f878a90893 Add config helper 2024-09-02 15:26:04 +02:00
Jordan Pittman
20f001cb3c Allow resolve config to take in optional paths alongside configs 2024-09-02 15:26:04 +02:00
Jordan Pittman
f876304557 Add support for presets 2024-09-02 15:26:04 +02:00
Jordan Pittman
3553b5912e Use resolveConfig to normalize plugins 2024-09-02 15:26:04 +02:00
Philipp Spiess
d9e3fd613b
Add standalone CLI (#14270)
This PR adds a new standalone client: A single-binary file that you can
use to run Tailwind v4 without having a node setup. To make this work we
use Bun's single-binary build which can properly package up native
modules and the bun runtime for us so we do not have to rely on any
expand-into-tmp-folder-at-runtime workarounds.

When running locally, `pnpm build` will now standalone artifacts inside
`packages/@tailwindcss-standalone/dist`. Note that since we do not build
Oxide for other environments in the local setup, you won't be able to
use the standalone artifacts for other platforms in local dev mode.

Unfortunately Bun does not have support for Windows ARM builds yet but
we found that using the `bun-baseline` runtime for Windows x64 would
make the builds work fine in ARM emulation mode:

![Screenshot
windows](https://github.com/user-attachments/assets/5b39387f-ec50-4757-9469-19b98e43162d)


Some Bun related issues we faced and worked around:

- We found that the regular Windows x64 build of `bun` does not run on
Windows ARM via emulation. Instead, we have to use the `bun-baseline`
builds which emulate correctly.

- When we tried to bundle artifacts with [embed
directories](https://bun.sh/docs/bundler/executables#embed-directories),
node binary dependencies were no longer resolved correctly even though
they would still be bundled and accessible within the [`embeddedFiles`
list](https://bun.sh/docs/bundler/executables#listing-embedded-files).
We worked around this by using the `import * as from ... with { type:
"file" };` and patching the resolver we use in our CLI.
  
  
- If you have an import to a module that is used as a regular import
_and_ a `with { type: "file" }`, it will either return the module in
both cases _or_ the file path when we would expect only the `with {
type: "file" }` import to return the path. We do read the Tailwind CSS
version via the file system and `require.resolve()` in the CLI and via
`import * from './package.json'` in core and had to work around this by
patching the version resolution in our CLI.
 
  ```ts
  import packageJson from "./package.json"
  import packageJsonPath from "./package.json" with {type: "file"}
  
  // We do not expect these to be equal
  packageJson === packageJsonPath 
  ```
- We can not customize the app icon used for Windows `.exe` builds
without decompiling the binary. For now we will leave the default but
one workaround is to [use tools like
ResourceHacker](698d9c4bd1)
to decompile the binary first.

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2024-09-02 15:23:46 +02:00