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 +18 -21
- package/dist/client/config.d.mts +4 -5
- package/dist/client/config.mjs +3 -2
- package/dist/client/plugin.d.mts +7 -12
- package/dist/client/plugin.mjs +17 -21
- package/dist/node/cli.d.mts +1 -2
- package/dist/node/cli.mjs +39 -50
- package/dist/node/index.d.mts +6 -6
- package/dist/node/index.mjs +2 -20
- package/dist/node-UMSghnjT.mjs +470 -0
- package/dist/types-C3c_wslr.d.mts +43 -0
- package/package.json +27 -43
- 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.Bxmi3UeO.mjs +0 -449
- package/dist/shared/kirbyup.DNMktHWN.d.mts +0 -43
- package/dist/shared/kirbyup.DNMktHWN.d.ts +0 -43
package/README.md
CHANGED
|
@@ -2,25 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
# kirbyup
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
15
|
-
- 🎒 PostCSS
|
|
16
|
-
-
|
|
17
|
-
- 🔌
|
|
18
|
-
- 🦔 [
|
|
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
|
-
>
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
> - [`tailwindcss`](./examples/tailwindcss)
|
|
33
|
+
# yarn
|
|
34
|
+
yarn add -D kirbyup
|
|
35
|
+
```
|
|
39
36
|
|
|
40
|
-
|
|
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.
|
|
46
|
+
"kirbyup": "^3.5.0"
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
```
|
|
53
50
|
|
|
54
|
-
##
|
|
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.
|
|
60
|
-
5.
|
|
56
|
+
4. Build with `pnpm run build`
|
|
57
|
+
5. Run tests with `pnpm test`
|
|
61
58
|
|
|
62
59
|
## License
|
|
63
60
|
|
package/dist/client/config.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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 };
|
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,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
17
|
+
return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")).toLowerCase();
|
|
22
18
|
}
|
|
23
|
-
|
|
19
|
+
//#endregion
|
|
24
20
|
export { kirbyup };
|
package/dist/node/cli.d.mts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { };
|
|
1
|
+
export {}
|
package/dist/node/cli.mjs
CHANGED
|
@@ -1,53 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 {};
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
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<
|
|
6
|
-
|
|
7
|
-
export { build, serve };
|
|
5
|
+
declare function serve(options: ServeOptions): Promise<ViteDevServer>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { build, serve };
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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 };
|