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/README.md +143 -15
- package/client/global.d.ts +41 -0
- package/client/index.mjs +48 -0
- package/client/package.json +18 -0
- package/client/types.d.ts +34 -0
- package/jsx/global.d.ts +4 -3
- package/jsx/jsx.d.ts +18 -10
- package/jsx/jsx.mjs +3 -2
- package/jsx/package.json +1 -1
- package/jsx/types.d.ts +16 -0
- package/meta/Head.mjs +81 -0
- package/meta/global.d.ts +60 -0
- package/meta/helpers.mjs +52 -0
- package/meta/index.mjs +3 -0
- package/meta/package.json +18 -0
- package/meta/tags.mjs +57 -0
- package/meta/types.d.ts +36 -0
- package/package.json +45 -13
- package/router/a.mjs +50 -0
- package/router/cache.mjs +14 -0
- package/router/global.d.ts +162 -0
- package/router/helpers.mjs +198 -0
- package/router/index.mjs +7 -0
- package/router/lazy.mjs +60 -0
- package/router/package.json +19 -0
- package/router/router.mjs +43 -0
- package/router/routes.mjs +51 -0
- package/router/state.mjs +27 -0
- package/router/types.d.ts +156 -0
- package/server/global.d.ts +49 -0
- package/server/index.mjs +97 -0
- package/server/package.json +20 -0
- package/server/types.d.ts +38 -0
- package/setup/package.json +2 -2
- package/setup/van.d.ts +1 -0
- package/setup/vanX.d.ts +1 -0
- package/setup/vanX.mjs +1 -1
- package/src/index.mjs +10 -10
- package/src/types.d.ts +28 -4
- package/tsconfig.json +14 -2
- package/jsx/index.d.ts +0 -16
- package/jsx/utils.mjs +0 -24
- /package/setup/{index.d.ts → types.d.ts} +0 -0
package/src/types.d.ts
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "../
|
|
3
|
-
export * from "../
|
|
4
|
-
export
|
|
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": "
|
|
29
|
+
"jsxImportSource": "@vanjs/jsx",
|
|
30
|
+
// "types": ["vanjs-core", "vanjs-ext", "mini-van-plate"],
|
|
30
31
|
},
|
|
31
|
-
"include": [
|
|
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
|