@zubra/unplugin 5.9.1 → 5.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zubra/unplugin",
3
- "version": "5.9.1",
3
+ "version": "5.10.0",
4
4
  "description": "Compile .zb components in Vite, Rollup, webpack, esbuild and Rspack, with React and Vue wrappers picked automatically",
5
5
  "license": "ISC",
6
6
  "repository": {
@@ -10,14 +10,35 @@
10
10
  },
11
11
  "type": "module",
12
12
  "exports": {
13
- ".": "./src/index.js",
14
- "./vite": "./src/vite.js",
15
- "./rollup": "./src/rollup.js",
16
- "./webpack": "./src/webpack.js",
17
- "./esbuild": "./src/esbuild.js",
13
+ ".": {
14
+ "types": "./src/index.d.ts",
15
+ "default": "./src/index.js"
16
+ },
17
+ "./vite": {
18
+ "types": "./src/vite.d.ts",
19
+ "default": "./src/vite.js"
20
+ },
21
+ "./rollup": {
22
+ "types": "./src/rollup.d.ts",
23
+ "default": "./src/rollup.js"
24
+ },
25
+ "./webpack": {
26
+ "types": "./src/webpack.d.ts",
27
+ "default": "./src/webpack.js"
28
+ },
29
+ "./esbuild": {
30
+ "types": "./src/esbuild.d.ts",
31
+ "default": "./src/esbuild.js"
32
+ },
18
33
  "./loader": "./src/loader.cjs",
19
- "./rspack": "./src/rspack.js",
20
- "./astro": "./src/astro.js",
34
+ "./rspack": {
35
+ "types": "./src/rspack.d.ts",
36
+ "default": "./src/rspack.js"
37
+ },
38
+ "./astro": {
39
+ "types": "./src/astro.d.ts",
40
+ "default": "./src/astro.js"
41
+ },
21
42
  "./astro/server": "./src/astro-server.js",
22
43
  "./astro/client": "./src/astro-client.js",
23
44
  "./client": {
@@ -34,8 +55,8 @@
34
55
  "unplugin": "3.7.0"
35
56
  },
36
57
  "peerDependencies": {
37
- "@zubra/compiler": "^5.9.0",
38
- "@zubra/runtime": "^5.9.0"
58
+ "@zubra/compiler": "^5.10.0",
59
+ "@zubra/runtime": "^5.10.0"
39
60
  },
40
61
  "devDependencies": {
41
62
  "@zubra/compiler": "file:../compiler",
package/src/astro.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { ZubraOptions } from './index.js';
2
+
3
+ /** The Astro integration: `.zb` components in Astro pages, server-rendered and hydrated with a client directive. */
4
+ export default function zubra(options?: ZubraOptions): {
5
+ name: string;
6
+ hooks: Record<string, (...args: any[]) => unknown>;
7
+ };
@@ -0,0 +1,4 @@
1
+ import { unplugin } from './index.js';
2
+
3
+ declare const zubra: typeof unplugin.esbuild;
4
+ export default zubra;
package/src/index.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ // Typings for @zubra/unplugin. The option docs match the README's "Options".
2
+ import type { UnpluginInstance } from 'unplugin';
3
+
4
+ export interface ZubraOptions {
5
+ /** The compiler CLI to run. Default: `$ZUBRA_COMPILER`, then `@zubra/compiler` (WebAssembly), then `zubra` on PATH. */
6
+ compiler?: string;
7
+ /** What a `.zb` import gives plain `.js`/`.ts` files. Default: `'auto'` (detected from the React or Vue Vite plugin). */
8
+ framework?: 'auto' | 'react' | 'vue' | 'element';
9
+ /** Write typings (`x.d.zb.ts`) next to each component. Default: `true`. */
10
+ dts?: boolean;
11
+ /** The runtime module compiled code imports. Default: `'@zubra/runtime'`. */
12
+ runtime?: string;
13
+ /** Server builds register a renderer, which needs `@zubra/compiler` at run time. Default: `true`. */
14
+ ssr?: boolean;
15
+ /** The module server builds render with. Default: `'@zubra/compiler'`. */
16
+ compilerModule?: string;
17
+ /** Compile for the Zubra DevTools in builds too, not only in Vite's dev server. Default: `$ZUBRA_DEVTOOLS === '1'`. */
18
+ devtools?: boolean;
19
+ }
20
+
21
+ export declare const unplugin: UnpluginInstance<ZubraOptions | undefined, false>;
22
+
23
+ /** The variant a `.zb` import gives: by explicit query, by the importer's kind, or the project's. */
24
+ export declare function variantFor(query: string, importer: string | undefined, project: string | null): 'element' | 'react' | 'vue';
25
+
26
+ /** Whether a `.zb` component renders into light DOM (no `shadow` on its host tag). */
27
+ export declare function isLightDom(source: string): boolean;
28
+
29
+ export default unplugin;
@@ -0,0 +1,4 @@
1
+ import { unplugin } from './index.js';
2
+
3
+ declare const zubra: typeof unplugin.rollup;
4
+ export default zubra;
@@ -0,0 +1,4 @@
1
+ import { unplugin } from './index.js';
2
+
3
+ declare const zubra: typeof unplugin.rspack;
4
+ export default zubra;
package/src/vite.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { unplugin } from './index.js';
2
+
3
+ declare const zubra: typeof unplugin.vite;
4
+ export default zubra;
@@ -0,0 +1,4 @@
1
+ import { unplugin } from './index.js';
2
+
3
+ declare const zubra: typeof unplugin.webpack;
4
+ export default zubra;