@void/solid 0.10.10 → 0.10.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/dist/plugin.mjs +37 -95
- package/package.json +4 -4
package/dist/plugin.mjs
CHANGED
|
@@ -1,105 +1,47 @@
|
|
|
1
1
|
import solid from "vite-plugin-solid";
|
|
2
2
|
import { generateComponentManifest, resolveEffectiveLayoutChain, resolvePagesDir, resolveStaticPageDataBuildOptions, scanPages } from "void/pages";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
|
+
import nodePath from "node:path";
|
|
4
5
|
import { normalizePath } from "vite";
|
|
5
6
|
import { ISLANDS_CLIENT_ENTRY_ID, ISLANDS_RENDERER_ID, computePagesNeedingClientJS, extractCssImports, needsIslandClientBundle, resolveSpecifier, rewriteCssImportForVirtualModule, watchPagesForRescan } from "void/pages-islands-plugin";
|
|
6
|
-
//#region ../../node_modules/.pnpm/
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
const resolve = function(...arguments_) {
|
|
20
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
21
|
-
let resolvedPath = "";
|
|
22
|
-
let resolvedAbsolute = false;
|
|
23
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
24
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
25
|
-
if (!path || path.length === 0) continue;
|
|
26
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
27
|
-
resolvedAbsolute = isAbsolute(path);
|
|
28
|
-
}
|
|
29
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
30
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
31
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
32
|
-
};
|
|
33
|
-
function normalizeString(path, allowAboveRoot) {
|
|
34
|
-
let res = "";
|
|
35
|
-
let lastSegmentLength = 0;
|
|
36
|
-
let lastSlash = -1;
|
|
37
|
-
let dots = 0;
|
|
38
|
-
let char = null;
|
|
39
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
40
|
-
if (index < path.length) char = path[index];
|
|
41
|
-
else if (char === "/") break;
|
|
42
|
-
else char = "/";
|
|
43
|
-
if (char === "/") {
|
|
44
|
-
if (lastSlash === index - 1 || dots === 1);
|
|
45
|
-
else if (dots === 2) {
|
|
46
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
47
|
-
if (res.length > 2) {
|
|
48
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
49
|
-
if (lastSlashIndex === -1) {
|
|
50
|
-
res = "";
|
|
51
|
-
lastSegmentLength = 0;
|
|
52
|
-
} else {
|
|
53
|
-
res = res.slice(0, lastSlashIndex);
|
|
54
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
55
|
-
}
|
|
56
|
-
lastSlash = index;
|
|
57
|
-
dots = 0;
|
|
58
|
-
continue;
|
|
59
|
-
} else if (res.length > 0) {
|
|
60
|
-
res = "";
|
|
61
|
-
lastSegmentLength = 0;
|
|
62
|
-
lastSlash = index;
|
|
63
|
-
dots = 0;
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (allowAboveRoot) {
|
|
68
|
-
res += res.length > 0 ? "/.." : "..";
|
|
69
|
-
lastSegmentLength = 2;
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
73
|
-
else res = path.slice(lastSlash + 1, index);
|
|
74
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
75
|
-
}
|
|
76
|
-
lastSlash = index;
|
|
77
|
-
dots = 0;
|
|
78
|
-
} else if (char === "." && dots !== -1) ++dots;
|
|
79
|
-
else dots = -1;
|
|
80
|
-
}
|
|
81
|
-
return res;
|
|
7
|
+
//#region ../../node_modules/.pnpm/pathslash@0.1.0/node_modules/pathslash/dist/index.mjs
|
|
8
|
+
const BACKSLASH_RE = /\\/g;
|
|
9
|
+
const isWindows = process.platform === "win32";
|
|
10
|
+
/**
|
|
11
|
+
* Flip backslashes to forward slashes, used to slash-ify `node:path.win32`
|
|
12
|
+
* output. `\\?\` (extended-length) paths are left untouched: there a forward
|
|
13
|
+
* slash is a literal character, not a separator.
|
|
14
|
+
*/
|
|
15
|
+
const toForwardSlash = (path) => path.startsWith("\\\\?\\") ? path : path.replace(BACKSLASH_RE, "/");
|
|
16
|
+
const w = nodePath.win32;
|
|
17
|
+
function slashed(fn) {
|
|
18
|
+
return (...args) => toForwardSlash(fn(...args));
|
|
82
19
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
20
|
+
const win32 = {
|
|
21
|
+
resolve: slashed(w.resolve),
|
|
22
|
+
normalize: slashed(w.normalize),
|
|
23
|
+
join: slashed(w.join),
|
|
24
|
+
relative: slashed(w.relative),
|
|
25
|
+
dirname: slashed(w.dirname),
|
|
26
|
+
format: slashed(w.format),
|
|
27
|
+
parse: (path) => {
|
|
28
|
+
const parsed = w.parse(path);
|
|
29
|
+
parsed.root = toForwardSlash(parsed.root);
|
|
30
|
+
parsed.dir = toForwardSlash(parsed.dir);
|
|
31
|
+
return parsed;
|
|
32
|
+
},
|
|
33
|
+
basename: w.basename,
|
|
34
|
+
extname: w.extname,
|
|
35
|
+
isAbsolute: w.isAbsolute,
|
|
36
|
+
matchesGlob: w.matchesGlob,
|
|
37
|
+
toNamespacedPath: w.toNamespacedPath,
|
|
38
|
+
delimiter: w.delimiter,
|
|
39
|
+
sep: "/"
|
|
102
40
|
};
|
|
41
|
+
const posix = { ...nodePath.posix };
|
|
42
|
+
posix.posix = win32.posix = posix;
|
|
43
|
+
posix.win32 = win32.win32 = win32;
|
|
44
|
+
const { basename, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, parse, relative, resolve, sep, toNamespacedPath } = isWindows ? win32 : posix;
|
|
103
45
|
//#endregion
|
|
104
46
|
//#region src/plugin-islands.ts
|
|
105
47
|
const COMPONENT_EXTENSIONS = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@void/solid",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.12",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/voidzero-dev/void.git",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^26.1.0",
|
|
42
|
-
"
|
|
42
|
+
"pathslash": "^0.1.0",
|
|
43
43
|
"solid-js": "^1.9.14",
|
|
44
44
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.2",
|
|
45
45
|
"vite-plus": "^0.2.2",
|
|
46
|
-
"void": "0.10.
|
|
46
|
+
"void": "0.10.12"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"solid-js": "^1.9.0",
|
|
50
50
|
"vite": "^8.0.0",
|
|
51
|
-
"void": "0.10.
|
|
51
|
+
"void": "0.10.12"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "vp pack",
|