@vp-tw/dirwell 0.0.0-stage → 0.1.0-alpha.1
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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +182 -2
- package/THEME_PACKAGE_CONTRACT.md +64 -0
- package/THEMING.md +88 -0
- package/THIRD_PARTY_NOTICES.md +14 -0
- package/dist/bin.d.mts +1 -0
- package/dist/bin.mjs +306 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/bun.d.mts +7 -0
- package/dist/bun.mjs +7 -0
- package/dist/bun.mjs.map +1 -0
- package/dist/config-BJG2Zc3Q.d.mts +34 -0
- package/dist/dev-server-Q7NC1wiB.mjs +132 -0
- package/dist/dev-server-Q7NC1wiB.mjs.map +1 -0
- package/dist/esbuild.d.mts +7 -0
- package/dist/esbuild.mjs +7 -0
- package/dist/esbuild.mjs.map +1 -0
- package/dist/farm.d.mts +7 -0
- package/dist/farm.mjs +7 -0
- package/dist/farm.mjs.map +1 -0
- package/dist/generator-CtX3iHhK.mjs +1783 -0
- package/dist/generator-CtX3iHhK.mjs.map +1 -0
- package/dist/index.d.mts +47 -0
- package/dist/index.mjs +74 -0
- package/dist/index.mjs.map +1 -0
- package/dist/model-CWjYM17j.d.mts +100 -0
- package/dist/rolldown.d.mts +7 -0
- package/dist/rolldown.mjs +7 -0
- package/dist/rolldown.mjs.map +1 -0
- package/dist/rollup.d.mts +7 -0
- package/dist/rollup.mjs +7 -0
- package/dist/rollup.mjs.map +1 -0
- package/dist/rsbuild.d.mts +7 -0
- package/dist/rsbuild.mjs +7 -0
- package/dist/rsbuild.mjs.map +1 -0
- package/dist/rspack.d.mts +7 -0
- package/dist/rspack.mjs +7 -0
- package/dist/rspack.mjs.map +1 -0
- package/dist/theme-components-CXzvdQY-.mjs +8 -0
- package/dist/theme-components-CXzvdQY-.mjs.map +1 -0
- package/dist/theme-components-DW0fv9_C.d.mts +141 -0
- package/dist/theme-components.d.mts +2 -0
- package/dist/theme-components.mjs +2 -0
- package/dist/theme-runtime.js +1128 -0
- package/dist/theme-worker.js +27 -0
- package/dist/unplugin-CKRUCTgW.d.mts +16 -0
- package/dist/unplugin-p6AXhL4F.mjs +421 -0
- package/dist/unplugin-p6AXhL4F.mjs.map +1 -0
- package/dist/unplugin.d.mts +2 -0
- package/dist/unplugin.mjs +2 -0
- package/dist/vite-JBsvRvuW.mjs +282 -0
- package/dist/vite-JBsvRvuW.mjs.map +1 -0
- package/dist/vite.d.mts +12 -0
- package/dist/vite.mjs +2 -0
- package/dist/vscode-icons/NOTICE.txt +16 -0
- package/dist/vscode-icons/default_file.svg +1 -0
- package/dist/vscode-icons/default_folder.svg +1 -0
- package/dist/vscode-icons/file_type_css.svg +1 -0
- package/dist/vscode-icons/file_type_html.svg +1 -0
- package/dist/vscode-icons/file_type_image.svg +1 -0
- package/dist/vscode-icons/file_type_js.svg +1 -0
- package/dist/vscode-icons/file_type_json.svg +1 -0
- package/dist/vscode-icons/file_type_markdown.svg +1 -0
- package/dist/vscode-icons/file_type_pdf2.svg +1 -0
- package/dist/vscode-icons/file_type_shell.svg +1 -0
- package/dist/vscode-icons/file_type_text.svg +1 -0
- package/dist/vscode-icons/file_type_typescript.svg +1 -0
- package/dist/vscode-icons/file_type_yaml.svg +1 -0
- package/dist/vscode-icons/file_type_zip.svg +1 -0
- package/dist/webpack.d.mts +7 -0
- package/dist/webpack.mjs +7 -0
- package/dist/webpack.mjs.map +1 -0
- package/package.json +133 -4
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { g as selectSourcePaths, h as validateConfig, i as generateExplorerSkippingPaths, m as resolveGenerateOptions, p as loadDirwellConfig, r as generateExplorer } from "./generator-CtX3iHhK.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { lstat, mkdtemp, readFile, readdir, readlink, realpath, rm, stat, writeFile } from "node:fs/promises";
|
|
4
|
+
import { createReadStream } from "node:fs";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import { createVitePlugin } from "unplugin";
|
|
7
|
+
//#region src/plugin-safety.ts
|
|
8
|
+
function isWithin(parent, candidate) {
|
|
9
|
+
const relative = path.relative(parent, candidate);
|
|
10
|
+
return relative === "" || relative !== ".." && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
|
|
11
|
+
}
|
|
12
|
+
async function canonicalPath(candidate) {
|
|
13
|
+
const missing = [];
|
|
14
|
+
let existing = candidate;
|
|
15
|
+
while (true) try {
|
|
16
|
+
return path.join(await realpath(existing), ...missing.reverse());
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (error.code !== "ENOENT") throw error;
|
|
19
|
+
const parent = path.dirname(existing);
|
|
20
|
+
if (parent === existing) throw error;
|
|
21
|
+
missing.push(path.basename(existing));
|
|
22
|
+
existing = parent;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function assertSafeMirroredSymlinks(options) {
|
|
26
|
+
const sourceDir = path.resolve(options.sourceDir);
|
|
27
|
+
const outputDir = path.resolve(options.outputDir);
|
|
28
|
+
const selection = await selectSourcePaths(sourceDir, outputDir, options.include, options.exclude);
|
|
29
|
+
async function visit(directory) {
|
|
30
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
31
|
+
const entryPath = path.join(directory, entry.name);
|
|
32
|
+
if (isWithin(outputDir, entryPath)) continue;
|
|
33
|
+
const relativePath = path.relative(sourceDir, entryPath).split(path.sep).join("/");
|
|
34
|
+
if (!selection.selected.has(relativePath)) continue;
|
|
35
|
+
if (entry.isSymbolicLink()) {
|
|
36
|
+
const target = await readlink(entryPath);
|
|
37
|
+
if (path.isAbsolute(target) || !isWithin(sourceDir, path.resolve(directory, target))) throw new Error(`Dirwell cannot mirror a symlink outside its output: ${entryPath}`);
|
|
38
|
+
} else if (entry.isDirectory()) await visit(entryPath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
await visit(sourceDir);
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/vite.ts
|
|
45
|
+
const ownershipMarker = ".dirwell-vite-output";
|
|
46
|
+
const contentTypes = {
|
|
47
|
+
".css": "text/css; charset=utf-8",
|
|
48
|
+
".html": "text/html; charset=utf-8",
|
|
49
|
+
".js": "text/javascript; charset=utf-8",
|
|
50
|
+
".json": "application/json; charset=utf-8",
|
|
51
|
+
".svg": "image/svg+xml",
|
|
52
|
+
".txt": "text/plain; charset=utf-8"
|
|
53
|
+
};
|
|
54
|
+
function mountPath(base) {
|
|
55
|
+
const pathname = /^https?:\/\//i.test(base) ? new URL(base).pathname : base;
|
|
56
|
+
if (!pathname.startsWith("/")) throw new TypeError("Dirwell base must be an absolute URL path");
|
|
57
|
+
return `${pathname.replace(/\/+$/, "")}/`;
|
|
58
|
+
}
|
|
59
|
+
function defaultBase(config, relativeOutput) {
|
|
60
|
+
const viteBase = config.base;
|
|
61
|
+
if (!viteBase.startsWith("/") && !/^https?:\/\//i.test(viteBase)) throw new TypeError("Set Dirwell base when Vite uses a relative base");
|
|
62
|
+
const suffix = relativeOutput.split(path.sep).map(encodeURIComponent).join("/");
|
|
63
|
+
return `${viteBase.replace(/\/+$/, "")}/${suffix}/`;
|
|
64
|
+
}
|
|
65
|
+
async function assertOwnedDestination(outputDir) {
|
|
66
|
+
let info;
|
|
67
|
+
try {
|
|
68
|
+
info = await lstat(outputDir);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (error.code === "ENOENT") return;
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
if (!info.isDirectory() || info.isSymbolicLink()) throw new Error(`Dirwell outDir is not an owned directory: ${outputDir}`);
|
|
74
|
+
let marker;
|
|
75
|
+
try {
|
|
76
|
+
marker = await readFile(path.join(outputDir, ownershipMarker), "utf8");
|
|
77
|
+
} catch {
|
|
78
|
+
throw new Error(`Dirwell refuses to replace an unowned outDir: ${outputDir}`);
|
|
79
|
+
}
|
|
80
|
+
if (marker !== "dirwell-vite-v1\n") throw new Error(`Dirwell refuses to replace an unowned outDir: ${outputDir}`);
|
|
81
|
+
}
|
|
82
|
+
function createDirwellPlugin(inlineOptions, destinations) {
|
|
83
|
+
return createVitePlugin(() => {
|
|
84
|
+
let viteConfig;
|
|
85
|
+
let runtime;
|
|
86
|
+
let server;
|
|
87
|
+
let temporary;
|
|
88
|
+
let temporaryReal;
|
|
89
|
+
let pending = Promise.resolve();
|
|
90
|
+
let timer;
|
|
91
|
+
let closed = false;
|
|
92
|
+
let watchListener;
|
|
93
|
+
async function rebuild() {
|
|
94
|
+
if (closed || temporary === void 0) return;
|
|
95
|
+
try {
|
|
96
|
+
if (runtime.generate.mirror !== false) await assertSafeMirroredSymlinks(runtime.generate);
|
|
97
|
+
await generateExplorerSkippingPaths({
|
|
98
|
+
...runtime.generate,
|
|
99
|
+
outputDir: temporary
|
|
100
|
+
}, [runtime.outputDir]);
|
|
101
|
+
server?.ws.send({ type: "full-reload" });
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
104
|
+
server?.config.logger.error(`Dirwell rebuild failed: ${message}`);
|
|
105
|
+
server?.ws.send({
|
|
106
|
+
type: "error",
|
|
107
|
+
err: {
|
|
108
|
+
message,
|
|
109
|
+
stack: error instanceof Error ? error.stack ?? message : message
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
name: "dirwell:vite",
|
|
116
|
+
vite: {
|
|
117
|
+
async configResolved(config) {
|
|
118
|
+
viteConfig = config;
|
|
119
|
+
const projectRoot = path.resolve(inlineOptions?.cwd ?? config.root);
|
|
120
|
+
const viteOutput = path.resolve(config.root, config.build.outDir);
|
|
121
|
+
const { config: fileConfig } = await loadDirwellConfig(projectRoot, config.command === "build" ? "build" : "serve");
|
|
122
|
+
const merged = {
|
|
123
|
+
urls: "base",
|
|
124
|
+
...fileConfig,
|
|
125
|
+
...inlineOptions
|
|
126
|
+
};
|
|
127
|
+
validateConfig(merged);
|
|
128
|
+
const outputDir = path.resolve(projectRoot, merged.outDir ?? path.join(viteOutput, inlineOptions?.outputPath ?? "dirwell"));
|
|
129
|
+
const canonicalOutput = await canonicalPath(outputDir);
|
|
130
|
+
const canonicalViteOutput = await canonicalPath(viteOutput);
|
|
131
|
+
if (isWithin(canonicalOutput, canonicalViteOutput)) throw new Error("Dirwell outDir must not contain the Vite build output directory");
|
|
132
|
+
const relativeOutput = path.relative(canonicalViteOutput, canonicalOutput);
|
|
133
|
+
if (!isWithin(canonicalViteOutput, canonicalOutput) && merged.base === void 0) throw new Error("Dirwell base is required when outDir is outside Vite build.outDir");
|
|
134
|
+
const base = merged.base ?? defaultBase(config, relativeOutput);
|
|
135
|
+
const publicMount = mountPath(base);
|
|
136
|
+
if (destinations !== void 0) {
|
|
137
|
+
for (const destination of destinations) {
|
|
138
|
+
if (isWithin(destination.outputDir, canonicalOutput) || isWithin(canonicalOutput, destination.outputDir)) throw new Error("Dirwell options array has overlapping outDir paths");
|
|
139
|
+
if (publicMount.startsWith(destination.publicMount) || destination.publicMount.startsWith(publicMount)) throw new Error("Dirwell options array has overlapping base paths");
|
|
140
|
+
}
|
|
141
|
+
destinations.push({
|
|
142
|
+
outputDir: canonicalOutput,
|
|
143
|
+
publicMount
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const hostMount = config.base.startsWith("/") || /^https?:\/\//i.test(config.base) ? mountPath(config.base) : null;
|
|
147
|
+
if (publicMount === "/" || publicMount === hostMount) throw new Error("Dirwell base must use a dedicated path within the Vite server");
|
|
148
|
+
const generate = resolveGenerateOptions(projectRoot, {
|
|
149
|
+
...merged,
|
|
150
|
+
base,
|
|
151
|
+
outDir: outputDir
|
|
152
|
+
});
|
|
153
|
+
if (isWithin(canonicalOutput, await canonicalPath(generate.sourceDir))) throw new Error("Dirwell outDir must not contain the source directory");
|
|
154
|
+
runtime = {
|
|
155
|
+
sourceDir: generate.sourceDir,
|
|
156
|
+
sourceReal: await canonicalPath(generate.sourceDir),
|
|
157
|
+
outputDir,
|
|
158
|
+
base,
|
|
159
|
+
generate
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
async writeBundle() {
|
|
163
|
+
if (viteConfig.command !== "build" || viteConfig.build.ssr) return;
|
|
164
|
+
await assertOwnedDestination(runtime.outputDir);
|
|
165
|
+
if (runtime.generate.mirror !== false) await assertSafeMirroredSymlinks(runtime.generate);
|
|
166
|
+
await generateExplorer(runtime.generate);
|
|
167
|
+
await writeFile(path.join(runtime.outputDir, ownershipMarker), "dirwell-vite-v1\n");
|
|
168
|
+
},
|
|
169
|
+
async configureServer(viteServer) {
|
|
170
|
+
server = viteServer;
|
|
171
|
+
closed = false;
|
|
172
|
+
temporary = await mkdtemp(path.join(tmpdir(), "dirwell-vite-"));
|
|
173
|
+
temporaryReal = await realpath(temporary);
|
|
174
|
+
try {
|
|
175
|
+
if (runtime.generate.mirror !== false) await assertSafeMirroredSymlinks(runtime.generate);
|
|
176
|
+
await generateExplorerSkippingPaths({
|
|
177
|
+
...runtime.generate,
|
|
178
|
+
outputDir: temporary
|
|
179
|
+
}, [runtime.outputDir]);
|
|
180
|
+
} catch (error) {
|
|
181
|
+
await rm(temporary, {
|
|
182
|
+
recursive: true,
|
|
183
|
+
force: true
|
|
184
|
+
});
|
|
185
|
+
temporary = void 0;
|
|
186
|
+
temporaryReal = void 0;
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
const publicMount = mountPath(runtime.base);
|
|
190
|
+
viteServer.middlewares.use(async (request, response, next) => {
|
|
191
|
+
const pathname = new URL(request.url ?? "/", "http://localhost").pathname;
|
|
192
|
+
if (pathname === publicMount.slice(0, -1)) {
|
|
193
|
+
response.writeHead(308, { location: publicMount }).end();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (!pathname.startsWith(publicMount)) return next();
|
|
197
|
+
let relative;
|
|
198
|
+
try {
|
|
199
|
+
relative = decodeURIComponent(pathname.slice(publicMount.length));
|
|
200
|
+
} catch {
|
|
201
|
+
response.writeHead(400).end("Invalid path");
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
let filePath = path.resolve(temporary, relative);
|
|
205
|
+
if (!isWithin(temporary, filePath)) {
|
|
206
|
+
response.writeHead(403).end("Forbidden");
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
if ((await stat(filePath)).isDirectory()) filePath = path.join(filePath, "index.html");
|
|
211
|
+
if (!isWithin(temporaryReal, await realpath(filePath))) {
|
|
212
|
+
response.writeHead(403).end("Forbidden");
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const fileStats = await stat(filePath);
|
|
216
|
+
if (!fileStats.isFile()) {
|
|
217
|
+
response.writeHead(404).end("Not found");
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const extension = path.extname(filePath).toLowerCase();
|
|
221
|
+
const headers = {
|
|
222
|
+
"cache-control": "no-store",
|
|
223
|
+
"content-type": contentTypes[extension] ?? "application/octet-stream"
|
|
224
|
+
};
|
|
225
|
+
if (extension === ".html") {
|
|
226
|
+
const clientPath = `${mountPath(viteServer.config.base)}@vite/client`;
|
|
227
|
+
const html = await readFile(filePath, "utf8");
|
|
228
|
+
const client = `<script type="module" src="${clientPath}"><\/script>`;
|
|
229
|
+
const contents = html.includes("</body>") ? html.replace("</body>", `${client}</body>`) : `${html}${client}`;
|
|
230
|
+
response.writeHead(200, headers).end(contents);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
headers["content-length"] = fileStats.size;
|
|
234
|
+
response.writeHead(200, headers);
|
|
235
|
+
createReadStream(filePath).on("error", (error) => response.destroy(error)).pipe(response);
|
|
236
|
+
} catch (error) {
|
|
237
|
+
if (error.code === "ENOENT") {
|
|
238
|
+
response.writeHead(404).end("Not found");
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
next(error);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
watchListener = (_event, changedPath) => {
|
|
245
|
+
const changed = path.resolve(changedPath);
|
|
246
|
+
if (!isWithin(runtime.sourceDir, changed) && !isWithin(runtime.sourceReal, changed)) return;
|
|
247
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
248
|
+
timer = setTimeout(() => {
|
|
249
|
+
pending = pending.then(rebuild);
|
|
250
|
+
}, 75);
|
|
251
|
+
};
|
|
252
|
+
viteServer.watcher.add(runtime.sourceDir);
|
|
253
|
+
viteServer.watcher.on("all", watchListener);
|
|
254
|
+
},
|
|
255
|
+
async closeServer() {
|
|
256
|
+
closed = true;
|
|
257
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
258
|
+
if (watchListener !== void 0) server?.watcher.off("all", watchListener);
|
|
259
|
+
await pending;
|
|
260
|
+
if (temporary !== void 0) await rm(temporary, {
|
|
261
|
+
recursive: true,
|
|
262
|
+
force: true
|
|
263
|
+
});
|
|
264
|
+
temporary = void 0;
|
|
265
|
+
temporaryReal = void 0;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
})(inlineOptions);
|
|
270
|
+
}
|
|
271
|
+
function dirwellVite(options) {
|
|
272
|
+
if (Array.isArray(options)) {
|
|
273
|
+
if (options.length === 0) throw new TypeError("Dirwell options array must not be empty");
|
|
274
|
+
const destinations = [];
|
|
275
|
+
return options.map((entry) => createDirwellPlugin(entry, destinations));
|
|
276
|
+
}
|
|
277
|
+
return createDirwellPlugin(options);
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
export { isWithin as i, assertSafeMirroredSymlinks as n, canonicalPath as r, dirwellVite as t };
|
|
281
|
+
|
|
282
|
+
//# sourceMappingURL=vite-JBsvRvuW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-JBsvRvuW.mjs","names":[],"sources":["../src/plugin-safety.ts","../src/vite.ts"],"sourcesContent":["import { readdir, readlink, realpath } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { selectSourcePaths } from \"./filters.ts\";\nimport type { GenerateOptions } from \"./model.ts\";\n\nexport function isWithin(parent: string, candidate: string): boolean {\n const relative = path.relative(parent, candidate);\n return (\n relative === \"\" ||\n (relative !== \"..\" && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative))\n );\n}\n\nexport async function canonicalPath(candidate: string): Promise<string> {\n const missing: string[] = [];\n let existing = candidate;\n while (true) {\n try {\n return path.join(await realpath(existing), ...missing.reverse());\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n const parent = path.dirname(existing);\n if (parent === existing) throw error;\n missing.push(path.basename(existing));\n existing = parent;\n }\n }\n}\n\nexport async function assertSafeMirroredSymlinks(options: GenerateOptions): Promise<void> {\n const sourceDir = path.resolve(options.sourceDir);\n const outputDir = path.resolve(options.outputDir);\n const selection = await selectSourcePaths(sourceDir, outputDir, options.include, options.exclude);\n async function visit(directory: string): Promise<void> {\n for (const entry of await readdir(directory, { withFileTypes: true })) {\n const entryPath = path.join(directory, entry.name);\n if (isWithin(outputDir, entryPath)) continue;\n const relativePath = path.relative(sourceDir, entryPath).split(path.sep).join(\"/\");\n if (!selection.selected.has(relativePath)) continue;\n if (entry.isSymbolicLink()) {\n const target = await readlink(entryPath);\n if (path.isAbsolute(target) || !isWithin(sourceDir, path.resolve(directory, target))) {\n throw new Error(`Dirwell cannot mirror a symlink outside its output: ${entryPath}`);\n }\n } else if (entry.isDirectory()) {\n await visit(entryPath);\n }\n }\n }\n await visit(sourceDir);\n}\n","import { lstat, mkdtemp, readFile, realpath, rm, stat, writeFile } from \"node:fs/promises\";\nimport { createReadStream } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\nimport { createVitePlugin } from \"unplugin\";\nimport type { ResolvedConfig, ViteDevServer } from \"vite\";\nimport {\n loadDirwellConfig,\n resolveGenerateOptions,\n validateConfig,\n type DirwellConfig,\n} from \"./config.ts\";\nimport { generateExplorer, generateExplorerSkippingPaths } from \"./generator.ts\";\nimport { assertSafeMirroredSymlinks, canonicalPath, isWithin } from \"./plugin-safety.ts\";\n\n/** Dirwell configuration with an output path relative to the Vite project root or absolute. */\nexport type DirwellViteOptions = Omit<DirwellConfig, \"extends\" | \"server\"> & {\n readonly cwd?: string;\n readonly outputPath?: string;\n};\n\nconst ownershipMarker = \".dirwell-vite-output\";\nconst contentTypes: Readonly<Record<string, string>> = {\n \".css\": \"text/css; charset=utf-8\",\n \".html\": \"text/html; charset=utf-8\",\n \".js\": \"text/javascript; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".svg\": \"image/svg+xml\",\n \".txt\": \"text/plain; charset=utf-8\",\n};\n\nfunction mountPath(base: string): string {\n const pathname = /^https?:\\/\\//i.test(base) ? new URL(base).pathname : base;\n if (!pathname.startsWith(\"/\")) throw new TypeError(\"Dirwell base must be an absolute URL path\");\n return `${pathname.replace(/\\/+$/, \"\")}/`;\n}\n\nfunction defaultBase(config: ResolvedConfig, relativeOutput: string): string {\n const viteBase = config.base;\n if (!viteBase.startsWith(\"/\") && !/^https?:\\/\\//i.test(viteBase)) {\n throw new TypeError(\"Set Dirwell base when Vite uses a relative base\");\n }\n const suffix = relativeOutput.split(path.sep).map(encodeURIComponent).join(\"/\");\n return `${viteBase.replace(/\\/+$/, \"\")}/${suffix}/`;\n}\n\nasync function assertOwnedDestination(outputDir: string): Promise<void> {\n let info;\n try {\n info = await lstat(outputDir);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return;\n throw error;\n }\n if (!info.isDirectory() || info.isSymbolicLink()) {\n throw new Error(`Dirwell outDir is not an owned directory: ${outputDir}`);\n }\n let marker: string;\n try {\n marker = await readFile(path.join(outputDir, ownershipMarker), \"utf8\");\n } catch {\n throw new Error(`Dirwell refuses to replace an unowned outDir: ${outputDir}`);\n }\n if (marker !== \"dirwell-vite-v1\\n\") {\n throw new Error(`Dirwell refuses to replace an unowned outDir: ${outputDir}`);\n }\n}\n\ninterface RuntimeOptions {\n readonly sourceDir: string;\n readonly sourceReal: string;\n readonly outputDir: string;\n readonly base: string;\n readonly generate: Parameters<typeof generateExplorer>[0];\n}\n\ninterface PluginDestination {\n readonly outputDir: string;\n readonly publicMount: string;\n}\n\nfunction createDirwellPlugin(\n inlineOptions: DirwellViteOptions | undefined,\n destinations?: PluginDestination[],\n): import(\"vite\").Plugin {\n const factory = createVitePlugin<DirwellViteOptions | undefined, false>(() => {\n let viteConfig: ResolvedConfig;\n let runtime: RuntimeOptions;\n let server: ViteDevServer | undefined;\n let temporary: string | undefined;\n let temporaryReal: string | undefined;\n let pending = Promise.resolve();\n let timer: ReturnType<typeof setTimeout> | undefined;\n let closed = false;\n let watchListener: ((event: string, changedPath: string) => void) | undefined;\n\n async function rebuild(): Promise<void> {\n if (closed || temporary === undefined) return;\n try {\n if (runtime.generate.mirror !== false) {\n await assertSafeMirroredSymlinks(runtime.generate);\n }\n await generateExplorerSkippingPaths({ ...runtime.generate, outputDir: temporary }, [\n runtime.outputDir,\n ]);\n server?.ws.send({ type: \"full-reload\" });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n server?.config.logger.error(`Dirwell rebuild failed: ${message}`);\n server?.ws.send({\n type: \"error\",\n err: { message, stack: error instanceof Error ? (error.stack ?? message) : message },\n });\n }\n }\n\n return {\n name: \"dirwell:vite\",\n vite: {\n async configResolved(config) {\n viteConfig = config;\n const projectRoot = path.resolve(inlineOptions?.cwd ?? config.root);\n const viteOutput = path.resolve(config.root, config.build.outDir);\n const { config: fileConfig } = await loadDirwellConfig(\n projectRoot,\n config.command === \"build\" ? \"build\" : \"serve\",\n );\n const merged = { urls: \"base\" as const, ...fileConfig, ...inlineOptions };\n validateConfig(merged);\n const outputDir = path.resolve(\n projectRoot,\n merged.outDir ?? path.join(viteOutput, inlineOptions?.outputPath ?? \"dirwell\"),\n );\n const canonicalOutput = await canonicalPath(outputDir);\n const canonicalViteOutput = await canonicalPath(viteOutput);\n if (isWithin(canonicalOutput, canonicalViteOutput)) {\n throw new Error(\"Dirwell outDir must not contain the Vite build output directory\");\n }\n const relativeOutput = path.relative(canonicalViteOutput, canonicalOutput);\n const insideViteOutput = isWithin(canonicalViteOutput, canonicalOutput);\n if (!insideViteOutput && merged.base === undefined) {\n throw new Error(\"Dirwell base is required when outDir is outside Vite build.outDir\");\n }\n const base = merged.base ?? defaultBase(config, relativeOutput);\n const publicMount = mountPath(base);\n if (destinations !== undefined) {\n for (const destination of destinations) {\n if (\n isWithin(destination.outputDir, canonicalOutput) ||\n isWithin(canonicalOutput, destination.outputDir)\n ) {\n throw new Error(\"Dirwell options array has overlapping outDir paths\");\n }\n if (\n publicMount.startsWith(destination.publicMount) ||\n destination.publicMount.startsWith(publicMount)\n ) {\n throw new Error(\"Dirwell options array has overlapping base paths\");\n }\n }\n destinations.push({ outputDir: canonicalOutput, publicMount });\n }\n const hostMount =\n config.base.startsWith(\"/\") || /^https?:\\/\\//i.test(config.base)\n ? mountPath(config.base)\n : null;\n if (publicMount === \"/\" || publicMount === hostMount) {\n throw new Error(\"Dirwell base must use a dedicated path within the Vite server\");\n }\n const generate = resolveGenerateOptions(projectRoot, {\n ...merged,\n base,\n outDir: outputDir,\n });\n if (isWithin(canonicalOutput, await canonicalPath(generate.sourceDir))) {\n throw new Error(\"Dirwell outDir must not contain the source directory\");\n }\n runtime = {\n sourceDir: generate.sourceDir,\n sourceReal: await canonicalPath(generate.sourceDir),\n outputDir,\n base,\n generate,\n };\n },\n async writeBundle() {\n if (viteConfig.command !== \"build\" || viteConfig.build.ssr) return;\n await assertOwnedDestination(runtime.outputDir);\n if (runtime.generate.mirror !== false) {\n await assertSafeMirroredSymlinks(runtime.generate);\n }\n await generateExplorer(runtime.generate);\n await writeFile(path.join(runtime.outputDir, ownershipMarker), \"dirwell-vite-v1\\n\");\n },\n async configureServer(viteServer) {\n server = viteServer;\n closed = false;\n temporary = await mkdtemp(path.join(tmpdir(), \"dirwell-vite-\"));\n temporaryReal = await realpath(temporary);\n try {\n if (runtime.generate.mirror !== false) {\n await assertSafeMirroredSymlinks(runtime.generate);\n }\n await generateExplorerSkippingPaths({ ...runtime.generate, outputDir: temporary }, [\n runtime.outputDir,\n ]);\n } catch (error) {\n await rm(temporary, { recursive: true, force: true });\n temporary = undefined;\n temporaryReal = undefined;\n throw error;\n }\n const publicMount = mountPath(runtime.base);\n viteServer.middlewares.use(async (request, response, next) => {\n const pathname = new URL(request.url ?? \"/\", \"http://localhost\").pathname;\n if (pathname === publicMount.slice(0, -1)) {\n response.writeHead(308, { location: publicMount }).end();\n return;\n }\n if (!pathname.startsWith(publicMount)) return next();\n let relative: string;\n try {\n relative = decodeURIComponent(pathname.slice(publicMount.length));\n } catch {\n response.writeHead(400).end(\"Invalid path\");\n return;\n }\n let filePath = path.resolve(temporary!, relative);\n if (!isWithin(temporary!, filePath)) {\n response.writeHead(403).end(\"Forbidden\");\n return;\n }\n try {\n if ((await stat(filePath)).isDirectory())\n filePath = path.join(filePath, \"index.html\");\n if (!isWithin(temporaryReal!, await realpath(filePath))) {\n response.writeHead(403).end(\"Forbidden\");\n return;\n }\n const fileStats = await stat(filePath);\n if (!fileStats.isFile()) {\n response.writeHead(404).end(\"Not found\");\n return;\n }\n const extension = path.extname(filePath).toLowerCase();\n const headers: Record<string, string | number> = {\n \"cache-control\": \"no-store\",\n \"content-type\": contentTypes[extension] ?? \"application/octet-stream\",\n };\n if (extension === \".html\") {\n const clientPath = `${mountPath(viteServer.config.base)}@vite/client`;\n const html = await readFile(filePath, \"utf8\");\n const client = `<script type=\"module\" src=\"${clientPath}\"></script>`;\n const contents = html.includes(\"</body>\")\n ? html.replace(\"</body>\", `${client}</body>`)\n : `${html}${client}`;\n response.writeHead(200, headers).end(contents);\n return;\n }\n headers[\"content-length\"] = fileStats.size;\n response.writeHead(200, headers);\n createReadStream(filePath)\n .on(\"error\", (error) => response.destroy(error))\n .pipe(response);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n response.writeHead(404).end(\"Not found\");\n return;\n }\n next(error);\n }\n });\n watchListener = (_event, changedPath) => {\n const changed = path.resolve(changedPath);\n if (!isWithin(runtime.sourceDir, changed) && !isWithin(runtime.sourceReal, changed))\n return;\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n pending = pending.then(rebuild);\n }, 75);\n };\n viteServer.watcher.add(runtime.sourceDir);\n viteServer.watcher.on(\"all\", watchListener);\n },\n async closeServer() {\n closed = true;\n if (timer !== undefined) clearTimeout(timer);\n if (watchListener !== undefined) server?.watcher.off(\"all\", watchListener);\n await pending;\n if (temporary !== undefined) await rm(temporary, { recursive: true, force: true });\n temporary = undefined;\n temporaryReal = undefined;\n },\n },\n };\n });\n return factory(inlineOptions) as import(\"vite\").Plugin;\n}\n\nexport default function dirwellVite(options?: DirwellViteOptions): import(\"vite\").Plugin;\nexport default function dirwellVite(\n options: readonly DirwellViteOptions[],\n): import(\"vite\").Plugin[];\nexport default function dirwellVite(\n options?: DirwellViteOptions | readonly DirwellViteOptions[],\n): import(\"vite\").Plugin | import(\"vite\").Plugin[] {\n if (Array.isArray(options)) {\n if (options.length === 0) throw new TypeError(\"Dirwell options array must not be empty\");\n const destinations: PluginDestination[] = [];\n return options.map((entry) => createDirwellPlugin(entry, destinations));\n }\n return createDirwellPlugin(options as DirwellViteOptions | undefined);\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,SAAS,QAAgB,WAA4B;CACnE,MAAM,WAAW,KAAK,SAAS,QAAQ,SAAS;CAChD,OACE,aAAa,MACZ,aAAa,QAAQ,CAAC,SAAS,WAAW,KAAK,KAAK,KAAK,KAAK,CAAC,KAAK,WAAW,QAAQ;AAE5F;AAEA,eAAsB,cAAc,WAAoC;CACtE,MAAM,UAAoB,CAAC;CAC3B,IAAI,WAAW;CACf,OAAO,MACL,IAAI;EACF,OAAO,KAAK,KAAK,MAAM,SAAS,QAAQ,GAAG,GAAG,QAAQ,QAAQ,CAAC;CACjE,SAAS,OAAO;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,KAAA;KACZ,gBAAgB,KAAA;IAClB;GACF;EACF;CACF,CACa,CAAC,CAAC,aAAa;AAC9B;AAMA,SAAwB,YACtB,SACiD;CACjD,IAAI,MAAM,QAAQ,OAAO,GAAG;EAC1B,IAAI,QAAQ,WAAW,GAAG,MAAM,IAAI,UAAU,yCAAyC;EACvF,MAAM,eAAoC,CAAC;EAC3C,OAAO,QAAQ,KAAK,UAAU,oBAAoB,OAAO,YAAY,CAAC;CACxE;CACA,OAAO,oBAAoB,OAAyC;AACtE"}
|
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as DirwellConfig } from "./config-BJG2Zc3Q.mjs";
|
|
2
|
+
//#region src/vite.d.ts
|
|
3
|
+
/** Dirwell configuration with an output path relative to the Vite project root or absolute. */
|
|
4
|
+
export type DirwellViteOptions = Omit<DirwellConfig, "extends" | "server"> & {
|
|
5
|
+
readonly cwd?: string;
|
|
6
|
+
readonly outputPath?: string;
|
|
7
|
+
};
|
|
8
|
+
declare function dirwellVite(options?: DirwellViteOptions): import("vite").Plugin;
|
|
9
|
+
declare function dirwellVite(options: readonly DirwellViteOptions[]): import("vite").Plugin[];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { dirwellVite as default };
|
|
12
|
+
//# sourceMappingURL=vite.d.mts.map
|
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Dirwell includes selected, unmodified icons from vscode-icons.
|
|
2
|
+
Source: https://github.com/vscode-icons/vscode-icons/tree/6b4471cf8dcdeafc9d1203f9156d285fc3e9d552/icons
|
|
3
|
+
Authors: vscode-icons contributors
|
|
4
|
+
Icon license: Creative Commons Attribution-ShareAlike 4.0 International
|
|
5
|
+
https://creativecommons.org/licenses/by-sa/4.0/
|
|
6
|
+
|
|
7
|
+
The icons in this directory are file and folder artwork. The vscode-icons
|
|
8
|
+
project states that branded icons remain subject to their owners' copyright.
|
|
9
|
+
Neither vscode-icons nor those owners endorse Dirwell.
|
|
10
|
+
|
|
11
|
+
Included source filenames:
|
|
12
|
+
default_file.svg, default_folder.svg, file_type_css.svg,
|
|
13
|
+
file_type_html.svg, file_type_image.svg, file_type_js.svg,
|
|
14
|
+
file_type_json.svg, file_type_markdown.svg, file_type_pdf2.svg,
|
|
15
|
+
file_type_shell.svg, file_type_text.svg, file_type_typescript.svg,
|
|
16
|
+
file_type_yaml.svg, file_type_zip.svg.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>default_file</title><path d="M20.414,2H5V30H27V8.586ZM7,28V4H19v6h6V28Z" style="fill:#c5c5c5"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>default_folder</title><path d="M27.5,5.5H18.2L16.1,9.7H4.4V26.5H29.6V5.5Zm0,4.2H19.3l1.1-2.1h7.1Z" style="fill:#c09553"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" aria-labelledby="css-logo-title css-logo-description"><title>CSS Logo</title><g style="display:inline"><path fill="#639" d="M1.995 1.994h23.52a4.48 4.48 0 0 1 4.48 4.48v19.04a4.48 4.48 0 0 1-4.48 4.48H6.475a4.48 4.48 0 0 1-4.48-4.48Z"/><path fill="#fff" d="M9.079 24.87v-4.704c0-1.876 1.204-2.884 3.024-2.884 1.792-.028 2.912 1.148 2.856 3.136h-2.072c.056-.756-.28-1.316-.84-1.288-.7 0-.896.476-.896 1.372v4.088c0 .868.28 1.288.896 1.316.644 0 .896-.644.84-1.372h2.072c.112 2.044-1.176 3.248-2.996 3.22-1.764 0-2.884-.98-2.884-2.884zm6.636-.336h1.932c.028.896.308 1.456.924 1.456.616 0 .84-.364.84-1.204 0-.7-.308-1.092-1.064-1.456l-.728-.336c-1.288-.616-1.82-1.372-1.82-2.884 0-1.68 1.064-2.856 2.8-2.856 1.736 0 2.66 1.204 2.688 3.164h-1.876c0-.812-.168-1.372-.784-1.372-.56 0-.84.28-.84.98s.252.98.924 1.26l.672.308c1.428.672 2.044 1.54 2.044 3.164 0 1.932-1.092 2.996-2.884 2.996-1.792 0-2.8-1.232-2.828-3.22zm6.328 0h1.96c0 .896.308 1.456.896 1.456.588 0 .84-.364.84-1.204 0-.7-.28-1.092-1.064-1.456l-.728-.336c-1.288-.616-1.792-1.372-1.792-2.884 0-1.68 1.036-2.856 2.8-2.856 1.764 0 2.632 1.204 2.688 3.164h-1.876c-.028-.812-.196-1.372-.812-1.372-.56 0-.812.28-.812.98s.224.98.896 1.26l.7.308c1.4.672 2.016 1.54 2.016 3.164 0 1.932-1.092 2.996-2.884 2.996-1.792 0-2.8-1.232-2.828-3.22z"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_html</title><polygon points="5.902 27.201 3.655 2 28.345 2 26.095 27.197 15.985 30 5.902 27.201" style="fill:#e44f26"/><polygon points="16 27.858 24.17 25.593 26.092 4.061 16 4.061 16 27.858" style="fill:#f1662a"/><polygon points="16 13.407 11.91 13.407 11.628 10.242 16 10.242 16 7.151 15.989 7.151 8.25 7.151 8.324 7.981 9.083 16.498 16 16.498 16 13.407" style="fill:#ebebeb"/><polygon points="16 21.434 15.986 21.438 12.544 20.509 12.324 18.044 10.651 18.044 9.221 18.044 9.654 22.896 15.986 24.654 16 24.65 16 21.434" style="fill:#ebebeb"/><polygon points="15.989 13.407 15.989 16.498 19.795 16.498 19.437 20.507 15.989 21.437 15.989 24.653 22.326 22.896 22.372 22.374 23.098 14.237 23.174 13.407 22.341 13.407 15.989 13.407" style="fill:#fff"/><polygon points="15.989 7.151 15.989 9.071 15.989 10.235 15.989 10.242 23.445 10.242 23.445 10.242 23.455 10.242 23.517 9.548 23.658 7.981 23.732 7.151 15.989 7.151" style="fill:#fff"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_image</title><path d="M30,5.851Q30,16,30,26.149H2Q2,16,2,5.851H30" style="fill:#2dcc9f"/><path d="M24.232,8.541a2.2,2.2,0,1,0,1.127.623,2.212,2.212,0,0,0-1.127-.623" style="fill:#fff"/><path d="M18.111,20.1q-2.724-3.788-5.45-7.575Q8.619,18.147,4.579,23.766q5.449,0,10.9,0,1.316-1.832,2.634-3.663" style="fill:#fff"/><path d="M22.057,16q-2.793,3.882-5.584,7.765,5.584,0,11.169,0Q24.851,19.882,22.057,16Z" style="fill:#fff"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_js</title><path d="M18.774,19.7a3.727,3.727,0,0,0,3.376,2.078c1.418,0,2.324-.709,2.324-1.688,0-1.173-.931-1.589-2.491-2.272l-.856-.367c-2.469-1.052-4.11-2.37-4.11-5.156,0-2.567,1.956-4.52,5.012-4.52A5.058,5.058,0,0,1,26.9,10.52l-2.665,1.711a2.327,2.327,0,0,0-2.2-1.467,1.489,1.489,0,0,0-1.638,1.467c0,1.027.636,1.442,2.1,2.078l.856.366c2.908,1.247,4.549,2.518,4.549,5.376,0,3.081-2.42,4.769-5.671,4.769a6.575,6.575,0,0,1-6.236-3.5ZM6.686,20c.538.954,1.027,1.76,2.2,1.76,1.124,0,1.834-.44,1.834-2.15V7.975h3.422V19.658c0,3.543-2.078,5.156-5.11,5.156A5.312,5.312,0,0,1,3.9,21.688Z" style="fill:#f5de19"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_json</title><path d="M4.014,14.976a2.51,2.51,0,0,0,1.567-.518A2.377,2.377,0,0,0,6.386,13.1,15.261,15.261,0,0,0,6.6,10.156q.012-2.085.075-2.747a5.236,5.236,0,0,1,.418-1.686,3.025,3.025,0,0,1,.755-1.018A3.046,3.046,0,0,1,9,4.125,6.762,6.762,0,0,1,10.544,4h.7V5.96h-.387a2.338,2.338,0,0,0-1.723.468A3.4,3.4,0,0,0,8.709,8.52a36.054,36.054,0,0,1-.137,4.133,4.734,4.734,0,0,1-.768,2.06A4.567,4.567,0,0,1,6.1,16a3.809,3.809,0,0,1,1.992,1.754,8.861,8.861,0,0,1,.618,3.865q0,2.435.05,2.9A1.755,1.755,0,0,0,9.264,25.7a2.639,2.639,0,0,0,1.592.337h.387V28h-.7a5.655,5.655,0,0,1-1.773-.2,2.97,2.97,0,0,1-1.324-.93,3.353,3.353,0,0,1-.681-1.63A24.175,24.175,0,0,1,6.6,22.006,16.469,16.469,0,0,0,6.386,18.9a2.408,2.408,0,0,0-.805-1.361,2.489,2.489,0,0,0-1.567-.524Z" style="fill:#f5de19"/><path d="M27.986,17.011a2.489,2.489,0,0,0-1.567.524,2.408,2.408,0,0,0-.805,1.361,16.469,16.469,0,0,0-.212,3.109,24.175,24.175,0,0,1-.169,3.234,3.353,3.353,0,0,1-.681,1.63,2.97,2.97,0,0,1-1.324.93,5.655,5.655,0,0,1-1.773.2h-.7V26.04h.387a2.639,2.639,0,0,0,1.592-.337,1.755,1.755,0,0,0,.506-1.186q.05-.462.05-2.9a8.861,8.861,0,0,1,.618-3.865A3.809,3.809,0,0,1,25.9,16a4.567,4.567,0,0,1-1.7-1.286,4.734,4.734,0,0,1-.768-2.06,36.054,36.054,0,0,1-.137-4.133,3.4,3.4,0,0,0-.425-2.092,2.338,2.338,0,0,0-1.723-.468h-.387V4h.7A6.762,6.762,0,0,1,23,4.125a3.046,3.046,0,0,1,1.149.581,3.025,3.025,0,0,1,.755,1.018,5.236,5.236,0,0,1,.418,1.686q.062.662.075,2.747a15.261,15.261,0,0,0,.212,2.947,2.377,2.377,0,0,0,.805,1.355,2.51,2.51,0,0,0,1.567.518Z" style="fill:#f5de19"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_markdown</title><rect x="2.5" y="7.955" width="27" height="16.091" style="fill:none;stroke:#755838"/><polygon points="5.909 20.636 5.909 11.364 8.636 11.364 11.364 14.773 14.091 11.364 16.818 11.364 16.818 20.636 14.091 20.636 14.091 15.318 11.364 18.727 8.636 15.318 8.636 20.636 5.909 20.636" style="fill:#755838"/><polygon points="22.955 20.636 18.864 16.136 21.591 16.136 21.591 11.364 24.318 11.364 24.318 16.136 27.045 16.136 22.955 20.636" style="fill:#755838"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_pdf2</title><path d="M24.1,2.072h0l5.564,5.8V29.928H8.879V30H29.735V7.945L24.1,2.072" style="fill:#909090"/><path d="M24.031,2H8.808V29.928H29.664V7.873L24.03,2" style="fill:#f4f4f4"/><path d="M8.655,3.5H2.265v6.827h20.1V3.5H8.655" style="fill:#7a7b7c"/><path d="M22.472,10.211H2.395V3.379H22.472v6.832" style="fill:#dd2025"/><path d="M9.052,4.534h-.03l-.207,0H7.745v4.8H8.773V7.715L9,7.728a2.042,2.042,0,0,0,.647-.117,1.427,1.427,0,0,0,.493-.291,1.224,1.224,0,0,0,.335-.454,2.13,2.13,0,0,0,.105-.908,2.237,2.237,0,0,0-.114-.644,1.173,1.173,0,0,0-.687-.65A2.149,2.149,0,0,0,9.37,4.56a2.232,2.232,0,0,0-.319-.026M8.862,6.828l-.089,0V5.348h.193a.57.57,0,0,1,.459.181.92.92,0,0,1,.183.558c0,.246,0,.469-.222.626a.942.942,0,0,1-.524.114" style="fill:#464648"/><path d="M12.533,4.521c-.111,0-.219.008-.295.011L12,4.538h-.78v4.8h.918a2.677,2.677,0,0,0,1.028-.175,1.71,1.71,0,0,0,.68-.491,1.939,1.939,0,0,0,.373-.749,3.728,3.728,0,0,0,.114-.949,4.416,4.416,0,0,0-.087-1.127,1.777,1.777,0,0,0-.4-.733,1.63,1.63,0,0,0-.535-.4,2.413,2.413,0,0,0-.549-.178,1.282,1.282,0,0,0-.228-.017m-.182,3.937-.1,0V5.392h.013a1.062,1.062,0,0,1,.6.107,1.2,1.2,0,0,1,.324.4,1.3,1.3,0,0,1,.142.526c.009.22,0,.4,0,.549a2.926,2.926,0,0,1-.033.513,1.756,1.756,0,0,1-.169.5,1.13,1.13,0,0,1-.363.36.673.673,0,0,1-.416.106" style="fill:#464648"/><path d="M17.43,4.538H15v4.8h1.028V7.434h1.3V6.542h-1.3V5.43h1.4V4.538" style="fill:#464648"/><path d="M21.781,20.255s3.188-.578,3.188.511S22.994,21.412,21.781,20.255Zm-2.357.083a7.543,7.543,0,0,0-1.473.489l.4-.9c.4-.9.815-2.127.815-2.127a14.216,14.216,0,0,0,1.658,2.252,13.033,13.033,0,0,0-1.4.288Zm-1.262-6.5c0-.949.307-1.208.546-1.208s.508.115.517.939a10.787,10.787,0,0,1-.517,2.434A4.426,4.426,0,0,1,18.161,13.841ZM13.513,24.354c-.978-.585,2.051-2.386,2.6-2.444C16.11,21.911,14.537,24.966,13.513,24.354ZM25.9,20.895c-.01-.1-.1-1.207-2.07-1.16a14.228,14.228,0,0,0-2.453.173,12.542,12.542,0,0,1-2.012-2.655,11.76,11.76,0,0,0,.623-3.1c-.029-1.2-.316-1.888-1.236-1.878s-1.054.815-.933,2.013a9.309,9.309,0,0,0,.665,2.338s-.425,1.323-.987,2.639-.946,2.006-.946,2.006a9.622,9.622,0,0,0-2.725,1.4c-.824.767-1.159,1.356-.725,1.945.374.508,1.683.623,2.853-.91a22.549,22.549,0,0,0,1.7-2.492s1.784-.489,2.339-.623,1.226-.24,1.226-.24,1.629,1.639,3.2,1.581,1.495-.939,1.485-1.035" style="fill:#dd2025"/><path d="M23.954,2.077V7.95h5.633L23.954,2.077Z" style="fill:#909090"/><path d="M24.031,2V7.873h5.633L24.031,2Z" style="fill:#f4f4f4"/><path d="M8.975,4.457h-.03l-.207,0H7.668v4.8H8.7V7.639l.228.013a2.042,2.042,0,0,0,.647-.117,1.428,1.428,0,0,0,.493-.291A1.224,1.224,0,0,0,10.4,6.79a2.13,2.13,0,0,0,.105-.908,2.237,2.237,0,0,0-.114-.644,1.173,1.173,0,0,0-.687-.65,2.149,2.149,0,0,0-.411-.105,2.232,2.232,0,0,0-.319-.026M8.785,6.751l-.089,0V5.271H8.89a.57.57,0,0,1,.459.181.92.92,0,0,1,.183.558c0,.246,0,.469-.222.626a.942.942,0,0,1-.524.114" style="fill:#fff"/><path d="M12.456,4.444c-.111,0-.219.008-.295.011l-.235.006h-.78v4.8h.918a2.677,2.677,0,0,0,1.028-.175,1.71,1.71,0,0,0,.68-.491,1.939,1.939,0,0,0,.373-.749,3.728,3.728,0,0,0,.114-.949,4.416,4.416,0,0,0-.087-1.127,1.777,1.777,0,0,0-.4-.733,1.63,1.63,0,0,0-.535-.4,2.413,2.413,0,0,0-.549-.178,1.282,1.282,0,0,0-.228-.017m-.182,3.937-.1,0V5.315h.013a1.062,1.062,0,0,1,.6.107,1.2,1.2,0,0,1,.324.4,1.3,1.3,0,0,1,.142.526c.009.22,0,.4,0,.549a2.926,2.926,0,0,1-.033.513,1.756,1.756,0,0,1-.169.5,1.13,1.13,0,0,1-.363.36.673.673,0,0,1-.416.106" style="fill:#fff"/><path d="M17.353,4.461h-2.43v4.8h1.028V7.357h1.3V6.465h-1.3V5.353h1.4V4.461" style="fill:#fff"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_shell</title><path d="M29.4,27.6H2.5V4.5H29.4Zm-25.9-1H28.4V5.5H3.5Z" style="fill:#d9b400"/><polygon points="6.077 19.316 5.522 18.484 10.366 15.255 5.479 11.184 6.12 10.416 12.035 15.344 6.077 19.316" style="fill:#d9b400"/><rect x="12.7" y="18.2" width="7.8" height="1" style="fill:#d9b400"/><rect x="2.5" y="5.5" width="26.9" height="1.9" style="fill:#d9b400"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_text</title><path d="M22.038,2H6.375a1.755,1.755,0,0,0-1.75,1.75v24.5A1.755,1.755,0,0,0,6.375,30h19.25a1.755,1.755,0,0,0,1.75-1.75V6.856Zm.525,2.844,1.663,1.531H22.563ZM6.375,28.25V3.75H20.813V8.125h4.813V28.25Z" style="fill:#c2c2c2"/><rect x="8.125" y="15.097" width="13.076" height="1.75" style="fill:#829ec2"/><rect x="8.125" y="24.439" width="9.762" height="1.75" style="fill:#829ec2"/><rect x="8.125" y="19.763" width="15.75" height="1.75" style="fill:#829ec2"/><rect x="8.125" y="10.23" width="15.75" height="1.75" style="fill:#829ec2"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_typescript</title><path d="M23.827,8.243A4.424,4.424,0,0,1,26.05,9.524a5.853,5.853,0,0,1,.852,1.143c.011.045-1.534,1.083-2.471,1.662-.034.023-.169-.124-.322-.35a2.014,2.014,0,0,0-1.67-1c-1.077-.074-1.771.49-1.766,1.433a1.3,1.3,0,0,0,.153.666c.237.49.677.784,2.059,1.383,2.544,1.095,3.636,1.817,4.31,2.843a5.158,5.158,0,0,1,.416,4.333,4.764,4.764,0,0,1-3.932,2.815,10.9,10.9,0,0,1-2.708-.028,6.531,6.531,0,0,1-3.616-1.884,6.278,6.278,0,0,1-.926-1.371,2.655,2.655,0,0,1,.327-.208c.158-.09.756-.434,1.32-.761L19.1,19.6l.214.312a4.771,4.771,0,0,0,1.35,1.292,3.3,3.3,0,0,0,3.458-.175,1.545,1.545,0,0,0,.2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8,8.8,0,0,1-3.349-2.055,4.687,4.687,0,0,1-.976-1.777,7.116,7.116,0,0,1-.062-2.268,4.332,4.332,0,0,1,3.644-3.374A9,9,0,0,1,23.827,8.243ZM15.484,9.726l.011,1.454h-4.63V24.328H7.6V11.183H2.97V9.755A13.986,13.986,0,0,1,3.01,8.289c.017-.023,2.832-.034,6.245-.028l6.211.017Z" style="fill:#007acc"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_yaml</title><path d="M2 12.218c.755 0 1.51-.008 2.264 0l.053.038 2.761 2.758c.891-.906 1.8-1.794 2.7-2.7.053-.052.11-.113.192-.1h1.823a1.4 1.4 0 0 1 .353.019c-.7.67-1.377 1.369-2.069 2.05L5.545 18.8c-.331.324-.648.663-.989.975-.754.022-1.511.007-2.266.007 1.223-1.209 2.431-2.433 3.658-3.637-1.321-1.304-2.63-2.62-3.948-3.927M12.7 12.218h1.839v7.566c-.611 0-1.222.012-1.832-.008v-4.994c-1.6 1.607-3.209 3.2-4.811 4.8-.089.08-.166.217-.305.194-.824-.006-1.649 0-2.474 0Q8.916 16 12.7 12.218M14.958 12.22c.47-.009.939 0 1.409 0 .836.853 1.69 1.689 2.536 2.532q1.268-1.267 2.539-2.532h1.4q-.008 3.784 0 7.567c-.471 0-.943.006-1.414 0q.008-2.387 0-4.773c-.844.843-1.676 1.7-2.526 2.536-.856-.835-1.687-1.695-2.532-2.541 0 1.594-.006 3.188.006 4.781-.472 0-.943.005-1.415 0q-.003-3.79-.003-7.57M23.259 12.217c.472 0 .944-.007 1.416 0q-.007 3.083 0 6.166h3.782c.063.006.144-.012.191.045.448.454.907.9 1.353 1.354q-3.371.007-6.741 0 .007-3.782-.001-7.565" style="fill:#ffe885"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="17.65" y1="26.056" x2="21.099" y2="26.056" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#4d4d4d"/><stop offset="0.5" stop-color="#fff"/><stop offset="1" stop-color="#4d4d4d"/></linearGradient><linearGradient id="b" x1="17.65" y1="23.756" x2="21.099" y2="23.756" xlink:href="#a"/><linearGradient id="c" x1="17.65" y1="21.456" x2="21.099" y2="21.456" xlink:href="#a"/><linearGradient id="d" x1="17.65" y1="19.156" x2="21.099" y2="19.156" xlink:href="#a"/><linearGradient id="e" x1="17.65" y1="16.857" x2="21.099" y2="16.857" xlink:href="#a"/><linearGradient id="f" x1="17.65" y1="14.557" x2="21.099" y2="14.557" xlink:href="#a"/><linearGradient id="g" x1="17.65" y1="12.257" x2="21.099" y2="12.257" xlink:href="#a"/><linearGradient id="h" x1="17.65" y1="9.957" x2="21.099" y2="9.957" xlink:href="#a"/><linearGradient id="i" x1="17.65" y1="7.657" x2="21.099" y2="7.657" xlink:href="#a"/><linearGradient id="j" x1="16.237" y1="27.217" x2="19.686" y2="27.217" xlink:href="#a"/><linearGradient id="k" x1="16.237" y1="24.918" x2="19.686" y2="24.918" xlink:href="#a"/><linearGradient id="l" x1="16.237" y1="22.618" x2="19.686" y2="22.618" xlink:href="#a"/><linearGradient id="m" x1="16.237" y1="20.318" x2="19.686" y2="20.318" xlink:href="#a"/><linearGradient id="n" x1="16.237" y1="18.018" x2="19.686" y2="18.018" xlink:href="#a"/><linearGradient id="o" x1="17.65" y1="28.356" x2="21.099" y2="28.356" xlink:href="#a"/><linearGradient id="p" x1="16.237" y1="15.718" x2="19.686" y2="15.718" xlink:href="#a"/><linearGradient id="q" x1="16.237" y1="13.419" x2="19.686" y2="13.419" xlink:href="#a"/><linearGradient id="r" x1="16.237" y1="11.119" x2="19.686" y2="11.119" xlink:href="#a"/><linearGradient id="s" x1="16.237" y1="8.819" x2="19.686" y2="8.819" xlink:href="#a"/><linearGradient id="t" x1="16.237" y1="29.514" x2="19.686" y2="29.514" xlink:href="#a"/><linearGradient id="u" x1="16.985" y1="11.196" x2="20.446" y2="11.196" xlink:href="#a"/><linearGradient id="v" x1="18.096" y1="5.329" x2="19.336" y2="5.329" xlink:href="#a"/><linearGradient id="w" x1="16.029" y1="5.591" x2="21.403" y2="5.591" xlink:href="#a"/></defs><title>file_type_zip</title><path d="M27.667,27.667V17.333L23,15V2H4.333V30H27.667Zm-4.667,0V18.556l2.333,1.222v7.889Z" style="fill:#c09553"/><rect x="17.65" y="25.559" width="3.45" height="0.993" style="fill:url(#a)"/><rect x="17.65" y="23.26" width="3.45" height="0.993" style="fill:url(#b)"/><rect x="17.65" y="20.96" width="3.45" height="0.993" style="fill:url(#c)"/><rect x="17.65" y="18.66" width="3.45" height="0.993" style="fill:url(#d)"/><rect x="17.65" y="16.36" width="3.45" height="0.993" style="fill:url(#e)"/><rect x="17.65" y="14.06" width="3.45" height="0.993" style="fill:url(#f)"/><rect x="17.65" y="11.76" width="3.45" height="0.993" style="fill:url(#g)"/><rect x="17.65" y="9.461" width="3.45" height="0.993" style="fill:url(#h)"/><rect x="17.65" y="7.161" width="3.45" height="0.993" style="fill:url(#i)"/><rect x="16.237" y="26.721" width="3.45" height="0.993" style="fill:url(#j)"/><rect x="16.237" y="24.421" width="3.45" height="0.993" style="fill:url(#k)"/><rect x="16.237" y="22.121" width="3.45" height="0.993" style="fill:url(#l)"/><rect x="16.237" y="19.821" width="3.45" height="0.993" style="fill:url(#m)"/><rect x="16.237" y="17.522" width="3.45" height="0.993" style="fill:url(#n)"/><rect x="17.65" y="27.859" width="3.45" height="0.993" style="fill:url(#o)"/><rect x="16.237" y="15.222" width="3.45" height="0.993" style="fill:url(#p)"/><rect x="16.237" y="12.922" width="3.45" height="0.993" style="fill:url(#q)"/><rect x="16.237" y="10.622" width="3.45" height="0.993" style="fill:url(#r)"/><rect x="16.237" y="8.322" width="3.45" height="0.993" style="fill:url(#s)"/><rect x="16.237" y="29.018" width="3.45" height="0.993" style="fill:url(#t)"/><path d="M20.1,5.911a.554.554,0,0,0-.548-.53h-.009v.557h.092l.206,2.514H17.589L17.8,5.938h.094V5.381h-.044a.552.552,0,0,0-.547.53l-.314,10.569a.513.513,0,0,0,.515.531h2.432a.512.512,0,0,0,.513-.531Zm-1.384,10.5a1.171,1.171,0,1,1,1.171-1.171A1.171,1.171,0,0,1,18.716,16.408Z" style="fill:url(#u)"/><rect x="18.096" y="3.802" width="1.24" height="3.054" style="fill:url(#v)"/><path d="M21.4,4.56a2.549,2.549,0,0,0-2.549-2.549h-.276a2.55,2.55,0,0,0-2.436,3.3h0l0,.006v0A7.986,7.986,0,0,1,16.4,7.878H16.4a1.811,1.811,0,0,0,.641,1.271l.109-3.441a.593.593,0,0,1,.6-.551h.135V3.587h1.653v1.57h.1a.6.6,0,0,1,.605.551l.121,3.462a1.813,1.813,0,0,0,.666-1.292h0V7.8c0-.014,0-.027,0-.041s0-.026,0-.039a7.693,7.693,0,0,1,.236-2.359A2.543,2.543,0,0,0,21.4,4.56Z" style="fill:url(#w)"/></svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { n as DirwellPluginOptions, t as DirwellPluginInput } from "./unplugin-CKRUCTgW.mjs";
|
|
2
|
+
import { UnpluginInstance } from "unplugin";
|
|
3
|
+
//#region src/webpack.d.ts
|
|
4
|
+
declare const plugin: UnpluginInstance<DirwellPluginInput, true>["webpack"];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { type DirwellPluginOptions, plugin as default };
|
|
7
|
+
//# sourceMappingURL=webpack.d.mts.map
|
package/dist/webpack.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.mjs","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginInstance } from \"unplugin\";\nimport unplugin, { type DirwellPluginInput } from \"./unplugin.ts\";\nexport type { DirwellPluginOptions } from \"./unplugin.ts\";\nconst plugin: UnpluginInstance<DirwellPluginInput, true>[\"webpack\"] = unplugin.webpack;\nexport default plugin;\n"],"mappings":";;AAGA,MAAM,SAAgE,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,135 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vp-tw/dirwell",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "A static file explorer with safe symlinks, themes, and live reload.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"directory-index",
|
|
7
|
+
"file-browser",
|
|
8
|
+
"static-site-generator"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://vp-tw.github.io/dirwell/",
|
|
11
|
+
"bugs": "https://github.com/vp-tw/dirwell/issues",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/vp-tw/dirwell.git"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"dirwell": "./dist/bin.mjs"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"THIRD_PARTY_NOTICES.md",
|
|
24
|
+
"README.md",
|
|
25
|
+
"CHANGELOG.md",
|
|
26
|
+
"THEMING.md",
|
|
27
|
+
"THEME_PACKAGE_CONTRACT.md"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.mts",
|
|
33
|
+
"import": "./dist/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"./theme": {
|
|
36
|
+
"types": "./dist/theme-components.d.mts",
|
|
37
|
+
"import": "./dist/theme-components.mjs"
|
|
38
|
+
},
|
|
39
|
+
"./vite": {
|
|
40
|
+
"types": "./dist/vite.d.mts",
|
|
41
|
+
"import": "./dist/vite.mjs"
|
|
42
|
+
},
|
|
43
|
+
"./unplugin": {
|
|
44
|
+
"types": "./dist/unplugin.d.mts",
|
|
45
|
+
"import": "./dist/unplugin.mjs"
|
|
46
|
+
},
|
|
47
|
+
"./rollup": {
|
|
48
|
+
"types": "./dist/rollup.d.mts",
|
|
49
|
+
"import": "./dist/rollup.mjs"
|
|
50
|
+
},
|
|
51
|
+
"./rolldown": {
|
|
52
|
+
"types": "./dist/rolldown.d.mts",
|
|
53
|
+
"import": "./dist/rolldown.mjs"
|
|
54
|
+
},
|
|
55
|
+
"./webpack": {
|
|
56
|
+
"types": "./dist/webpack.d.mts",
|
|
57
|
+
"import": "./dist/webpack.mjs"
|
|
58
|
+
},
|
|
59
|
+
"./rspack": {
|
|
60
|
+
"types": "./dist/rspack.d.mts",
|
|
61
|
+
"import": "./dist/rspack.mjs"
|
|
62
|
+
},
|
|
63
|
+
"./rsbuild": {
|
|
64
|
+
"types": "./dist/rsbuild.d.mts",
|
|
65
|
+
"import": "./dist/rsbuild.mjs"
|
|
66
|
+
},
|
|
67
|
+
"./esbuild": {
|
|
68
|
+
"types": "./dist/esbuild.d.mts",
|
|
69
|
+
"import": "./dist/esbuild.mjs"
|
|
70
|
+
},
|
|
71
|
+
"./farm": {
|
|
72
|
+
"types": "./dist/farm.d.mts",
|
|
73
|
+
"import": "./dist/farm.mjs"
|
|
74
|
+
},
|
|
75
|
+
"./bun": {
|
|
76
|
+
"types": "./dist/bun.d.mts",
|
|
77
|
+
"import": "./dist/bun.mjs"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public",
|
|
82
|
+
"tag": "alpha"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"build": "vp pack && node scripts/copy-static-assets.ts",
|
|
86
|
+
"build:explorer": "node src/bin.ts build fixture --out-dir generated",
|
|
87
|
+
"check": "vp check && tsc --noEmit",
|
|
88
|
+
"dev": "node src/bin.ts serve fixture --out-dir generated",
|
|
89
|
+
"dirwell": "node src/bin.ts",
|
|
90
|
+
"docs:build": "pnpm --dir docs build",
|
|
91
|
+
"docs:dev": "node scripts/dev-docs.ts",
|
|
92
|
+
"examples:build": "node scripts/build-examples.ts",
|
|
93
|
+
"format": "vp fmt --write",
|
|
94
|
+
"lint": "vp lint",
|
|
95
|
+
"release:status": "changeset status",
|
|
96
|
+
"site:build": "pnpm run examples:build && pnpm run docs:build",
|
|
97
|
+
"test": "node --test test/*.test.ts test/*.test.mjs",
|
|
98
|
+
"test:browser": "playwright test",
|
|
99
|
+
"check:types": "tsc --noEmit",
|
|
100
|
+
"release:version": "changeset version && vp fmt --write .changeset CHANGELOG.md package.json",
|
|
101
|
+
"verify:package": "node scripts/verify-package.mjs"
|
|
102
|
+
},
|
|
103
|
+
"dependencies": {
|
|
104
|
+
"c12": "4.0.0-rc.1",
|
|
105
|
+
"chokidar": "5.0.0",
|
|
106
|
+
"citty": "0.2.2",
|
|
107
|
+
"giget": "3.3.1",
|
|
108
|
+
"jiti": "2.7.0",
|
|
109
|
+
"picomatch": "4.0.7",
|
|
110
|
+
"unplugin": "3.4.0"
|
|
111
|
+
},
|
|
112
|
+
"devDependencies": {
|
|
113
|
+
"@astrojs/starlight": "0.42.2",
|
|
114
|
+
"@changesets/cli": "3.0.3",
|
|
115
|
+
"@farmfe/core": "1.7.11",
|
|
116
|
+
"@playwright/test": "1.63.0",
|
|
117
|
+
"@rsbuild/core": "2.2.12",
|
|
118
|
+
"@rspack/core": "2.2.8",
|
|
119
|
+
"@types/node": "26.6.2",
|
|
120
|
+
"@types/picomatch": "4.0.3",
|
|
121
|
+
"astro": "7.3.3",
|
|
122
|
+
"esbuild": "0.28.2",
|
|
123
|
+
"rolldown": "1.2.13",
|
|
124
|
+
"rollup": "4.64.2",
|
|
125
|
+
"typescript": "7.0.2",
|
|
126
|
+
"vite": "catalog:",
|
|
127
|
+
"vite-plus": "catalog:",
|
|
128
|
+
"vite-upstream": "npm:vite@8.3.0",
|
|
129
|
+
"webpack": "5.111.1"
|
|
130
|
+
},
|
|
131
|
+
"engines": {
|
|
132
|
+
"node": ">=26"
|
|
133
|
+
},
|
|
134
|
+
"packageManager": "pnpm@11.25.0"
|
|
135
|
+
}
|