kirbyup 3.0.2 → 3.1.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
@@ -1,6 +1,6 @@
1
1
  # kirbyup
2
2
 
3
- > [!NOTE]
3
+ > [!TIP]
4
4
  > Take a look into Kirby's [pluginkit](https://github.com/getkirby/pluginkit/tree/4-panel) repository for an example setup.
5
5
 
6
6
  The fastest and leanest way to bundle your Kirby Panel plugins. No configuration necessary.
@@ -24,9 +24,10 @@ The fastest and leanest way to bundle your Kirby Panel plugins. No configuration
24
24
 
25
25
  … With one of the following Panel plugin kits:
26
26
 
27
- - [`eslint-and-prettier`](./examples/eslint-and-prettier) (recommended)
27
+ - [`eslint`](./examples/eslint)
28
28
  - [`tailwindcss`](./examples/tailwindcss)
29
- - [Kirby's default `pluginkit`](https://github.com/getkirby/pluginkit/tree/4-panel)
29
+
30
+ I highly recommend using one of these starters instead of [Kirby's default `pluginkit`](https://github.com/getkirby/pluginkit/tree/4-panel). They provide a better developer experience out of the box.
30
31
 
31
32
  ## Installation
32
33
 
@@ -125,7 +126,7 @@ You can use the alias:
125
126
  import someUtility from '~/utils'
126
127
  ```
127
128
 
128
- > [!NOTE]
129
+ > [!TIP]
129
130
  > You can use `@/` as path alias as well.
130
131
 
131
132
  ### Auto-Import Blocks and Fields
@@ -219,6 +220,7 @@ For a complete list of options, take a look at the [Vite configuration options](
219
220
 
220
221
  ## Options
221
222
 
223
+ > [!TIP]
222
224
  > Inspect all available options with `kirbyup --help` and `kirbyup serve --help`.
223
225
 
224
226
  ### `kirbyup <input>`
package/dist/node/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
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.3a78cfb2.mjs';
2
+ import { n as name, b as build, s as serve, v as version, h as handleError } from '../shared/kirbyup.9b5c1ecd.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'pathe';
@@ -18,7 +18,7 @@ import 'postcss-dir-pseudo-class';
18
18
  import 'node:zlib';
19
19
  import 'node:util';
20
20
  import 'node:buffer';
21
- import 'unconfig';
21
+ import 'c12';
22
22
  import 'magic-string';
23
23
  import 'detect-package-manager';
24
24
 
@@ -13,10 +13,10 @@ 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 '../shared/kirbyup.3a78cfb2.mjs';
16
+ export { b as build, s as serve } from '../shared/kirbyup.9b5c1ecd.mjs';
17
17
  import 'node:zlib';
18
18
  import 'node:util';
19
19
  import 'node:buffer';
20
- import 'unconfig';
20
+ import 'c12';
21
21
  import 'magic-string';
22
22
  import 'detect-package-manager';
@@ -1,4 +1,4 @@
1
- import { existsSync, statSync, unlinkSync } from 'node:fs';
1
+ import { existsSync, unlinkSync } from 'node:fs';
2
2
  import { writeFile, readFile } from 'node:fs/promises';
3
3
  import { normalize, relative, resolve, dirname, basename } from 'pathe';
4
4
  import { consola } from 'consola';
@@ -16,12 +16,12 @@ import postcssDirPseudoClass from 'postcss-dir-pseudo-class';
16
16
  import { gzip } from 'node:zlib';
17
17
  import { promisify } from 'node:util';
18
18
  import { Buffer } from 'node:buffer';
19
- import { createConfigLoader } from 'unconfig';
19
+ import { loadConfig as loadConfig$1 } from 'c12';
20
20
  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.2";
24
+ const version = "3.1.0";
25
25
 
26
26
  class PrettyError extends Error {
27
27
  constructor(message) {
@@ -59,43 +59,16 @@ async function printFileInfo(root, outDir, filePath, content, type, maxLength) {
59
59
  );
60
60
  }
61
61
 
62
- async function loadConfig(cwd = process.cwd(), configOrPath = cwd, extraConfigSources = []) {
63
- let inlineConfig = {};
64
- if (typeof configOrPath !== "string") {
65
- inlineConfig = configOrPath;
66
- if (inlineConfig.configFile === false) {
67
- return {
68
- config: inlineConfig,
69
- sources: []
70
- };
71
- } else {
72
- configOrPath = inlineConfig.configFile || process.cwd();
73
- }
74
- }
75
- const resolved = resolve(configOrPath);
76
- let isFile = false;
77
- if (existsSync(resolved) && statSync(resolved).isFile()) {
78
- isFile = true;
79
- cwd = dirname(resolved);
80
- }
81
- const loader = createConfigLoader({
82
- sources: isFile ? [
83
- {
84
- files: resolved,
85
- extensions: []
86
- }
87
- ] : [
88
- {
89
- files: ["kirbyup.config"]
90
- },
91
- ...extraConfigSources
92
- ],
62
+ function loadConfig(cwd = process.cwd()) {
63
+ return loadConfig$1({
93
64
  cwd,
94
- defaults: inlineConfig
65
+ name: "kirbyup",
66
+ rcFile: false,
67
+ jitiOptions: {
68
+ interopDefault: true,
69
+ esmResolve: true
70
+ }
95
71
  });
96
- const result = await loader.load();
97
- result.config = result.config || inlineConfig;
98
- return result;
99
72
  }
100
73
 
101
74
  const multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//gm;
@@ -362,8 +335,8 @@ async function generate(options) {
362
335
  async function build(options) {
363
336
  ensureEntry(options);
364
337
  const { cwd } = options;
365
- const { config, sources: configSources } = await loadConfig(cwd);
366
- resolvedKirbyupConfig = config;
338
+ const { config, configFile } = await loadConfig(cwd);
339
+ resolvedKirbyupConfig = config ?? {};
367
340
  try {
368
341
  resolvedPostCssConfig = await postcssrc(void 0, void 0, { stopDir: cwd });
369
342
  } catch (err) {
@@ -404,11 +377,11 @@ async function build(options) {
404
377
  ignored,
405
378
  cwd
406
379
  });
407
- if (configSources.length)
408
- watcher.add(configSources);
380
+ if (configFile)
381
+ watcher.add(configFile);
409
382
  watcher.on("all", async (type, file) => {
410
- if (configSources.includes(file)) {
411
- resolvedKirbyupConfig = (await loadConfig()).config;
383
+ if (configFile === file) {
384
+ resolvedKirbyupConfig = (await loadConfig(cwd)).config ?? {};
412
385
  consola.info(
413
386
  `${colors.cyan(basename(file))} changed, setting new config`
414
387
  );
@@ -426,7 +399,7 @@ async function serve(options) {
426
399
  ensureEntry(options);
427
400
  const { cwd } = options;
428
401
  const { config } = await loadConfig(cwd);
429
- resolvedKirbyupConfig = config;
402
+ resolvedKirbyupConfig = config ?? {};
430
403
  try {
431
404
  resolvedPostCssConfig = await postcssrc(void 0, void 0, { stopDir: cwd });
432
405
  } catch (err) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "kirbyup",
3
3
  "type": "module",
4
- "version": "3.0.2",
5
- "packageManager": "pnpm@8.10.5",
4
+ "version": "3.1.0",
5
+ "packageManager": "pnpm@8.11.0",
6
6
  "description": "Zero-config bundler for Kirby Panel plugins",
7
7
  "author": {
8
8
  "name": "Johann Schopplich",
@@ -72,6 +72,7 @@
72
72
  "@vitejs/plugin-vue2": "2.2.0",
73
73
  "@vitejs/plugin-vue2-jsx": "1.1.0",
74
74
  "@vue/compiler-sfc": "^2.7.15",
75
+ "c12": "^1.5.1",
75
76
  "cac": "^6.7.14",
76
77
  "chokidar": "^3.5.3",
77
78
  "consola": "^3.2.3",
@@ -79,30 +80,29 @@
79
80
  "magic-string": "^0.30.5",
80
81
  "pathe": "^1.1.1",
81
82
  "perfect-debounce": "^1.0.0",
82
- "postcss": "^8.4.31",
83
+ "postcss": "^8.4.32",
83
84
  "postcss-dir-pseudo-class": "^8.0.0",
84
- "postcss-load-config": "^4.0.1",
85
+ "postcss-load-config": "^5.0.2",
85
86
  "postcss-logical": "^7.0.0",
86
- "rollup-plugin-external-globals": "^0.8.0",
87
+ "rollup-plugin-external-globals": "^0.9.1",
87
88
  "sass": "^1.69.5",
88
- "unconfig": "^0.3.11",
89
- "vite": "^4.5.0",
90
- "vite-plugin-full-reload": "^1.0.5",
89
+ "vite": "^5.0.6",
90
+ "vite-plugin-full-reload": "^1.1.0",
91
91
  "vue": "^2.7.15"
92
92
  },
93
93
  "devDependencies": {
94
- "@antfu/eslint-config": "^1.1.2",
94
+ "@antfu/eslint-config": "^2.3.4",
95
95
  "@types/fs-extra": "^11.0.4",
96
- "@types/node": "^20.9.0",
97
- "@types/prompts": "^2.4.8",
96
+ "@types/node": "^20.10.4",
97
+ "@types/prompts": "^2.4.9",
98
98
  "bumpp": "^9.2.0",
99
- "eslint": "^8.53.0",
99
+ "eslint": "^8.55.0",
100
100
  "fast-glob": "^3.3.2",
101
- "fs-extra": "^11.1.1",
101
+ "fs-extra": "^11.2.0",
102
102
  "simple-git-hooks": "^2.9.0",
103
- "typescript": "~5.2.2",
103
+ "typescript": "~5.3.3",
104
104
  "unbuild": "^2.0.0",
105
- "vitest": "^0.34.6"
105
+ "vitest": "^1.0.1"
106
106
  },
107
107
  "simple-git-hooks": {
108
108
  "commit-msg": "node scripts/verifyCommit.mjs $1"