kirbyup 4.0.0-alpha.2 → 4.0.0-alpha.3
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 +1 -1
- package/dist/client/config.d.mts +4 -4
- package/dist/client/config.mjs +4 -2
- package/dist/client/plugin.d.mts +7 -12
- package/dist/client/plugin.mjs +11 -21
- package/dist/node/cli.d.mts +1 -2
- package/dist/node/cli.mjs +40 -51
- package/dist/node/index.d.mts +6 -5
- package/dist/node/index.mjs +3 -23
- package/dist/node-DxNmVk8V.mjs +491 -0
- package/dist/types-CFhX3iS8.d.mts +40 -0
- package/package.json +25 -33
- package/dist/client/config.d.ts +0 -6
- package/dist/client/plugin.d.ts +0 -12
- package/dist/node/cli.d.ts +0 -2
- package/dist/node/index.d.ts +0 -7
- package/dist/shared/kirbyup.CPpXMJtV.d.mts +0 -39
- package/dist/shared/kirbyup.CPpXMJtV.d.ts +0 -39
- package/dist/shared/kirbyup.ij1WTPTc.mjs +0 -888
package/README.md
CHANGED
package/dist/client/config.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import 'vite';
|
|
1
|
+
import { r as UserConfig } from "../types-CFhX3iS8.mjs";
|
|
3
2
|
|
|
3
|
+
//#region src/client/config.d.ts
|
|
4
4
|
declare function defineConfig(config: UserConfig): UserConfig;
|
|
5
|
-
|
|
6
|
-
export { defineConfig };
|
|
5
|
+
//#endregion
|
|
6
|
+
export { defineConfig };
|
package/dist/client/config.mjs
CHANGED
package/dist/client/plugin.d.mts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
import(glob: string): Record<string, any>;
|
|
10
|
-
}>;
|
|
11
|
-
|
|
12
|
-
export { kirbyup };
|
|
1
|
+
//#region src/client/plugin.d.ts
|
|
2
|
+
interface KirbyupUtilities {
|
|
3
|
+
import: (glob: string) => Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare const kirbyup: Readonly<KirbyupUtilities>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { KirbyupUtilities, kirbyup };
|
package/dist/client/plugin.mjs
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import(glob) {
|
|
10
|
-
const modules = glob;
|
|
11
|
-
return Object.entries(modules).reduce(
|
|
12
|
-
(accumulator, [path, component]) => {
|
|
13
|
-
accumulator[getComponentName(path)] = component.default;
|
|
14
|
-
return accumulator;
|
|
15
|
-
},
|
|
16
|
-
{}
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
1
|
+
//#region src/client/plugin.ts
|
|
2
|
+
const kirbyup = Object.freeze({ import(glob) {
|
|
3
|
+
const modules = glob;
|
|
4
|
+
return Object.entries(modules).reduce((accumulator, [path, component]) => {
|
|
5
|
+
accumulator[getComponentName(path)] = component.default;
|
|
6
|
+
return accumulator;
|
|
7
|
+
}, {});
|
|
8
|
+
} });
|
|
20
9
|
function getComponentName(path) {
|
|
21
|
-
|
|
10
|
+
return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")).toLowerCase();
|
|
22
11
|
}
|
|
23
12
|
|
|
24
|
-
|
|
13
|
+
//#endregion
|
|
14
|
+
export { kirbyup };
|
package/dist/node/cli.d.mts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { };
|
|
1
|
+
export { };
|
package/dist/node/cli.mjs
CHANGED
|
@@ -1,56 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import 'node:fs';
|
|
4
|
-
import 'node:fs/promises';
|
|
5
|
-
import '@vitejs/plugin-vue';
|
|
6
|
-
import '@vitejs/plugin-vue-jsx';
|
|
7
|
-
import 'consola';
|
|
8
|
-
import 'consola/utils';
|
|
9
|
-
import 'pathe';
|
|
10
|
-
import 'perfect-debounce';
|
|
11
|
-
import 'vite';
|
|
12
|
-
import 'vite-plugin-full-reload';
|
|
13
|
-
import 'vue/compiler-sfc';
|
|
14
|
-
import 'c12';
|
|
15
|
-
import 'postcss-load-config';
|
|
16
|
-
import 'node:module';
|
|
17
|
-
import 'child_process';
|
|
18
|
-
import 'path';
|
|
19
|
-
import 'process';
|
|
20
|
-
import 'stream';
|
|
21
|
-
import 'readline';
|
|
22
|
-
import 'node:buffer';
|
|
23
|
-
import 'node:util';
|
|
24
|
-
import 'node:zlib';
|
|
1
|
+
import { a as version, i as name, n as serve, r as handleError, t as build } from "../node-DxNmVk8V.mjs";
|
|
2
|
+
import { cac } from "cac";
|
|
25
3
|
|
|
4
|
+
//#region src/node/cli-start.ts
|
|
26
5
|
async function startCli(cwd = process.cwd(), argv = process.argv) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
6
|
+
const cli = cac(name);
|
|
7
|
+
cli.command("<file>", "Compile the Kirby Panel plugin to index.js and index.css").option("-d, --out-dir <dir>", "Output directory", { default: cwd }).option("-w, --watch [path]", "Watch for file changes. If no path is specified, the folder of the input file will be watched", { default: false }).example("kirbyup src/index.js").example("kirbyup src/index.js --out-dir ~/kirby-site/site/plugins/demo").example("kirbyup src/index.js --watch src/**/*.{js,css} --watch assets/*\n").action(async (file, options) => {
|
|
8
|
+
process.env.NODE_ENV ||= options.watch ? "development" : "production";
|
|
9
|
+
await build({
|
|
10
|
+
cwd,
|
|
11
|
+
entry: file,
|
|
12
|
+
...options
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
cli.command("serve <file>", "Start development server with live reload").option("--no-watch", "Don't watch .php files for changes", { default: "\0" }).option("-w, --watch <path>", "Watch additional files", { default: "./**/*.php" }).option("-p, --port <number>", "Port for the development server", { default: 5177 }).option("-d, --out-dir <dir>", "Output directory").example("kirbyup serve src/index.js").example("kirbyup serve src/index.js --no-watch --port 3003").example("kirbyup serve src/index.js --watch snippets/*.php --watch templates/*.php\n").action(async (file, options) => {
|
|
16
|
+
process.env.NODE_ENV ||= "development";
|
|
17
|
+
const server = await serve({
|
|
18
|
+
cwd,
|
|
19
|
+
entry: file,
|
|
20
|
+
...options
|
|
21
|
+
});
|
|
22
|
+
const exitProcess = async () => {
|
|
23
|
+
try {
|
|
24
|
+
await server.close();
|
|
25
|
+
} finally {
|
|
26
|
+
process.exit();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
process.once("SIGINT", exitProcess);
|
|
30
|
+
});
|
|
31
|
+
cli.help((s) => s.map((msg) => ({
|
|
32
|
+
...msg,
|
|
33
|
+
body: msg.body.replace(" (default: \0)", "")
|
|
34
|
+
})));
|
|
35
|
+
cli.version(version);
|
|
36
|
+
cli.parse(argv, { run: false });
|
|
37
|
+
await cli.runMatchedCommand();
|
|
54
38
|
}
|
|
55
39
|
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/node/cli.ts
|
|
56
42
|
startCli().catch(handleError);
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { n as ServeOptions, t as BuildOptions } from "../types-CFhX3iS8.mjs";
|
|
2
|
+
import { ViteDevServer } from "vite";
|
|
3
3
|
|
|
4
|
+
//#region src/node/index.d.ts
|
|
4
5
|
declare function build(options: BuildOptions): Promise<void>;
|
|
5
|
-
declare function serve(options: ServeOptions): Promise<
|
|
6
|
-
|
|
7
|
-
export { build, serve };
|
|
6
|
+
declare function serve(options: ServeOptions): Promise<ViteDevServer>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { build, serve };
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import '@vitejs/plugin-vue-jsx';
|
|
5
|
-
import 'consola';
|
|
6
|
-
import 'consola/utils';
|
|
7
|
-
import 'pathe';
|
|
8
|
-
import 'perfect-debounce';
|
|
9
|
-
import 'vite';
|
|
10
|
-
import 'vite-plugin-full-reload';
|
|
11
|
-
import 'vue/compiler-sfc';
|
|
12
|
-
export { b as build, s as serve } from '../shared/kirbyup.ij1WTPTc.mjs';
|
|
13
|
-
import 'c12';
|
|
14
|
-
import 'postcss-load-config';
|
|
15
|
-
import 'node:module';
|
|
16
|
-
import 'child_process';
|
|
17
|
-
import 'path';
|
|
18
|
-
import 'process';
|
|
19
|
-
import 'stream';
|
|
20
|
-
import 'readline';
|
|
21
|
-
import 'node:buffer';
|
|
22
|
-
import 'node:util';
|
|
23
|
-
import 'node:zlib';
|
|
1
|
+
import { n as serve, t as build } from "../node-DxNmVk8V.mjs";
|
|
2
|
+
|
|
3
|
+
export { build, serve };
|