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 CHANGED
@@ -46,7 +46,7 @@ Having installed kirbyup, you can add the following scripts as shortcuts to the
46
46
  "build": "kirbyup src/index.js"
47
47
  },
48
48
  "devDependencies": {
49
- "kirbyup": "^3.1.3"
49
+ "kirbyup": "^3.4.0"
50
50
  }
51
51
  }
52
52
  ```
@@ -1,6 +1,6 @@
1
- import { U as UserConfig } from '../shared/kirbyup.CPpXMJtV.mjs';
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 };
@@ -1,5 +1,7 @@
1
+ //#region src/client/config.ts
1
2
  function defineConfig(config) {
2
- return config;
3
+ return config;
3
4
  }
4
5
 
5
- export { defineConfig };
6
+ //#endregion
7
+ export { defineConfig };
@@ -1,12 +1,7 @@
1
- declare const kirbyup: Readonly<{
2
- /**
3
- * Auto-import Kirby Panel components, transformed by
4
- * kirbyup's glob-import plugin for Vite.
5
- *
6
- * @example
7
- * kirbyup.import('./components/blocks/*.vue')
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 };
@@ -1,24 +1,14 @@
1
- const kirbyup = Object.freeze({
2
- /**
3
- * Auto-import Kirby Panel components, transformed by
4
- * kirbyup's glob-import plugin for Vite.
5
- *
6
- * @example
7
- * kirbyup.import('./components/blocks/*.vue')
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
- return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")).toLowerCase();
10
+ return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")).toLowerCase();
22
11
  }
23
12
 
24
- export { kirbyup };
13
+ //#endregion
14
+ export { kirbyup };
@@ -1,2 +1 @@
1
-
2
- export { };
1
+ export { };
package/dist/node/cli.mjs CHANGED
@@ -1,56 +1,45 @@
1
- import { cac } from 'cac';
2
- import { n as name, b as build, s as serve, v as version, h as handleError } from '../shared/kirbyup.ij1WTPTc.mjs';
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
- const cli = cac(name);
28
- cli.command("<file>", "Compile the Kirby Panel plugin to index.js and index.css").option("-d, --out-dir <dir>", "Output directory", { default: cwd }).option(
29
- "-w, --watch [path]",
30
- "Watch for file changes. If no path is specified, the folder of the input file will be watched",
31
- { default: false }
32
- ).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) => {
33
- process.env.NODE_ENV ||= options.watch ? "development" : "production";
34
- await build({ cwd, entry: file, ...options });
35
- });
36
- 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) => {
37
- process.env.NODE_ENV ||= "development";
38
- const server = await serve({ cwd, entry: file, ...options });
39
- const exitProcess = async () => {
40
- try {
41
- await server.close();
42
- } finally {
43
- process.exit();
44
- }
45
- };
46
- process.once("SIGINT", exitProcess);
47
- });
48
- cli.help(
49
- (s) => s.map((msg) => ({ ...msg, body: msg.body.replace(" (default: \0)", "") }))
50
- );
51
- cli.version(version);
52
- cli.parse(argv, { run: false });
53
- await cli.runMatchedCommand();
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 { };
@@ -1,7 +1,8 @@
1
- import * as vite from 'vite';
2
- import { B as BuildOptions, S as ServeOptions } from '../shared/kirbyup.CPpXMJtV.mjs';
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<vite.ViteDevServer>;
6
-
7
- export { build, serve };
6
+ declare function serve(options: ServeOptions): Promise<ViteDevServer>;
7
+ //#endregion
8
+ export { build, serve };
@@ -1,23 +1,3 @@
1
- import 'node:fs';
2
- import 'node:fs/promises';
3
- import '@vitejs/plugin-vue';
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 };