kirbyup 3.1.4 → 3.1.6

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.DSMJ9KWQ.mjs';
2
+ import { n as name, b as build, s as serve, v as version, h as handleError } from '../shared/kirbyup.CoQcp64G.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'pathe';
@@ -10,7 +10,7 @@ import '@vitejs/plugin-vue2';
10
10
  import '@vitejs/plugin-vue2-jsx';
11
11
  import 'vite-plugin-full-reload';
12
12
  import 'rollup-plugin-external-globals';
13
- export { b as build, s as serve } from '../shared/kirbyup.DSMJ9KWQ.mjs';
13
+ export { b as build, s as serve } from '../shared/kirbyup.CoQcp64G.mjs';
14
14
  import 'node:zlib';
15
15
  import 'node:util';
16
16
  import 'node:buffer';
@@ -21,7 +21,7 @@ import MagicString from 'magic-string';
21
21
  import 'node:module';
22
22
 
23
23
  const name = "kirbyup";
24
- const version = "3.1.4";
24
+ const version = "3.1.6";
25
25
 
26
26
  class PrettyError extends Error {
27
27
  constructor(message) {
@@ -185,7 +185,7 @@ function kirbyupGlobImportPlugin() {
185
185
  async function findup(cwd, match, options = {}) {
186
186
  const segments = normalize(cwd).split("/");
187
187
  while (segments.length > 0) {
188
- const path = segments.join("/");
188
+ const path = segments.join("/") || "/";
189
189
  const result = await match(path);
190
190
  if (result || !options.includeParentDirs) {
191
191
  return result;
@@ -195,7 +195,11 @@ async function findup(cwd, match, options = {}) {
195
195
  }
196
196
 
197
197
  const packageManagers = [
198
- { name: "npm", command: "npm", lockFile: "package-lock.json" },
198
+ {
199
+ name: "npm",
200
+ command: "npm",
201
+ lockFile: "package-lock.json"
202
+ },
199
203
  {
200
204
  name: "pnpm",
201
205
  command: "pnpm",
@@ -223,7 +227,7 @@ const packageManagers = [
223
227
  ];
224
228
  async function detectPackageManager(cwd, options = {}) {
225
229
  const detected = await findup(
226
- cwd,
230
+ resolve(cwd || "."),
227
231
  async (path) => {
228
232
  if (!options.ignorePackageJSON) {
229
233
  const packageJSONPath = join(path, "package.json");
@@ -265,6 +269,17 @@ async function detectPackageManager(cwd, options = {}) {
265
269
  includeParentDirs: options.includeParentDirs ?? true
266
270
  }
267
271
  );
272
+ if (!detected && !options.ignoreArgv) {
273
+ const scriptArg = process.argv[1];
274
+ if (scriptArg) {
275
+ for (const packageManager of packageManagers) {
276
+ const re = new RegExp(`[/\\\\]\\.?${packageManager.command}`);
277
+ if (re.test(scriptArg)) {
278
+ return packageManager;
279
+ }
280
+ }
281
+ }
282
+ }
268
283
  return detected;
269
284
  }
270
285
 
@@ -344,7 +359,7 @@ function getViteConfig(command, options) {
344
359
  const aliasDir = resolve(options.cwd, dirname(options.entry));
345
360
  const { alias = {}, vite, extendViteConfig } = resolvedKirbyupConfig;
346
361
  const userConfig = vite ?? extendViteConfig ?? {};
347
- const baseConfig = {
362
+ const sharedConfig = {
348
363
  resolve: {
349
364
  alias: {
350
365
  "~/": `${aliasDir}/`,
@@ -366,7 +381,7 @@ function getViteConfig(command, options) {
366
381
  };
367
382
  if (command === "serve") {
368
383
  const { port, watch } = options;
369
- const serveConfig = mergeConfig(baseConfig, {
384
+ const serveConfig = mergeConfig(sharedConfig, {
370
385
  plugins: [
371
386
  kirbyupHmrPlugin(options),
372
387
  watch && fullReloadPlugin(watch)
@@ -379,7 +394,7 @@ function getViteConfig(command, options) {
379
394
  return mergeConfig(serveConfig, userConfig);
380
395
  }
381
396
  const mode = options.watch ? "development" : "production";
382
- const buildConfig = mergeConfig(baseConfig, {
397
+ const buildConfig = mergeConfig(sharedConfig, {
383
398
  plugins: [kirbyupBuildCleanupPlugin(options)],
384
399
  mode,
385
400
  build: {
@@ -433,7 +448,7 @@ async function generate(options) {
433
448
  return result;
434
449
  }
435
450
  async function build(options) {
436
- ensureEntry(options);
451
+ assertEntryExists(options);
437
452
  const { cwd } = options;
438
453
  const { config, configFile } = await loadConfig(cwd);
439
454
  resolvedKirbyupConfig = config ?? {};
@@ -488,7 +503,7 @@ async function build(options) {
488
503
  startWatcher();
489
504
  }
490
505
  async function serve(options) {
491
- ensureEntry(options);
506
+ assertEntryExists(options);
492
507
  const { cwd } = options;
493
508
  const { config } = await loadConfig(cwd);
494
509
  resolvedKirbyupConfig = config ?? {};
@@ -502,7 +517,7 @@ async function serve(options) {
502
517
  consola.success(`Server is listening on :${server.config.server.port}`);
503
518
  return server;
504
519
  }
505
- function ensureEntry(options) {
520
+ function assertEntryExists(options) {
506
521
  if (!existsSync(resolve(options.cwd, options.entry)))
507
522
  throw new PrettyError(`Cannot find "${options.entry}"`);
508
523
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "kirbyup",
3
3
  "type": "module",
4
- "version": "3.1.4",
5
- "packageManager": "pnpm@8.15.3",
4
+ "version": "3.1.6",
5
+ "packageManager": "pnpm@9.1.1",
6
6
  "description": "Zero-config bundler for Kirby Panel plugins",
7
7
  "author": {
8
8
  "name": "Johann Schopplich",
9
- "email": "pkg@johannschopplich.com",
9
+ "email": "hello@johannschopplich.com",
10
10
  "url": "https://johannschopplich.com"
11
11
  },
12
12
  "license": "MIT",
@@ -61,9 +61,9 @@
61
61
  "scripts": {
62
62
  "build": "unbuild",
63
63
  "dev": "UNBUILD_STUB=true unbuild",
64
- "docs": "pnpm -C docs run dev",
65
- "docs:build": "pnpm -C docs run build",
66
- "docs:serve": "pnpm -C docs run serve",
64
+ "docs:dev": "vitepress dev docs",
65
+ "docs:build": "vitepress build docs",
66
+ "docs:preview": "vitepress preview docs",
67
67
  "lint": "eslint .",
68
68
  "lint:fix": "eslint . --fix",
69
69
  "release": "bumpp --commit --push --tag",
@@ -75,37 +75,37 @@
75
75
  "@vitejs/plugin-vue2": "2.2.0",
76
76
  "@vitejs/plugin-vue2-jsx": "1.1.0",
77
77
  "@vue/compiler-sfc": "^2.7.16",
78
- "c12": "^1.8.0",
78
+ "c12": "^1.10.0",
79
79
  "cac": "^6.7.14",
80
80
  "chokidar": "^3.6.0",
81
81
  "consola": "^3.2.3",
82
- "magic-string": "^0.30.7",
82
+ "magic-string": "^0.30.10",
83
83
  "pathe": "^1.1.2",
84
84
  "perfect-debounce": "^1.0.0",
85
- "postcss": "^8.4.35",
85
+ "postcss": "^8.4.38",
86
86
  "postcss-dir-pseudo-class": "^8.0.1",
87
- "postcss-load-config": "^5.0.3",
87
+ "postcss-load-config": "^5.1.0",
88
88
  "postcss-logical": "^7.0.1",
89
- "rollup-plugin-external-globals": "^0.9.2",
90
- "sass": "^1.70.0",
91
- "vite": "^5.1.2",
89
+ "rollup-plugin-external-globals": "^0.10.0",
90
+ "sass": "^1.77.1",
91
+ "vite": "~5.1.7",
92
92
  "vite-plugin-full-reload": "^1.1.0",
93
93
  "vue": "^2.7.16"
94
94
  },
95
95
  "devDependencies": {
96
- "@antfu/eslint-config": "^2.6.4",
96
+ "@antfu/eslint-config": "^2.18.0",
97
97
  "@types/fs-extra": "^11.0.4",
98
- "@types/node": "^20.11.18",
98
+ "@types/node": "^20.12.12",
99
99
  "@types/prompts": "^2.4.9",
100
- "bumpp": "^9.3.0",
101
- "eslint": "^8.56.0",
100
+ "bumpp": "^9.4.1",
101
+ "eslint": "^9.2.0",
102
102
  "fast-glob": "^3.3.2",
103
103
  "fs-extra": "^11.2.0",
104
- "nypm": "^0.3.6",
105
- "simple-git-hooks": "^2.9.0",
106
- "typescript": "~5.3.3",
104
+ "nypm": "^0.3.8",
105
+ "simple-git-hooks": "^2.11.1",
106
+ "typescript": "^5.4.5",
107
107
  "unbuild": "^3.0.0-rc.1",
108
- "vitest": "^1.2.2"
108
+ "vitest": "^1.6.0"
109
109
  },
110
110
  "simple-git-hooks": {
111
111
  "commit-msg": "node scripts/verifyCommit.mjs $1"