csszyx 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +70 -0
- package/dist/lite.d.ts +1 -0
- package/dist/lite.js +8 -0
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +5 -0
- package/dist/webpack.d.ts +1 -0
- package/dist/webpack.js +5 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# csszyx
|
|
2
|
+
|
|
3
|
+
> Universal CSS-in-JS for Tailwind CSS with WASM core.
|
|
4
|
+
|
|
5
|
+
**csszyx** is a zero-runtime, framework-agnostic CSS-in-JS library that compiles your styles into atomic CSS classes at build time. It leverages a Rust-based WASM core for blisteringly fast performance and safety.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- ⚡ **Zero-Runtime Overhead**: Styles are extracted to static CSS.
|
|
10
|
+
- 🎨 **Tailwind Compatible**: Use your existing Tailwind config.
|
|
11
|
+
- 🛡️ **Type Safe**: Full TypeScript support.
|
|
12
|
+
- 🔒 **SSR Safe**: Built-in hydration mismatch protection.
|
|
13
|
+
- 📦 **WASM Power**: Core logic runs in WebAssembly.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install csszyx
|
|
19
|
+
# or
|
|
20
|
+
pnpm add csszyx
|
|
21
|
+
# or
|
|
22
|
+
yarn add csszyx
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
1. **Initialize your project**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx csszyx init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. **Start coding**:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { _sz } from "csszyx";
|
|
37
|
+
|
|
38
|
+
function Button() {
|
|
39
|
+
return (
|
|
40
|
+
<button className={_sz("bg-blue-500 text-white p-4")}>Click me</button>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Packages
|
|
46
|
+
|
|
47
|
+
- **[@csszyx/unplugin](https://www.npmjs.com/package/@csszyx/unplugin)**: Integrations for Vite, Webpack, and more.
|
|
48
|
+
- **[@csszyx/cli](https://www.npmjs.com/package/@csszyx/cli)**: Command-line tools.
|
|
49
|
+
- **[@csszyx/core](https://www.npmjs.com/package/@csszyx/core)**: WASM core engine.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT © [csszyx contributors](https://github.com/nguyennhutien/csszyx)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="@csszyx/types/jsx" />
|
|
2
|
+
export { compute_mangle_checksum, encode, transform_sz, verify_mangle_checksum } from '@csszyx/core';
|
|
3
|
+
export { _sz, _sz2, _sz3, _szIf, _szMerge, _szSwitch, abortHydration, endHydration, getSSRContext, isHydrating, isSSREnvironment, startHydration, verifyMangleMapIntegrity } from '@csszyx/runtime';
|
|
4
|
+
export { _szIf as _szIfLite, _sz as _szLite } from '@csszyx/runtime/lite';
|
|
5
|
+
export { SzObject, serializeManifest, transform, transformSourceCode, validateSzRecover } from '@csszyx/compiler';
|
|
6
|
+
export { unplugin as default, esbuildPlugin, rollupPlugin, unplugin, vitePlugin, webpackPlugin } from '@csszyx/unplugin';
|
|
7
|
+
export { CsszyxConfig, DevelopmentConfig, PartialCsszyxConfig, ProductionConfig, RecoveryManifest, SzProp, SzProps } from '@csszyx/types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
compute_mangle_checksum,
|
|
4
|
+
encode,
|
|
5
|
+
transform_sz,
|
|
6
|
+
verify_mangle_checksum
|
|
7
|
+
} from "@csszyx/core";
|
|
8
|
+
import {
|
|
9
|
+
_sz,
|
|
10
|
+
_sz2,
|
|
11
|
+
_sz3,
|
|
12
|
+
_szIf,
|
|
13
|
+
_szMerge,
|
|
14
|
+
_szSwitch
|
|
15
|
+
} from "@csszyx/runtime";
|
|
16
|
+
import { _szIf as _szIf2, _sz as _sz4 } from "@csszyx/runtime/lite";
|
|
17
|
+
import {
|
|
18
|
+
abortHydration,
|
|
19
|
+
endHydration,
|
|
20
|
+
getSSRContext,
|
|
21
|
+
isHydrating,
|
|
22
|
+
isSSREnvironment,
|
|
23
|
+
startHydration,
|
|
24
|
+
verifyMangleMapIntegrity
|
|
25
|
+
} from "@csszyx/runtime";
|
|
26
|
+
import {
|
|
27
|
+
serializeManifest,
|
|
28
|
+
transform,
|
|
29
|
+
transformSourceCode,
|
|
30
|
+
validateSzRecover
|
|
31
|
+
} from "@csszyx/compiler";
|
|
32
|
+
import {
|
|
33
|
+
esbuildPlugin,
|
|
34
|
+
rollupPlugin,
|
|
35
|
+
unplugin,
|
|
36
|
+
vitePlugin,
|
|
37
|
+
webpackPlugin
|
|
38
|
+
} from "@csszyx/unplugin";
|
|
39
|
+
import { unplugin as unplugin2 } from "@csszyx/unplugin";
|
|
40
|
+
export {
|
|
41
|
+
_sz,
|
|
42
|
+
_sz2,
|
|
43
|
+
_sz3,
|
|
44
|
+
_szIf,
|
|
45
|
+
_szIf2 as _szIfLite,
|
|
46
|
+
_sz4 as _szLite,
|
|
47
|
+
_szMerge,
|
|
48
|
+
_szSwitch,
|
|
49
|
+
abortHydration,
|
|
50
|
+
compute_mangle_checksum,
|
|
51
|
+
unplugin2 as default,
|
|
52
|
+
encode,
|
|
53
|
+
endHydration,
|
|
54
|
+
esbuildPlugin,
|
|
55
|
+
getSSRContext,
|
|
56
|
+
isHydrating,
|
|
57
|
+
isSSREnvironment,
|
|
58
|
+
rollupPlugin,
|
|
59
|
+
serializeManifest,
|
|
60
|
+
startHydration,
|
|
61
|
+
transform,
|
|
62
|
+
transformSourceCode,
|
|
63
|
+
transform_sz,
|
|
64
|
+
unplugin,
|
|
65
|
+
validateSzRecover,
|
|
66
|
+
verifyMangleMapIntegrity,
|
|
67
|
+
verify_mangle_checksum,
|
|
68
|
+
vitePlugin,
|
|
69
|
+
webpackPlugin
|
|
70
|
+
};
|
package/dist/lite.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SzInput, __szColorVar, _sz, _sz2, _szIf } from '@csszyx/runtime/lite';
|
package/dist/lite.js
ADDED
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { vitePlugin as default } from '@csszyx/unplugin';
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { webpackPlugin as default } from '@csszyx/unplugin';
|
package/dist/webpack.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "csszyx",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Universal CSS-in-JS for Tailwind CSS with WASM core",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"css",
|
|
7
|
+
"tailwind",
|
|
8
|
+
"css-in-js",
|
|
9
|
+
"utility-first",
|
|
10
|
+
"ssr",
|
|
11
|
+
"react",
|
|
12
|
+
"vue",
|
|
13
|
+
"svelte",
|
|
14
|
+
"wasm"
|
|
15
|
+
],
|
|
16
|
+
"author": "csszyx contributors",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://github.com/nguyennhutien/csszyx#readme",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/nguyennhutien/csszyx.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/nguyennhutien/csszyx/issues"
|
|
25
|
+
},
|
|
26
|
+
"private": false,
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./lite": {
|
|
37
|
+
"types": "./dist/lite.d.ts",
|
|
38
|
+
"import": "./dist/lite.js"
|
|
39
|
+
},
|
|
40
|
+
"./vite": {
|
|
41
|
+
"types": "./dist/vite.d.ts",
|
|
42
|
+
"import": "./dist/vite.js"
|
|
43
|
+
},
|
|
44
|
+
"./webpack": {
|
|
45
|
+
"types": "./dist/webpack.d.ts",
|
|
46
|
+
"import": "./dist/webpack.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"dist"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup src/index.ts src/lite.ts src/vite.ts src/webpack.ts --format esm --dts && echo '/// <reference types=\"@csszyx/types/jsx\" />' | cat - dist/index.d.ts > dist/index.d.ts.tmp && mv dist/index.d.ts.tmp dist/index.d.ts",
|
|
54
|
+
"dev": "tsup src/index.ts src/lite.ts src/vite.ts src/webpack.ts --format esm --dts --watch"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@csszyx/core": "workspace:*",
|
|
58
|
+
"@csszyx/runtime": "workspace:*",
|
|
59
|
+
"@csszyx/compiler": "workspace:*",
|
|
60
|
+
"@csszyx/unplugin": "workspace:*",
|
|
61
|
+
"@csszyx/types": "workspace:*"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"tsup": "^8.0.2",
|
|
65
|
+
"typescript": "^5.4.5"
|
|
66
|
+
}
|
|
67
|
+
}
|