qarpeo 0.4.5 → 0.4.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.
@@ -11,7 +11,7 @@ import { useRuntimeConfig, defineEventHandler } from 'nuxt/server';
11
11
  import { mkdir, writeFile, readFile } from 'node:fs/promises';
12
12
  import { defu } from 'defu';
13
13
 
14
- const version = "0.4.5";
14
+ const version = "0.4.6";
15
15
 
16
16
  function resolveBindingName(service, override, defaultName) {
17
17
  if (override && typeof override === "string") {
@@ -634,7 +634,7 @@ function resolveBinaryPath(binName, cwd = process.cwd()) {
634
634
  return null;
635
635
  }
636
636
  async function confirmInstall(packageName, purpose) {
637
- if (!stdin.isTTY || process.env.npm_lifecycle_event === "postinstall") {
637
+ if (!stdin.isTTY || stdin.isRaw || process.env.npm_lifecycle_event === "postinstall") {
638
638
  return false;
639
639
  }
640
640
  const rl = readline.createInterface({ input: stdin, output: stdout });
@@ -680,7 +680,15 @@ async function ensurePackage(packageName, options = {}) {
680
680
  if (isPackageInstalled(packageName, cwd)) {
681
681
  return true;
682
682
  }
683
- const confirmed = await confirmInstall(packageName, purpose);
683
+ if (process.env.npm_lifecycle_event === "postinstall") {
684
+ const addCmd = await formatAddCommand(packageName, { cwd, dev: options.dev });
685
+ console.warn(
686
+ `
687
+ \u26A0\uFE0F [qarpeo] Missing optional dependency "${packageName}" for ${purpose}. Run: ${addCmd}`
688
+ );
689
+ return false;
690
+ }
691
+ const confirmed = options.autoInstall ? true : await confirmInstall(packageName, purpose);
684
692
  if (!confirmed) {
685
693
  const addCmd = await formatAddCommand(packageName, { cwd, dev: options.dev });
686
694
  console.error(
package/dist/module.mjs CHANGED
@@ -5359,18 +5359,21 @@ async function setupCMS(options, nuxt, resolver, logger) {
5359
5359
  await ensurePackage("@comark/vue", {
5360
5360
  cwd: nuxt.options.rootDir,
5361
5361
  dev: false,
5362
- purpose: "CMS markdown rendering"
5362
+ purpose: "CMS markdown rendering",
5363
+ autoInstall: true
5363
5364
  });
5364
5365
  await ensurePackage("comark", {
5365
5366
  cwd: nuxt.options.rootDir,
5366
5367
  dev: false,
5367
- purpose: "CMS markdown parsing"
5368
+ purpose: "CMS markdown parsing",
5369
+ autoInstall: true
5368
5370
  });
5369
5371
  if (shikiEnabled) {
5370
5372
  await ensurePackage("shiki", {
5371
5373
  cwd: nuxt.options.rootDir,
5372
5374
  dev: false,
5373
- purpose: "CMS code syntax highlighting"
5375
+ purpose: "CMS code syntax highlighting",
5376
+ autoInstall: true
5374
5377
  });
5375
5378
  }
5376
5379
  }
@@ -32,4 +32,5 @@ export declare function ensurePackage(packageName: string, options?: {
32
32
  cwd?: string;
33
33
  dev?: boolean;
34
34
  purpose?: string;
35
+ autoInstall?: boolean;
35
36
  }): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qarpeo",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Zero-config Cloudflare Edge Platform for Nuxt",
5
5
  "keywords": [
6
6
  "analytics-engine",