vite-plugin-vanjs 0.1.7 → 0.1.9

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
@@ -7,8 +7,8 @@
7
7
  [![typescript version](https://img.shields.io/badge/typescript-5.6.2-brightgreen)](https://www.typescriptlang.org/)
8
8
  [![vanjs-core version](https://img.shields.io/badge/vanjs--core-1.5.5-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.1.2-brightgreen)](https://www.vitest.dev/)
11
- [![vite version](https://img.shields.io/badge/vite-6.3.4-brightgreen)](https://vite.dev)
10
+ [![vitest version](https://img.shields.io/badge/vitest-3.1.3-brightgreen)](https://www.vitest.dev/)
11
+ [![vite version](https://img.shields.io/badge/vite-6.3.5-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;
@@ -36,6 +36,7 @@ deno add npm:vite-plugin-vanjs@latest
36
36
  bun add vite-plugin-vanjs@latest
37
37
  ```
38
38
 
39
+
39
40
  ### Wiki
40
41
 
41
42
  For a complete guide on how to use the plugin, be sure to check the wiki:
package/jsx/jsx.d.ts CHANGED
@@ -26,10 +26,15 @@ export type { Fragment } from "./fragment";
26
26
  export as namespace JSX;
27
27
  export = JSX;
28
28
 
29
+ // trick TypeScript into thinking this is real React
30
+ declare global {
31
+ const React: {};
32
+ }
33
+
29
34
  declare namespace JSX {
30
35
  // type FunctionMaybe<T = unknown> = { (): T } | T;
31
36
  // type Element = VanNode;
32
- type FunctionMaybe<T = unknown> = (() => T) | StateView<T> | T;
37
+ type FunctionMaybe<T = unknown> = (() => T) | StateView<T> | T | undefined;
33
38
  type Element =
34
39
  | State<Primitive | null | undefined>
35
40
  | Node
@@ -397,61 +402,61 @@ declare namespace JSX {
397
402
  * Identifies the currently active element when DOM focus is on a composite widget, textbox,
398
403
  * group, or application.
399
404
  */
400
- "aria-activedescendant"?: string;
405
+ "aria-activedescendant"?: FunctionMaybe<string>;
401
406
  /**
402
407
  * Indicates whether assistive technologies will present all, or only parts of, the changed
403
408
  * region based on the change notifications defined by the aria-relevant attribute.
404
409
  */
405
- "aria-atomic"?: boolean | "false" | "true";
410
+ "aria-atomic"?: FunctionMaybe<boolean | "false" | "true">;
406
411
  /**
407
412
  * Indicates whether inputting text could trigger display of one or more predictions of the
408
413
  * user's intended value for an input and specifies how predictions would be presented if they
409
414
  * are made.
410
415
  */
411
- "aria-autocomplete"?: "none" | "inline" | "list" | "both";
416
+ "aria-autocomplete"?: FunctionMaybe<"none" | "inline" | "list" | "both">;
412
417
  /**
413
418
  * Indicates an element is being modified and that assistive technologies MAY want to wait until
414
419
  * the modifications are complete before exposing them to the user.
415
420
  */
416
- "aria-busy"?: boolean | "false" | "true";
421
+ "aria-busy"?: FunctionMaybe<boolean | "false" | "true">;
417
422
  /**
418
423
  * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
419
424
  *
420
425
  * @see aria-pressed @see aria-selected.
421
426
  */
422
- "aria-checked"?: boolean | "false" | "mixed" | "true";
427
+ "aria-checked"?: FunctionMaybe<boolean | "false" | "mixed" | "true">;
423
428
  /**
424
429
  * Defines the total number of columns in a table, grid, or treegrid.
425
430
  *
426
431
  * @see aria-colindex.
427
432
  */
428
- "aria-colcount"?: number | string;
433
+ "aria-colcount"?: FunctionMaybe<number | string>;
429
434
  /**
430
435
  * Defines an element's column index or position with respect to the total number of columns
431
436
  * within a table, grid, or treegrid.
432
437
  *
433
438
  * @see aria-colcount @see aria-colspan.
434
439
  */
435
- "aria-colindex"?: number | string;
440
+ "aria-colindex"?: FunctionMaybe<number | string>;
436
441
  /**
437
442
  * Defines the number of columns spanned by a cell or gridcell within a table, grid, or
438
443
  * treegrid.
439
444
  *
440
445
  * @see aria-colindex @see aria-rowspan.
441
446
  */
442
- "aria-colspan"?: number | string;
447
+ "aria-colspan"?: FunctionMaybe<number | string>;
443
448
  /**
444
449
  * Identifies the element (or elements) whose contents or presence are controlled by the current
445
450
  * element.
446
451
  *
447
452
  * @see aria-owns.
448
453
  */
449
- "aria-controls"?: string;
454
+ "aria-controls"?: FunctionMaybe<string>;
450
455
  /**
451
456
  * Indicates the element that represents the current item within a container or set of related
452
457
  * elements.
453
458
  */
454
- "aria-current"?:
459
+ "aria-current"?: FunctionMaybe<
455
460
  | boolean
456
461
  | "false"
457
462
  | "true"
@@ -459,61 +464,65 @@ declare namespace JSX {
459
464
  | "step"
460
465
  | "location"
461
466
  | "date"
462
- | "time";
467
+ | "time"
468
+ | undefined
469
+ >;
463
470
  /**
464
471
  * Identifies the element (or elements) that describes the object.
465
472
  *
466
473
  * @see aria-labelledby
467
474
  */
468
- "aria-describedby"?: string;
475
+ "aria-describedby"?: FunctionMaybe<string>;
469
476
  /**
470
477
  * Identifies the element that provides a detailed, extended description for the object.
471
478
  *
472
479
  * @see aria-describedby.
473
480
  */
474
- "aria-details"?: string;
481
+ "aria-details"?: FunctionMaybe<string>;
475
482
  /**
476
483
  * Indicates that the element is perceivable but disabled, so it is not editable or otherwise
477
484
  * operable.
478
485
  *
479
486
  * @see aria-hidden @see aria-readonly.
480
487
  */
481
- "aria-disabled"?: boolean | "false" | "true";
488
+ "aria-disabled"?: FunctionMaybe<boolean | "false" | "true">;
482
489
  /**
483
490
  * Indicates what functions can be performed when a dragged object is released on the drop
484
491
  * target.
485
492
  *
486
493
  * @deprecated In ARIA 1.1
487
494
  */
488
- "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup";
495
+ "aria-dropeffect"?: FunctionMaybe<
496
+ "none" | "copy" | "execute" | "link" | "move" | "popup"
497
+ >;
489
498
  /**
490
499
  * Identifies the element that provides an error message for the object.
491
500
  *
492
501
  * @see aria-invalid @see aria-describedby.
493
502
  */
494
- "aria-errormessage"?: string;
503
+ "aria-errormessage"?: FunctionMaybe<string>;
495
504
  /**
496
505
  * Indicates whether the element, or another grouping element it controls, is currently expanded
497
506
  * or collapsed.
498
507
  */
499
- "aria-expanded"?: boolean | "false" | "true";
508
+ "aria-expanded"?: FunctionMaybe<boolean | "false" | "true">;
500
509
  /**
501
510
  * Identifies the next element (or elements) in an alternate reading order of content which, at
502
511
  * the user's discretion, allows assistive technology to override the general default of reading
503
512
  * in document source order.
504
513
  */
505
- "aria-flowto"?: string;
514
+ "aria-flowto"?: FunctionMaybe<string>;
506
515
  /**
507
516
  * Indicates an element's "grabbed" state in a drag-and-drop operation.
508
517
  *
509
518
  * @deprecated In ARIA 1.1
510
519
  */
511
- "aria-grabbed"?: boolean | "false" | "true";
520
+ "aria-grabbed"?: FunctionMaybe<boolean | "false" | "true">;
512
521
  /**
513
522
  * Indicates the availability and type of interactive popup element, such as menu or dialog,
514
523
  * that can be triggered by an element.
515
524
  */
516
- "aria-haspopup"?:
525
+ "aria-haspopup"?: FunctionMaybe<
517
526
  | boolean
518
527
  | "false"
519
528
  | "true"
@@ -521,54 +530,57 @@ declare namespace JSX {
521
530
  | "listbox"
522
531
  | "tree"
523
532
  | "grid"
524
- | "dialog";
533
+ | "dialog"
534
+ >;
525
535
  /**
526
536
  * Indicates whether the element is exposed to an accessibility API.
527
537
  *
528
538
  * @see aria-disabled.
529
539
  */
530
- "aria-hidden"?: boolean | "false" | "true";
540
+ "aria-hidden"?: FunctionMaybe<boolean | "false" | "true">;
531
541
  /**
532
542
  * Indicates the entered value does not conform to the format expected by the application.
533
543
  *
534
544
  * @see aria-errormessage.
535
545
  */
536
- "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling";
546
+ "aria-invalid"?: FunctionMaybe<
547
+ boolean | "false" | "true" | "grammar" | "spelling"
548
+ >;
537
549
  /**
538
550
  * Indicates keyboard shortcuts that an author has implemented to activate or give focus to an
539
551
  * element.
540
552
  */
541
- "aria-keyshortcuts"?: string;
553
+ "aria-keyshortcuts"?: FunctionMaybe<string>;
542
554
  /**
543
555
  * Defines a string value that labels the current element.
544
556
  *
545
557
  * @see aria-labelledby.
546
558
  */
547
- "aria-label"?: string;
559
+ "aria-label"?: FunctionMaybe<string>;
548
560
  /**
549
561
  * Identifies the element (or elements) that labels the current element.
550
562
  *
551
563
  * @see aria-describedby.
552
564
  */
553
- "aria-labelledby"?: string;
565
+ "aria-labelledby"?: FunctionMaybe<string>;
554
566
  /** Defines the hierarchical level of an element within a structure. */
555
- "aria-level"?: number | string;
567
+ "aria-level"?: FunctionMaybe<number | string>;
556
568
  /**
557
569
  * Indicates that an element will be updated, and describes the types of updates the user
558
570
  * agents, assistive technologies, and user can expect from the live region.
559
571
  */
560
- "aria-live"?: "off" | "assertive" | "polite";
572
+ "aria-live"?: FunctionMaybe<"off" | "assertive" | "polite">;
561
573
  /** Indicates whether an element is modal when displayed. */
562
- "aria-modal"?: boolean | "false" | "true";
574
+ "aria-modal"?: FunctionMaybe<boolean | "false" | "true">;
563
575
  /** Indicates whether a text box accepts multiple lines of input or only a single line. */
564
- "aria-multiline"?: boolean | "false" | "true";
576
+ "aria-multiline"?: FunctionMaybe<boolean | "false" | "true">;
565
577
  /**
566
578
  * Indicates that the user may select more than one item from the current selectable
567
579
  * descendants.
568
580
  */
569
- "aria-multiselectable"?: boolean | "false" | "true";
581
+ "aria-multiselectable"?: FunctionMaybe<boolean | "false" | "true">;
570
582
  /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
571
- "aria-orientation"?: "horizontal" | "vertical";
583
+ "aria-orientation"?: FunctionMaybe<"horizontal" | "vertical">;
572
584
  /**
573
585
  * Identifies an element (or elements) in order to define a visual, functional, or contextual
574
586
  * parent/child relationship between DOM elements where the DOM hierarchy cannot be used to
@@ -576,39 +588,39 @@ declare namespace JSX {
576
588
  *
577
589
  * @see aria-controls.
578
590
  */
579
- "aria-owns"?: string;
591
+ "aria-owns"?: FunctionMaybe<string>;
580
592
  /**
581
593
  * Defines a short hint (a word or short phrase) intended to aid the user with data entry when
582
594
  * the control has no value. A hint could be a sample value or a brief description of the
583
595
  * expected format.
584
596
  */
585
- "aria-placeholder"?: string;
597
+ "aria-placeholder"?: FunctionMaybe<string>;
586
598
  /**
587
599
  * Defines an element's number or position in the current set of listitems or treeitems. Not
588
600
  * required if all elements in the set are present in the DOM.
589
601
  *
590
602
  * @see aria-setsize.
591
603
  */
592
- "aria-posinset"?: number | string;
604
+ "aria-posinset"?: FunctionMaybe<number | string>;
593
605
  /**
594
606
  * Indicates the current "pressed" state of toggle buttons.
595
607
  *
596
608
  * @see aria-checked @see aria-selected.
597
609
  */
598
- "aria-pressed"?: boolean | "false" | "mixed" | "true";
610
+ "aria-pressed"?: FunctionMaybe<boolean | "false" | "mixed" | "true">;
599
611
  /**
600
612
  * Indicates that the element is not editable, but is otherwise operable.
601
613
  *
602
614
  * @see aria-disabled.
603
615
  */
604
- "aria-readonly"?: boolean | "false" | "true";
616
+ "aria-readonly"?: FunctionMaybe<boolean | "false" | "true">;
605
617
  /**
606
618
  * Indicates what notifications the user agent will trigger when the accessibility tree within a
607
619
  * live region is modified.
608
620
  *
609
621
  * @see aria-atomic.
610
622
  */
611
- "aria-relevant"?:
623
+ "aria-relevant"?: FunctionMaybe<
612
624
  | "additions"
613
625
  | "additions removals"
614
626
  | "additions text"
@@ -618,57 +630,58 @@ declare namespace JSX {
618
630
  | "removals text"
619
631
  | "text"
620
632
  | "text additions"
621
- | "text removals";
633
+ | "text removals"
634
+ >;
622
635
  /** Indicates that user input is required on the element before a form may be submitted. */
623
- "aria-required"?: boolean | "false" | "true";
636
+ "aria-required"?: FunctionMaybe<boolean | "false" | "true">;
624
637
  /** Defines a human-readable, author-localized description for the role of an element. */
625
- "aria-roledescription"?: string;
638
+ "aria-roledescription"?: FunctionMaybe<string>;
626
639
  /**
627
640
  * Defines the total number of rows in a table, grid, or treegrid.
628
641
  *
629
642
  * @see aria-rowindex.
630
643
  */
631
- "aria-rowcount"?: number | string;
644
+ "aria-rowcount"?: FunctionMaybe<number | string>;
632
645
  /**
633
646
  * Defines an element's row index or position with respect to the total number of rows within a
634
647
  * table, grid, or treegrid.
635
648
  *
636
649
  * @see aria-rowcount @see aria-rowspan.
637
650
  */
638
- "aria-rowindex"?: number | string;
651
+ "aria-rowindex"?: FunctionMaybe<number | string>;
639
652
  /**
640
653
  * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
641
654
  *
642
655
  * @see aria-rowindex @see aria-colspan.
643
656
  */
644
- "aria-rowspan"?: number | string;
657
+ "aria-rowspan"?: FunctionMaybe<number | string>;
645
658
  /**
646
659
  * Indicates the current "selected" state of various widgets.
647
660
  *
648
661
  * @see aria-checked @see aria-pressed.
649
662
  */
650
- "aria-selected"?: boolean | "false" | "true";
663
+ "aria-selected"?: FunctionMaybe<boolean | "false" | "true">;
651
664
  /**
652
665
  * Defines the number of items in the current set of listitems or treeitems. Not required if all
653
666
  * elements in the set are present in the DOM.
654
667
  *
655
668
  * @see aria-posinset.
656
669
  */
657
- "aria-setsize"?: number | string;
670
+ "aria-setsize"?: FunctionMaybe<number | string>;
658
671
  /** Indicates if items in a table or grid are sorted in ascending or descending order. */
659
- "aria-sort"?: "none" | "ascending" | "descending" | "other";
672
+ "aria-sort"?: FunctionMaybe<"none" | "ascending" | "descending" | "other">;
660
673
  /** Defines the maximum allowed value for a range widget. */
661
- "aria-valuemax"?: number | string;
674
+ "aria-valuemax"?: FunctionMaybe<number | string>;
662
675
  /** Defines the minimum allowed value for a range widget. */
663
- "aria-valuemin"?: number | string;
676
+ "aria-valuemin"?: FunctionMaybe<number | string>;
664
677
  /**
665
678
  * Defines the current value for a range widget.
666
679
  *
667
680
  * @see aria-valuetext.
668
681
  */
669
- "aria-valuenow"?: number | string;
682
+ "aria-valuenow"?: FunctionMaybe<number | string>;
670
683
  /** Defines the human readable text alternative of aria-valuenow for a range widget. */
671
- "aria-valuetext"?: string;
684
+ "aria-valuetext"?: FunctionMaybe<string>;
672
685
  role?: FunctionMaybe<
673
686
  | "alert"
674
687
  | "alertdialog"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vanjs",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "author": "thednp",
5
5
  "license": "MIT",
6
6
  "description": "A mini meta-framework for VanJS powered by Vite",
@@ -87,14 +87,14 @@
87
87
  "vanjs-ext": "^0.6.2"
88
88
  },
89
89
  "devDependencies": {
90
- "@types/node": "^22.15.3",
91
- "@vitest/browser": "^3.1.2",
92
- "@vitest/coverage-istanbul": "^3.1.2",
93
- "@vitest/ui": "^3.1.2",
90
+ "@types/node": "^22.15.12",
91
+ "@vitest/browser": "^3.1.3",
92
+ "@vitest/coverage-istanbul": "^3.1.3",
93
+ "@vitest/ui": "^3.1.3",
94
94
  "happy-dom": "^16.8.1",
95
95
  "typescript": "5.6.2",
96
- "vite": "^6.3.4",
97
- "vitest": "^3.1.2"
96
+ "vite": "^6.3.5",
97
+ "vitest": "^3.1.3"
98
98
  },
99
99
  "packageManager": "pnpm@8.6.12",
100
100
  "engines": {
package/plugin/index.mjs CHANGED
@@ -71,8 +71,7 @@ export default function VitePluginVanJS(options = {}) {
71
71
  include: [
72
72
  "vanjs-core",
73
73
  "vanjs-ext",
74
- "mini-van-plate/van-plate",
75
- "mini-van-plate/shared",
74
+ "mini-van-plate",
76
75
  ],
77
76
  },
78
77
  ssr: {
package/tsconfig.json CHANGED
@@ -26,8 +26,7 @@
26
26
  "noEmit": true,
27
27
  "checkJs": true,
28
28
  "jsx": "preserve",
29
- "jsxImportSource": "@vanjs/jsx",
30
- // "types": ["vanjs-core", "vanjs-ext", "mini-van-plate"],
29
+ "jsxImportSource": "@vanjs/jsx"
31
30
  },
32
31
  "include": [
33
32
  "./tests/*.ts",