kirbyup 3.1.13 → 3.2.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/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.DNd0vhSV.mjs';
2
+ import { n as name, b as build, s as serve, v as version, h as handleError } from '../shared/kirbyup.zmDi6JQM.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import '@vitejs/plugin-vue2';
@@ -29,13 +29,11 @@ async function startCli(cwd = process.cwd(), argv = process.argv) {
29
29
  "Watch for file changes. If no path is specified, the folder of the input file will be watched",
30
30
  { default: false }
31
31
  ).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) => {
32
- if (!process.env.NODE_ENV)
33
- process.env.NODE_ENV = options.watch ? "development" : "production";
32
+ process.env.NODE_ENV ||= options.watch ? "development" : "production";
34
33
  await build({ cwd, entry: file, ...options });
35
34
  });
36
35
  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) => {
37
- if (!process.env.NODE_ENV)
38
- process.env.NODE_ENV = "development";
36
+ process.env.NODE_ENV ||= "development";
39
37
  const server = await serve({ cwd, entry: file, ...options });
40
38
  const exitProcess = async () => {
41
39
  try {
@@ -10,7 +10,7 @@ import 'rollup-plugin-external-globals';
10
10
  import 'vite';
11
11
  import 'vite-plugin-full-reload';
12
12
  import 'vue/compiler-sfc';
13
- export { b as build, s as serve } from '../shared/kirbyup.DNd0vhSV.mjs';
13
+ export { b as build, s as serve } from '../shared/kirbyup.zmDi6JQM.mjs';
14
14
  import 'c12';
15
15
  import 'postcss-dir-pseudo-class';
16
16
  import 'postcss-load-config';
@@ -1,5 +1,7 @@
1
- import { existsSync, unlinkSync } from 'node:fs';
2
- import { readFile, writeFile } from 'node:fs/promises';
1
+ import * as fs from 'node:fs';
2
+ import { existsSync } from 'node:fs';
3
+ import * as fsp from 'node:fs/promises';
4
+ import { readFile } from 'node:fs/promises';
3
5
  import vuePlugin from '@vitejs/plugin-vue2';
4
6
  import vueJsxPlugin from '@vitejs/plugin-vue2-jsx';
5
7
  import { consola } from 'consola';
@@ -21,17 +23,14 @@ import { promisify } from 'node:util';
21
23
  import { gzip } from 'node:zlib';
22
24
 
23
25
  const name = "kirbyup";
24
- const version = "3.1.13";
26
+ const version = "3.2.0";
25
27
 
26
28
  function loadConfig(cwd = process.cwd()) {
27
29
  return loadConfig$1({
28
30
  cwd,
29
31
  name: "kirbyup",
30
32
  rcFile: false,
31
- jitiOptions: {
32
- interopDefault: true,
33
- esmResolve: true
34
- }
33
+ packageJson: false
35
34
  });
36
35
  }
37
36
  async function resolvePostCSSConfig(cwd) {
@@ -71,8 +70,8 @@ function kirbyupBuildCleanupPlugin(options) {
71
70
  devIndexPath = resolve(config.root, options.outDir, "index.dev.mjs");
72
71
  },
73
72
  writeBundle() {
74
- if (existsSync(devIndexPath))
75
- unlinkSync(devIndexPath);
73
+ if (fs.existsSync(devIndexPath))
74
+ fs.unlinkSync(devIndexPath);
76
75
  }
77
76
  };
78
77
  }
@@ -204,7 +203,7 @@ const packageManagers = [
204
203
  {
205
204
  name: "bun",
206
205
  command: "bun",
207
- lockFile: "bun.lockb"
206
+ lockFile: ["bun.lockb", "bun.lock"]
208
207
  },
209
208
  {
210
209
  name: "yarn",
@@ -250,8 +249,8 @@ async function detectPackageManager(cwd, options = {}) {
250
249
  for (const packageManager of packageManagers) {
251
250
  const detectionsFiles = [
252
251
  packageManager.lockFile,
253
- ...packageManager.files || []
254
- ].filter(Boolean);
252
+ packageManager.files
253
+ ].flat().filter(Boolean);
255
254
  if (detectionsFiles.some((file) => existsSync(resolve(path, file)))) {
256
255
  return {
257
256
  ...packageManager
@@ -309,12 +308,12 @@ function kirbyupHmrPlugin(options) {
309
308
  const baseUrl = `http://${hostname}:${port}${config.base}`;
310
309
  const entryUrl = new URL(entryPath, baseUrl).href;
311
310
  const pm = await detectPackageManager(config.root);
312
- await writeFile(devIndexPath, getViteProxyModule(entryUrl, pm));
311
+ await fsp.writeFile(devIndexPath, getViteProxyModule(entryUrl, pm));
313
312
  });
314
313
  },
315
314
  closeBundle() {
316
- if (existsSync(devIndexPath))
317
- unlinkSync(devIndexPath);
315
+ if (fs.existsSync(devIndexPath))
316
+ fs.unlinkSync(devIndexPath);
318
317
  }
319
318
  };
320
319
  }
@@ -387,6 +386,7 @@ function getViteConfig(command, options) {
387
386
  css: {
388
387
  postcss: resolvedPostCssConfig
389
388
  },
389
+ envDir: options.cwd,
390
390
  envPrefix: ["VITE_", "KIRBYUP_"],
391
391
  customLogger: logger,
392
392
  logLevel
@@ -459,7 +459,7 @@ async function generate(options) {
459
459
  options.cwd,
460
460
  options.outDir,
461
461
  fileName,
462
- code ?? await readFile(resolve(options.outDir, fileName), "utf8"),
462
+ code ?? await fsp.readFile(resolve(options.outDir, fileName), "utf8"),
463
463
  type,
464
464
  longest
465
465
  );
@@ -538,7 +538,7 @@ async function serve(options) {
538
538
  return server;
539
539
  }
540
540
  function assertEntryExists(options) {
541
- if (!existsSync(resolve(options.cwd, options.entry)))
541
+ if (!fs.existsSync(resolve(options.cwd, options.entry)))
542
542
  throw new PrettyError(`Cannot find "${options.entry}"`);
543
543
  }
544
544
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "kirbyup",
3
3
  "type": "module",
4
- "version": "3.1.13",
5
- "packageManager": "pnpm@9.10.0",
4
+ "version": "3.2.0",
5
+ "packageManager": "pnpm@9.13.0",
6
6
  "description": "Zero-config bundler for Kirby Panel plugins",
7
7
  "author": {
8
8
  "name": "Johann Schopplich",
@@ -66,7 +66,7 @@
66
66
  "docs:preview": "vitepress preview docs",
67
67
  "lint": "eslint .",
68
68
  "lint:fix": "eslint . --fix",
69
- "release": "bumpp --commit --push --tag",
69
+ "release": "bumpp",
70
70
  "test": "vitest --no-isolate",
71
71
  "test:types": "tsc --noEmit"
72
72
  },
@@ -74,35 +74,33 @@
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.2",
77
+ "c12": "^2.0.1",
78
78
  "cac": "^6.7.14",
79
- "chokidar": "^3.6.0",
79
+ "chokidar": "~3.6.0",
80
80
  "consola": "^3.2.3",
81
- "magic-string": "^0.30.11",
81
+ "magic-string": "^0.30.12",
82
82
  "pathe": "^1.1.2",
83
83
  "perfect-debounce": "^1.0.0",
84
- "postcss": "^8.4.45",
85
- "postcss-dir-pseudo-class": "^9.0.0",
84
+ "postcss": "^8.4.49",
85
+ "postcss-dir-pseudo-class": "^9.0.1",
86
86
  "postcss-load-config": "^6.0.1",
87
87
  "postcss-logical": "^8.0.0",
88
88
  "rollup-plugin-external-globals": "^0.12.0",
89
- "sass": "^1.78.0",
90
- "vite": "~5.3.5",
89
+ "sass": "^1.80.7",
90
+ "vite": "~5.4.11",
91
91
  "vite-plugin-full-reload": "^1.2.0",
92
92
  "vue": "^2.7.16"
93
93
  },
94
94
  "devDependencies": {
95
- "@antfu/eslint-config": "^3.5.1",
96
- "@types/fs-extra": "^11.0.4",
97
- "@types/node": "^20.16.5",
95
+ "@antfu/eslint-config": "^3.9.1",
96
+ "@types/node": "^20.17.6",
98
97
  "@types/prompts": "^2.4.9",
99
- "bumpp": "^9.5.2",
100
- "eslint": "^9.10.0",
98
+ "bumpp": "^9.8.1",
99
+ "eslint": "^9.14.0",
101
100
  "fast-glob": "^3.3.2",
102
- "fs-extra": "^11.2.0",
103
- "nypm": "^0.3.11",
104
- "typescript": "^5.5.4",
105
- "unbuild": "^3.0.0-rc.7",
106
- "vitest": "^2.0.5"
101
+ "nypm": "^0.3.12",
102
+ "typescript": "^5.6.3",
103
+ "unbuild": "^3.0.0-rc.11",
104
+ "vitest": "^2.1.5"
107
105
  }
108
106
  }