@typestyles/astro 0.0.0-unstable.3a8feb2a3be6 → 0.0.0-unstable.3b624adca193
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 +10 -5
- package/dist/index.cjs +31 -40
- package/dist/index.d.cts +6 -7
- package/dist/index.d.ts +6 -7
- package/dist/index.js +15 -16
- package/package.json +9 -12
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @typestyles/astro
|
|
2
2
|
|
|
3
|
-
[Astro](https://astro.build) integration for [typestyles](https://github.com/
|
|
3
|
+
[Astro](https://astro.build) integration for [typestyles](https://github.com/phthalo-dev/typestyles): wires `@typestyles/vite` into your Astro config for style HMR in development and build-time CSS extraction in production.
|
|
4
4
|
|
|
5
5
|
## When to use this
|
|
6
6
|
|
|
@@ -74,14 +74,17 @@ When `extract.modules` resolves (or a [convention entry](https://typestyles.dev/
|
|
|
74
74
|
```astro
|
|
75
75
|
---
|
|
76
76
|
// src/components/Card.astro
|
|
77
|
-
import {
|
|
77
|
+
import { createTypeStyles } from 'typestyles';
|
|
78
78
|
|
|
79
|
-
const
|
|
80
|
-
|
|
79
|
+
const { recipe } = createTypeStyles({ scopeId: 'app' });
|
|
80
|
+
|
|
81
|
+
const card = recipe({
|
|
82
|
+
name: 'card',
|
|
83
|
+
styles: { base: { padding: '16px', borderRadius: '8px' } },
|
|
81
84
|
});
|
|
82
85
|
---
|
|
83
86
|
|
|
84
|
-
<div class={card()}>Hello</div>
|
|
87
|
+
<div class={card().className}>Hello</div>
|
|
85
88
|
```
|
|
86
89
|
|
|
87
90
|
## Configuration
|
|
@@ -91,6 +94,8 @@ Accepts the same options as `@typestyles/vite`:
|
|
|
91
94
|
```ts
|
|
92
95
|
typestyles({
|
|
93
96
|
warnDuplicates?: boolean;
|
|
97
|
+
/** Default true. Set false to allow app recipes outside the extract entry. */
|
|
98
|
+
coverage?: boolean;
|
|
94
99
|
mode?: 'runtime' | 'build' | 'hybrid';
|
|
95
100
|
extract?: {
|
|
96
101
|
modules?: string[];
|
package/dist/index.cjs
CHANGED
|
@@ -1,50 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
8
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
default: () => typestyles
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
var import_vite = __toESM(require("@typestyles/vite"), 1);
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
let _typestyles_vite = require("@typestyles/vite");
|
|
24
|
+
_typestyles_vite = __toESM(_typestyles_vite, 1);
|
|
25
|
+
//#region src/index.ts
|
|
37
26
|
function typestyles(options = {}) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
27
|
+
return {
|
|
28
|
+
name: "typestyles",
|
|
29
|
+
hooks: { "astro:config:setup"({ updateConfig }) {
|
|
30
|
+
updateConfig({ vite: { plugins: [(0, _typestyles_vite.default)({
|
|
31
|
+
...options,
|
|
32
|
+
extract: {
|
|
33
|
+
...options.extract,
|
|
34
|
+
fileName: options.extract?.fileName ?? "typestyles.css"
|
|
35
|
+
}
|
|
36
|
+
})] } });
|
|
37
|
+
} }
|
|
38
|
+
};
|
|
50
39
|
}
|
|
40
|
+
//#endregion
|
|
41
|
+
module.exports = typestyles;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AstroIntegration } from
|
|
2
|
-
import { TypestylesPluginOptions } from
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { AstroIntegration } from "astro";
|
|
2
|
+
import { TypestylesPluginOptions, TypestylesPluginOptions as TypestylesPluginOptions$1 } from "@typestyles/vite";
|
|
3
|
+
//#region src/index.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Astro integration for typestyles.
|
|
7
6
|
*
|
|
@@ -17,6 +16,6 @@ export { TypestylesPluginOptions } from '@typestyles/vite';
|
|
|
17
16
|
* dynamically imports the same entry (e.g. `if (import.meta.env.DEV) void import('./typestyles-entry')`)
|
|
18
17
|
* and avoid inlining `getRegisteredCss()` in dev, or updates will appear stuck until a full reload.
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export {
|
|
19
|
+
export default function typestyles(options?: TypestylesPluginOptions$1): AstroIntegration;
|
|
20
|
+
//#endregion
|
|
21
|
+
export type { TypestylesPluginOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { TypestylesPluginOptions, TypestylesPluginOptions as TypestylesPluginOptions$1 } from "@typestyles/vite";
|
|
2
|
+
import { AstroIntegration } from "astro";
|
|
3
|
+
//#region src/index.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Astro integration for typestyles.
|
|
7
6
|
*
|
|
@@ -17,6 +16,6 @@ export { TypestylesPluginOptions } from '@typestyles/vite';
|
|
|
17
16
|
* dynamically imports the same entry (e.g. `if (import.meta.env.DEV) void import('./typestyles-entry')`)
|
|
18
17
|
* and avoid inlining `getRegisteredCss()` in dev, or updates will appear stuck until a full reload.
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export {
|
|
19
|
+
export default function typestyles(options?: TypestylesPluginOptions$1): AstroIntegration;
|
|
20
|
+
//#endregion
|
|
21
|
+
export type { TypestylesPluginOptions };
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
1
|
import typestylesVite from "@typestyles/vite";
|
|
2
|
+
//#region src/index.ts
|
|
3
3
|
function typestyles(options = {}) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
return {
|
|
5
|
+
name: "typestyles",
|
|
6
|
+
hooks: { "astro:config:setup"({ updateConfig }) {
|
|
7
|
+
updateConfig({ vite: { plugins: [typestylesVite({
|
|
8
|
+
...options,
|
|
9
|
+
extract: {
|
|
10
|
+
...options.extract,
|
|
11
|
+
fileName: options.extract?.fileName ?? "typestyles.css"
|
|
12
|
+
}
|
|
13
|
+
})] } });
|
|
14
|
+
} }
|
|
15
|
+
};
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { typestyles as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typestyles/astro",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.3b624adca193",
|
|
4
4
|
"description": "Astro integration for typestyles (dev HMR, production CSS extraction)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -30,28 +30,25 @@
|
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "https://github.com/
|
|
33
|
+
"url": "https://github.com/phthalo-dev/typestyles",
|
|
34
34
|
"directory": "packages/astro"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"astro": ">=4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@typestyles/vite": "0.0.0-unstable.
|
|
40
|
+
"@typestyles/vite": "0.0.0-unstable.3b624adca193"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"astro": "^5.6.1",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"vite": "^6.0.0",
|
|
49
|
-
"vitest": "^3.0.0"
|
|
44
|
+
"typescript": "^6.0.0",
|
|
45
|
+
"typestyles": "0.0.0-unstable.3b624adca193",
|
|
46
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
|
|
47
|
+
"vite-plus": "1.3.0"
|
|
50
48
|
},
|
|
51
49
|
"scripts": {
|
|
52
|
-
"build": "
|
|
53
|
-
"test": "
|
|
54
|
-
"lint": "eslint .",
|
|
50
|
+
"build": "vp pack",
|
|
51
|
+
"test": "vp test run",
|
|
55
52
|
"typecheck": "tsc --noEmit"
|
|
56
53
|
}
|
|
57
54
|
}
|