kirbyup 3.1.11 → 3.1.13

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/dist/node/cli.mjs CHANGED
@@ -1,26 +1,26 @@
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.98Dqv1XN.mjs';
2
+ import { n as name, b as build, s as serve, v as version, h as handleError } from '../shared/kirbyup.DNd0vhSV.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
- import 'pathe';
5
+ import '@vitejs/plugin-vue2';
6
+ import '@vitejs/plugin-vue2-jsx';
6
7
  import 'consola';
7
8
  import 'consola/utils';
9
+ import 'pathe';
8
10
  import 'perfect-debounce';
11
+ import 'rollup-plugin-external-globals';
9
12
  import 'vite';
10
- import 'vue/compiler-sfc';
11
- import '@vitejs/plugin-vue2';
12
- import '@vitejs/plugin-vue2-jsx';
13
13
  import 'vite-plugin-full-reload';
14
- import 'rollup-plugin-external-globals';
15
- import 'node:zlib';
16
- import 'node:util';
17
- import 'node:buffer';
14
+ import 'vue/compiler-sfc';
18
15
  import 'c12';
16
+ import 'postcss-dir-pseudo-class';
19
17
  import 'postcss-load-config';
20
18
  import 'postcss-logical';
21
- import 'postcss-dir-pseudo-class';
22
19
  import 'magic-string';
23
20
  import 'node:module';
21
+ import 'node:buffer';
22
+ import 'node:util';
23
+ import 'node:zlib';
24
24
 
25
25
  async function startCli(cwd = process.cwd(), argv = process.argv) {
26
26
  const cli = cac(name);
@@ -1,22 +1,22 @@
1
1
  import 'node:fs';
2
2
  import 'node:fs/promises';
3
- import 'pathe';
3
+ import '@vitejs/plugin-vue2';
4
+ import '@vitejs/plugin-vue2-jsx';
4
5
  import 'consola';
5
6
  import 'consola/utils';
7
+ import 'pathe';
6
8
  import 'perfect-debounce';
9
+ import 'rollup-plugin-external-globals';
7
10
  import 'vite';
8
- import 'vue/compiler-sfc';
9
- import '@vitejs/plugin-vue2';
10
- import '@vitejs/plugin-vue2-jsx';
11
11
  import 'vite-plugin-full-reload';
12
- import 'rollup-plugin-external-globals';
13
- export { b as build, s as serve } from '../shared/kirbyup.98Dqv1XN.mjs';
14
- import 'node:zlib';
15
- import 'node:util';
16
- import 'node:buffer';
12
+ import 'vue/compiler-sfc';
13
+ export { b as build, s as serve } from '../shared/kirbyup.DNd0vhSV.mjs';
17
14
  import 'c12';
15
+ import 'postcss-dir-pseudo-class';
18
16
  import 'postcss-load-config';
19
17
  import 'postcss-logical';
20
- import 'postcss-dir-pseudo-class';
21
18
  import 'magic-string';
22
19
  import 'node:module';
20
+ import 'node:buffer';
21
+ import 'node:util';
22
+ import 'node:zlib';
@@ -1,63 +1,27 @@
1
1
  import { existsSync, unlinkSync } from 'node:fs';
2
2
  import { readFile, writeFile } from 'node:fs/promises';
3
- import { normalize, relative, resolve, join, dirname, basename } from 'pathe';
3
+ import vuePlugin from '@vitejs/plugin-vue2';
4
+ import vueJsxPlugin from '@vitejs/plugin-vue2-jsx';
4
5
  import { consola } from 'consola';
5
6
  import { colors } from 'consola/utils';
7
+ import { resolve, join, normalize, relative, dirname, basename } from 'pathe';
6
8
  import { debounce } from 'perfect-debounce';
9
+ import externalGlobals from 'rollup-plugin-external-globals';
7
10
  import { createLogger, createServer, mergeConfig, build as build$1 } from 'vite';
8
- import * as vueCompilerSfc from 'vue/compiler-sfc';
9
- import vuePlugin from '@vitejs/plugin-vue2';
10
- import vueJsxPlugin from '@vitejs/plugin-vue2-jsx';
11
11
  import fullReloadPlugin from 'vite-plugin-full-reload';
12
- import externalGlobals from 'rollup-plugin-external-globals';
13
- import { gzip } from 'node:zlib';
14
- import { promisify } from 'node:util';
15
- import { Buffer } from 'node:buffer';
12
+ import * as vueCompilerSfc from 'vue/compiler-sfc';
16
13
  import { loadConfig as loadConfig$1 } from 'c12';
14
+ import postcssDirPseudoClass from 'postcss-dir-pseudo-class';
17
15
  import postcssrc from 'postcss-load-config';
18
16
  import postcssLogical from 'postcss-logical';
19
- import postcssDirPseudoClass from 'postcss-dir-pseudo-class';
20
17
  import MagicString from 'magic-string';
21
18
  import 'node:module';
19
+ import { Buffer } from 'node:buffer';
20
+ import { promisify } from 'node:util';
21
+ import { gzip } from 'node:zlib';
22
22
 
23
23
  const name = "kirbyup";
24
- const version = "3.1.11";
25
-
26
- class PrettyError extends Error {
27
- constructor(message) {
28
- super(message);
29
- this.name = this.constructor.name;
30
- if (typeof Error.captureStackTrace === "function")
31
- Error.captureStackTrace(this, this.constructor);
32
- else
33
- this.stack = new Error(message).stack;
34
- }
35
- }
36
- function handleError(error) {
37
- consola.error(error.message);
38
- process.exitCode = 1;
39
- }
40
-
41
- function toArray(array) {
42
- array = array || [];
43
- if (Array.isArray(array))
44
- return array;
45
- return [array];
46
- }
47
- const compress = promisify(gzip);
48
- async function getCompressedSize(code) {
49
- const size = (await compress(typeof code === "string" ? code : Buffer.from(code))).length / 1024;
50
- return ` / gzip: ${size.toFixed(2)} KiB`;
51
- }
52
- async function printFileInfo(root, outDir, filePath, content, type, maxLength) {
53
- const prettyOutDir = `${normalize(relative(root, resolve(root, outDir)))}/`;
54
- const kibs = content.length / 1024;
55
- const compressedSize = await getCompressedSize(content);
56
- const writeColor = type === "chunk" ? colors.cyan : colors.magenta;
57
- consola.log(
58
- colors.white(colors.dim(prettyOutDir)) + writeColor(filePath.padEnd(maxLength + 2)) + colors.dim(`${kibs.toFixed(2)} kB${compressedSize}`)
59
- );
60
- }
24
+ const version = "3.1.13";
61
25
 
62
26
  function loadConfig(cwd = process.cwd()) {
63
27
  return loadConfig$1({
@@ -82,6 +46,37 @@ async function resolvePostCSSConfig(cwd) {
82
46
  }
83
47
  }
84
48
 
49
+ class PrettyError extends Error {
50
+ constructor(message) {
51
+ super(message);
52
+ this.name = this.constructor.name;
53
+ if (typeof Error.captureStackTrace === "function")
54
+ Error.captureStackTrace(this, this.constructor);
55
+ else
56
+ this.stack = new Error(message).stack;
57
+ }
58
+ }
59
+ function handleError(error) {
60
+ consola.error(error.message);
61
+ process.exitCode = 1;
62
+ }
63
+
64
+ function kirbyupBuildCleanupPlugin(options) {
65
+ let config;
66
+ let devIndexPath;
67
+ return {
68
+ name: "kirbyup:build-cleanup",
69
+ configResolved(resolvedConfig) {
70
+ config = resolvedConfig;
71
+ devIndexPath = resolve(config.root, options.outDir, "index.dev.mjs");
72
+ },
73
+ writeBundle() {
74
+ if (existsSync(devIndexPath))
75
+ unlinkSync(devIndexPath);
76
+ }
77
+ };
78
+ }
79
+
85
80
  const multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//g;
86
81
  const singlelineCommentsRE = /\/\/.*/g;
87
82
  const HMR_RUNTIME_ID = "\0plugin-vue2:hmr-runtime";
@@ -214,13 +209,13 @@ const packageManagers = [
214
209
  {
215
210
  name: "yarn",
216
211
  command: "yarn",
217
- majorVersion: "1.0.0",
212
+ majorVersion: "1",
218
213
  lockFile: "yarn.lock"
219
214
  },
220
215
  {
221
216
  name: "yarn",
222
217
  command: "yarn",
223
- majorVersion: "3.0.0",
218
+ majorVersion: "3",
224
219
  lockFile: "yarn.lock",
225
220
  files: [".yarnrc.yml"]
226
221
  }
@@ -337,20 +332,23 @@ try {
337
332
  `.trimStart();
338
333
  }
339
334
 
340
- function kirbyupBuildCleanupPlugin(options) {
341
- let config;
342
- let devIndexPath;
343
- return {
344
- name: "kirbyup:build-cleanup",
345
- configResolved(resolvedConfig) {
346
- config = resolvedConfig;
347
- devIndexPath = resolve(config.root, options.outDir, "index.dev.mjs");
348
- },
349
- writeBundle() {
350
- if (existsSync(devIndexPath))
351
- unlinkSync(devIndexPath);
352
- }
353
- };
335
+ function toArray(array) {
336
+ array ??= [];
337
+ return Array.isArray(array) ? array : [array];
338
+ }
339
+ const compress = promisify(gzip);
340
+ async function getCompressedSize(code) {
341
+ const size = (await compress(typeof code === "string" ? code : Buffer.from(code))).length / 1024;
342
+ return ` / gzip: ${size.toFixed(2)} KiB`;
343
+ }
344
+ async function printFileInfo(root, outDir, filePath, content, type, maxLength) {
345
+ const prettyOutDir = `${normalize(relative(root, resolve(root, outDir)))}/`;
346
+ const kibs = content.length / 1024;
347
+ const compressedSize = await getCompressedSize(content);
348
+ const writeColor = type === "chunk" ? colors.cyan : colors.magenta;
349
+ consola.log(
350
+ colors.white(colors.dim(prettyOutDir)) + writeColor(filePath.padEnd(maxLength + 2)) + colors.dim(`${kibs.toFixed(2)} kB${compressedSize}`)
351
+ );
354
352
  }
355
353
 
356
354
  let resolvedKirbyupConfig;
@@ -383,7 +381,12 @@ function getViteConfig(command, options) {
383
381
  kirbyupGlobImportPlugin(),
384
382
  { ...externalGlobals({ vue: "Vue" }), enforce: "post" }
385
383
  ],
386
- css: { postcss: resolvedPostCssConfig },
384
+ build: {
385
+ copyPublicDir: false
386
+ },
387
+ css: {
388
+ postcss: resolvedPostCssConfig
389
+ },
387
390
  envPrefix: ["VITE_", "KIRBYUP_"],
388
391
  customLogger: logger,
389
392
  logLevel
@@ -412,8 +415,8 @@ function getViteConfig(command, options) {
412
415
  }
413
416
  const mode = options.watch ? "development" : "production";
414
417
  const buildConfig = mergeConfig(sharedConfig, {
415
- plugins: [kirbyupBuildCleanupPlugin(options)],
416
418
  mode,
419
+ plugins: [kirbyupBuildCleanupPlugin(options)],
417
420
  build: {
418
421
  lib: {
419
422
  entry: resolve(options.cwd, options.entry),
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "kirbyup",
3
3
  "type": "module",
4
- "version": "3.1.11",
5
- "packageManager": "pnpm@9.5.0",
4
+ "version": "3.1.13",
5
+ "packageManager": "pnpm@9.10.0",
6
6
  "description": "Zero-config bundler for Kirby Panel plugins",
7
7
  "author": {
8
8
  "name": "Johann Schopplich",
@@ -74,35 +74,35 @@
74
74
  "@vitejs/plugin-vue2": "2.2.0",
75
75
  "@vitejs/plugin-vue2-jsx": "1.1.0",
76
76
  "@vue/compiler-sfc": "^2.7.16",
77
- "c12": "^1.11.1",
77
+ "c12": "^1.11.2",
78
78
  "cac": "^6.7.14",
79
79
  "chokidar": "^3.6.0",
80
80
  "consola": "^3.2.3",
81
- "magic-string": "^0.30.10",
81
+ "magic-string": "^0.30.11",
82
82
  "pathe": "^1.1.2",
83
83
  "perfect-debounce": "^1.0.0",
84
- "postcss": "^8.4.39",
85
- "postcss-dir-pseudo-class": "^8.0.1",
86
- "postcss-load-config": "^5.1.0",
87
- "postcss-logical": "^7.0.1",
88
- "rollup-plugin-external-globals": "^0.11.0",
89
- "sass": "^1.77.7",
90
- "vite": "~5.3.3",
84
+ "postcss": "^8.4.45",
85
+ "postcss-dir-pseudo-class": "^9.0.0",
86
+ "postcss-load-config": "^6.0.1",
87
+ "postcss-logical": "^8.0.0",
88
+ "rollup-plugin-external-globals": "^0.12.0",
89
+ "sass": "^1.78.0",
90
+ "vite": "~5.3.5",
91
91
  "vite-plugin-full-reload": "^1.2.0",
92
92
  "vue": "^2.7.16"
93
93
  },
94
94
  "devDependencies": {
95
- "@antfu/eslint-config": "^2.22.0",
95
+ "@antfu/eslint-config": "^3.5.1",
96
96
  "@types/fs-extra": "^11.0.4",
97
- "@types/node": "^20.14.10",
97
+ "@types/node": "^20.16.5",
98
98
  "@types/prompts": "^2.4.9",
99
- "bumpp": "^9.4.1",
100
- "eslint": "^9.6.0",
99
+ "bumpp": "^9.5.2",
100
+ "eslint": "^9.10.0",
101
101
  "fast-glob": "^3.3.2",
102
102
  "fs-extra": "^11.2.0",
103
- "nypm": "^0.3.9",
104
- "typescript": "^5.5.3",
105
- "unbuild": "^3.0.0-rc.6",
106
- "vitest": "^2.0.1"
103
+ "nypm": "^0.3.11",
104
+ "typescript": "^5.5.4",
105
+ "unbuild": "^3.0.0-rc.7",
106
+ "vitest": "^2.0.5"
107
107
  }
108
108
  }