@typestyles/vite 0.0.0-unstable.b51907a4a2f1 → 0.0.0-unstable.b5a2077e79ce
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 +3 -3
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ export default defineConfig({
|
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Edit any file that calls `
|
|
41
|
+
Edit any file that calls `recipe`, `style`, `tokens.create`, etc. Styles update in place without a full page reload.
|
|
42
42
|
|
|
43
43
|
### Runtime in dev, zero-runtime in production (recommended)
|
|
44
44
|
|
|
@@ -96,7 +96,7 @@ import { DEFAULT_EXTRACT_MODULE_CANDIDATES, discoverDefaultExtractModules } from
|
|
|
96
96
|
|
|
97
97
|
```ts
|
|
98
98
|
typestyles({
|
|
99
|
-
/** Default: true — fail the build on duplicate
|
|
99
|
+
/** Default: true — fail the build on duplicate recipe / style namespaces */
|
|
100
100
|
warnDuplicates?: boolean;
|
|
101
101
|
|
|
102
102
|
/**
|
|
@@ -142,7 +142,7 @@ Even with a convention entry present, this keeps `<style>` injection in producti
|
|
|
142
142
|
|
|
143
143
|
**Extraction:** On `vite build`, matching entry modules are bundled and executed in Node via `@typestyles/build-runner`. The collected CSS is emitted as a static asset. In dev, the same extraction runs on demand when the browser requests `/typestyles.css` so your `<link>` href works without SPA fallback returning HTML.
|
|
144
144
|
|
|
145
|
-
**Duplicate detection:** The plugin scans every source file for namespace strings (`
|
|
145
|
+
**Duplicate detection:** The plugin scans every source file for namespace strings (`recipe('button', …)` → `.button-`). Collisions across files fail the build with a clear error.
|
|
146
146
|
|
|
147
147
|
## Verify production output
|
|
148
148
|
|
package/dist/index.d.cts
CHANGED
|
@@ -6,12 +6,13 @@ export { DEFAULT_EXTRACT_MODULE_CANDIDATES, TypestylesExtractOptions, discoverDe
|
|
|
6
6
|
* Regex patterns to extract namespace strings from typestyles API calls.
|
|
7
7
|
*
|
|
8
8
|
* Matches:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* recipe('button', ...) → prefix ".button-"
|
|
10
|
+
* style('card', ...) → prefix ".card-"
|
|
11
11
|
* tokens.create('color', ...) → key "tokens:color"
|
|
12
|
-
* tokens.createTheme('dark',
|
|
12
|
+
* tokens.createTheme({ name: 'dark', … }) → key "theme:dark"
|
|
13
|
+
* createTheme('dark', …) → key "theme:dark" (low-level positional)
|
|
13
14
|
* keyframes.create('fadeIn', ...) → key "keyframes:fadeIn"
|
|
14
|
-
* global.
|
|
15
|
+
* global.rule('body', ...) → prefix "body"
|
|
15
16
|
* global.fontFace('Inter', ...) → prefix "font-face:Inter"
|
|
16
17
|
*/
|
|
17
18
|
interface TypestylesPluginOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -6,12 +6,13 @@ export { DEFAULT_EXTRACT_MODULE_CANDIDATES, TypestylesExtractOptions, discoverDe
|
|
|
6
6
|
* Regex patterns to extract namespace strings from typestyles API calls.
|
|
7
7
|
*
|
|
8
8
|
* Matches:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* recipe('button', ...) → prefix ".button-"
|
|
10
|
+
* style('card', ...) → prefix ".card-"
|
|
11
11
|
* tokens.create('color', ...) → key "tokens:color"
|
|
12
|
-
* tokens.createTheme('dark',
|
|
12
|
+
* tokens.createTheme({ name: 'dark', … }) → key "theme:dark"
|
|
13
|
+
* createTheme('dark', …) → key "theme:dark" (low-level positional)
|
|
13
14
|
* keyframes.create('fadeIn', ...) → key "keyframes:fadeIn"
|
|
14
|
-
* global.
|
|
15
|
+
* global.rule('body', ...) → prefix "body"
|
|
15
16
|
* global.fontFace('Inter', ...) → prefix "font-face:Inter"
|
|
16
17
|
*/
|
|
17
18
|
interface TypestylesPluginOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typestyles/vite",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.b5a2077e79ce",
|
|
4
4
|
"description": "Vite plugin for typestyles HMR support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"eslint": "^9.39.2",
|
|
42
42
|
"tsup": "^8.0.0",
|
|
43
43
|
"typescript": "^5.4.0",
|
|
44
|
-
"typestyles": "0.0.0-unstable.
|
|
44
|
+
"typestyles": "0.0.0-unstable.b5a2077e79ce",
|
|
45
45
|
"vite": "^6.0.0",
|
|
46
46
|
"vitest": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@typestyles/build-runner": "0.0.0-unstable.
|
|
49
|
+
"@typestyles/build-runner": "0.0.0-unstable.b5a2077e79ce"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean --external typestyles,@typestyles/build-runner",
|