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 +0 -5
- package/package.json +9 -9
- package/plugin/index.mjs +6 -6
- package/plugin/types.d.ts +2 -2
- package/tsconfig.json +0 -2
package/README.md
CHANGED
|
@@ -4,11 +4,6 @@
|
|
|
4
4
|
[](https://github.com/thednp/vite-plugin-vanjs/actions/workflows/ci.yml)
|
|
5
5
|
[](https://www.npmjs.com/package/vite-plugin-vanjs)
|
|
6
6
|
[](http://npm-stat.com/charts.html?package=vite-plugin-vanjs)
|
|
7
|
-
[](https://www.typescriptlang.org/)
|
|
8
|
-
[](https://github.com/vanjs-org/van)
|
|
9
|
-
[](https://github.com/vanjs-org/mini-van-plate)
|
|
10
|
-
[](https://www.vitest.dev/)
|
|
11
|
-
[](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.
|
|
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": "^
|
|
91
|
-
"@vitest/browser": "^
|
|
92
|
-
"@vitest/coverage-istanbul": "^
|
|
93
|
-
"@vitest/ui": "^
|
|
94
|
-
"happy-dom": "^
|
|
95
|
-
"typescript": "
|
|
96
|
-
"vite": "^
|
|
97
|
-
"vitest": "^
|
|
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 {
|
|
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
|
-
|
|
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
|
|
221
|
+
const result = await transformWithOxc(
|
|
222
222
|
routesScript,
|
|
223
223
|
id,
|
|
224
|
-
{
|
|
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
|
|
12
|
-
extensions
|
|
11
|
+
routesDir?: string;
|
|
12
|
+
extensions?: string[];
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export declare const VitePluginVanJS: (
|
package/tsconfig.json
CHANGED