kirbyup 3.4.0 → 3.5.0

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
@@ -2,25 +2,26 @@
2
2
 
3
3
  # kirbyup
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/kirbyup?color=a1b858&label=)](https://www.npmjs.com/package/kirbyup)
6
-
7
- The official bundler for Kirby Panel plugins with zero-config usage and built-in HMR.
5
+ The official bundler for Kirby Panel plugins. Zero-config, built-in HMR.
8
6
 
9
7
  - [✨  Release Notes](https://github.com/johannschopplich/kirbyup/releases)
10
8
  - [📖  Read the documentation](https://kirbyup.getkirby.com)
11
9
 
12
10
  ## Key Features
13
11
 
14
- - 🔄 [Hot module replacement](https://kirbyup.getkirby.com/guide/getting-started.html#development)
15
- - 🎒 PostCSS support
16
- - 🧭 Add custom path aliases
17
- - 🔌 Run actions based on environment variables
18
- - 🦔 [Extends Vite with `kirbyup.config.js`](https://kirbyup.getkirby.com/guide/config-file)
12
+ - 🔄 [Hot Module Replacement](https://kirbyup.getkirby.com/guide/getting-started.html#development)
13
+ - 🎒 [PostCSS & Sass](https://kirbyup.getkirby.com/guide/postcss)
14
+ - 🧩 [kirbyuse Integration](https://kirbyup.getkirby.com/guide/kirbyuse)
15
+ - 🔌 [Environment Variables](https://kirbyup.getkirby.com/guide/environment-variables)
16
+ - 🦔 [Configuration File](https://kirbyup.getkirby.com/guide/config-file)
17
+ - 🧭 [Path Aliases](https://kirbyup.getkirby.com/guide/path-aliases)
19
18
 
20
19
  ## Setup
21
20
 
22
21
  > [!TIP]
23
- > [📖 Read the documentation](https://kirbyup.getkirby.com)
22
+ > Skip starting from scratch and pick one of the following starters:
23
+ > - [`eslint`](./examples/eslint)
24
+ > - [`unocss`](./examples/unocss)
24
25
 
25
26
  ```bash
26
27
  # pnpm
@@ -28,16 +29,12 @@ pnpm add -D kirbyup
28
29
 
29
30
  # npm
30
31
  npm i -D kirbyup
31
- ```
32
-
33
- ## Basic Usage
34
32
 
35
- > [!TIP]
36
- > [📖 Read the documentation](https://kirbyup.getkirby.com) or skip starting from scratch and pick one of the following starters:
37
- > - [`eslint`](./examples/eslint)
38
- > - [`tailwindcss`](./examples/tailwindcss)
33
+ # yarn
34
+ yarn add -D kirbyup
35
+ ```
39
36
 
40
- Having installed kirbyup, you can add the following scripts as shortcuts to the commands you will use most often:
37
+ After installation, add these scripts to your `package.json`:
41
38
 
42
39
  ```json
43
40
  {
@@ -46,18 +43,18 @@ Having installed kirbyup, you can add the following scripts as shortcuts to the
46
43
  "build": "kirbyup src/index.js"
47
44
  },
48
45
  "devDependencies": {
49
- "kirbyup": "^3.4.0"
46
+ "kirbyup": "^3.5.0"
50
47
  }
51
48
  }
52
49
  ```
53
50
 
54
- ## 💻 Development
51
+ ## Development
55
52
 
56
53
  1. Clone this repository
57
54
  2. Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
58
55
  3. Install dependencies using `pnpm install`
59
- 4. Run `pnpm run dev:prepare`
60
- 5. Start development server using `pnpm run dev`
56
+ 4. Build with `pnpm run build`
57
+ 5. Run tests with `pnpm test`
61
58
 
62
59
  ## License
63
60
 
@@ -1,6 +1,5 @@
1
- import { U as UserConfig } from '../shared/kirbyup.DNMktHWN.mjs';
2
- import 'vite';
3
-
1
+ import { r as UserConfig } from "../types-C3c_wslr.mjs";
2
+ //#region src/client/config.d.ts
4
3
  declare function defineConfig(config: UserConfig): UserConfig;
5
-
6
- export { defineConfig };
4
+ //#endregion
5
+ export { defineConfig };
@@ -1,5 +1,6 @@
1
+ //#region src/client/config.ts
1
2
  function defineConfig(config) {
2
- return config;
3
+ return config;
3
4
  }
4
-
5
+ //#endregion
5
6
  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,20 @@
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({
3
+ /**
4
+ * Auto-import Kirby Panel components, transformed by
5
+ * kirbyup's glob-import plugin for Vite.
6
+ *
7
+ * @example
8
+ * kirbyup.import('./components/blocks/*.vue')
9
+ */
10
+ import(glob) {
11
+ return Object.entries(glob).reduce((accumulator, [path, component]) => {
12
+ accumulator[getComponentName(path)] = component.default;
13
+ return accumulator;
14
+ }, {});
15
+ } });
20
16
  function getComponentName(path) {
21
- return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")).toLowerCase();
17
+ return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")).toLowerCase();
22
18
  }
23
-
19
+ //#endregion
24
20
  export { kirbyup };
@@ -1,2 +1 @@
1
-
2
- export { };
1
+ export {}
package/dist/node/cli.mjs CHANGED
@@ -1,53 +1,42 @@
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.Bxmi3UeO.mjs';
3
- import 'node:fs';
4
- import 'node:fs/promises';
5
- import '@vitejs/plugin-vue2';
6
- import '@vitejs/plugin-vue2-jsx';
7
- import 'consola';
8
- import 'consola/utils';
9
- import 'pathe';
10
- import 'perfect-debounce';
11
- import 'rollup-plugin-external-globals';
12
- import 'vite';
13
- import 'vite-plugin-full-reload';
14
- import 'vue/compiler-sfc';
15
- import 'c12';
16
- import 'postcss-load-config';
17
- import 'magic-string';
18
- import 'nypm';
19
- import 'node:buffer';
20
- import 'node:util';
21
- import 'node:zlib';
22
-
1
+ import { a as version, i as name, n as serve, r as handleError, t as build } from "../node-UMSghnjT.mjs";
2
+ import { cac } from "cac";
3
+ //#region src/node/cli-start.ts
23
4
  async function startCli(cwd = process.cwd(), argv = process.argv) {
24
- const cli = cac(name);
25
- cli.command("<file>", "Compile the Kirby Panel plugin to index.js and index.css").option("-d, --out-dir <dir>", "Output directory", { default: cwd }).option(
26
- "-w, --watch [path]",
27
- "Watch for file changes. If no path is specified, the folder of the input file will be watched",
28
- { default: false }
29
- ).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) => {
30
- process.env.NODE_ENV ||= options.watch ? "development" : "production";
31
- await build({ cwd, entry: file, ...options });
32
- });
33
- 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) => {
34
- process.env.NODE_ENV ||= "development";
35
- const server = await serve({ cwd, entry: file, ...options });
36
- const exitProcess = async () => {
37
- try {
38
- await server.close();
39
- } finally {
40
- process.exit();
41
- }
42
- };
43
- process.once("SIGINT", exitProcess);
44
- });
45
- cli.help(
46
- (s) => s.map((msg) => ({ ...msg, body: msg.body.replace(" (default: \0)", "") }))
47
- );
48
- cli.version(version);
49
- cli.parse(argv, { run: false });
50
- await cli.runMatchedCommand();
5
+ const cli = cac(name);
6
+ 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) => {
7
+ process.env.NODE_ENV ||= options.watch ? "development" : "production";
8
+ await build({
9
+ cwd,
10
+ entry: file,
11
+ ...options
12
+ });
13
+ });
14
+ 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) => {
15
+ process.env.NODE_ENV ||= "development";
16
+ const server = await serve({
17
+ cwd,
18
+ entry: file,
19
+ ...options
20
+ });
21
+ const exitProcess = async () => {
22
+ try {
23
+ await server.close();
24
+ } finally {
25
+ process.exit();
26
+ }
27
+ };
28
+ process.once("SIGINT", exitProcess);
29
+ });
30
+ cli.help((s) => s.map((msg) => ({
31
+ ...msg,
32
+ body: msg.body.replace(" (default: \0)", "")
33
+ })));
34
+ cli.version(version);
35
+ cli.parse(argv, { run: false });
36
+ await cli.runMatchedCommand();
51
37
  }
52
-
38
+ //#endregion
39
+ //#region src/node/cli.ts
53
40
  startCli().catch(handleError);
41
+ //#endregion
42
+ export {};
@@ -1,7 +1,7 @@
1
- import * as vite from 'vite';
2
- import { B as BuildOptions, S as ServeOptions } from '../shared/kirbyup.DNMktHWN.mjs';
3
-
1
+ import { n as ServeOptions, t as BuildOptions } from "../types-C3c_wslr.mjs";
2
+ import { ViteDevServer } from "vite";
3
+ //#region src/node/index.d.ts
4
4
  declare function build(options: BuildOptions): Promise<void>;
5
- declare function serve(options: ServeOptions): Promise<vite.ViteDevServer>;
6
-
7
- export { build, serve };
5
+ declare function serve(options: ServeOptions): Promise<ViteDevServer>;
6
+ //#endregion
7
+ export { build, serve };
@@ -1,20 +1,2 @@
1
- import 'node:fs';
2
- import 'node:fs/promises';
3
- import '@vitejs/plugin-vue2';
4
- import '@vitejs/plugin-vue2-jsx';
5
- import 'consola';
6
- import 'consola/utils';
7
- import 'pathe';
8
- import 'perfect-debounce';
9
- import 'rollup-plugin-external-globals';
10
- import 'vite';
11
- import 'vite-plugin-full-reload';
12
- import 'vue/compiler-sfc';
13
- export { b as build, s as serve } from '../shared/kirbyup.Bxmi3UeO.mjs';
14
- import 'c12';
15
- import 'postcss-load-config';
16
- import 'magic-string';
17
- import 'nypm';
18
- import 'node:buffer';
19
- import 'node:util';
20
- import 'node:zlib';
1
+ import { n as serve, t as build } from "../node-UMSghnjT.mjs";
2
+ export { build, serve };