kirbyup 3.0.0 → 3.0.2
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/LICENSE +2 -2
- package/README.md +15 -8
- package/cli.mjs +1 -1
- package/dist/client/config.d.mts +6 -0
- package/dist/{config.d.ts → client/config.d.ts} +1 -1
- package/dist/client/plugin.d.ts +12 -0
- package/dist/node/cli.d.mts +2 -0
- package/dist/node/cli.d.ts +2 -0
- package/dist/{cli.mjs → node/cli.mjs} +2 -2
- package/dist/node/index.d.mts +7 -0
- package/dist/{index.d.ts → node/index.d.ts} +1 -1
- package/dist/{index.mjs → node/index.mjs} +2 -2
- package/dist/shared/{kirbyup.330155d0.mjs → kirbyup.3a78cfb2.mjs} +4 -4
- package/dist/{types-77db3ac4.d.ts → shared/kirbyup.cf02d174.d.mts} +1 -1
- package/dist/shared/kirbyup.cf02d174.d.ts +36 -0
- package/package.json +38 -38
- package/dist/cli.d.ts +0 -2
- /package/dist/{config.mjs → client/config.mjs} +0 -0
- /package/dist/{plugin.d.ts → client/plugin.d.mts} +0 -0
- /package/dist/{plugin.mjs → client/plugin.mjs} +0 -0
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021-
|
|
4
|
-
Copyright (c) 2022-
|
|
3
|
+
Copyright (c) 2021-PRESENT Johann Schopplich <https://github.com/johannschopplich>
|
|
4
|
+
Copyright (c) 2022-PRESENT Jonas Kuske <https://github.com/jonaskuske>
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# kirbyup
|
|
2
2
|
|
|
3
|
+
> [!NOTE]
|
|
3
4
|
> Take a look into Kirby's [pluginkit](https://github.com/getkirby/pluginkit/tree/4-panel) repository for an example setup.
|
|
4
5
|
|
|
5
6
|
The fastest and leanest way to bundle your Kirby Panel plugins. No configuration necessary.
|
|
@@ -17,7 +18,7 @@ The fastest and leanest way to bundle your Kirby Panel plugins. No configuration
|
|
|
17
18
|
|
|
18
19
|
## Requirements
|
|
19
20
|
|
|
20
|
-
- Node
|
|
21
|
+
- Latest Node.js LTS version (currently v18)
|
|
21
22
|
|
|
22
23
|
## Get Started Right Away
|
|
23
24
|
|
|
@@ -41,6 +42,7 @@ If you want to use kirbyup right away, there is no need to install it. Simply ca
|
|
|
41
42
|
}
|
|
42
43
|
```
|
|
43
44
|
|
|
45
|
+
> [!NOTE]
|
|
44
46
|
> If `npx` doesn't use the latest kirbyup version, although it is available, run `npx -y kirbyup@latest` instead or delete the `~/.npm/_npx` cache folder.
|
|
45
47
|
|
|
46
48
|
While kirbyup will stay backwards compatible, exact build reproducibility may be of importance to you. If so, I recommend targeting a specific package version, rather than using `npx`. Install kirbyup with a package manager of your choice locally to your project:
|
|
@@ -72,7 +74,8 @@ Global installation is supported as well, but not recommended.
|
|
|
72
74
|
|
|
73
75
|
Start a development server for the Panel plugin:
|
|
74
76
|
|
|
75
|
-
>
|
|
77
|
+
> [!NOTE]
|
|
78
|
+
> This feature requires Kirby v3.7.4+.
|
|
76
79
|
|
|
77
80
|
```bash
|
|
78
81
|
kirbyup serve src/index.js
|
|
@@ -122,7 +125,8 @@ You can use the alias:
|
|
|
122
125
|
import someUtility from '~/utils'
|
|
123
126
|
```
|
|
124
127
|
|
|
125
|
-
>
|
|
128
|
+
> [!NOTE]
|
|
129
|
+
> You can use `@/` as path alias as well.
|
|
126
130
|
|
|
127
131
|
### Auto-Import Blocks and Fields
|
|
128
132
|
|
|
@@ -172,7 +176,7 @@ Loaded env variables are also exposed to your source code via `import.meta.env`.
|
|
|
172
176
|
|
|
173
177
|
To prevent accidentally leaking env variables for distribution, only variables prefixed with `KIRBYUP_` or `VITE_` are exposed to your processed code. Take the following file as an example:
|
|
174
178
|
|
|
175
|
-
```
|
|
179
|
+
```ini
|
|
176
180
|
DB_PASSWORD=foobar
|
|
177
181
|
KIRBYUP_SOME_KEY=123
|
|
178
182
|
```
|
|
@@ -187,9 +191,11 @@ Create a `kirbyup.config.js` or `kirbyup.config.ts` configuration file the root-
|
|
|
187
191
|
import { resolve } from 'node:path'
|
|
188
192
|
import { defineConfig } from 'kirbyup/config'
|
|
189
193
|
|
|
194
|
+
const currentDir = new URL('.', import.meta.url).pathname
|
|
195
|
+
|
|
190
196
|
export default defineConfig({
|
|
191
197
|
alias: {
|
|
192
|
-
'#deep/': `${resolve(
|
|
198
|
+
'#deep/': `${resolve(currentDir, 'src/deep')}/`
|
|
193
199
|
},
|
|
194
200
|
extendViteConfig: {
|
|
195
201
|
build: {
|
|
@@ -239,7 +245,8 @@ The output directory where the plugin file read by Kirby is saved. Defaults to t
|
|
|
239
245
|
|
|
240
246
|
Specifies additional files that should be watched for changes, with changes causing the page to reload. Repeat `--watch` for multiple paths.
|
|
241
247
|
|
|
242
|
-
>
|
|
248
|
+
> [!NOTE]
|
|
249
|
+
> By default, kirbyup will watch all PHP files (`./**/*.php`) in the plugin directory and reload the page if it detects changes. Using `--watch` to set your own path overrides this setting, so you need to add the PHP glob explicitly if you want to keep the behavior: `--watch ./my/files/* --watch ./**/*.php`
|
|
243
250
|
|
|
244
251
|
##### `--no-watch`
|
|
245
252
|
|
|
@@ -252,6 +259,6 @@ Disables the default behavior of watching all PHP files for changes.
|
|
|
252
259
|
|
|
253
260
|
## License
|
|
254
261
|
|
|
255
|
-
[MIT](./LICENSE) License © 2021-
|
|
262
|
+
[MIT](./LICENSE) License © 2021-PRESENT [Johann Schopplich](https://github.com/johannschopplich)
|
|
256
263
|
|
|
257
|
-
[MIT](./LICENSE) License © 2022-
|
|
264
|
+
[MIT](./LICENSE) License © 2022-PRESENT [Jonas Kuske](https://github.com/jonaskuske)
|
package/cli.mjs
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const kirbyup: Readonly<{
|
|
2
|
+
/**
|
|
3
|
+
* Auto-import Kirby Panel components, will be transformed by
|
|
4
|
+
* kirbyup's auto 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,10 +1,10 @@
|
|
|
1
1
|
import { cac } from 'cac';
|
|
2
|
-
import { n as name, b as build, s as serve, v as version, h as handleError } from '
|
|
2
|
+
import { n as name, b as build, s as serve, v as version, h as handleError } from '../shared/kirbyup.3a78cfb2.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'pathe';
|
|
6
6
|
import 'consola';
|
|
7
|
-
import '
|
|
7
|
+
import 'consola/utils';
|
|
8
8
|
import 'perfect-debounce';
|
|
9
9
|
import 'vite';
|
|
10
10
|
import 'vue/compiler-sfc';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as vite from 'vite';
|
|
2
|
+
import { B as BuildOptions, S as ServeOptions } from '../shared/kirbyup.cf02d174.mjs';
|
|
3
|
+
|
|
4
|
+
declare function build(options: BuildOptions): Promise<void>;
|
|
5
|
+
declare function serve(options: ServeOptions): Promise<vite.ViteDevServer>;
|
|
6
|
+
|
|
7
|
+
export { build, serve };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { B as BuildOptions, S as ServeOptions } from '
|
|
2
|
+
import { B as BuildOptions, S as ServeOptions } from '../shared/kirbyup.cf02d174.js';
|
|
3
3
|
|
|
4
4
|
declare function build(options: BuildOptions): Promise<void>;
|
|
5
5
|
declare function serve(options: ServeOptions): Promise<vite.ViteDevServer>;
|
|
@@ -2,7 +2,7 @@ import 'node:fs';
|
|
|
2
2
|
import 'node:fs/promises';
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import 'consola';
|
|
5
|
-
import '
|
|
5
|
+
import 'consola/utils';
|
|
6
6
|
import 'perfect-debounce';
|
|
7
7
|
import 'vite';
|
|
8
8
|
import 'vue/compiler-sfc';
|
|
@@ -13,7 +13,7 @@ import 'rollup-plugin-external-globals';
|
|
|
13
13
|
import 'postcss-load-config';
|
|
14
14
|
import 'postcss-logical';
|
|
15
15
|
import 'postcss-dir-pseudo-class';
|
|
16
|
-
export { b as build, s as serve } from '
|
|
16
|
+
export { b as build, s as serve } from '../shared/kirbyup.3a78cfb2.mjs';
|
|
17
17
|
import 'node:zlib';
|
|
18
18
|
import 'node:util';
|
|
19
19
|
import 'node:buffer';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, statSync, unlinkSync } from 'node:fs';
|
|
2
2
|
import { writeFile, readFile } from 'node:fs/promises';
|
|
3
3
|
import { normalize, relative, resolve, dirname, basename } from 'pathe';
|
|
4
|
-
import consola from 'consola';
|
|
5
|
-
import colors from '
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
import { colors } from 'consola/utils';
|
|
6
6
|
import { debounce } from 'perfect-debounce';
|
|
7
7
|
import { createServer, mergeConfig, build as build$1 } from 'vite';
|
|
8
8
|
import * as vueCompilerSfc from 'vue/compiler-sfc';
|
|
@@ -21,7 +21,7 @@ import MagicString from 'magic-string';
|
|
|
21
21
|
import { detect } from 'detect-package-manager';
|
|
22
22
|
|
|
23
23
|
const name = "kirbyup";
|
|
24
|
-
const version = "3.0.
|
|
24
|
+
const version = "3.0.2";
|
|
25
25
|
|
|
26
26
|
class PrettyError extends Error {
|
|
27
27
|
constructor(message) {
|
|
@@ -55,7 +55,7 @@ async function printFileInfo(root, outDir, filePath, content, type, maxLength) {
|
|
|
55
55
|
const compressedSize = await getCompressedSize(content);
|
|
56
56
|
const writeColor = type === "chunk" ? colors.cyan : colors.magenta;
|
|
57
57
|
consola.log(
|
|
58
|
-
colors.white(colors.dim(prettyOutDir)) + writeColor(filePath.padEnd(maxLength + 2)) + colors.dim(`${kibs.toFixed(2)}
|
|
58
|
+
colors.white(colors.dim(prettyOutDir)) + writeColor(filePath.padEnd(maxLength + 2)) + colors.dim(`${kibs.toFixed(2)} kB${compressedSize}`)
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AliasOptions, InlineConfig } from 'vite';
|
|
2
|
+
|
|
3
|
+
interface BaseOptions {
|
|
4
|
+
cwd: string;
|
|
5
|
+
entry: string;
|
|
6
|
+
}
|
|
7
|
+
interface ServeOptions extends BaseOptions {
|
|
8
|
+
watch: false | string | string[];
|
|
9
|
+
port: number;
|
|
10
|
+
outDir?: string;
|
|
11
|
+
}
|
|
12
|
+
interface BuildOptions extends BaseOptions {
|
|
13
|
+
outDir: string;
|
|
14
|
+
watch: boolean | string | string[];
|
|
15
|
+
}
|
|
16
|
+
interface UserConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Load from config files
|
|
19
|
+
* Set to `false` to disable
|
|
20
|
+
*/
|
|
21
|
+
configFile?: string | false;
|
|
22
|
+
/**
|
|
23
|
+
* Specifies an `Object`, or an `Array` of `Object`,
|
|
24
|
+
* which defines aliases used to replace values in `import` statements.
|
|
25
|
+
* With either format, the order of the entries is important,
|
|
26
|
+
* in that the first defined rules are applied first.
|
|
27
|
+
*/
|
|
28
|
+
alias?: AliasOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Extends Vite's configuration. Will be merged with kirbyup's
|
|
31
|
+
* default configuration. Be careful what to extend.
|
|
32
|
+
*/
|
|
33
|
+
extendViteConfig?: InlineConfig;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type { BuildOptions as B, ServeOptions as S, UserConfig as U };
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirbyup",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "3.0.2",
|
|
5
|
+
"packageManager": "pnpm@8.10.5",
|
|
5
6
|
"description": "Zero-config bundler for Kirby Panel plugins",
|
|
6
7
|
"author": {
|
|
7
8
|
"name": "Johann Schopplich",
|
|
@@ -25,27 +26,27 @@
|
|
|
25
26
|
],
|
|
26
27
|
"exports": {
|
|
27
28
|
".": {
|
|
28
|
-
"types": "./dist/index.d.ts",
|
|
29
|
-
"import": "./dist/index.mjs"
|
|
29
|
+
"types": "./dist/node/index.d.ts",
|
|
30
|
+
"import": "./dist/node/index.mjs"
|
|
30
31
|
},
|
|
31
32
|
"./config": {
|
|
32
|
-
"types": "./dist/config.d.ts",
|
|
33
|
-
"import": "./dist/config.mjs"
|
|
33
|
+
"types": "./dist/client/config.d.ts",
|
|
34
|
+
"import": "./dist/client/config.mjs"
|
|
34
35
|
},
|
|
35
36
|
"./plugin": {
|
|
36
|
-
"types": "./dist/plugin.d.ts",
|
|
37
|
-
"import": "./dist/plugin.mjs"
|
|
37
|
+
"types": "./dist/client/plugin.d.ts",
|
|
38
|
+
"import": "./dist/client/plugin.mjs"
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
|
-
"module": "./dist/index.mjs",
|
|
41
|
-
"types": "./dist/index.d.ts",
|
|
41
|
+
"module": "./dist/node/index.mjs",
|
|
42
|
+
"types": "./dist/node/index.d.ts",
|
|
42
43
|
"typesVersions": {
|
|
43
44
|
"*": {
|
|
44
45
|
"config": [
|
|
45
|
-
"./dist/config.d.ts"
|
|
46
|
+
"./dist/client/config.d.ts"
|
|
46
47
|
],
|
|
47
48
|
"plugin": [
|
|
48
|
-
"./dist/plugin.d.ts"
|
|
49
|
+
"./dist/client/plugin.d.ts"
|
|
49
50
|
]
|
|
50
51
|
}
|
|
51
52
|
},
|
|
@@ -55,11 +56,11 @@
|
|
|
55
56
|
"dist"
|
|
56
57
|
],
|
|
57
58
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
59
|
+
"node": ">=18"
|
|
59
60
|
},
|
|
60
61
|
"scripts": {
|
|
61
62
|
"build": "unbuild",
|
|
62
|
-
"dev": "
|
|
63
|
+
"dev": "UNBUILD_STUB=true unbuild",
|
|
63
64
|
"lint": "eslint .",
|
|
64
65
|
"lint:fix": "eslint . --fix",
|
|
65
66
|
"release": "bumpp --commit --push --tag",
|
|
@@ -70,39 +71,38 @@
|
|
|
70
71
|
"dependencies": {
|
|
71
72
|
"@vitejs/plugin-vue2": "2.2.0",
|
|
72
73
|
"@vitejs/plugin-vue2-jsx": "1.1.0",
|
|
73
|
-
"@vue/compiler-sfc": "^2.7.
|
|
74
|
+
"@vue/compiler-sfc": "^2.7.15",
|
|
74
75
|
"cac": "^6.7.14",
|
|
75
76
|
"chokidar": "^3.5.3",
|
|
76
|
-
"consola": "^2.
|
|
77
|
-
"detect-package-manager": "^
|
|
78
|
-
"magic-string": "^0.30.
|
|
77
|
+
"consola": "^3.2.3",
|
|
78
|
+
"detect-package-manager": "^3.0.1",
|
|
79
|
+
"magic-string": "^0.30.5",
|
|
79
80
|
"pathe": "^1.1.1",
|
|
80
|
-
"perfect-debounce": "^0.
|
|
81
|
-
"
|
|
82
|
-
"postcss": "^8.
|
|
83
|
-
"postcss-dir-pseudo-class": "^7.0.2",
|
|
81
|
+
"perfect-debounce": "^1.0.0",
|
|
82
|
+
"postcss": "^8.4.31",
|
|
83
|
+
"postcss-dir-pseudo-class": "^8.0.0",
|
|
84
84
|
"postcss-load-config": "^4.0.1",
|
|
85
|
-
"postcss-logical": "^
|
|
85
|
+
"postcss-logical": "^7.0.0",
|
|
86
86
|
"rollup-plugin-external-globals": "^0.8.0",
|
|
87
|
-
"sass": "^1.
|
|
88
|
-
"unconfig": "^0.3.
|
|
89
|
-
"vite": "^4.
|
|
87
|
+
"sass": "^1.69.5",
|
|
88
|
+
"unconfig": "^0.3.11",
|
|
89
|
+
"vite": "^4.5.0",
|
|
90
90
|
"vite-plugin-full-reload": "^1.0.5",
|
|
91
|
-
"vue": "^2.7.
|
|
91
|
+
"vue": "^2.7.15"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@antfu/eslint-config": "^
|
|
95
|
-
"@types/fs-extra": "^11.0.
|
|
96
|
-
"@types/node": "^
|
|
97
|
-
"@types/prompts": "^2.4.
|
|
98
|
-
"bumpp": "^9.
|
|
99
|
-
"eslint": "^8.
|
|
100
|
-
"fast-glob": "^3.2
|
|
94
|
+
"@antfu/eslint-config": "^1.1.2",
|
|
95
|
+
"@types/fs-extra": "^11.0.4",
|
|
96
|
+
"@types/node": "^20.9.0",
|
|
97
|
+
"@types/prompts": "^2.4.8",
|
|
98
|
+
"bumpp": "^9.2.0",
|
|
99
|
+
"eslint": "^8.53.0",
|
|
100
|
+
"fast-glob": "^3.3.2",
|
|
101
101
|
"fs-extra": "^11.1.1",
|
|
102
|
-
"simple-git-hooks": "^2.
|
|
103
|
-
"typescript": "~5.
|
|
104
|
-
"unbuild": "^
|
|
105
|
-
"vitest": "^0.
|
|
102
|
+
"simple-git-hooks": "^2.9.0",
|
|
103
|
+
"typescript": "~5.2.2",
|
|
104
|
+
"unbuild": "^2.0.0",
|
|
105
|
+
"vitest": "^0.34.6"
|
|
106
106
|
},
|
|
107
107
|
"simple-git-hooks": {
|
|
108
108
|
"commit-msg": "node scripts/verifyCommit.mjs $1"
|
package/dist/cli.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|