@vite-hub/workspace 0.0.1 → 0.0.2
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 +190 -17
- package/dist/{ai-Bk3LLnit.js → ai-Cztw4eLk.js} +149 -29
- package/dist/ai-hFdsvDHC.d.ts +162 -0
- package/dist/ai.d.ts +2 -85
- package/dist/ai.js +1 -1
- package/dist/artifacts-store-BAV9jZpd.js +555 -0
- package/dist/asset-registry-CaG9b7tf.js +19 -0
- package/dist/cli.d.ts +31 -0
- package/dist/cli.js +303 -0
- package/dist/cloudflare-env-CKxUs2fa.js +20 -0
- package/dist/cloudflare.d.ts +16 -0
- package/dist/cloudflare.js +3 -0
- package/dist/collections/client.d.ts +39 -0
- package/dist/collections/client.js +137 -0
- package/dist/collections.d.ts +59 -0
- package/dist/collections.js +159 -0
- package/dist/config--r5unwPc.js +7811 -0
- package/dist/config-Ca5DM8fF.d.ts +28 -0
- package/dist/config-DCQ6y30R.js +30 -0
- package/dist/file-B2q9NE18.js +24 -0
- package/dist/{files-DbsIjBya.js → files-xy0le-_U.js} +6 -5
- package/dist/github-lIO6-2sH.js +194 -0
- package/dist/glob-DeH0dzZX.js +23 -0
- package/dist/host-I-_vDs05.js +370 -0
- package/dist/hosted-vercel-blob.d.ts +15 -0
- package/dist/hosted-vercel-blob.js +26 -0
- package/dist/hosted.d.ts +18 -0
- package/dist/hosted.js +30 -0
- package/dist/index.d.ts +137 -102
- package/dist/index.js +479 -594
- package/dist/lifecycle-Lhk3dAMt.js +176 -0
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +1 -1
- package/dist/nitro.d.ts +2 -31
- package/dist/nitro.js +2 -2
- package/dist/nuxt.d.ts +26 -0
- package/dist/nuxt.js +36 -0
- package/dist/path-CNI6wKIU.js +115 -0
- package/dist/{provider-BZuKAV4e.js → provider-CeQciesl.js} +142 -37
- package/dist/providers/cloudflare/artifacts-store.d.ts +1 -1
- package/dist/providers/cloudflare/artifacts-store.js +1 -383
- package/dist/providers/github/store.d.ts +6 -0
- package/dist/providers/github/store.js +362 -0
- package/dist/providers/vercel/blob-store.d.ts +1 -1
- package/dist/providers/vercel/blob-store.js +77 -18
- package/dist/publish.d.ts +3 -2
- package/dist/publish.js +48 -142
- package/dist/registry-C7DMdBXN.js +74 -0
- package/dist/{registry-D4Qzq26I.d.ts → registry-CoC9JxVt.d.ts} +3 -2
- package/dist/request-execution-C8qRcReq.js +80 -0
- package/dist/runtime/assets.d.ts +2 -1
- package/dist/runtime/assets.js +5 -5
- package/dist/runtime/empty-assets-registry.d.ts +1 -1
- package/dist/runtime/empty-registry.d.ts +1 -1
- package/dist/runtime/state.d.ts +4 -21
- package/dist/runtime/state.js +7 -4
- package/dist/runtime/workspace.d.ts +2 -0
- package/dist/runtime/workspace.js +2 -0
- package/dist/runtime.d.ts +38 -0
- package/dist/runtime.js +643 -0
- package/dist/{search-DtaEyjpO.js → search-C4REyHj9.js} +2 -2
- package/dist/server.d.ts +65 -0
- package/dist/server.js +355 -0
- package/dist/shared-BRycRSbo.js +255 -0
- package/dist/source-metadata.d.ts +2 -0
- package/dist/source-metadata.js +2 -0
- package/dist/state-DSAHEsq6.d.ts +25 -0
- package/dist/sync-DO42ypji.js +269 -0
- package/dist/target-D4Bqb1eH.js +11 -0
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/types-DHkae7Cb.d.ts +628 -0
- package/dist/use-D16tf8Ph.d.ts +86 -0
- package/dist/use-d_PlAdOu.js +353 -0
- package/dist/{utils-BtAm_K5P.js → utils-BPdaCyI6.js} +7 -3
- package/dist/vite-NWC9mFjI.js +1882 -0
- package/dist/vite.d.ts +33 -5
- package/dist/vite.js +2 -131
- package/dist/workspace-f2DBLmPZ.d.ts +6 -0
- package/dist/workspace-n4wBmdaM.js +1476 -0
- package/package.json +158 -62
- package/dist/asset-registry-CMuQbyvl.js +0 -14
- package/dist/cloudflare-env-DL94Uvpz.js +0 -12
- package/dist/config-CvS-7sre.js +0 -49
- package/dist/errors-BUL8SoFS.js +0 -21
- package/dist/lifecycle-uD82JeGh.js +0 -92
- package/dist/module-8LZUMEXC.js +0 -922
- package/dist/path-BVv9OXhg.js +0 -63
- package/dist/registry-Cnr0NoKv.js +0 -932
- package/dist/runtime/nitro-plugin.d.ts +0 -6
- package/dist/runtime/nitro-plugin.js +0 -14
- package/dist/sandbox-DtGXCWRq.js +0 -198
- package/dist/types-CwNcWTdt.d.ts +0 -378
- /package/dist/{chunk-DrSxFLj_.js → chunk-8H4AJuhK.js} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { A as WorkspaceCacheOptions, Dt as WorkspaceSourceInput, Mt as WorkspaceSourceRequestDescriptor, P as WorkspaceDefinition, Z as WorkspaceMaterializeMode, qt as WorkspaceSourceSyncPolicy, rn as WorkspaceValidateMode, wt as WorkspaceSource } from "./types-DHkae7Cb.js";
|
|
2
|
+
|
|
3
|
+
//#region src/sources/request-metadata.d.ts
|
|
4
|
+
declare function getWorkspaceSourceRequestDescriptor(source: WorkspaceSource): WorkspaceSourceRequestDescriptor | undefined;
|
|
5
|
+
declare function isWorkspaceSourceRequestOnly(source: WorkspaceSource): boolean;
|
|
6
|
+
declare function workspaceSourceRequestDescriptorPath(sourceKey: string): string;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/sources/config.d.ts
|
|
9
|
+
interface ResolvedWorkspaceSource {
|
|
10
|
+
key: string;
|
|
11
|
+
source: WorkspaceSource;
|
|
12
|
+
mountPath: string;
|
|
13
|
+
materialize: WorkspaceMaterializeMode;
|
|
14
|
+
cache: false | WorkspaceCacheOptions;
|
|
15
|
+
sync: false | WorkspaceSourceSyncPolicy;
|
|
16
|
+
validate: WorkspaceValidateMode;
|
|
17
|
+
livePaths?: Record<string, string>;
|
|
18
|
+
probeKeys?: string[];
|
|
19
|
+
readonly: true;
|
|
20
|
+
requestDescriptor?: WorkspaceSourceRequestDescriptor;
|
|
21
|
+
requestOnly?: boolean;
|
|
22
|
+
}
|
|
23
|
+
type WorkspaceSourceMetadata = Pick<ResolvedWorkspaceSource, "cache" | "key" | "materialize" | "mountPath" | "probeKeys" | "requestOnly" | "source" | "sync">;
|
|
24
|
+
declare function normalizeWorkspaceSourcesMetadata(sources: WorkspaceDefinition["sources"]): WorkspaceSourceMetadata[];
|
|
25
|
+
declare function normalizeWorkspaceSourceMetadata(key: string, input: WorkspaceSourceInput): WorkspaceSourceMetadata;
|
|
26
|
+
declare function workspaceSourceGrantPaths(key: string, input: WorkspaceSourceInput): string[];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { getWorkspaceSourceRequestDescriptor as a, workspaceSourceGrantPaths as i, normalizeWorkspaceSourceMetadata as n, isWorkspaceSourceRequestOnly as o, normalizeWorkspaceSourcesMetadata as r, workspaceSourceRequestDescriptorPath as s, WorkspaceSourceMetadata as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { n as normalizeWorkspaceStoreOptions } from "./provider-CeQciesl.js";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
//#region ../internal/src/object.ts
|
|
4
|
+
function isPlainObject(value) {
|
|
5
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/config.ts
|
|
9
|
+
const workspaceConfigKeys = new Set([
|
|
10
|
+
"assets",
|
|
11
|
+
"projectRoot",
|
|
12
|
+
"root",
|
|
13
|
+
"store"
|
|
14
|
+
]);
|
|
15
|
+
function normalizeWorkspaceOptions(options, input = {}) {
|
|
16
|
+
if (options === false) return false;
|
|
17
|
+
if (typeof options !== "undefined" && !isPlainObject(options)) throw new TypeError("`workspace` must be a plain object.");
|
|
18
|
+
const resolvedOptions = options || {};
|
|
19
|
+
const unsupported = Object.keys(resolvedOptions).filter((key) => !workspaceConfigKeys.has(key));
|
|
20
|
+
if (unsupported.length) throw new TypeError(`[vitehub] workspace config does not support option${unsupported.length === 1 ? "" : "s"}: ${unsupported.join(", ")}.`);
|
|
21
|
+
const rootDir = input.rootDir || process.cwd();
|
|
22
|
+
const root = resolvedOptions.root || ".vitehub/workspaces";
|
|
23
|
+
return {
|
|
24
|
+
assets: resolvedOptions.assets,
|
|
25
|
+
root: resolve(rootDir, root),
|
|
26
|
+
store: normalizeWorkspaceStoreOptions(resolvedOptions.store, input) || { provider: "local" }
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { normalizeWorkspaceOptions as t };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-8H4AJuhK.js";
|
|
2
|
+
import { o as normalizeSafeWorkspacePath } from "./path-CNI6wKIU.js";
|
|
3
|
+
import { file } from "@vite-hub/source/sources/file";
|
|
4
|
+
//#region src/sources/file.ts
|
|
5
|
+
var file_exports = /* @__PURE__ */ __exportAll({ file: () => file$1 });
|
|
6
|
+
function file$1(input) {
|
|
7
|
+
const options = typeof input === "string" ? { path: input } : input;
|
|
8
|
+
const key = normalizeSafeWorkspacePath(options.workspacePath || options.path || "");
|
|
9
|
+
const mount = typeof options.mount === "object" && options.mount && !("path" in options.mount) ? {
|
|
10
|
+
...options.mount,
|
|
11
|
+
path: ""
|
|
12
|
+
} : options.mount ?? "";
|
|
13
|
+
return {
|
|
14
|
+
...file(options),
|
|
15
|
+
cache: options.cache,
|
|
16
|
+
materialize: options.materialize,
|
|
17
|
+
mount,
|
|
18
|
+
probeKeys: options.probeKeys || [key],
|
|
19
|
+
sync: options.sync,
|
|
20
|
+
validate: options.validate
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { file_exports as n, file$1 as t };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as matchesAny, c as normalizeWorkspacePath } from "./path-CNI6wKIU.js";
|
|
2
|
+
import { n as createSourceContext } from "./config--r5unwPc.js";
|
|
2
3
|
//#region src/loaders/files.ts
|
|
3
4
|
function shouldLoad(path, options) {
|
|
4
5
|
if (options.include && !matchesAny(path, options.include)) return false;
|
|
@@ -9,11 +10,11 @@ function files(options = {}) {
|
|
|
9
10
|
return {
|
|
10
11
|
name: "files",
|
|
11
12
|
async load(ctx) {
|
|
12
|
-
const sourceContext = {
|
|
13
|
+
const sourceContext = createSourceContext({
|
|
14
|
+
name: ctx.workspace,
|
|
13
15
|
rootDir: ctx.rootDir,
|
|
14
|
-
sourceRootDir: ctx.sourceRootDir
|
|
15
|
-
|
|
16
|
-
};
|
|
16
|
+
sourceRootDir: ctx.sourceRootDir
|
|
17
|
+
}, void 0, ctx.store);
|
|
17
18
|
for (const source of ctx.sources) {
|
|
18
19
|
await source.prepare?.(sourceContext);
|
|
19
20
|
for (const key of await source.getKeys(sourceContext)) {
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-8H4AJuhK.js";
|
|
2
|
+
import { t as getActiveCloudflareBinding } from "./cloudflare-env-CKxUs2fa.js";
|
|
3
|
+
import { h as resolveGitHubTokenOption, s as processEnv } from "./shared-BRycRSbo.js";
|
|
4
|
+
import { github } from "@vite-hub/source/sources/github";
|
|
5
|
+
//#region src/env.ts
|
|
6
|
+
let viteLoadEnv;
|
|
7
|
+
async function resolveWorkspaceEnv(rootDir, name) {
|
|
8
|
+
return (await loadWorkspaceEnv(rootDir))?.[name];
|
|
9
|
+
}
|
|
10
|
+
async function loadWorkspaceEnv(rootDir) {
|
|
11
|
+
return await loadViteEnv(rootDir);
|
|
12
|
+
}
|
|
13
|
+
async function loadViteEnv(rootDir) {
|
|
14
|
+
if (viteLoadEnv === null) return;
|
|
15
|
+
if (!viteLoadEnv) try {
|
|
16
|
+
viteLoadEnv = (await import(
|
|
17
|
+
/* @vite-ignore */
|
|
18
|
+
"vite"
|
|
19
|
+
)).loadEnv;
|
|
20
|
+
} catch {
|
|
21
|
+
viteLoadEnv = null;
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
return viteLoadEnv("", rootDir, "");
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/sources/github.ts
|
|
28
|
+
var github_exports = /* @__PURE__ */ __exportAll({ github: () => github$1 });
|
|
29
|
+
const githubTokenEnvNames = [
|
|
30
|
+
"WORKSPACE_GITHUB_TOKEN",
|
|
31
|
+
"VITEHUB_WORKSPACE_GITHUB_TOKEN",
|
|
32
|
+
"GITHUB_TOKEN",
|
|
33
|
+
"GH_TOKEN"
|
|
34
|
+
];
|
|
35
|
+
function github$1(input) {
|
|
36
|
+
if (typeof input === "function") return resolvableGitHubSource(input);
|
|
37
|
+
const resolvedOptions = { ...input };
|
|
38
|
+
const baseSource = github({
|
|
39
|
+
...resolvedOptions,
|
|
40
|
+
auth: createGitHubAuthResolver(resolvedOptions.auth)
|
|
41
|
+
});
|
|
42
|
+
const sourceByRootAndToken = /* @__PURE__ */ new Map();
|
|
43
|
+
async function getSourceForRoot(rootDir) {
|
|
44
|
+
const token = await resolveGitHubAuth(resolvedOptions.auth, rootDir);
|
|
45
|
+
const cacheKey = `${rootDir}\0${token || ""}`;
|
|
46
|
+
const cachedSource = sourceByRootAndToken.get(cacheKey);
|
|
47
|
+
if (cachedSource) return cachedSource;
|
|
48
|
+
const source = github({
|
|
49
|
+
...resolvedOptions,
|
|
50
|
+
auth: token
|
|
51
|
+
});
|
|
52
|
+
sourceByRootAndToken.set(cacheKey, source);
|
|
53
|
+
return source;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...baseSource,
|
|
57
|
+
cache: resolvedOptions.cache,
|
|
58
|
+
fingerprint: {
|
|
59
|
+
exclude: resolvedOptions.exclude,
|
|
60
|
+
include: resolvedOptions.include,
|
|
61
|
+
ref: resolvedOptions.ref,
|
|
62
|
+
repo: resolvedOptions.repo,
|
|
63
|
+
root: resolvedOptions.root
|
|
64
|
+
},
|
|
65
|
+
materialize: resolvedOptions.materialize,
|
|
66
|
+
mount: resolvedOptions.mount,
|
|
67
|
+
sync: resolvedOptions.sync,
|
|
68
|
+
validate: resolvedOptions.validate,
|
|
69
|
+
async prepare(ctx) {
|
|
70
|
+
await (await getSourceForRoot(ctx.rootDir)).prepare?.(ctx);
|
|
71
|
+
},
|
|
72
|
+
async getKeys(ctx) {
|
|
73
|
+
return await (await getSourceForRoot(ctx.rootDir)).getKeys(ctx);
|
|
74
|
+
},
|
|
75
|
+
async getItem(key, ctx) {
|
|
76
|
+
return await (await getSourceForRoot(ctx.rootDir)).getItem(key, ctx);
|
|
77
|
+
},
|
|
78
|
+
async getItems(ctx) {
|
|
79
|
+
const source = await getSourceForRoot(ctx.rootDir);
|
|
80
|
+
return await source.getItems?.(ctx) ?? await Promise.all((await source.getKeys(ctx)).map((key) => source.getItem(key, ctx)));
|
|
81
|
+
},
|
|
82
|
+
async getMeta(key, ctx) {
|
|
83
|
+
return await (await getSourceForRoot(ctx.rootDir)).getMeta?.(key, ctx);
|
|
84
|
+
},
|
|
85
|
+
async search(query, ctx) {
|
|
86
|
+
return await (await getSourceForRoot(ctx.rootDir)).search?.(query, ctx) ?? [];
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function resolvableGitHubSource(resolve) {
|
|
91
|
+
return {
|
|
92
|
+
fingerprint: { sourceResolution: "github" },
|
|
93
|
+
materialize: "lazy",
|
|
94
|
+
async getKeys() {
|
|
95
|
+
return [];
|
|
96
|
+
},
|
|
97
|
+
async getItem(key) {
|
|
98
|
+
throw new Error(`[vitehub] github() resolver did not resolve before reading ${JSON.stringify(key)}.`);
|
|
99
|
+
},
|
|
100
|
+
async getItems() {
|
|
101
|
+
return [];
|
|
102
|
+
},
|
|
103
|
+
async search() {
|
|
104
|
+
return [];
|
|
105
|
+
},
|
|
106
|
+
async resolve(ctx) {
|
|
107
|
+
const options = await resolve(ctx);
|
|
108
|
+
return options ? github$1(githubResolutionDefaults(options, ctx)) : false;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function githubResolutionDefaults(options, ctx) {
|
|
113
|
+
const source = pullRequestSource(ctx.invocation.context.get("pullRequest"));
|
|
114
|
+
const repo = options.repo || source?.repo;
|
|
115
|
+
if (!repo) throw new Error("[vitehub] github() resolver requires repo or typed pullRequest source context.");
|
|
116
|
+
return {
|
|
117
|
+
...options,
|
|
118
|
+
mount: options.mount ?? ctx.source.mountPath,
|
|
119
|
+
ref: options.ref ?? source?.ref,
|
|
120
|
+
repo
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function pullRequestSource(value) {
|
|
124
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
125
|
+
const flatRef = value.headRef;
|
|
126
|
+
const directSource = value.source;
|
|
127
|
+
if (directSource && typeof directSource === "object" && !Array.isArray(directSource)) {
|
|
128
|
+
const ref = directSource.ref;
|
|
129
|
+
const repo = directSource.repo;
|
|
130
|
+
if (typeof repo === "string" && repo) {
|
|
131
|
+
const resolvedRef = typeof ref === "string" && ref ? ref : typeof flatRef === "string" && flatRef ? flatRef : void 0;
|
|
132
|
+
return {
|
|
133
|
+
...resolvedRef ? { ref: resolvedRef } : {},
|
|
134
|
+
repo
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const flatRepo = value.repository;
|
|
139
|
+
if (typeof flatRepo === "string" && flatRepo) return {
|
|
140
|
+
...typeof flatRef === "string" && flatRef ? { ref: flatRef } : {},
|
|
141
|
+
repo: flatRepo
|
|
142
|
+
};
|
|
143
|
+
const pullRequest = value.pullRequest;
|
|
144
|
+
if (!pullRequest || typeof pullRequest !== "object" || Array.isArray(pullRequest)) return;
|
|
145
|
+
const source = pullRequest.source;
|
|
146
|
+
if (!source || typeof source !== "object" || Array.isArray(source)) return;
|
|
147
|
+
const ref = source.ref;
|
|
148
|
+
const repo = source.repo;
|
|
149
|
+
return {
|
|
150
|
+
...typeof ref === "string" && ref ? { ref } : {},
|
|
151
|
+
...typeof repo === "string" && repo ? { repo } : {}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function createGitHubAuthResolver(auth) {
|
|
155
|
+
if (auth === false) return false;
|
|
156
|
+
return () => {
|
|
157
|
+
return resolveExplicitGitHubAuth(auth) || getActiveCloudflareBinding("GITHUB_TOKEN") || processEnv(process.env, ...githubTokenEnvNames);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
async function resolveGitHubAuth(auth, rootDir) {
|
|
161
|
+
if (auth === false) return false;
|
|
162
|
+
return resolveExplicitGitHubAuth(auth) || resolveGitHubTokenOption({}) || await resolveGitHubEnvFileToken(rootDir) || await resolveGitHubCliToken();
|
|
163
|
+
}
|
|
164
|
+
function resolveExplicitGitHubAuth(auth) {
|
|
165
|
+
if (auth === false) return void 0;
|
|
166
|
+
if (typeof auth === "function") return auth();
|
|
167
|
+
return typeof auth === "string" ? auth : void 0;
|
|
168
|
+
}
|
|
169
|
+
async function resolveGitHubEnvFileToken(rootDir) {
|
|
170
|
+
return processEnv(Object.fromEntries(await Promise.all(githubTokenEnvNames.map(async (name) => [name, await resolveWorkspaceEnv(rootDir, name)]))), ...githubTokenEnvNames);
|
|
171
|
+
}
|
|
172
|
+
async function resolveGitHubCliToken() {
|
|
173
|
+
try {
|
|
174
|
+
const { execFileSync } = await import("node:child_process");
|
|
175
|
+
return execFileSync("gh", [
|
|
176
|
+
"auth",
|
|
177
|
+
"token",
|
|
178
|
+
"--hostname",
|
|
179
|
+
"github.com"
|
|
180
|
+
], {
|
|
181
|
+
encoding: "utf8",
|
|
182
|
+
stdio: [
|
|
183
|
+
"ignore",
|
|
184
|
+
"pipe",
|
|
185
|
+
"ignore"
|
|
186
|
+
],
|
|
187
|
+
timeout: 2e3
|
|
188
|
+
}).trim() || void 0;
|
|
189
|
+
} catch {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
export { github_exports as n, github$1 as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-8H4AJuhK.js";
|
|
2
|
+
import { glob } from "@vite-hub/source/sources/glob";
|
|
3
|
+
//#region src/sources/glob.ts
|
|
4
|
+
var glob_exports = /* @__PURE__ */ __exportAll({ glob: () => glob$1 });
|
|
5
|
+
function glob$1(options) {
|
|
6
|
+
return {
|
|
7
|
+
...glob({
|
|
8
|
+
...options,
|
|
9
|
+
keyCache: options.keyCache ?? !isLazySource(options)
|
|
10
|
+
}),
|
|
11
|
+
cache: options.cache,
|
|
12
|
+
materialize: options.materialize,
|
|
13
|
+
mount: options.mount,
|
|
14
|
+
sync: options.sync,
|
|
15
|
+
validate: options.validate
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function isLazySource(options) {
|
|
19
|
+
if (options.materialize === "lazy") return true;
|
|
20
|
+
return typeof options.mount === "object" && options.mount?.materialize === "lazy";
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { glob_exports as n, glob$1 as t };
|