Files
AFFiNE-Mirror/tools/cli
renovate a673f42073 chore: bump up tailwindcss version to v4 (#9918)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [tailwindcss](https://tailwindcss.com) ([source](https://redirect.github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss)) | [`^3.4.16` -> `^4.0.0`](https://renovatebot.com/diffs/npm/tailwindcss/3.4.17/4.0.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/tailwindcss/4.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/tailwindcss/4.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/tailwindcss/3.4.17/4.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tailwindcss/3.4.17/4.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>tailwindlabs/tailwindcss (tailwindcss)</summary>

### [`v4.0.3`](https://redirect.github.com/tailwindlabs/tailwindcss/blob/HEAD/CHANGELOG.md#403---2025-02-01)

[Compare Source](https://redirect.github.com/tailwindlabs/tailwindcss/compare/v4.0.2...v4.0.3)

##### Fixed

-   Fix incorrect removal of `@import url();` ([#&#8203;16144](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16144))

### [`v4.0.2`](https://redirect.github.com/tailwindlabs/tailwindcss/blob/HEAD/CHANGELOG.md#402---2025-01-31)

[Compare Source](https://redirect.github.com/tailwindlabs/tailwindcss/compare/v4.0.1...v4.0.2)

##### Fixed

-   Only generate positive `grid-cols-*` and `grid-rows-*` utilities ([#&#8203;16020](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16020))
-   Ensure escaped theme variables are handled correctly ([#&#8203;16064](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16064))
-   Ensure we process Tailwind CSS features when only using `@reference` or `@variant` ([#&#8203;16057](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16057))
-   Refactor gradient implementation to work around [prettier/prettier#17058](https://redirect.github.com/prettier/prettier/issues/17058) ([#&#8203;16072](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16072))
-   Vite: Ensure hot-reloading works with SolidStart setups ([#&#8203;16052](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16052))
-   Vite: Fix a crash when starting the development server in SolidStart setups ([#&#8203;16052](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16052))
-   Vite: Don't rebase URLs that appear to be aliases ([#&#8203;16078](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16078))
-   Vite: Transform `<style>` blocks in HTML files ([#&#8203;16069](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16069))
-   Prevent camel-casing CSS custom properties added by JavaScript plugins ([#&#8203;16103](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16103))
-   Do not emit `@keyframes` in `@theme reference` ([#&#8203;16120](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16120))
-   Discard invalid declarations when parsing CSS ([#&#8203;16093](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16093))
-   Do not emit empty CSS rules and at-rules ([#&#8203;16121](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16121))
-   Handle `@variant` when at the top-level of a stylesheet ([#&#8203;16129](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16129))

### [`v4.0.1`](https://redirect.github.com/tailwindlabs/tailwindcss/blob/HEAD/CHANGELOG.md#401---2025-01-29)

[Compare Source](https://redirect.github.com/tailwindlabs/tailwindcss/compare/v4.0.0...v4.0.1)

##### Added

-   Include `:open` pseudo-class in existing `open` variant ([#&#8203;15349](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15349))

##### Fixed

-   Remove invalid `min-w/h-none` utilities ([#&#8203;15845](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15845))
-   Discard CSS variable shorthand utilities that don't use valid CSS variables ([#&#8203;15738](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15738))
-   Ensure font-size utilities with `none` modifier have a line-height set e.g. `text-sm/none` ([#&#8203;15921](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15921))
-   Ensure font-size utilities with unknown modifier don't generate CSS ([#&#8203;15921](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15921))
-   Don’t suggest font weight utilities more than once ([#&#8203;15857](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15857))
-   Suggest container query variants ([#&#8203;15857](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15857))
-   Disable bare value suggestions when not using the `--spacing` variable ([#&#8203;15857](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15857))
-   Ensure suggested classes are properly sorted ([#&#8203;15857](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15857))
-   Don’t look at .gitignore files outside initialized repos ([#&#8203;15941](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15941))
-   Find utilities when using the Svelte class shorthand syntax across multiple lines ([#&#8203;15974](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15974))
-   Find utilities when using the Angular class shorthand syntax ([#&#8203;15974](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15974))
-   Find utilities when using functions inside arrays ([#&#8203;15974](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15974))
-   Ensure that `@tailwindcss/browser` does not pollute the global namespace ([#&#8203;15978](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15978))
-   Ensure that `tailwind-merge` is not scanned when using the Vite plugin ([#&#8203;16005](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16005))
-   Ensure CSS theme variables are available within shadow roots ([#&#8203;15975](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15975))
-   Fix crash when project lives in the `/` directory ([#&#8203;15988](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15988))
-   Ensure custom variants have a non-empty selector list ([#&#8203;16009](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16009))
-   *Upgrade*: Ensure JavaScript config files on different drives are correctly migrated ([#&#8203;15927](https://redirect.github.com/tailwindlabs/tailwindcss/pull/15927))
-   *Upgrade*: Migrate `leading-[1]` to `leading-none` ([#&#8203;16004](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16004))
-   *Upgrade*: Do not migrate arbitrary leading utilities to bare values ([#&#8203;16004](https://redirect.github.com/tailwindlabs/tailwindcss/pull/16004))

### [`v4.0.0`](https://redirect.github.com/tailwindlabs/tailwindcss/blob/HEAD/CHANGELOG.md#400---2025-01-21)

[Compare Source](https://redirect.github.com/tailwindlabs/tailwindcss/compare/v3.4.17...v4.0.0)

##### Added

-   [New high-performance engine](https://tailwindcss.com/blog/tailwindcss-v4#new-high-performance-engine) — where full builds are up to 5x faster, and incremental builds are over 100x faster — and measured in microseconds.
-   [Designed for the modern web](https://tailwindcss.com/blog/tailwindcss-v4#designed-for-the-modern-web) — built on cutting-edge CSS features like cascade layers, registered custom properties with `@property`, and `color-mix()`.
-   [Simplified installation](https://tailwindcss.com/blog/tailwindcss-v4#simplified-installation) — fewer dependencies, zero configuration, and just a single line of code in your CSS file.
-   [First-party Vite plugin](https://tailwindcss.com/blog/tailwindcss-v4#first-party-vite-plugin) — tight integration for maximum performance and minimum configuration.
-   [Automatic content detection](https://tailwindcss.com/blog/tailwindcss-v4#automatic-content-detection) — all of your template files are discovered automatically, with no configuration required.
-   [Built-in import support](https://tailwindcss.com/blog/tailwindcss-v4#built-in-import-support) — no additional tooling necessary to bundle multiple CSS files.
-   [CSS-first configuration](https://tailwindcss.com/blog/tailwindcss-v4#css-first-configuration) — a reimagined developer experience where you customize and extend the framework directly in CSS instead of a JavaScript configuration file.
-   [CSS theme variables](https://tailwindcss.com/blog/tailwindcss-v4#css-theme-variables) — all of your design tokens exposed as native CSS variables so you can access them anywhere.
-   [Dynamic utility values and variants](https://tailwindcss.com/blog/tailwindcss-v4#dynamic-utility-values-and-variants) — stop guessing what values exist in your spacing scale, or extending your configuration for things like basic data attributes.
-   [Modernized P3 color palette](https://tailwindcss.com/blog/tailwindcss-v4#modernized-p3-color-palette) — a redesigned, more vivid color palette that takes full advantage of modern display technology.
-   [Container queries](https://tailwindcss.com/blog/tailwindcss-v4#container-queries) — first-class APIs for styling elements based on their container size, no plugins required.
-   [New 3D transform utilities](https://tailwindcss.com/blog/tailwindcss-v4#new-3d-transform-utilities) — transform elements in 3D space directly in your HTML.
-   [Expanded gradient APIs](https://tailwindcss.com/blog/tailwindcss-v4#expanded-gradient-apis) — radial and conic gradients, interpolation modes, and more.
-   [@&#8203;starting-style support](https://tailwindcss.com/blog/tailwindcss-v4#starting-style-support) — a new variant you can use to create enter and exit transitions, without the need for JavaScript.
-   [not-\* variant](https://tailwindcss.com/blog/tailwindcss-v4#not-variant) — style an element only when it doesn't match another variant, custom selector, or media or feature query.
-   [Even more new utilities and variants](https://tailwindcss.com/blog/tailwindcss-v4#even-more-new-utilities-and-variants) — including support for `color-scheme`, `field-sizing`, complex shadows, `inert`, and more.

Start using Tailwind CSS v4.0 today by [installing it in a new project](https://tailwindcss.com/docs/installation/), or playing with it directly in the browser on [Tailwind Play](https://play.tailwindcss.com/).

For existing projects, we've published a comprehensive [upgrade guide](https://tailwindcss.com/docs/upgrade-guide) and built an [automated upgrade tool](https://tailwindcss.com/docs/upgrade-guide#using-the-upgrade-tool) to get you on the latest version as quickly and painlessly as possible.

For a deep-dive into everything that's new, [check out the announcement post](https://tailwindcss.com/blog/tailwindcss-v4).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNDUuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE0NS4wIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
2025-02-02 07:43:18 +00:00
..
2024-12-24 15:29:48 +08:00
2025-01-08 04:07:56 +00:00
2024-12-24 15:29:48 +08:00

AFFiNE Monorepo Cli

Start

yarn affine -h

Run build command defined in package.json

yarn affine i18n build
# or
yarn build -p i18n

Run dev command defined in package.json

yarn affine web dev
# or
yarn dev -p i18n

Clean

yarn affine clean --dist --rust
# clean node_modules
yarn affine clean --node-modules

Init

Generate files that make the monorepo work properly, the per project codegen will not be included anymore

yarn affine init

Tricks

Define scripts to run a .ts files without --loader ts-node/esm/transpile-only

affine run will automatically inject ts-node's transpile service(swc used) for your scripts

{
  "name": "@affine/demo",
  "scripts": {
    "dev": "node ./dev.ts"
  }
}
affine @affine/demo dev

or

{
  "name": "@affine/demo",
  "scripts": {
    "dev": "r ./src/index.ts"
  },
  "devDependencies": {
    "@affine-tools/cli": "workspace:*"
  }
}

Short your key presses

# af is also available for running the scripts
yarn af web build

by custom shell script

personally, I use 'af'

create file af in the root of AFFiNE project with the following content

#!/usr/bin/env sh
./tools/scripts/bin/runner.js affine.ts $@

or on windows:

node "./tools/cli/bin/runner.js" affine.ts %*

and give it executable permission

chmod a+x ./af

# now you can run scripts with simply
./af web build

if you want to go further, but for vscode(or other forks) only, add the following to your .vscode/settings.json

{
  "terminal.integrated.env.osx": {
    "PATH": "${env:PATH}:${cwd}"
  },
  "terminal.integrated.env.linux": {
    "PATH": "${env:PATH}:${cwd}"
  },
  "terminal.integrated.env.windows": {
    "PATH": "${env:PATH};${cwd}"
  }
}

restart all the integrated terminals and now you get:

af web build