vite-plugin-vanjs 0.1.11 → 0.1.12

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
@@ -4,11 +4,6 @@
4
4
  [![ci](https://github.com/thednp/vite-plugin-vanjs/actions/workflows/ci.yml/badge.svg)](https://github.com/thednp/vite-plugin-vanjs/actions/workflows/ci.yml)
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
- [![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.6.0-brightgreen)](https://github.com/vanjs-org/van)
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.4-brightgreen)](https://www.vitest.dev/)
11
- [![vite version](https://img.shields.io/badge/vite-6.4.1-brightgreen)](https://vite.dev)
12
7
 
13
8
  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
9
  * ***@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vanjs",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
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.3"
88
88
  },
89
89
  "devDependencies": {
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
- "happy-dom": "^16.8.1",
95
- "typescript": "5.6.2",
96
- "vite": "^6.4.1",
97
- "vitest": "^3.2.4"
90
+ "@types/node": "^25.5.0",
91
+ "@vitest/browser": "^4.1.2",
92
+ "@vitest/coverage-istanbul": "^4.1.2",
93
+ "@vitest/ui": "^4.1.2",
94
+ "happy-dom": "^20.8.8",
95
+ "typescript": "6.0.2",
96
+ "vite": "^8.0.3",
97
+ "vitest": "^4.1.2"
98
98
  },
99
99
  "engines": {
100
100
  "node": ">=20",
package/plugin/index.mjs CHANGED
@@ -5,7 +5,7 @@
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { dirname, join, resolve } from "node:path";
7
7
  import process from "node:process";
8
- import { transformWithEsbuild } from "vite";
8
+ import { transformWithOxc } from "vite";
9
9
  import { routes } from "../router/routes.mjs";
10
10
  import { generateRoute, getRoutes } from "./helpers.mjs";
11
11
 
@@ -89,7 +89,7 @@ export default function VitePluginVanJS(options = {}) {
89
89
  "@vanjs/jsx": toAbsolute("../jsx"),
90
90
  },
91
91
  },
92
- esbuild: {
92
+ oxc: {
93
93
  jsx: "automatic",
94
94
  jsxImportSource: "@vanjs/jsx",
95
95
  },
@@ -175,7 +175,7 @@ export default function VitePluginVanJS(options = {}) {
175
175
  isResolvedVanFile || (source === "vanjs-core" && !isSetupFile)
176
176
  ? "@vanjs/van"
177
177
  : isResolvedVanXFile ||
178
- (source === "vanjs-ext" && /* istanbul ignore next */
178
+ (source === "vanjs-ext" && /* istanbul ignore next @preserve */
179
179
  !isImportedVanXFile)
180
180
  ? "@vanjs/vanX"
181
181
  : isResolvedSetupFile && (!ssr && isSetupFile || ssr && !isSetupFile)
@@ -214,14 +214,14 @@ ${currentRoutes.map(generateRoute).join("\n")}
214
214
  ${
215
215
  ops.ssr && currentRoutes.length
216
216
  ? `console.log(\`🍦 @vanjs/router registered ${currentRoutes.length} routes.\`)`
217
- : /* istanbul ignore next - satisfied */ ""
217
+ : /* istanbul ignore next @preserve - satisfied */ ""
218
218
  }
219
219
  `;
220
220
 
221
- const result = await transformWithEsbuild(
221
+ const result = await transformWithOxc(
222
222
  routesScript,
223
223
  id,
224
- { loader: "js" },
224
+ { lang: "js" },
225
225
  );
226
226
 
227
227
  return {
package/plugin/types.d.ts CHANGED
@@ -8,8 +8,8 @@ export * from "../client/types.d.ts";
8
8
  import type { PluginOption } from "vite";
9
9
 
10
10
  export type VanJSPluginOptions = {
11
- routesDir: string;
12
- extensions: string[];
11
+ routesDir?: string;
12
+ extensions?: string[];
13
13
  };
14
14
 
15
15
  export declare const VitePluginVanJS: (
package/tsconfig.json CHANGED
@@ -2,8 +2,6 @@
2
2
  // https://janessagarrow.com/blog/typescript-and-esbuild/
3
3
  "compilerOptions": {
4
4
  "lib": ["DOM", "ESNext", "DOM.Iterable"],
5
- "rootDir": "./",
6
- "baseUrl": "./",
7
5
  "module": "ESNext",
8
6
  "target": "ESNext",
9
7
  "moduleResolution": "Bundler",