@slidev/cli 0.40.2 → 0.40.4
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/{build-L4S5TZG4.js → build-HVQ7GG2W.js} +9 -7
- package/dist/{build-BGUF7J7N.mjs → build-QEAAPDMG.mjs} +5 -3
- package/dist/{chunk-ZAT6O5HR.mjs → chunk-46GOGODM.mjs} +37 -21
- package/dist/{chunk-EZ2J7PMK.mjs → chunk-4FABOYKQ.mjs} +63 -15
- package/dist/{chunk-RRNUXVEA.js → chunk-CKLR5LMV.js} +141 -93
- package/dist/{chunk-VLEV37KF.mjs → chunk-CTG3GV2W.mjs} +4 -0
- package/dist/{chunk-QU6XIJOB.js → chunk-FT5Y6KDW.js} +61 -45
- package/dist/{chunk-UJ5GHVII.js → chunk-GE7W2DBE.js} +4 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +87 -78
- package/dist/cli.mjs +75 -66
- package/dist/{export-BRPXINGP.js → export-INNI35CW.js} +6 -5
- package/dist/{export-BAZ4BSV6.mjs → export-N3YCMXVO.mjs} +4 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/package.json +25 -25
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkFT5Y6KDWjs = require('./chunk-FT5Y6KDW.js');
|
|
6
|
+
require('./chunk-GE7W2DBE.js');
|
|
7
7
|
|
|
8
8
|
// node/build.ts
|
|
9
9
|
var _path = require('path');
|
|
@@ -646,16 +646,16 @@ async function build(options, viteConfig = {}, args) {
|
|
|
646
646
|
let originalIndexHTML;
|
|
647
647
|
if (_fsextra2.default.existsSync(indexPath))
|
|
648
648
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
649
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
649
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkFT5Y6KDWjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
650
650
|
let config = void 0;
|
|
651
651
|
try {
|
|
652
|
-
const inlineConfig = await
|
|
652
|
+
const inlineConfig = await _chunkFT5Y6KDWjs.mergeViteConfigs.call(void 0,
|
|
653
653
|
options,
|
|
654
654
|
viteConfig,
|
|
655
655
|
{
|
|
656
656
|
root: options.userRoot,
|
|
657
657
|
plugins: [
|
|
658
|
-
await
|
|
658
|
+
await _chunkFT5Y6KDWjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
659
659
|
{
|
|
660
660
|
name: "resolve-config",
|
|
661
661
|
configResolved(_config) {
|
|
@@ -676,7 +676,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
676
676
|
} else {
|
|
677
677
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
678
678
|
await _vite.build.call(void 0,
|
|
679
|
-
await
|
|
679
|
+
await _chunkFT5Y6KDWjs.mergeViteConfigs.call(void 0,
|
|
680
680
|
options,
|
|
681
681
|
inlineConfig,
|
|
682
682
|
{
|
|
@@ -684,6 +684,8 @@ async function build(options, viteConfig = {}, args) {
|
|
|
684
684
|
base: `${config.base}iframes/monaco/`,
|
|
685
685
|
build: {
|
|
686
686
|
outDir: _path.resolve.call(void 0, config.build.outDir, "iframes/monaco"),
|
|
687
|
+
// fix for monaco workers
|
|
688
|
+
// https://github.com/vitejs/vite/issues/1927#issuecomment-805803918
|
|
687
689
|
rollupOptions: {
|
|
688
690
|
output: {
|
|
689
691
|
manualChunks: {
|
|
@@ -715,7 +717,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
715
717
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
716
718
|
`, "utf-8");
|
|
717
719
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
718
|
-
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-
|
|
720
|
+
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-INNI35CW.js"));
|
|
719
721
|
const port = 12445;
|
|
720
722
|
const app = _connect2.default.call(void 0, );
|
|
721
723
|
const server = _http2.default.createServer(app);
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-46GOGODM.mjs";
|
|
6
|
+
import "./chunk-CTG3GV2W.mjs";
|
|
7
7
|
|
|
8
8
|
// node/build.ts
|
|
9
9
|
import { join as join3, resolve as resolve3 } from "path";
|
|
@@ -684,6 +684,8 @@ async function build(options, viteConfig = {}, args) {
|
|
|
684
684
|
base: `${config.base}iframes/monaco/`,
|
|
685
685
|
build: {
|
|
686
686
|
outDir: resolve3(config.build.outDir, "iframes/monaco"),
|
|
687
|
+
// fix for monaco workers
|
|
688
|
+
// https://github.com/vitejs/vite/issues/1927#issuecomment-805803918
|
|
687
689
|
rollupOptions: {
|
|
688
690
|
output: {
|
|
689
691
|
manualChunks: {
|
|
@@ -715,7 +717,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
715
717
|
await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
716
718
|
`, "utf-8");
|
|
717
719
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
718
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
720
|
+
const { exportSlides, getExportOptions } = await import("./export-N3YCMXVO.mjs");
|
|
719
721
|
const port = 12445;
|
|
720
722
|
const app = connect();
|
|
721
723
|
const server = http.createServer(app);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
resolveImportPath,
|
|
8
8
|
stringifyMarkdownTokens,
|
|
9
9
|
toAtFS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CTG3GV2W.mjs";
|
|
11
11
|
|
|
12
12
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
13
13
|
var require_fast_deep_equal = __commonJS({
|
|
@@ -81,7 +81,7 @@ ${(((_a = index.match(/<head>([\s\S]*?)<\/head>/im)) == null ? void 0 : _a[1]) |
|
|
|
81
81
|
${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) || "").trim()}`;
|
|
82
82
|
}
|
|
83
83
|
if (data.features.tweet)
|
|
84
|
-
body += '\n<script async src="https://platform.twitter.com/widgets.js"
|
|
84
|
+
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
|
|
85
85
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
86
86
|
head += `
|
|
87
87
|
<link rel="stylesheet" href="${generateGoogleFontsUrl(data.config.fonts)}" type="text/css">`;
|
|
@@ -269,25 +269,25 @@ var dependencies = {
|
|
|
269
269
|
"@antfu/utils": "^0.7.2",
|
|
270
270
|
"@slidev/parser": "workspace:*",
|
|
271
271
|
"@slidev/types": "workspace:*",
|
|
272
|
-
"@unocss/reset": "^0.
|
|
273
|
-
"@vueuse/core": "^9.
|
|
274
|
-
"@vueuse/head": "^1.
|
|
275
|
-
"@vueuse/math": "^9.
|
|
272
|
+
"@unocss/reset": "^0.50.6",
|
|
273
|
+
"@vueuse/core": "^9.13.0",
|
|
274
|
+
"@vueuse/head": "^1.1.23",
|
|
275
|
+
"@vueuse/math": "^9.13.0",
|
|
276
276
|
"@vueuse/motion": "^2.0.0-beta.27",
|
|
277
277
|
codemirror: "^5.65.5",
|
|
278
278
|
defu: "^6.1.2",
|
|
279
279
|
drauu: "^0.3.2",
|
|
280
280
|
"file-saver": "^2.0.5",
|
|
281
|
-
"js-base64": "^3.7.
|
|
281
|
+
"js-base64": "^3.7.5",
|
|
282
282
|
"js-yaml": "^4.1.0",
|
|
283
283
|
katex: "^0.16.4",
|
|
284
|
-
mermaid: "^9.3
|
|
284
|
+
mermaid: "^9.4.3",
|
|
285
285
|
"monaco-editor": "^0.33.0",
|
|
286
|
-
nanoid: "^4.0.
|
|
287
|
-
prettier: "^2.8.
|
|
286
|
+
nanoid: "^4.0.1",
|
|
287
|
+
prettier: "^2.8.6",
|
|
288
288
|
recordrtc: "^5.6.2",
|
|
289
289
|
resolve: "^1.22.1",
|
|
290
|
-
unocss: "^0.
|
|
290
|
+
unocss: "^0.50.6",
|
|
291
291
|
"vite-plugin-windicss": "^1.8.10",
|
|
292
292
|
vue: "^3.2.47",
|
|
293
293
|
"vue-router": "^4.1.6",
|
|
@@ -299,7 +299,14 @@ var dependencies = {
|
|
|
299
299
|
import fs3 from "fs";
|
|
300
300
|
import { dirname as dirname3, join as join3 } from "path";
|
|
301
301
|
var ROOT_FILES = [
|
|
302
|
+
// '.git',
|
|
303
|
+
// https://pnpm.js.org/workspaces/
|
|
302
304
|
"pnpm-workspace.yaml"
|
|
305
|
+
// https://rushjs.io/pages/advanced/config_files/
|
|
306
|
+
// 'rush.json',
|
|
307
|
+
// https://nx.dev/latest/react/getting-started/nx-setup
|
|
308
|
+
// 'workspace.json',
|
|
309
|
+
// 'nx.json'
|
|
303
310
|
];
|
|
304
311
|
function hasWorkspacePackageJSON(root) {
|
|
305
312
|
const path = join3(root, "package.json");
|
|
@@ -399,11 +406,11 @@ function createConfigPlugin(options) {
|
|
|
399
406
|
...isInstalledGlobally ? [dirname4(resolveGlobalImportPath("@slidev/client/package.json")), dirname4(resolveGlobalImportPath("katex/package.json"))] : []
|
|
400
407
|
])
|
|
401
408
|
}
|
|
402
|
-
}
|
|
409
|
+
},
|
|
410
|
+
publicDir: join4(options.userRoot, "public")
|
|
403
411
|
};
|
|
404
412
|
if (isInstalledGlobally) {
|
|
405
413
|
injection.cacheDir = join4(options.cliRoot, "node_modules/.vite");
|
|
406
|
-
injection.publicDir = join4(options.userRoot, "public");
|
|
407
414
|
injection.root = options.cliRoot;
|
|
408
415
|
injection.resolve.alias.vue = `${resolveImportPath("vue/dist/vue.esm-browser.js", true)}`;
|
|
409
416
|
}
|
|
@@ -520,6 +527,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
520
527
|
var _a, _b, _c;
|
|
521
528
|
if (!data.entries.some((i) => slash2(i) === ctx.file))
|
|
522
529
|
return;
|
|
530
|
+
await ctx.read();
|
|
523
531
|
const newData = await parser.load(entry, data.themeMeta);
|
|
524
532
|
const moduleIds = /* @__PURE__ */ new Set();
|
|
525
533
|
if (data.slides.length !== newData.slides.length) {
|
|
@@ -744,7 +752,7 @@ ${imports.join("\n")}
|
|
|
744
752
|
if (matchExport) {
|
|
745
753
|
const exportIndex = (matchExport.index || 0) + matchExport[0].length;
|
|
746
754
|
let component = code.slice(exportIndex);
|
|
747
|
-
component = component.slice(0, component.indexOf("
|
|
755
|
+
component = component.slice(0, component.indexOf("</script>"));
|
|
748
756
|
const scriptIndex = (matchScript.index || 0) + matchScript[0].length;
|
|
749
757
|
const provideImport = '\nimport { injectionSlidevContext } from "@slidev/client/constants"\n';
|
|
750
758
|
code = `${code.slice(0, scriptIndex)}${provideImport}${code.slice(scriptIndex)}`;
|
|
@@ -774,7 +782,7 @@ ${code.slice(injectIndex)}`;
|
|
|
774
782
|
}
|
|
775
783
|
return `<script setup>
|
|
776
784
|
${imports.join("\n")}
|
|
777
|
-
|
|
785
|
+
</script>
|
|
778
786
|
${code}`;
|
|
779
787
|
}
|
|
780
788
|
function transformTitles(code) {
|
|
@@ -851,10 +859,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
851
859
|
'import "virtual:windi-components.css"',
|
|
852
860
|
'import "virtual:windi-base.css"'
|
|
853
861
|
);
|
|
854
|
-
imports.push(
|
|
855
|
-
|
|
856
|
-
'import "virtual:windi-devtools"'
|
|
857
|
-
);
|
|
862
|
+
imports.push('import "virtual:windi-utilities.css"');
|
|
863
|
+
if (process.env.NODE_ENV !== "production")
|
|
864
|
+
imports.push('import "virtual:windi-devtools"');
|
|
858
865
|
}
|
|
859
866
|
return imports.join("\n");
|
|
860
867
|
}
|
|
@@ -1076,7 +1083,8 @@ function isValidDelim(state, pos) {
|
|
|
1076
1083
|
let can_close = true;
|
|
1077
1084
|
const prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;
|
|
1078
1085
|
const nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1;
|
|
1079
|
-
if (prevChar === 32 || prevChar === 9 ||
|
|
1086
|
+
if (prevChar === 32 || prevChar === 9 || /* \t */
|
|
1087
|
+
nextChar >= 48 && nextChar <= 57)
|
|
1080
1088
|
can_close = false;
|
|
1081
1089
|
if (nextChar === 32 || nextChar === 9)
|
|
1082
1090
|
can_open = false;
|
|
@@ -1394,6 +1402,13 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1394
1402
|
});
|
|
1395
1403
|
}
|
|
1396
1404
|
function transformMarkdownMonaco(md2) {
|
|
1405
|
+
md2 = md2.replace(/^```(\w+?)\s*{monaco-diff}\s*?({.*?})?\s*?\n([\s\S]+?)^~~~\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code, diff) => {
|
|
1406
|
+
lang = lang.trim();
|
|
1407
|
+
options = options.trim() || "{}";
|
|
1408
|
+
const encoded = base64.encode(code, true);
|
|
1409
|
+
const encodedDiff = base64.encode(diff, true);
|
|
1410
|
+
return `<Monaco :code="'${encoded}'" :diff="'${encodedDiff}'" lang="${lang}" v-bind="${options}" />`;
|
|
1411
|
+
});
|
|
1397
1412
|
md2 = md2.replace(/^```(\w+?)\s*{monaco}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code) => {
|
|
1398
1413
|
lang = lang.trim();
|
|
1399
1414
|
options = options.trim() || "{}";
|
|
@@ -1553,6 +1568,7 @@ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, u
|
|
|
1553
1568
|
|
|
1554
1569
|
// node/plugins/preset.ts
|
|
1555
1570
|
var customElements = /* @__PURE__ */ new Set([
|
|
1571
|
+
// katex
|
|
1556
1572
|
"annotation",
|
|
1557
1573
|
"math",
|
|
1558
1574
|
"menclose",
|
|
@@ -1683,7 +1699,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1683
1699
|
dev: true,
|
|
1684
1700
|
build: true
|
|
1685
1701
|
}) : null,
|
|
1686
|
-
config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions)
|
|
1702
|
+
config.css === "none" ? null : config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions)
|
|
1687
1703
|
].flat().filter(notNullish2);
|
|
1688
1704
|
}
|
|
1689
1705
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-46GOGODM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__privateAdd,
|
|
@@ -11,14 +11,15 @@ import {
|
|
|
11
11
|
__toESM,
|
|
12
12
|
packageExists,
|
|
13
13
|
resolveImportPath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CTG3GV2W.mjs";
|
|
15
15
|
|
|
16
16
|
// ../../node_modules/.pnpm/semver@7.3.8/node_modules/semver/internal/constants.js
|
|
17
17
|
var require_constants = __commonJS({
|
|
18
18
|
"../../node_modules/.pnpm/semver@7.3.8/node_modules/semver/internal/constants.js"(exports, module) {
|
|
19
19
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
20
20
|
var MAX_LENGTH = 256;
|
|
21
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
|
21
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
22
|
+
9007199254740991;
|
|
22
23
|
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
23
24
|
module.exports = {
|
|
24
25
|
SEMVER_SPEC_VERSION,
|
|
@@ -276,6 +277,8 @@ var require_semver = __commonJS({
|
|
|
276
277
|
}
|
|
277
278
|
} while (++i);
|
|
278
279
|
}
|
|
280
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
281
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
279
282
|
inc(release, identifier) {
|
|
280
283
|
switch (release) {
|
|
281
284
|
case "premajor":
|
|
@@ -1124,6 +1127,7 @@ var require_lru_cache = __commonJS({
|
|
|
1124
1127
|
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
1125
1128
|
this.reset();
|
|
1126
1129
|
}
|
|
1130
|
+
// resize the cache when the max changes.
|
|
1127
1131
|
set max(mL) {
|
|
1128
1132
|
if (typeof mL !== "number" || mL < 0)
|
|
1129
1133
|
throw new TypeError("max must be a non-negative number");
|
|
@@ -1148,6 +1152,7 @@ var require_lru_cache = __commonJS({
|
|
|
1148
1152
|
get maxAge() {
|
|
1149
1153
|
return this[MAX_AGE];
|
|
1150
1154
|
}
|
|
1155
|
+
// resize the cache when the lengthCalculator changes.
|
|
1151
1156
|
set lengthCalculator(lC) {
|
|
1152
1157
|
if (typeof lC !== "function")
|
|
1153
1158
|
lC = naiveLength;
|
|
@@ -1462,6 +1467,7 @@ var require_range = __commonJS({
|
|
|
1462
1467
|
});
|
|
1463
1468
|
});
|
|
1464
1469
|
}
|
|
1470
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
1465
1471
|
test(version3) {
|
|
1466
1472
|
if (!version3) {
|
|
1467
1473
|
return false;
|
|
@@ -2400,12 +2406,12 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2400
2406
|
import * as parser from "@slidev/parser/fs";
|
|
2401
2407
|
|
|
2402
2408
|
// package.json
|
|
2403
|
-
var version = "0.40.
|
|
2409
|
+
var version = "0.40.4";
|
|
2404
2410
|
|
|
2405
2411
|
// node/themes.ts
|
|
2406
2412
|
import prompts2 from "prompts";
|
|
2407
2413
|
|
|
2408
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
2414
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.20.0/node_modules/@antfu/ni/dist/shared/ni.dfba777f.mjs
|
|
2409
2415
|
import require$$0, { resolve } from "path";
|
|
2410
2416
|
import require$$0$6 from "readline";
|
|
2411
2417
|
import require$$2 from "events";
|
|
@@ -2490,10 +2496,12 @@ var AGENTS = {
|
|
|
2490
2496
|
"upgrade": "yarn up {0}",
|
|
2491
2497
|
"upgrade-interactive": "yarn up -i {0}",
|
|
2492
2498
|
"execute": "yarn dlx {0}",
|
|
2499
|
+
// Yarn 2+ removed 'global', see https://github.com/yarnpkg/berry/issues/821
|
|
2493
2500
|
"global": "npm i -g {0}",
|
|
2494
2501
|
"global_uninstall": "npm uninstall -g {0}"
|
|
2495
2502
|
},
|
|
2496
2503
|
"pnpm": pnpm,
|
|
2504
|
+
// pnpm v6.x or below
|
|
2497
2505
|
"pnpm@6": {
|
|
2498
2506
|
...pnpm,
|
|
2499
2507
|
run: npmRun("pnpm")
|
|
@@ -3069,8 +3077,10 @@ var getNotFoundError$1 = (cmd) => Object.assign(new Error(`not found: ${cmd}`),
|
|
|
3069
3077
|
var getPathInfo$1 = (cmd, opt) => {
|
|
3070
3078
|
const colon = opt.colon || COLON;
|
|
3071
3079
|
const pathEnv = cmd.match(/\//) || isWindows$1 && cmd.match(/\\/) ? [""] : [
|
|
3080
|
+
// windows always checks the cwd first
|
|
3072
3081
|
...isWindows$1 ? [process.cwd()] : [],
|
|
3073
|
-
...(opt.path || process.env.PATH ||
|
|
3082
|
+
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
3083
|
+
"").split(colon)
|
|
3074
3084
|
];
|
|
3075
3085
|
const pathExtExe = isWindows$1 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
3076
3086
|
const pathExt = isWindows$1 ? pathExtExe.split(colon) : [""];
|
|
@@ -3966,6 +3976,9 @@ function requireSignals() {
|
|
|
3966
3976
|
"SIGSYS",
|
|
3967
3977
|
"SIGQUIT",
|
|
3968
3978
|
"SIGIOT"
|
|
3979
|
+
// should detect profiler and enable/disable accordingly.
|
|
3980
|
+
// see #21
|
|
3981
|
+
// 'SIGPROF'
|
|
3969
3982
|
);
|
|
3970
3983
|
}
|
|
3971
3984
|
if (process.platform === "linux") {
|
|
@@ -4098,7 +4111,8 @@ if (!processOk(process$1)) {
|
|
|
4098
4111
|
if (!processOk(commonjsGlobal.process)) {
|
|
4099
4112
|
return;
|
|
4100
4113
|
}
|
|
4101
|
-
process$1.exitCode = code ||
|
|
4114
|
+
process$1.exitCode = code || /* istanbul ignore next */
|
|
4115
|
+
0;
|
|
4102
4116
|
emit("exit", process$1.exitCode, null);
|
|
4103
4117
|
emit("afterexit", process$1.exitCode, null);
|
|
4104
4118
|
originalProcessReallyExit.call(process$1, process$1.exitCode);
|
|
@@ -4630,7 +4644,13 @@ ansiEscapes.eraseScreen = ESC + "2J";
|
|
|
4630
4644
|
ansiEscapes.scrollUp = ESC + "S";
|
|
4631
4645
|
ansiEscapes.scrollDown = ESC + "T";
|
|
4632
4646
|
ansiEscapes.clearScreen = "\x1Bc";
|
|
4633
|
-
ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` :
|
|
4647
|
+
ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : (
|
|
4648
|
+
// 1. Erases the screen (Only done in case `2` is not supported)
|
|
4649
|
+
// 2. Erases the whole screen including scrollback buffer
|
|
4650
|
+
// 3. Moves cursor to the top-left position
|
|
4651
|
+
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
4652
|
+
`${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`
|
|
4653
|
+
);
|
|
4634
4654
|
ansiEscapes.beep = BEL;
|
|
4635
4655
|
ansiEscapes.link = (text2, url2) => {
|
|
4636
4656
|
return [
|
|
@@ -4874,6 +4894,7 @@ function requireKleur() {
|
|
|
4874
4894
|
const { FORCE_COLOR: FORCE_COLOR2, NODE_DISABLE_COLORS: NODE_DISABLE_COLORS2, TERM: TERM2 } = process.env;
|
|
4875
4895
|
const $2 = {
|
|
4876
4896
|
enabled: !NODE_DISABLE_COLORS2 && TERM2 !== "dumb" && FORCE_COLOR2 !== "0",
|
|
4897
|
+
// modifiers
|
|
4877
4898
|
reset: init2(0, 0),
|
|
4878
4899
|
bold: init2(1, 22),
|
|
4879
4900
|
dim: init2(2, 22),
|
|
@@ -4882,6 +4903,7 @@ function requireKleur() {
|
|
|
4882
4903
|
inverse: init2(7, 27),
|
|
4883
4904
|
hidden: init2(8, 28),
|
|
4884
4905
|
strikethrough: init2(9, 29),
|
|
4906
|
+
// colors
|
|
4885
4907
|
black: init2(30, 39),
|
|
4886
4908
|
red: init2(31, 39),
|
|
4887
4909
|
green: init2(32, 39),
|
|
@@ -4892,6 +4914,7 @@ function requireKleur() {
|
|
|
4892
4914
|
white: init2(37, 39),
|
|
4893
4915
|
gray: init2(90, 39),
|
|
4894
4916
|
grey: init2(90, 39),
|
|
4917
|
+
// background colors
|
|
4895
4918
|
bgBlack: init2(40, 49),
|
|
4896
4919
|
bgRed: init2(41, 49),
|
|
4897
4920
|
bgGreen: init2(42, 49),
|
|
@@ -5888,7 +5911,7 @@ function requireDatepart$1() {
|
|
|
5888
5911
|
locales
|
|
5889
5912
|
}) {
|
|
5890
5913
|
this.token = token;
|
|
5891
|
-
this.date = date2 || new Date();
|
|
5914
|
+
this.date = date2 || /* @__PURE__ */ new Date();
|
|
5892
5915
|
this.parts = parts || [this];
|
|
5893
5916
|
this.locales = locales || {};
|
|
5894
5917
|
}
|
|
@@ -6208,13 +6231,21 @@ function requireDate$1() {
|
|
|
6208
6231
|
token
|
|
6209
6232
|
}) => token.replace(/\\(.)/g, "$1"),
|
|
6210
6233
|
2: (opts) => new Day(opts),
|
|
6234
|
+
// Day // TODO
|
|
6211
6235
|
3: (opts) => new Month(opts),
|
|
6236
|
+
// Month
|
|
6212
6237
|
4: (opts) => new Year(opts),
|
|
6238
|
+
// Year
|
|
6213
6239
|
5: (opts) => new Meridiem(opts),
|
|
6240
|
+
// AM/PM // TODO (special)
|
|
6214
6241
|
6: (opts) => new Hours(opts),
|
|
6242
|
+
// Hours
|
|
6215
6243
|
7: (opts) => new Minutes(opts),
|
|
6244
|
+
// Minutes
|
|
6216
6245
|
8: (opts) => new Seconds(opts),
|
|
6246
|
+
// Seconds
|
|
6217
6247
|
9: (opts) => new Milliseconds(opts)
|
|
6248
|
+
// Fractional seconds
|
|
6218
6249
|
};
|
|
6219
6250
|
const dfltLocales = {
|
|
6220
6251
|
months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
|
|
@@ -6229,7 +6260,7 @@ function requireDate$1() {
|
|
|
6229
6260
|
this.cursor = 0;
|
|
6230
6261
|
this.typed = "";
|
|
6231
6262
|
this.locales = Object.assign(dfltLocales, opts.locales);
|
|
6232
|
-
this._date = opts.initial || new Date();
|
|
6263
|
+
this._date = opts.initial || /* @__PURE__ */ new Date();
|
|
6233
6264
|
this.errorMsg = opts.error || "Please Enter A Valid Value";
|
|
6234
6265
|
this.validator = opts.validate || (() => true);
|
|
6235
6266
|
this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss";
|
|
@@ -6770,6 +6801,7 @@ Instructions:
|
|
|
6770
6801
|
}
|
|
6771
6802
|
return prefix + title + color.gray(desc || "");
|
|
6772
6803
|
}
|
|
6804
|
+
// shared with autocompleteMultiselect
|
|
6773
6805
|
paginateOptions(options) {
|
|
6774
6806
|
if (options.length === 0) {
|
|
6775
6807
|
return color.red("No matches for this query.");
|
|
@@ -6788,6 +6820,7 @@ Instructions:
|
|
|
6788
6820
|
}
|
|
6789
6821
|
return "\n" + styledOptions.join("\n");
|
|
6790
6822
|
}
|
|
6823
|
+
// shared with autocomleteMultiselect
|
|
6791
6824
|
renderOptions(options) {
|
|
6792
6825
|
if (!this.done) {
|
|
6793
6826
|
return this.paginateOptions(options);
|
|
@@ -8394,7 +8427,7 @@ function requireDatepart() {
|
|
|
8394
8427
|
class DatePart {
|
|
8395
8428
|
constructor({ token, date: date2, parts, locales }) {
|
|
8396
8429
|
this.token = token;
|
|
8397
|
-
this.date = date2 || new Date();
|
|
8430
|
+
this.date = date2 || /* @__PURE__ */ new Date();
|
|
8398
8431
|
this.parts = parts || [this];
|
|
8399
8432
|
this.locales = locales || {};
|
|
8400
8433
|
}
|
|
@@ -8683,13 +8716,21 @@ function requireDate() {
|
|
|
8683
8716
|
const regexGroups = {
|
|
8684
8717
|
1: ({ token }) => token.replace(/\\(.)/g, "$1"),
|
|
8685
8718
|
2: (opts) => new Day(opts),
|
|
8719
|
+
// Day // TODO
|
|
8686
8720
|
3: (opts) => new Month(opts),
|
|
8721
|
+
// Month
|
|
8687
8722
|
4: (opts) => new Year(opts),
|
|
8723
|
+
// Year
|
|
8688
8724
|
5: (opts) => new Meridiem(opts),
|
|
8725
|
+
// AM/PM // TODO (special)
|
|
8689
8726
|
6: (opts) => new Hours(opts),
|
|
8727
|
+
// Hours
|
|
8690
8728
|
7: (opts) => new Minutes(opts),
|
|
8729
|
+
// Minutes
|
|
8691
8730
|
8: (opts) => new Seconds(opts),
|
|
8731
|
+
// Seconds
|
|
8692
8732
|
9: (opts) => new Milliseconds(opts)
|
|
8733
|
+
// Fractional seconds
|
|
8693
8734
|
};
|
|
8694
8735
|
const dfltLocales = {
|
|
8695
8736
|
months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
|
|
@@ -8704,7 +8745,7 @@ function requireDate() {
|
|
|
8704
8745
|
this.cursor = 0;
|
|
8705
8746
|
this.typed = "";
|
|
8706
8747
|
this.locales = Object.assign(dfltLocales, opts.locales);
|
|
8707
|
-
this._date = opts.initial || new Date();
|
|
8748
|
+
this._date = opts.initial || /* @__PURE__ */ new Date();
|
|
8708
8749
|
this.errorMsg = opts.error || "Please Enter A Valid Value";
|
|
8709
8750
|
this.validator = opts.validate || (() => true);
|
|
8710
8751
|
this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss";
|
|
@@ -9206,6 +9247,7 @@ Instructions:
|
|
|
9206
9247
|
}
|
|
9207
9248
|
return prefix + title + color.gray(desc || "");
|
|
9208
9249
|
}
|
|
9250
|
+
// shared with autocompleteMultiselect
|
|
9209
9251
|
paginateOptions(options) {
|
|
9210
9252
|
if (options.length === 0) {
|
|
9211
9253
|
return color.red("No matches for this query.");
|
|
@@ -9224,6 +9266,7 @@ Instructions:
|
|
|
9224
9266
|
}
|
|
9225
9267
|
return "\n" + styledOptions.join("\n");
|
|
9226
9268
|
}
|
|
9269
|
+
// shared with autocomleteMultiselect
|
|
9227
9270
|
renderOptions(options) {
|
|
9228
9271
|
if (!this.done) {
|
|
9229
9272
|
return this.paginateOptions(options);
|
|
@@ -9923,8 +9966,10 @@ var getPathInfo = (cmd, {
|
|
|
9923
9966
|
delimiter: optDelimiter = delimiter
|
|
9924
9967
|
}) => {
|
|
9925
9968
|
const pathEnv = cmd.match(rSlash) ? [""] : [
|
|
9969
|
+
// windows always checks the cwd first
|
|
9926
9970
|
...isWindows ? [process.cwd()] : [],
|
|
9927
|
-
...(optPath ||
|
|
9971
|
+
...(optPath || /* istanbul ignore next: very unusual */
|
|
9972
|
+
"").split(optDelimiter)
|
|
9928
9973
|
];
|
|
9929
9974
|
if (isWindows) {
|
|
9930
9975
|
const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
|
|
@@ -10097,6 +10142,7 @@ if (typeof process !== "undefined") {
|
|
|
10097
10142
|
}
|
|
10098
10143
|
var $ = {
|
|
10099
10144
|
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY),
|
|
10145
|
+
// modifiers
|
|
10100
10146
|
reset: init(0, 0),
|
|
10101
10147
|
bold: init(1, 22),
|
|
10102
10148
|
dim: init(2, 22),
|
|
@@ -10105,6 +10151,7 @@ var $ = {
|
|
|
10105
10151
|
inverse: init(7, 27),
|
|
10106
10152
|
hidden: init(8, 28),
|
|
10107
10153
|
strikethrough: init(9, 29),
|
|
10154
|
+
// colors
|
|
10108
10155
|
black: init(30, 39),
|
|
10109
10156
|
red: init(31, 39),
|
|
10110
10157
|
green: init(32, 39),
|
|
@@ -10115,6 +10162,7 @@ var $ = {
|
|
|
10115
10162
|
white: init(37, 39),
|
|
10116
10163
|
gray: init(90, 39),
|
|
10117
10164
|
grey: init(90, 39),
|
|
10165
|
+
// background colors
|
|
10118
10166
|
bgBlack: init(40, 49),
|
|
10119
10167
|
bgRed: init(41, 49),
|
|
10120
10168
|
bgGreen: init(42, 49),
|
|
@@ -10180,7 +10228,7 @@ function init(open, close) {
|
|
|
10180
10228
|
return txt === void 0 ? chain([open], [blk]) : $.enabled ? run$1([blk], txt + "") : txt + "";
|
|
10181
10229
|
};
|
|
10182
10230
|
}
|
|
10183
|
-
var version2 = "0.
|
|
10231
|
+
var version2 = "0.20.0";
|
|
10184
10232
|
var DEBUG_SIGN = "?";
|
|
10185
10233
|
async function run(fn, args, options = {}) {
|
|
10186
10234
|
const debug2 = args.includes(DEBUG_SIGN);
|
|
@@ -10198,7 +10246,7 @@ async function run(fn, args, options = {}) {
|
|
|
10198
10246
|
`));
|
|
10199
10247
|
console.log(`ni ${dash} install`);
|
|
10200
10248
|
console.log(`nr ${dash} run`);
|
|
10201
|
-
console.log(`
|
|
10249
|
+
console.log(`nix ${dash} execute`);
|
|
10202
10250
|
console.log(`nu ${dash} upgrade`);
|
|
10203
10251
|
console.log(`nun ${dash} uninstall`);
|
|
10204
10252
|
console.log(`nci ${dash} clean install`);
|