vite-plugin-vanjs 0.0.3 → 0.0.5

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/src/types.d.ts CHANGED
@@ -1,4 +1,28 @@
1
- import type { Plugin } from "vite";
2
- export * from "../jsx";
3
- export * from "../setup";
4
- export default function VitePluginVanJS(): Plugin;
1
+ export * from "../jsx/types";
2
+ export * from "../setup/types";
3
+ export * from "../router/types";
4
+ export * from "../meta/types";
5
+ export * from "../server/types";
6
+ export * from "../client/types";
7
+
8
+ declare const VitePluginVanJS: () => {
9
+ name: "string";
10
+ enforce: "pre" | "post" | undefined;
11
+ apply: "build";
12
+ config(): {
13
+ resolve: {
14
+ alias: Record<string, string>;
15
+ };
16
+ esBuild: {
17
+ jsx: "string";
18
+ jsxImportSource: "string";
19
+ };
20
+ };
21
+ transform(code: string, id?: string): {
22
+ code: string;
23
+ map: null;
24
+ };
25
+ };
26
+ export default VitePluginVanJS;
27
+
28
+ export {};
package/tsconfig.json CHANGED
@@ -26,8 +26,20 @@
26
26
  "noEmit": true,
27
27
  "checkJs": true,
28
28
  "jsx": "preserve",
29
- "jsxImportSource": "vite-plugin-vanjs",
29
+ "jsxImportSource": "@vanjs/jsx",
30
+ // "types": ["vanjs-core", "vanjs-ext", "mini-van-plate"],
30
31
  },
31
- "include": ["./src/**/*.ts", "./jsx/*.d.ts", "setup/**/*"],
32
+ "include": [
33
+ "./tests/*.ts",
34
+ "./tests/*.tsx",
35
+ "./src/*.ts",
36
+ "./jsx/*.ts",
37
+ "./setup/*.ts",
38
+ "./router/*.ts",
39
+ "./meta/*.ts",
40
+ "./server/*.ts",
41
+ "./client/*.ts",
42
+ // "./tests/vite-env.d.ts"
43
+ ],
32
44
  "exclude": ["node_modules", "experiments", "coverage"],
33
45
  }
package/jsx/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- /// <reference path="global.d.ts" />
2
- import type { JSX } from "./jsx.d.ts";
3
- import type { Fragment } from "./fragment.d.ts";
4
-
5
- declare function jsx(
6
- type: any,
7
- props: any,
8
- ): () =>
9
- | (Node & {
10
- [key: string]: any;
11
- })
12
- | (Node & {
13
- [key: string]: any;
14
- })[];
15
-
16
- export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };
package/jsx/utils.mjs DELETED
@@ -1,24 +0,0 @@
1
- export const setAttribute = (element, key, value) => {
2
- if (value == null || value === false || value === "") {
3
- element.removeAttribute(key);
4
- } else {
5
- const attr = value === true ? "" : String(value);
6
- element.setAttribute(key, attr);
7
- }
8
- };
9
-
10
- export const styleToString = (style) => {
11
- return typeof style === "string"
12
- ? style
13
- : typeof style === "object"
14
- ? Object.entries(style).reduce((acc, key) =>
15
- acc +
16
- key[0]
17
- .split(/(?=[A-Z])/)
18
- .join("-")
19
- .toLowerCase() +
20
- ":" +
21
- key[1] +
22
- ";", "")
23
- : "";
24
- };
File without changes