also looking at this
Merge @stacksjs/ts-css into this repo as packages/toolkit
#27
128 files
+9797
-201
| @@ -0,0 +1,76 @@ | ||
| 1 | # Install | |
| 2 | ||
| 3 | `@stacksjs/ts-css` is a single package. There are no transitive dependencies. | |
| 4 | ||
| 5 | ## Package managers | |
| 6 | ||
| 7 | ::: code-group | |
| 8 | ||
| 9 | ```sh [bun] | |
| 10 | bun add @stacksjs/ts-css | |
| 11 | # or, dev dependency | |
| 12 | bun add --dev @stacksjs/ts-css | |
| 13 | ``` | |
| 14 | ||
| 15 | ```sh [npm] | |
| 16 | npm install @stacksjs/ts-css | |
| 17 | # or, dev dependency | |
| 18 | npm install --save-dev @stacksjs/ts-css | |
| 19 | ``` | |
| 20 | ||
| 21 | ```sh [pnpm] | |
| 22 | pnpm add @stacksjs/ts-css | |
| 23 | # or, dev dependency | |
| 24 | pnpm add --save-dev @stacksjs/ts-css | |
| 25 | ``` | |
| 26 | ||
| 27 | ```sh [yarn] | |
| 28 | yarn add @stacksjs/ts-css | |
| 29 | ``` | |
| 30 | ||
| 31 | ::: | |
| 32 | ||
| 33 | ## Local development with `bun link` | |
| 34 | ||
| 35 | If you're contributing to ts-css and want to test the changes against | |
| 36 | another project locally, register it once with `bun link`: | |
| 37 | ||
| 38 | ```sh | |
| 39 | # inside the ts-css repo | |
| 40 | bun link | |
| 41 | ||
| 42 | # inside the consumer project | |
| 43 | bun link @stacksjs/ts-css | |
| 44 | ``` | |
| 45 | ||
| 46 | That's how [`ts-svg`](https://github.com/stacksjs/ts-svg) consumes ts-css | |
| 47 | during development — its `package.json` carries | |
| 48 | `"@stacksjs/ts-css": "link:@stacksjs/ts-css"`. | |
| 49 | ||
| 50 | ## CLI binary (optional) | |
| 51 | ||
| 52 | The `ts-css` CLI ships with the package and is exposed via Bun's `bin` | |
| 53 | field. After installing, you can run: | |
| 54 | ||
| 55 | ```sh | |
| 56 | bunx ts-css minify input.css | |
| 57 | ``` | |
| 58 | ||
| 59 | For a standalone binary, build from source: | |
| 60 | ||
| 61 | ```sh | |
| 62 | bun run compile # builds bin/ts-css for your platform | |
| 63 | bun run compile:all # cross-compile for darwin/linux/windows | |
| 64 | ``` | |
| 65 | ||
| 66 | ## Verifying the install | |
| 67 | ||
| 68 | ```ts | |
| 69 | import { minify, parse } from '@stacksjs/ts-css' | |
| 70 | ||
| 71 | console.log(minify('.a { color: #aabbcc }').css) | |
| 72 | // → ".a{color:#abc}" | |
| 73 | ``` | |
| 74 | ||
| 75 | If that prints the minified output, you're set. Continue to | |
| 76 | [**Getting started**](./intro.md). | |