@slidev/cli 0.28.7 → 0.28.10

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.
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk2IUA7VOFjs = require('./chunk-2IUA7VOF.js');
3
+ var _chunk427KVGZFjs = require('./chunk-427KVGZF.js');
4
4
 
5
5
 
6
- var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
6
+ var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
7
7
 
8
8
  // node/server.ts
9
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
9
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
10
10
  var _path = require('path');
11
11
  var _vite = require('vite');
12
12
  async function createServer(options, viteConfig = {}, serverOptions = {}) {
@@ -20,7 +20,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
20
20
  ]
21
21
  },
22
22
  plugins: [
23
- await _chunk2IUA7VOFjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
23
+ await _chunk427KVGZFjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
24
24
  ]
25
25
  }));
26
26
  return server;
@@ -8,7 +8,7 @@ import {
8
8
  __toModule,
9
9
  init_esm_shims,
10
10
  resolveImportPath
11
- } from "./chunk-4OPORETI.mjs";
11
+ } from "./chunk-VYBQLH2X.mjs";
12
12
 
13
13
  // ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/constants.js
14
14
  var require_constants = __commonJS({
@@ -5372,21 +5372,22 @@ async function saveExternalSlide(slide) {
5372
5372
  init_esm_shims();
5373
5373
 
5374
5374
  // package.json
5375
- var version = "0.28.7";
5375
+ var version = "0.28.10";
5376
5376
 
5377
5377
  // node/themes.ts
5378
5378
  init_esm_shims();
5379
5379
  import prompts from "prompts";
5380
5380
 
5381
- // ../../node_modules/.pnpm/@antfu+ni@0.12.0/node_modules/@antfu/ni/dist/index.mjs
5381
+ // ../../node_modules/.pnpm/@antfu+ni@0.13.2/node_modules/@antfu/ni/dist/index.mjs
5382
5382
  init_esm_shims();
5383
5383
 
5384
- // ../../node_modules/.pnpm/@antfu+ni@0.12.0/node_modules/@antfu/ni/dist/chunk-7FS5ZXAO.mjs
5384
+ // ../../node_modules/.pnpm/@antfu+ni@0.13.2/node_modules/@antfu/ni/dist/chunk-VUUH4WJE.mjs
5385
5385
  init_esm_shims();
5386
5386
  import os from "os";
5387
5387
  import { execSync } from "child_process";
5388
5388
  import fs2 from "fs";
5389
5389
  import path from "path";
5390
+ import fs22 from "fs";
5390
5391
  import path2 from "path";
5391
5392
  import { resolve as resolve2 } from "path";
5392
5393
  var __create = Object.create;
@@ -5448,7 +5449,7 @@ var require_windows = __commonJS2({
5448
5449
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
5449
5450
  module.exports = isexe;
5450
5451
  isexe.sync = sync;
5451
- var fs22 = __require2("fs");
5452
+ var fs32 = __require2("fs");
5452
5453
  function checkPathExt(path3, options) {
5453
5454
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
5454
5455
  if (!pathext) {
@@ -5473,12 +5474,12 @@ var require_windows = __commonJS2({
5473
5474
  return checkPathExt(path3, options);
5474
5475
  }
5475
5476
  function isexe(path3, options, cb) {
5476
- fs22.stat(path3, function(er, stat) {
5477
+ fs32.stat(path3, function(er, stat) {
5477
5478
  cb(er, er ? false : checkStat(stat, path3, options));
5478
5479
  });
5479
5480
  }
5480
5481
  function sync(path3, options) {
5481
- return checkStat(fs22.statSync(path3), path3, options);
5482
+ return checkStat(fs32.statSync(path3), path3, options);
5482
5483
  }
5483
5484
  }
5484
5485
  });
@@ -5486,14 +5487,14 @@ var require_mode = __commonJS2({
5486
5487
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
5487
5488
  module.exports = isexe;
5488
5489
  isexe.sync = sync;
5489
- var fs22 = __require2("fs");
5490
+ var fs32 = __require2("fs");
5490
5491
  function isexe(path3, options, cb) {
5491
- fs22.stat(path3, function(er, stat) {
5492
+ fs32.stat(path3, function(er, stat) {
5492
5493
  cb(er, er ? false : checkStat(stat, options));
5493
5494
  });
5494
5495
  }
5495
5496
  function sync(path3, options) {
5496
- return checkStat(fs22.statSync(path3), options);
5497
+ return checkStat(fs32.statSync(path3), options);
5497
5498
  }
5498
5499
  function checkStat(stat, options) {
5499
5500
  return stat.isFile() && checkMode(stat, options);
@@ -5515,7 +5516,7 @@ var require_mode = __commonJS2({
5515
5516
  });
5516
5517
  var require_isexe = __commonJS2({
5517
5518
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
5518
- var fs22 = __require2("fs");
5519
+ var fs32 = __require2("fs");
5519
5520
  var core2;
5520
5521
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
5521
5522
  core2 = require_windows();
@@ -10855,11 +10856,11 @@ var require_locate_path = __commonJS2({
10855
10856
  "node_modules/.pnpm/locate-path@6.0.0/node_modules/locate-path/index.js"(exports, module) {
10856
10857
  "use strict";
10857
10858
  var path3 = __require2("path");
10858
- var fs22 = __require2("fs");
10859
+ var fs32 = __require2("fs");
10859
10860
  var { promisify } = __require2("util");
10860
10861
  var pLocate = require_p_locate();
10861
- var fsStat = promisify(fs22.stat);
10862
- var fsLStat = promisify(fs22.lstat);
10862
+ var fsStat = promisify(fs32.stat);
10863
+ var fsLStat = promisify(fs32.lstat);
10863
10864
  var typeMappings = {
10864
10865
  directory: "isDirectory",
10865
10866
  file: "isFile"
@@ -10895,7 +10896,7 @@ var require_locate_path = __commonJS2({
10895
10896
  type: "file"
10896
10897
  }, options);
10897
10898
  checkType(options);
10898
- const statFn = options.allowSymlinks ? fs22.statSync : fs22.lstatSync;
10899
+ const statFn = options.allowSymlinks ? fs32.statSync : fs32.lstatSync;
10899
10900
  for (const path_ of paths) {
10900
10901
  try {
10901
10902
  const stat = statFn(path3.resolve(options.cwd, path_));
@@ -10911,9 +10912,9 @@ var require_locate_path = __commonJS2({
10911
10912
  var require_path_exists = __commonJS2({
10912
10913
  "node_modules/.pnpm/path-exists@4.0.0/node_modules/path-exists/index.js"(exports, module) {
10913
10914
  "use strict";
10914
- var fs22 = __require2("fs");
10915
+ var fs32 = __require2("fs");
10915
10916
  var { promisify } = __require2("util");
10916
- var pAccess = promisify(fs22.access);
10917
+ var pAccess = promisify(fs32.access);
10917
10918
  module.exports = async (path3) => {
10918
10919
  try {
10919
10920
  await pAccess(path3);
@@ -10924,7 +10925,7 @@ var require_path_exists = __commonJS2({
10924
10925
  };
10925
10926
  module.exports.sync = (path3) => {
10926
10927
  try {
10927
- fs22.accessSync(path3);
10928
+ fs32.accessSync(path3);
10928
10929
  return true;
10929
10930
  } catch (_) {
10930
10931
  return false;
@@ -11105,16 +11106,16 @@ var require_shebang_command = __commonJS2({
11105
11106
  var require_readShebang = __commonJS2({
11106
11107
  "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
11107
11108
  "use strict";
11108
- var fs22 = __require2("fs");
11109
+ var fs32 = __require2("fs");
11109
11110
  var shebangCommand = require_shebang_command();
11110
11111
  function readShebang(command) {
11111
11112
  const size = 150;
11112
11113
  const buffer = Buffer.alloc(size);
11113
11114
  let fd;
11114
11115
  try {
11115
- fd = fs22.openSync(command, "r");
11116
- fs22.readSync(fd, buffer, 0, size, 0);
11117
- fs22.closeSync(fd);
11116
+ fd = fs32.openSync(command, "r");
11117
+ fs32.readSync(fd, buffer, 0, size, 0);
11118
+ fs32.closeSync(fd);
11118
11119
  } catch (e) {
11119
11120
  }
11120
11121
  return shebangCommand(buffer.toString());
@@ -12819,7 +12820,7 @@ function getVoltaPrefix() {
12819
12820
  const hasVoltaCommand = import_which.default.sync("volta", { nothrow: true }) !== null;
12820
12821
  return hasVoltaCommand ? VOLTA_PREFIX : "";
12821
12822
  }
12822
- var version2 = "0.12.0";
12823
+ var version2 = "0.13.2";
12823
12824
  var npmRun = (agent) => (args) => {
12824
12825
  if (args.length > 1)
12825
12826
  return `${agent} run ${args[0]} -- ${args.slice(1).join(" ")}`;
@@ -12827,7 +12828,7 @@ var npmRun = (agent) => (args) => {
12827
12828
  return `${agent} run ${args[0]}`;
12828
12829
  };
12829
12830
  var AGENTS = {
12830
- npm: {
12831
+ "npm": {
12831
12832
  "run": npmRun("npm"),
12832
12833
  "install": "npm i",
12833
12834
  "frozen": "npm ci",
@@ -12839,7 +12840,7 @@ var AGENTS = {
12839
12840
  "uninstall": "npm uninstall {0}",
12840
12841
  "global_uninstall": "npm uninstall -g {0}"
12841
12842
  },
12842
- yarn: {
12843
+ "yarn": {
12843
12844
  "run": "yarn run {0}",
12844
12845
  "install": "yarn install",
12845
12846
  "frozen": "yarn install --frozen-lockfile",
@@ -12851,7 +12852,19 @@ var AGENTS = {
12851
12852
  "uninstall": "yarn remove {0}",
12852
12853
  "global_uninstall": "yarn global remove {0}"
12853
12854
  },
12854
- pnpm: {
12855
+ "yarn@berry": {
12856
+ "run": "yarn run {0}",
12857
+ "install": "yarn install",
12858
+ "frozen": "yarn install --immutable",
12859
+ "global": "npm i -g {0}",
12860
+ "add": "yarn add {0}",
12861
+ "upgrade": "yarn up {0}",
12862
+ "upgrade-interactive": "yarn up -i {0}",
12863
+ "execute": "yarn dlx {0}",
12864
+ "uninstall": "yarn remove {0}",
12865
+ "global_uninstall": "npm uninstall -g {0}"
12866
+ },
12867
+ "pnpm": {
12855
12868
  "run": npmRun("pnpm"),
12856
12869
  "install": "pnpm i",
12857
12870
  "frozen": "pnpm i --frozen-lockfile",
@@ -12871,9 +12884,10 @@ var LOCKS = {
12871
12884
  "package-lock.json": "npm"
12872
12885
  };
12873
12886
  var INSTALL_PAGE = {
12874
- pnpm: "https://pnpm.js.org/en/installation",
12875
- yarn: "https://yarnpkg.com/getting-started/install",
12876
- npm: "https://www.npmjs.com/get-npm"
12887
+ "pnpm": "https://pnpm.js.org/en/installation",
12888
+ "yarn": "https://classic.yarnpkg.com/en/docs/install",
12889
+ "yarn@berry": "https://yarnpkg.com/getting-started/install",
12890
+ "npm": "https://www.npmjs.com/get-npm"
12877
12891
  };
12878
12892
  function getCommand(agent, command, args = []) {
12879
12893
  if (!(agent in AGENTS))
@@ -12922,9 +12936,9 @@ async function getConfig() {
12922
12936
  let packageManager = "";
12923
12937
  if (result)
12924
12938
  packageManager = (_a = JSON.parse(fs2.readFileSync(result, "utf8")).packageManager) != null ? _a : "";
12925
- const [, agent] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join("|")})@.*?$`)) || [];
12939
+ const [, agent, version22] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join("|")})@(d).*?$`)) || [];
12926
12940
  if (agent)
12927
- config = Object.assign({}, defaultConfig, { defaultAgent: agent });
12941
+ config = Object.assign({}, defaultConfig, { defaultAgent: agent === "yarn" && parseInt(version22) > 1 ? "yarn@berry" : agent });
12928
12942
  else if (!fs2.existsSync(rcPath))
12929
12943
  config = defaultConfig;
12930
12944
  else
@@ -13074,11 +13088,33 @@ terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, __spr
13074
13088
  terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
13075
13089
  var import_prompts = __toModule2(require_prompts3());
13076
13090
  async function detect({ autoInstall, cwd }) {
13077
- const result = await (0, import_find_up2.default)(Object.keys(LOCKS), { cwd });
13078
- const agent = result ? LOCKS[path2.basename(result)] : null;
13079
- if (agent && !cmdExists(agent)) {
13091
+ let agent = null;
13092
+ const lockPath = await (0, import_find_up2.default)(Object.keys(LOCKS), { cwd });
13093
+ let packageJsonPath;
13094
+ if (lockPath)
13095
+ packageJsonPath = path2.resolve(lockPath, "../package.json");
13096
+ else
13097
+ packageJsonPath = await (0, import_find_up2.default)("package.json", { cwd });
13098
+ if (packageJsonPath && fs22.existsSync(packageJsonPath)) {
13099
+ try {
13100
+ const pkg = JSON.parse(fs22.readFileSync(packageJsonPath, "utf8"));
13101
+ if (typeof pkg.packageManager === "string") {
13102
+ const [name, version22] = pkg.packageManager.split("@");
13103
+ if (name === "yarn" && parseInt(version22) > 1)
13104
+ agent = "yarn@berry";
13105
+ else if (name in AGENTS)
13106
+ agent = name;
13107
+ else
13108
+ console.warn("[ni] Unknown packageManager:", pkg.packageManager);
13109
+ }
13110
+ } catch {
13111
+ }
13112
+ }
13113
+ if (!agent && lockPath)
13114
+ agent = LOCKS[path2.basename(lockPath)];
13115
+ if (agent && !cmdExists(agent.split("@")[0])) {
13080
13116
  if (!autoInstall) {
13081
- console.warn(`Detected ${agent} but it doesn't seem to be installed.
13117
+ console.warn(`[ni] Detected ${agent} but it doesn't seem to be installed.
13082
13118
  `);
13083
13119
  if (process.env.CI)
13084
13120
  process.exit(1);
@@ -13118,7 +13154,7 @@ async function run(fn, args, options = {}) {
13118
13154
  name: "agent",
13119
13155
  type: "select",
13120
13156
  message: "Choose the agent",
13121
- choices: agents.map((value) => ({ title: value, value }))
13157
+ choices: agents.filter((i) => !i.includes("@")).map((value) => ({ title: value, value }))
13122
13158
  })).agent;
13123
13159
  if (!agent)
13124
13160
  return;