@ubean/build 0.3.0 → 0.3.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/dist/codegen/index.js +1 -1
- package/dist/{codegen-D6ewf11I.js → codegen-CYk6X-Hn.js} +34 -21
- package/dist/production.js +2 -2
- package/dist/{vite-D640Tpv8.js → vite-B3y8Qoan.js} +1 -1
- package/dist/vite.js +1 -1
- package/dist/{vue-BJO18Lwe.js → vue-CeSUQZ1J.js} +5 -5
- package/dist/vue.js +1 -1
- package/package.json +20 -20
package/dist/codegen/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as generateImportsTransform, a as generateOpenApiTypesFromServer, b as getUbeanComponentsConfig, c as generateI18nTypes, d as HONO_OPENAPI_PRESET, f as UBEAN_CLIENT_PRESET, g as generateAutoImports, h as VUE_PRESET, i as generateOpenApiTypes, l as messagesToTsType, m as VUE_MACROS_PRESET, n as CODEGEN_FILES, o as generatePageTypes, p as UBEAN_SERVER_PRESET, r as generateTypes, s as generateRouteTypes, t as CODEGEN_CONTRACT_VERSION, u as BUILTIN_PRESETS, v as getBuiltinComposables, y as getUbeanAutoImportConfig } from "../codegen-
|
|
1
|
+
import { _ as generateImportsTransform, a as generateOpenApiTypesFromServer, b as getUbeanComponentsConfig, c as generateI18nTypes, d as HONO_OPENAPI_PRESET, f as UBEAN_CLIENT_PRESET, g as generateAutoImports, h as VUE_PRESET, i as generateOpenApiTypes, l as messagesToTsType, m as VUE_MACROS_PRESET, n as CODEGEN_FILES, o as generatePageTypes, p as UBEAN_SERVER_PRESET, r as generateTypes, s as generateRouteTypes, t as CODEGEN_CONTRACT_VERSION, u as BUILTIN_PRESETS, v as getBuiltinComposables, y as getUbeanAutoImportConfig } from "../codegen-CYk6X-Hn.js";
|
|
2
2
|
export { BUILTIN_PRESETS, CODEGEN_CONTRACT_VERSION, CODEGEN_FILES, HONO_OPENAPI_PRESET, UBEAN_CLIENT_PRESET, UBEAN_SERVER_PRESET, VUE_MACROS_PRESET, VUE_PRESET, generateAutoImports, generateI18nTypes, generateImportsTransform, generateOpenApiTypes, generateOpenApiTypesFromServer, generatePageTypes, generateRouteTypes, generateTypes, getBuiltinComposables, getUbeanAutoImportConfig, getUbeanComponentsConfig, messagesToTsType };
|
|
@@ -276,7 +276,7 @@ async function generateAutoImports(_scanResult, options) {
|
|
|
276
276
|
components.push(...scanned);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
const componentsDts = generateComponentsDts(components);
|
|
279
|
+
const componentsDts = generateComponentsDts(components, componentsDtsPath);
|
|
280
280
|
await writeFile(componentsDtsPath, componentsDts, "utf-8");
|
|
281
281
|
return {
|
|
282
282
|
composablesImports,
|
|
@@ -285,34 +285,47 @@ async function generateAutoImports(_scanResult, options) {
|
|
|
285
285
|
componentsDtsPath
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
|
|
288
|
+
/**
|
|
289
|
+
* Generate the `.ubean/components.d.ts` in a format compatible with
|
|
290
|
+
* unplugin-vue-components (both writers own the same file).
|
|
291
|
+
*
|
|
292
|
+
* `ubean dev` runs codegen first, then unplugin-vue-components rewrites the
|
|
293
|
+
* file in dev mode using its append merge: it keeps entries scraped from the
|
|
294
|
+
* existing `GlobalComponents` interface but drops any surrounding
|
|
295
|
+
* `import`/`const` declaration lines. Entries must therefore be
|
|
296
|
+
* self-contained inline `typeof import('...')` declarations so they stay
|
|
297
|
+
* valid after unplugin merges them.
|
|
298
|
+
*/
|
|
299
|
+
function generateComponentsDts(components, dtsPath) {
|
|
300
|
+
const dtsDir = fileDirname(toPosixPath(normalize(dtsPath)));
|
|
301
|
+
const entries = /* @__PURE__ */ new Map();
|
|
302
|
+
for (const name of [
|
|
303
|
+
"Link",
|
|
304
|
+
"Head",
|
|
305
|
+
"PageView"
|
|
306
|
+
]) entries.set(name, `typeof import('ubean/client')['${name}']`);
|
|
307
|
+
for (const comp of components) {
|
|
308
|
+
const importPath = `./${toPosixPath(relative(dtsDir, toPosixPath(normalize(comp.filePath))))}`;
|
|
309
|
+
entries.set(comp.pascalName, `typeof import('${importPath}')['default']`);
|
|
310
|
+
}
|
|
289
311
|
const lines = [
|
|
290
312
|
"// Auto-generated by ubean - do not edit manually",
|
|
291
313
|
"/* eslint-disable */",
|
|
292
314
|
"// @ts-nocheck",
|
|
315
|
+
"// biome-ignore lint: disable",
|
|
316
|
+
"// oxlint-disable",
|
|
293
317
|
"",
|
|
294
|
-
"
|
|
318
|
+
"export {}",
|
|
319
|
+
"",
|
|
320
|
+
"/* prettier-ignore */",
|
|
321
|
+
"declare module 'vue' {",
|
|
322
|
+
" export interface GlobalComponents {"
|
|
295
323
|
];
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
importLines.push(` const ${name}: typeof import('ubean/client')['${name}'];`);
|
|
300
|
-
componentEntries.push(` ${name}: typeof ${name};`);
|
|
301
|
-
}
|
|
302
|
-
for (const comp of components) {
|
|
303
|
-
importLines.push(` import ${comp.pascalName} from ${JSON.stringify(comp.importPath)};`);
|
|
304
|
-
componentEntries.push(` ${comp.pascalName}: typeof ${comp.pascalName};`);
|
|
305
|
-
}
|
|
306
|
-
if (importLines.length > 0) {
|
|
307
|
-
lines.push(...importLines);
|
|
308
|
-
lines.push("");
|
|
309
|
-
lines.push(" export interface GlobalComponents {");
|
|
310
|
-
lines.push(...componentEntries);
|
|
311
|
-
lines.push(" }");
|
|
312
|
-
} else lines.push(" export interface GlobalComponents {}");
|
|
324
|
+
const sorted = [...entries.entries()].sort(([a], [b]) => a.localeCompare(b));
|
|
325
|
+
lines.push(...sorted.map(([name, declaration]) => ` ${name}: ${declaration}`));
|
|
326
|
+
lines.push(" }");
|
|
313
327
|
lines.push("}");
|
|
314
328
|
lines.push("");
|
|
315
|
-
lines.push("export {}");
|
|
316
329
|
return `${lines.join("\n")}\n`;
|
|
317
330
|
}
|
|
318
331
|
function getBuiltinComposables() {
|
package/dist/production.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as useVirtualRegistry } from "./virtual-registry-BWkaQHXN.js";
|
|
2
2
|
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, r as createMetaVirtualModule, t as createAppVirtualModule } from "./virtual-modules-D5WBA3u7.js";
|
|
3
3
|
import { a as ssrSingletonProdOptimizeExclude, o as ssrSingletonProdSsr } from "./ssr-singleton-CEQi_H6-.js";
|
|
4
|
-
import { n as localeVueParamFromI18n, r as serializeI18nConfig, t as ubeanPlugin } from "./vite-
|
|
5
|
-
import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-
|
|
4
|
+
import { n as localeVueParamFromI18n, r as serializeI18nConfig, t as ubeanPlugin } from "./vite-B3y8Qoan.js";
|
|
5
|
+
import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-CeSUQZ1J.js";
|
|
6
6
|
import { join, relative, resolve } from "pathe";
|
|
7
7
|
import { resolveModules } from "@ubean/config";
|
|
8
8
|
import { build } from "vite";
|
|
@@ -105,7 +105,7 @@ function ubeanPlugin(options) {
|
|
|
105
105
|
"locales"
|
|
106
106
|
];
|
|
107
107
|
const config = ubeanConfig;
|
|
108
|
-
const srcDir =
|
|
108
|
+
const srcDir = resolve(config.rootDir, config.srcDir);
|
|
109
109
|
for (const dir of watchDirs) server.watcher.add(join(srcDir, dir));
|
|
110
110
|
server.watcher.on("add", handleFileChange);
|
|
111
111
|
server.watcher.on("unlink", handleFileChange);
|
package/dist/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ubeanPlugin } from "./vite-
|
|
1
|
+
import { t as ubeanPlugin } from "./vite-B3y8Qoan.js";
|
|
2
2
|
export { ubeanPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as useVirtualRegistry, n as defineVirtualModule } from "./virtual-registry-BWkaQHXN.js";
|
|
2
2
|
import { c as getCssImports, i as ssrSingletonDevPolicy, s as getComponentResolvers } from "./ssr-singleton-CEQi_H6-.js";
|
|
3
|
-
import { f as UBEAN_CLIENT_PRESET, p as UBEAN_SERVER_PRESET } from "./codegen-
|
|
3
|
+
import { f as UBEAN_CLIENT_PRESET, p as UBEAN_SERVER_PRESET } from "./codegen-CYk6X-Hn.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
-
import { join } from "pathe";
|
|
5
|
+
import { join, resolve } from "pathe";
|
|
6
6
|
import { scanProject } from "@ubean/scan";
|
|
7
7
|
import { getVueLocaleParam } from "@ubean/i18n";
|
|
8
8
|
import { transformWithOxc } from "vite";
|
|
@@ -426,7 +426,7 @@ function localeVueParamFromConfig(config) {
|
|
|
426
426
|
function ubeanVite(options) {
|
|
427
427
|
const { config: ubeanConfig } = options;
|
|
428
428
|
const virtualRegistry = useVirtualRegistry();
|
|
429
|
-
const srcDir =
|
|
429
|
+
const srcDir = resolve(ubeanConfig.rootDir, ubeanConfig.srcDir);
|
|
430
430
|
const dtsDir = join(ubeanConfig.rootDir, ".ubean");
|
|
431
431
|
const markdownEnabled = ubeanConfig.markdown?.enabled !== false;
|
|
432
432
|
const mdxEnabled = ubeanConfig.markdown?.mdx === true;
|
|
@@ -656,7 +656,7 @@ function ubeanVite(options) {
|
|
|
656
656
|
*/
|
|
657
657
|
async function runPagefindIndexing(ubeanConfig, searchConfig) {
|
|
658
658
|
const { spawn } = await import("node:child_process");
|
|
659
|
-
const { resolve } = await import("node:path");
|
|
659
|
+
const { resolve: resolvePath } = await import("node:path");
|
|
660
660
|
const isObjectConfig = typeof searchConfig === "object";
|
|
661
661
|
if (!(isObjectConfig ? searchConfig.enabled !== false : true)) return;
|
|
662
662
|
const outDir = isObjectConfig && searchConfig.site ? searchConfig.site : "dist";
|
|
@@ -665,7 +665,7 @@ async function runPagefindIndexing(ubeanConfig, searchConfig) {
|
|
|
665
665
|
const args = [
|
|
666
666
|
"pagefind",
|
|
667
667
|
"--site",
|
|
668
|
-
|
|
668
|
+
resolvePath(ubeanConfig.rootDir, outDir),
|
|
669
669
|
"--output-subdir",
|
|
670
670
|
indexPath
|
|
671
671
|
];
|
package/dist/vue.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-
|
|
1
|
+
import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-CeSUQZ1J.js";
|
|
2
2
|
export { VUE_PLUGIN_INCLUDE, createClientEntryVirtualModule, createServerEntryVirtualModule, createVueAppEntryVirtualModule, createVuePagesVirtualModule, ubeanVite as default, ubeanVite };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubean/build",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Vite plugins, production build, SSG prerender, type codegen, and Server Actions plugin for ubean",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -41,37 +41,37 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@intlify/unplugin-vue-i18n": "11.2.5",
|
|
44
|
+
"@ubean/client": "0.3.1",
|
|
45
|
+
"@ubean/config": "0.3.1",
|
|
46
|
+
"@ubean/i18n": "0.3.1",
|
|
47
|
+
"@ubean/islands": "0.3.1",
|
|
48
|
+
"@ubean/markdown": "0.3.1",
|
|
49
|
+
"@ubean/pages": "0.3.1",
|
|
50
|
+
"@ubean/preset": "0.3.1",
|
|
51
|
+
"@ubean/routes": "0.3.1",
|
|
52
|
+
"@ubean/scan": "0.3.1",
|
|
53
|
+
"@ubean/shared": "0.3.1",
|
|
54
|
+
"@ubean/vue": "0.3.1",
|
|
44
55
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
45
56
|
"openapi-typescript": "^7.13.0",
|
|
46
|
-
"oxc-transform": "^0.
|
|
57
|
+
"oxc-transform": "^0.147.0",
|
|
47
58
|
"pathe": "^2.0.3",
|
|
48
59
|
"tinyglobby": "^0.2.17",
|
|
49
60
|
"unimport": "^6.4.0",
|
|
50
61
|
"unplugin-auto-import": "21.1.0",
|
|
51
62
|
"unplugin-vue-components": "^32.1.0",
|
|
52
|
-
"unplugin-vue-markdown": "^32.
|
|
53
|
-
"vue-i18n": "11.4.
|
|
54
|
-
"@ubean/config": "0.3.0",
|
|
55
|
-
"@ubean/client": "0.3.0",
|
|
56
|
-
"@ubean/i18n": "0.3.0",
|
|
57
|
-
"@ubean/pages": "0.3.0",
|
|
58
|
-
"@ubean/islands": "0.3.0",
|
|
59
|
-
"@ubean/preset": "0.3.0",
|
|
60
|
-
"@ubean/scan": "0.3.0",
|
|
61
|
-
"@ubean/markdown": "0.3.0",
|
|
62
|
-
"@ubean/shared": "0.3.0",
|
|
63
|
-
"@ubean/routes": "0.3.0",
|
|
64
|
-
"@ubean/vue": "0.3.0"
|
|
63
|
+
"unplugin-vue-markdown": "^32.1.1",
|
|
64
|
+
"vue-i18n": "11.4.10"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@types/node": "^26.
|
|
68
|
-
"hono": "4.13.
|
|
67
|
+
"@types/node": "^26.4.0",
|
|
68
|
+
"hono": "4.13.5",
|
|
69
69
|
"typescript": "7.0.2",
|
|
70
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.
|
|
71
|
-
"vite-plus": "0.
|
|
70
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
|
|
71
|
+
"vite-plus": "0.3.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.
|
|
74
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependenciesMeta": {
|
|
77
77
|
"vite": {
|