kirbyup 4.0.0-alpha.7 → 4.0.0-alpha.8
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/node/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as version, i as name, n as serve, r as handleError, t as build } from "../node-
|
|
1
|
+
import { a as version, i as name, n as serve, r as handleError, t as build } from "../node-DFNV7EsB.mjs";
|
|
2
2
|
import { cac } from "cac";
|
|
3
3
|
//#region src/node/cli-start.ts
|
|
4
4
|
async function startCli(cwd = process.cwd(), argv = process.argv) {
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as serve, t as build } from "../node-
|
|
1
|
+
import { n as serve, t as build } from "../node-DFNV7EsB.mjs";
|
|
2
2
|
export { build, serve };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as fsp from "node:fs/promises";
|
|
3
|
+
import { basename, dirname, relative, resolve } from "node:path";
|
|
3
4
|
import vuePlugin from "@vitejs/plugin-vue";
|
|
4
5
|
import vueJsxPlugin from "@vitejs/plugin-vue-jsx";
|
|
5
6
|
import { consola } from "consola";
|
|
6
7
|
import { colors } from "consola/utils";
|
|
7
|
-
import { basename, dirname, normalize, relative, resolve } from "pathe";
|
|
8
8
|
import { debounce } from "perfect-debounce";
|
|
9
9
|
import { build, createFilter, createLogger, createServer, mergeConfig, normalizePath } from "vite";
|
|
10
|
-
import * as vueCompilerSfc from "vue/compiler-sfc";
|
|
11
10
|
import { loadConfig } from "c12";
|
|
12
11
|
import postcssrcLoad from "postcss-load-config";
|
|
13
12
|
import { gzipSync } from "node:zlib";
|
|
@@ -16,7 +15,7 @@ import { stripLiteral } from "strip-literal";
|
|
|
16
15
|
import { isIP } from "node:net";
|
|
17
16
|
//#region package.json
|
|
18
17
|
var name = "kirbyup";
|
|
19
|
-
var version = "4.0.0-alpha.
|
|
18
|
+
var version = "4.0.0-alpha.8";
|
|
20
19
|
//#endregion
|
|
21
20
|
//#region src/node/config.ts
|
|
22
21
|
function loadConfig$1(cwd = process.cwd()) {
|
|
@@ -71,7 +70,7 @@ function toArray(array) {
|
|
|
71
70
|
return Array.isArray(array) ? array : [array];
|
|
72
71
|
}
|
|
73
72
|
async function printFileInfo({ root, outDir, filePath, content, type, maxLength }) {
|
|
74
|
-
const prettyOutDir = `${
|
|
73
|
+
const prettyOutDir = `${normalizePath(relative(root, outDir))}/`;
|
|
75
74
|
const kibs = content.length / 1024;
|
|
76
75
|
const compressedKibs = gzipSync(content).length / 1024;
|
|
77
76
|
const writeColor = type === "chunk" ? colors.cyan : colors.magenta;
|
|
@@ -101,7 +100,7 @@ function kirbyupFullReloadPlugin(paths) {
|
|
|
101
100
|
type: "full-reload",
|
|
102
101
|
path: "*"
|
|
103
102
|
}), 0);
|
|
104
|
-
logger.info(`${colors.green("full reload")} ${colors.dim(relative(root, path))}`, {
|
|
103
|
+
logger.info(`${colors.green("full reload")} ${colors.dim(normalizePath(relative(root, path)))}`, {
|
|
105
104
|
clear: true,
|
|
106
105
|
timestamp: true
|
|
107
106
|
});
|
|
@@ -173,7 +172,7 @@ function hostIncludesPort(host) {
|
|
|
173
172
|
}
|
|
174
173
|
//#endregion
|
|
175
174
|
//#region src/node/plugins/runtime/hmr-shim.js?raw
|
|
176
|
-
var hmr_shim_default = "/* eslint-disable no-undef */\nimport 'vue'\n\nif (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {\n const originalReload = __VUE_HMR_RUNTIME__.reload\n\n __VUE_HMR_RUNTIME__.reload = function (id, newComp) {\n const
|
|
175
|
+
var hmr_shim_default = "/* eslint-disable no-undef */\nimport 'vue'\n\nif (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {\n const originalReload = __VUE_HMR_RUNTIME__.reload\n\n __VUE_HMR_RUNTIME__.reload = function (id, newComp) {\n const { plugins, app } = window.panel ?? {}\n\n if (plugins?.components) {\n for (const [name, pluginComp] of Object.entries(plugins.components)) {\n if (\n pluginComp.__hmrId === id\n || (newComp.__file && pluginComp.__file === newComp.__file)\n ) {\n plugins.resolveComponentExtension(app, name, newComp)\n plugins.resolveComponentRender(newComp)\n plugins.resolveComponentMixins(newComp)\n break\n }\n }\n }\n\n return originalReload(id, newComp)\n }\n}\nelse {\n console.warn(\n '[kirbyup] Vue HMR runtime not detected; component changes will fall back to full page reload. The Kirby Panel may be loading a production build of Vue.',\n )\n}\n";
|
|
177
176
|
//#endregion
|
|
178
177
|
//#region src/node/plugins/runtime/vue-stub.js?raw
|
|
179
178
|
var vue_stub_default = "const __kirbyupVueImportMapEl = typeof document !== 'undefined'\n ? document.querySelector('script[type=\"importmap\"]')\n : null\nconst __kirbyupVueImports = __kirbyupVueImportMapEl\n ? (() => {\n try {\n return JSON.parse(__kirbyupVueImportMapEl.textContent || '{}').imports || {}\n }\n // eslint-disable-next-line unused-imports/no-unused-vars\n catch (_) {\n return {}\n }\n })()\n : {}\nconst __kirbyupVueUrl = __kirbyupVueImports.vue\nif (!__kirbyupVueUrl) {\n throw new Error(\n '[kirbyup] No \"vue\" entry found in the page <script type=\"importmap\">. Ensure Kirby\\'s Panel is loaded with v6 import maps enabled.',\n )\n}\n// eslint-disable-next-line no-unused-vars, antfu/no-top-level-await\nconst __kirbyupVueModule = await import(/* @vite-ignore */ __kirbyupVueUrl)\n";
|
|
@@ -197,7 +196,11 @@ const __HMR_SHIM_CODE__ = hmr_shim_default;
|
|
|
197
196
|
*/
|
|
198
197
|
function buildVueStubCode(namedExports) {
|
|
199
198
|
if (namedExports.length === 0) return vue_stub_default;
|
|
200
|
-
return vue_stub_default
|
|
199
|
+
return [vue_stub_default, `
|
|
200
|
+
export const {
|
|
201
|
+
${namedExports.map((name) => ` ${name},`).join("\n")}
|
|
202
|
+
} = __kirbyupVueModule
|
|
203
|
+
`.trimStart()].join("\n");
|
|
201
204
|
}
|
|
202
205
|
//#endregion
|
|
203
206
|
//#region src/node/plugins/hmr.ts
|
|
@@ -232,7 +235,7 @@ function kirbyupHmrPlugin(options) {
|
|
|
232
235
|
devIndexPath = resolve(config.root, options.outDir ?? "", "index.dev.js");
|
|
233
236
|
try {
|
|
234
237
|
const vueModule = await import("vue");
|
|
235
|
-
const namedExports = Object.keys(vueModule).filter((name) => name !== "default");
|
|
238
|
+
const namedExports = Object.keys(vueModule).filter((name) => name !== "default" && /^[A-Z_$][\w$]*$/i.test(name));
|
|
236
239
|
vueStubCode = namedExports.length > 0 ? buildVueStubCode(namedExports) : void 0;
|
|
237
240
|
} catch {
|
|
238
241
|
vueStubCode = void 0;
|
|
@@ -318,7 +321,7 @@ function getViteConfig(command, options, { kirbyupConfig, postCssConfig, logger
|
|
|
318
321
|
...alias
|
|
319
322
|
} },
|
|
320
323
|
plugins: [
|
|
321
|
-
vuePlugin(
|
|
324
|
+
vuePlugin(),
|
|
322
325
|
vueJsxPlugin(),
|
|
323
326
|
kirbyupGlobImportPlugin()
|
|
324
327
|
],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirbyup",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.8",
|
|
5
5
|
"packageManager": "pnpm@10.33.3",
|
|
6
6
|
"description": "Zero-config bundler for Kirby Panel plugins",
|
|
7
7
|
"author": {
|
|
@@ -39,16 +39,6 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"types": "./dist/node/index.d.mts",
|
|
42
|
-
"typesVersions": {
|
|
43
|
-
"*": {
|
|
44
|
-
"config": [
|
|
45
|
-
"./dist/client/config.d.mts"
|
|
46
|
-
],
|
|
47
|
-
"plugin": [
|
|
48
|
-
"./dist/client/plugin.d.mts"
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
42
|
"bin": {
|
|
53
43
|
"kirbyup": "bin/kirbyup.mjs"
|
|
54
44
|
},
|
|
@@ -73,13 +63,11 @@
|
|
|
73
63
|
"dependencies": {
|
|
74
64
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
75
65
|
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
76
|
-
"@vue/compiler-sfc": "^3.5.34",
|
|
77
66
|
"c12": "^4.0.0-beta.4",
|
|
78
67
|
"cac": "^7.0.0",
|
|
79
68
|
"chokidar": "^5.0.0",
|
|
80
69
|
"consola": "^3.4.2",
|
|
81
70
|
"magic-string": "^0.30.21",
|
|
82
|
-
"pathe": "^2.0.3",
|
|
83
71
|
"perfect-debounce": "^2.1.0",
|
|
84
72
|
"postcss": "^8.5.14",
|
|
85
73
|
"postcss-load-config": "^6.0.1",
|