vite-plugin-vanjs 0.1.10 → 0.1.11

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 CHANGED
@@ -5,10 +5,10 @@
5
5
  [![NPM Version](https://img.shields.io/npm/v/vite-plugin-vanjs.svg)](https://www.npmjs.com/package/vite-plugin-vanjs)
6
6
  [![NPM Downloads](https://img.shields.io/npm/dm/vite-plugin-vanjs.svg)](http://npm-stat.com/charts.html?package=vite-plugin-vanjs)
7
7
  [![typescript version](https://img.shields.io/badge/typescript-5.6.2-brightgreen)](https://www.typescriptlang.org/)
8
- [![vanjs-core version](https://img.shields.io/badge/vanjs--core-1.5.5-brightgreen)](https://github.com/vanjs-org/van)
8
+ [![vanjs-core version](https://img.shields.io/badge/vanjs--core-1.6.0-brightgreen)](https://github.com/vanjs-org/van)
9
9
  [![mini-van-plate version](https://img.shields.io/badge/mini--van--plate-0.6.3-brightgreen)](https://github.com/vanjs-org/mini-van-plate)
10
- [![vitest version](https://img.shields.io/badge/vitest-3.2.2-brightgreen)](https://www.vitest.dev/)
11
- [![vite version](https://img.shields.io/badge/vite-6.3.5-brightgreen)](https://vite.dev)
10
+ [![vitest version](https://img.shields.io/badge/vitest-3.2.4-brightgreen)](https://www.vitest.dev/)
11
+ [![vite version](https://img.shields.io/badge/vite-6.4.1-brightgreen)](https://vite.dev)
12
12
 
13
13
  A mini meta-framework for [VanJS](https://vanjs.org/) developed around the awesome [vite](https://vite.dev) and tested with [vitest](https://vitest.dev). The plugin comes with a set of modules to streamline your workflow:
14
14
  * ***@vanjs/router*** - one of the most important part of an application which allows you to split code and lazy load page like components with ease, handles both Client Side Rendering (SSR) and Server Side Rendering (CSR) and makes it really easy to work with;
package/jsx/fragment.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { JSX } from "./jsx";
1
+ import type { JSX } from "./jsx.d.ts";
2
2
 
3
3
  export type FragmentProps = {
4
4
  children?: JSX.Element;
package/jsx/jsx.d.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  // deno-lint-ignore-file no-empty-interface ban-types
2
2
 
3
3
  import * as csstype from "csstype";
4
- import type { Primitive, State, StateView } from "vanjs-core";
4
+ import type {
5
+ Primitive,
6
+ PropValueOrDerived,
7
+ State,
8
+ StateView,
9
+ } from "vanjs-core";
5
10
  import { Element as VElement } from "mini-van-plate/van-plate";
6
11
 
7
12
  /**
@@ -21,7 +26,7 @@ export type VanNode =
21
26
  | null
22
27
  | undefined;
23
28
 
24
- export type { Fragment } from "./fragment";
29
+ export type { Fragment } from "./fragment.d.ts";
25
30
 
26
31
  export as namespace JSX;
27
32
  export = JSX;
@@ -32,8 +37,6 @@ declare global {
32
37
  }
33
38
 
34
39
  declare namespace JSX {
35
- // type FunctionMaybe<T = unknown> = { (): T } | T;
36
- // type Element = VanNode;
37
40
  type FunctionMaybe<T = unknown> = (() => T) | StateView<T> | T | undefined;
38
41
  type Element =
39
42
  | State<Primitive | null | undefined>
@@ -41,8 +44,6 @@ declare namespace JSX {
41
44
  | DOMElement
42
45
  | HTMLElement
43
46
  | ArrayElement
44
- // | TagComponent<any>
45
- // | Component
46
47
  | FunctionElement
47
48
  | (string & {})
48
49
  | Primitive
@@ -142,8 +143,7 @@ declare namespace JSX {
142
143
  extends
143
144
  CustomAttributes<T>,
144
145
  CustomEventHandlersCamelCase<T>,
145
- CustomEventHandlersLowerCase<T>,
146
- CustomEventHandlersNamespaced<T> {
146
+ CustomEventHandlersLowerCase<T> {
147
147
  children?: Element;
148
148
  innerHTML?: string;
149
149
  innerText?: string | number;
@@ -2344,36 +2344,34 @@ declare namespace JSX {
2344
2344
  /** @type {MathMLElementTagNameMap} */
2345
2345
  interface MathMLElementTags {
2346
2346
  math: MathMLMathAttributes<MathMLElement>;
2347
- mi: MathMLAnnotationAttributes<MathMLMiElement>;
2348
- mn: MathMLAnnotationAttributes<MathMLMnElement>;
2349
- mo: MathMLOperatorAttributes<MathMLMoElement>;
2350
- ms: MathMLAnnotationAttributes<MathMLMsElement>;
2351
- mtext: MathMLAnnotationAttributes<MathMLMtextElement>;
2352
- mspace: MathMLMspaceAttributes<MathMLMspaceElement>;
2353
- mrow: MathMLRowAttributes<MathMLMrowElement>;
2354
- mfrac: MathMLFracAttributes<MathMLMfracElement>;
2355
- msqrt: MathMLRowAttributes<MathMLMsqrtElement>;
2356
- mroot: MathMLRowAttributes<MathMLMrootElement>;
2357
- mstyle: MathMLStyleAttributes<MathMLMstyleElement>;
2358
- merror: MathMLRowAttributes<MathMLMerrorElement>;
2359
- mpadded: MathMLPaddedAttributes<MathMLMpaddedElement>;
2360
- mphantom: MathMLRowAttributes<MathMLMphantomElement>;
2361
- mfenced: MathMLFencedAttributes<MathMLMfencedElement>;
2362
- mtable: MathMLTableAttributes<MathMLMtableElement>;
2363
- mtr: MathMLTableRowAttributes<MathMLMtrElement>;
2364
- mtd: MathMLTableCellAttributes<MathMLMtdElement>;
2365
- msub: MathMLScriptAttributes<MathMLMsubElement>;
2366
- msup: MathMLScriptAttributes<MathMLMsupElement>;
2367
- msubsup: MathMLScriptAttributes<MathMLMsubsupElement>;
2368
- mmultiscripts: MathMLMultiscriptsAttributes<MathMLMmultiscriptsElement>;
2369
- mover: MathMLScriptAttributes<MathMLMoverElement>;
2370
- munder: MathMLScriptAttributes<MathMLMunderElement>;
2371
- munderover: MathMLScriptAttributes<MathMLMunderoverElement>;
2372
- semantics: MathMLSemanticsAttributes<MathMLSemanticsElement>;
2373
- annotation: MathMLAnnotationElementAttributes<MathMLAnnotationElement>;
2374
- "annotation-xml": MathMLAnnotationElementAttributes<
2375
- MathMLAnnotationXMLElement
2376
- >;
2347
+ mi: MathMLAnnotationAttributes<MathMLElement>;
2348
+ mn: MathMLAnnotationAttributes<MathMLElement>;
2349
+ mo: MathMLOperatorAttributes<MathMLElement>;
2350
+ ms: MathMLAnnotationAttributes<MathMLElement>;
2351
+ mtext: MathMLAnnotationAttributes<MathMLElement>;
2352
+ mspace: MathMLMspaceAttributes<MathMLElement>;
2353
+ mrow: MathMLRowAttributes<MathMLElement>;
2354
+ mfrac: MathMLFracAttributes<MathMLElement>;
2355
+ msqrt: MathMLRowAttributes<MathMLElement>;
2356
+ mroot: MathMLRowAttributes<MathMLElement>;
2357
+ mstyle: MathMLStyleAttributes<MathMLElement>;
2358
+ merror: MathMLRowAttributes<MathMLElement>;
2359
+ mpadded: MathMLPaddedAttributes<MathMLElement>;
2360
+ mphantom: MathMLRowAttributes<MathMLElement>;
2361
+ mfenced: MathMLFencedAttributes<MathMLElement>;
2362
+ mtable: MathMLTableAttributes<MathMLElement>;
2363
+ mtr: MathMLTableRowAttributes<MathMLElement>;
2364
+ mtd: MathMLTableCellAttributes<MathMLElement>;
2365
+ msub: MathMLScriptAttributes<MathMLElement>;
2366
+ msup: MathMLScriptAttributes<MathMLElement>;
2367
+ msubsup: MathMLScriptAttributes<MathMLElement>;
2368
+ mmultiscripts: MathMLMultiscriptsAttributes<MathMLElement>;
2369
+ mover: MathMLScriptAttributes<MathMLElement>;
2370
+ munder: MathMLScriptAttributes<MathMLElement>;
2371
+ munderover: MathMLScriptAttributes<MathMLElement>;
2372
+ semantics: MathMLSemanticsAttributes<MathMLElement>;
2373
+ annotation: MathMLAnnotationElementAttributes<MathMLElement>;
2374
+ "annotation-xml": MathMLAnnotationElementAttributes<MathMLElement>;
2377
2375
  }
2378
2376
 
2379
2377
  /** MathML-specific attribute interfaces */
package/jsx/jsx.mjs CHANGED
@@ -1,9 +1,9 @@
1
+ /// <reference types="./jsx.d.ts" />
2
+
1
3
  import van from "vanjs-core";
2
4
  import isServer from "../setup/isServer.mjs";
3
5
  import { setAttributeNS, styleToString } from "../client/index.mjs";
4
- import { namespaceElements } from "./namespaceElements.mjs";
5
-
6
- let currentNamespace;
6
+ import { namespaceElements } from "./ns.mjs";
7
7
 
8
8
  /**
9
9
  * Compiles JSX to VanJS elements with automatic namespace resolution.
@@ -19,7 +19,7 @@ export const jsx = (jsxTag, { children, ref, style, ...rest }) => {
19
19
  );
20
20
 
21
21
  if (typeof jsxTag === "string") {
22
- const ns = currentNamespace || namespaceElements[jsxTag];
22
+ const ns = namespaceElements[jsxTag];
23
23
  const newElement = (ns ? van.tags(ns) : van.tags)[jsxTag](props, children);
24
24
 
25
25
  // Handle style reactively
package/jsx/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference path="global.d.ts" />
2
- import type { Fragment } from "./fragment";
2
+ import type { Fragment } from "./fragment.d.ts";
3
3
 
4
4
  declare function jsx(
5
5
  type: unknown,
@@ -12,5 +12,5 @@ declare function jsx(
12
12
  [key: string]: unknown;
13
13
  })[];
14
14
 
15
- export type { JSX } from "./jsx";
15
+ export type { JSX } from "./jsx.d.ts";
16
16
  export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vanjs",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "author": "thednp",
5
5
  "license": "MIT",
6
6
  "description": "A mini meta-framework for VanJS powered by Vite",
@@ -81,22 +81,21 @@
81
81
  "vanjs-ext": "*"
82
82
  },
83
83
  "dependencies": {
84
- "csstype": "^3.1.3",
84
+ "csstype": "^3.2.3",
85
85
  "mini-van-plate": "^0.6.3",
86
- "vanjs-core": "^1.5.5",
86
+ "vanjs-core": "^1.6.0",
87
87
  "vanjs-ext": "^0.6.3"
88
88
  },
89
89
  "devDependencies": {
90
- "@types/node": "^22.15.30",
91
- "@vitest/browser": "^3.2.2",
92
- "@vitest/coverage-istanbul": "^3.2.2",
93
- "@vitest/ui": "^3.2.2",
90
+ "@types/node": "^22.19.15",
91
+ "@vitest/browser": "^3.2.4",
92
+ "@vitest/coverage-istanbul": "^3.2.4",
93
+ "@vitest/ui": "^3.2.4",
94
94
  "happy-dom": "^16.8.1",
95
95
  "typescript": "5.6.2",
96
- "vite": "^6.3.5",
97
- "vitest": "^3.2.2"
96
+ "vite": "^6.4.1",
97
+ "vitest": "^3.2.4"
98
98
  },
99
- "packageManager": "pnpm@8.6.12",
100
99
  "engines": {
101
100
  "node": ">=20",
102
101
  "pnpm": ">=8.6.0"
@@ -104,7 +103,6 @@
104
103
  "scripts": {
105
104
  "test": "vitest --config vitest.config.ts",
106
105
  "test-ui": "vitest --config vitest.config.ts --ui=true",
107
- "badges": "npx -p dependency-version-badge update-badge vanjs-core mini-van-plate typescript vitest vite",
108
106
  "format": "deno fmt plugin meta router setup client server jsx",
109
107
  "lint": "pnpm lint:ts && pnpm check:ts",
110
108
  "lint:ts": "deno lint plugin meta router setup client server jsx",
package/plugin/types.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  // plugin/types.ts
2
- export * from "../jsx/types";
3
- export * from "../setup/types";
4
- export * from "../router/types";
5
- export * from "../meta/types";
6
- export * from "../server/types";
7
- export * from "../client/types";
8
- export * from "../parser/types";
2
+ export * from "../jsx/types.d.ts";
3
+ export * from "../setup/types.d.ts";
4
+ export * from "../router/types.d.ts";
5
+ export * from "../meta/types.d.ts";
6
+ export * from "../server/types.d.ts";
7
+ export * from "../client/types.d.ts";
9
8
  import type { PluginOption } from "vite";
10
9
 
11
10
  export type VanJSPluginOptions = {
@@ -14,7 +13,7 @@ export type VanJSPluginOptions = {
14
13
  };
15
14
 
16
15
  export declare const VitePluginVanJS: (
17
- config?: VitePluginVanJS,
16
+ config?: VanJSPluginOptions,
18
17
  ) => PluginOption<VanJSPluginOptions>;
19
18
 
20
19
  export default VitePluginVanJS;
package/router/types.d.ts CHANGED
@@ -12,7 +12,7 @@ import type {
12
12
  PropValueOrDerived,
13
13
  State,
14
14
  } from "vanjs-core";
15
- import { LayoutFile } from "../plugin/types";
15
+ import { LayoutFile } from "../plugin/types.d.ts";
16
16
 
17
17
  // type VanElement = VElement | Exclude<Primitive, boolean | undefined>;
18
18
  // type DOMElement = globalThis.Element;
File without changes