base44 0.0.9 → 0.0.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.
- package/dist/cli/index.js +456 -443
- package/dist/cli/templates/templates.json +4 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -5,12 +5,11 @@ import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
|
5
5
|
import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
|
|
6
6
|
import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
8
|
-
import os, { constants, homedir, tmpdir } from "node:os";
|
|
9
|
-
import tty from "node:tty";
|
|
10
8
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
11
9
|
import * as g from "node:readline";
|
|
12
10
|
import O from "node:readline";
|
|
13
11
|
import Stream, { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
|
|
12
|
+
import os, { constants, homedir, tmpdir } from "node:os";
|
|
14
13
|
import { fileURLToPath } from "node:url";
|
|
15
14
|
import fs$1 from "fs";
|
|
16
15
|
import path$1, { dirname as dirname$1, parse } from "path";
|
|
@@ -18,6 +17,7 @@ import { finished } from "node:stream/promises";
|
|
|
18
17
|
import EE, { EventEmitter as EventEmitter$1 } from "events";
|
|
19
18
|
import fsPromises, { access, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
20
19
|
import { Buffer as Buffer$1 } from "buffer";
|
|
20
|
+
import tty from "node:tty";
|
|
21
21
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
22
22
|
import { StringDecoder } from "node:string_decoder";
|
|
23
23
|
import assert from "assert";
|
|
@@ -2705,415 +2705,6 @@ var require_commander = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2705
2705
|
var import_commander = /* @__PURE__ */ __toESM(require_commander(), 1);
|
|
2706
2706
|
const { program: program$1, createCommand: createCommand$1, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help } = import_commander.default;
|
|
2707
2707
|
|
|
2708
|
-
//#endregion
|
|
2709
|
-
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
2710
|
-
const ANSI_BACKGROUND_OFFSET = 10;
|
|
2711
|
-
const wrapAnsi16 = (offset = 0) => (code$1) => `\u001B[${code$1 + offset}m`;
|
|
2712
|
-
const wrapAnsi256 = (offset = 0) => (code$1) => `\u001B[${38 + offset};5;${code$1}m`;
|
|
2713
|
-
const wrapAnsi16m = (offset = 0) => (red$1, green$1, blue$1) => `\u001B[${38 + offset};2;${red$1};${green$1};${blue$1}m`;
|
|
2714
|
-
const styles$1 = {
|
|
2715
|
-
modifier: {
|
|
2716
|
-
reset: [0, 0],
|
|
2717
|
-
bold: [1, 22],
|
|
2718
|
-
dim: [2, 22],
|
|
2719
|
-
italic: [3, 23],
|
|
2720
|
-
underline: [4, 24],
|
|
2721
|
-
overline: [53, 55],
|
|
2722
|
-
inverse: [7, 27],
|
|
2723
|
-
hidden: [8, 28],
|
|
2724
|
-
strikethrough: [9, 29]
|
|
2725
|
-
},
|
|
2726
|
-
color: {
|
|
2727
|
-
black: [30, 39],
|
|
2728
|
-
red: [31, 39],
|
|
2729
|
-
green: [32, 39],
|
|
2730
|
-
yellow: [33, 39],
|
|
2731
|
-
blue: [34, 39],
|
|
2732
|
-
magenta: [35, 39],
|
|
2733
|
-
cyan: [36, 39],
|
|
2734
|
-
white: [37, 39],
|
|
2735
|
-
blackBright: [90, 39],
|
|
2736
|
-
gray: [90, 39],
|
|
2737
|
-
grey: [90, 39],
|
|
2738
|
-
redBright: [91, 39],
|
|
2739
|
-
greenBright: [92, 39],
|
|
2740
|
-
yellowBright: [93, 39],
|
|
2741
|
-
blueBright: [94, 39],
|
|
2742
|
-
magentaBright: [95, 39],
|
|
2743
|
-
cyanBright: [96, 39],
|
|
2744
|
-
whiteBright: [97, 39]
|
|
2745
|
-
},
|
|
2746
|
-
bgColor: {
|
|
2747
|
-
bgBlack: [40, 49],
|
|
2748
|
-
bgRed: [41, 49],
|
|
2749
|
-
bgGreen: [42, 49],
|
|
2750
|
-
bgYellow: [43, 49],
|
|
2751
|
-
bgBlue: [44, 49],
|
|
2752
|
-
bgMagenta: [45, 49],
|
|
2753
|
-
bgCyan: [46, 49],
|
|
2754
|
-
bgWhite: [47, 49],
|
|
2755
|
-
bgBlackBright: [100, 49],
|
|
2756
|
-
bgGray: [100, 49],
|
|
2757
|
-
bgGrey: [100, 49],
|
|
2758
|
-
bgRedBright: [101, 49],
|
|
2759
|
-
bgGreenBright: [102, 49],
|
|
2760
|
-
bgYellowBright: [103, 49],
|
|
2761
|
-
bgBlueBright: [104, 49],
|
|
2762
|
-
bgMagentaBright: [105, 49],
|
|
2763
|
-
bgCyanBright: [106, 49],
|
|
2764
|
-
bgWhiteBright: [107, 49]
|
|
2765
|
-
}
|
|
2766
|
-
};
|
|
2767
|
-
const modifierNames = Object.keys(styles$1.modifier);
|
|
2768
|
-
const foregroundColorNames = Object.keys(styles$1.color);
|
|
2769
|
-
const backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
2770
|
-
const colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
2771
|
-
function assembleStyles() {
|
|
2772
|
-
const codes = /* @__PURE__ */ new Map();
|
|
2773
|
-
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
2774
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
2775
|
-
styles$1[styleName] = {
|
|
2776
|
-
open: `\u001B[${style[0]}m`,
|
|
2777
|
-
close: `\u001B[${style[1]}m`
|
|
2778
|
-
};
|
|
2779
|
-
group[styleName] = styles$1[styleName];
|
|
2780
|
-
codes.set(style[0], style[1]);
|
|
2781
|
-
}
|
|
2782
|
-
Object.defineProperty(styles$1, groupName, {
|
|
2783
|
-
value: group,
|
|
2784
|
-
enumerable: false
|
|
2785
|
-
});
|
|
2786
|
-
}
|
|
2787
|
-
Object.defineProperty(styles$1, "codes", {
|
|
2788
|
-
value: codes,
|
|
2789
|
-
enumerable: false
|
|
2790
|
-
});
|
|
2791
|
-
styles$1.color.close = "\x1B[39m";
|
|
2792
|
-
styles$1.bgColor.close = "\x1B[49m";
|
|
2793
|
-
styles$1.color.ansi = wrapAnsi16();
|
|
2794
|
-
styles$1.color.ansi256 = wrapAnsi256();
|
|
2795
|
-
styles$1.color.ansi16m = wrapAnsi16m();
|
|
2796
|
-
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
2797
|
-
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
2798
|
-
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
2799
|
-
Object.defineProperties(styles$1, {
|
|
2800
|
-
rgbToAnsi256: {
|
|
2801
|
-
value(red$1, green$1, blue$1) {
|
|
2802
|
-
if (red$1 === green$1 && green$1 === blue$1) {
|
|
2803
|
-
if (red$1 < 8) return 16;
|
|
2804
|
-
if (red$1 > 248) return 231;
|
|
2805
|
-
return Math.round((red$1 - 8) / 247 * 24) + 232;
|
|
2806
|
-
}
|
|
2807
|
-
return 16 + 36 * Math.round(red$1 / 255 * 5) + 6 * Math.round(green$1 / 255 * 5) + Math.round(blue$1 / 255 * 5);
|
|
2808
|
-
},
|
|
2809
|
-
enumerable: false
|
|
2810
|
-
},
|
|
2811
|
-
hexToRgb: {
|
|
2812
|
-
value(hex) {
|
|
2813
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
2814
|
-
if (!matches) return [
|
|
2815
|
-
0,
|
|
2816
|
-
0,
|
|
2817
|
-
0
|
|
2818
|
-
];
|
|
2819
|
-
let [colorString] = matches;
|
|
2820
|
-
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
2821
|
-
const integer$1 = Number.parseInt(colorString, 16);
|
|
2822
|
-
return [
|
|
2823
|
-
integer$1 >> 16 & 255,
|
|
2824
|
-
integer$1 >> 8 & 255,
|
|
2825
|
-
integer$1 & 255
|
|
2826
|
-
];
|
|
2827
|
-
},
|
|
2828
|
-
enumerable: false
|
|
2829
|
-
},
|
|
2830
|
-
hexToAnsi256: {
|
|
2831
|
-
value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
|
|
2832
|
-
enumerable: false
|
|
2833
|
-
},
|
|
2834
|
-
ansi256ToAnsi: {
|
|
2835
|
-
value(code$1) {
|
|
2836
|
-
if (code$1 < 8) return 30 + code$1;
|
|
2837
|
-
if (code$1 < 16) return 90 + (code$1 - 8);
|
|
2838
|
-
let red$1;
|
|
2839
|
-
let green$1;
|
|
2840
|
-
let blue$1;
|
|
2841
|
-
if (code$1 >= 232) {
|
|
2842
|
-
red$1 = ((code$1 - 232) * 10 + 8) / 255;
|
|
2843
|
-
green$1 = red$1;
|
|
2844
|
-
blue$1 = red$1;
|
|
2845
|
-
} else {
|
|
2846
|
-
code$1 -= 16;
|
|
2847
|
-
const remainder = code$1 % 36;
|
|
2848
|
-
red$1 = Math.floor(code$1 / 36) / 5;
|
|
2849
|
-
green$1 = Math.floor(remainder / 6) / 5;
|
|
2850
|
-
blue$1 = remainder % 6 / 5;
|
|
2851
|
-
}
|
|
2852
|
-
const value = Math.max(red$1, green$1, blue$1) * 2;
|
|
2853
|
-
if (value === 0) return 30;
|
|
2854
|
-
let result = 30 + (Math.round(blue$1) << 2 | Math.round(green$1) << 1 | Math.round(red$1));
|
|
2855
|
-
if (value === 2) result += 60;
|
|
2856
|
-
return result;
|
|
2857
|
-
},
|
|
2858
|
-
enumerable: false
|
|
2859
|
-
},
|
|
2860
|
-
rgbToAnsi: {
|
|
2861
|
-
value: (red$1, green$1, blue$1) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red$1, green$1, blue$1)),
|
|
2862
|
-
enumerable: false
|
|
2863
|
-
},
|
|
2864
|
-
hexToAnsi: {
|
|
2865
|
-
value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
|
|
2866
|
-
enumerable: false
|
|
2867
|
-
}
|
|
2868
|
-
});
|
|
2869
|
-
return styles$1;
|
|
2870
|
-
}
|
|
2871
|
-
const ansiStyles = assembleStyles();
|
|
2872
|
-
var ansi_styles_default = ansiStyles;
|
|
2873
|
-
|
|
2874
|
-
//#endregion
|
|
2875
|
-
//#region node_modules/chalk/source/vendor/supports-color/index.js
|
|
2876
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
|
|
2877
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
2878
|
-
const position = argv.indexOf(prefix + flag);
|
|
2879
|
-
const terminatorPosition = argv.indexOf("--");
|
|
2880
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
2881
|
-
}
|
|
2882
|
-
const { env } = y;
|
|
2883
|
-
let flagForceColor;
|
|
2884
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
2885
|
-
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
2886
|
-
function envForceColor() {
|
|
2887
|
-
if ("FORCE_COLOR" in env) {
|
|
2888
|
-
if (env.FORCE_COLOR === "true") return 1;
|
|
2889
|
-
if (env.FORCE_COLOR === "false") return 0;
|
|
2890
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
2891
|
-
}
|
|
2892
|
-
}
|
|
2893
|
-
function translateLevel(level) {
|
|
2894
|
-
if (level === 0) return false;
|
|
2895
|
-
return {
|
|
2896
|
-
level,
|
|
2897
|
-
hasBasic: true,
|
|
2898
|
-
has256: level >= 2,
|
|
2899
|
-
has16m: level >= 3
|
|
2900
|
-
};
|
|
2901
|
-
}
|
|
2902
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
2903
|
-
const noFlagForceColor = envForceColor();
|
|
2904
|
-
if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
|
|
2905
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
2906
|
-
if (forceColor === 0) return 0;
|
|
2907
|
-
if (sniffFlags) {
|
|
2908
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
2909
|
-
if (hasFlag("color=256")) return 2;
|
|
2910
|
-
}
|
|
2911
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
|
|
2912
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
2913
|
-
const min = forceColor || 0;
|
|
2914
|
-
if (env.TERM === "dumb") return min;
|
|
2915
|
-
if (y.platform === "win32") {
|
|
2916
|
-
const osRelease = os.release().split(".");
|
|
2917
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2918
|
-
return 1;
|
|
2919
|
-
}
|
|
2920
|
-
if ("CI" in env) {
|
|
2921
|
-
if ([
|
|
2922
|
-
"GITHUB_ACTIONS",
|
|
2923
|
-
"GITEA_ACTIONS",
|
|
2924
|
-
"CIRCLECI"
|
|
2925
|
-
].some((key) => key in env)) return 3;
|
|
2926
|
-
if ([
|
|
2927
|
-
"TRAVIS",
|
|
2928
|
-
"APPVEYOR",
|
|
2929
|
-
"GITLAB_CI",
|
|
2930
|
-
"BUILDKITE",
|
|
2931
|
-
"DRONE"
|
|
2932
|
-
].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
|
|
2933
|
-
return min;
|
|
2934
|
-
}
|
|
2935
|
-
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
2936
|
-
if (env.COLORTERM === "truecolor") return 3;
|
|
2937
|
-
if (env.TERM === "xterm-kitty") return 3;
|
|
2938
|
-
if (env.TERM === "xterm-ghostty") return 3;
|
|
2939
|
-
if (env.TERM === "wezterm") return 3;
|
|
2940
|
-
if ("TERM_PROGRAM" in env) {
|
|
2941
|
-
const version$2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
2942
|
-
switch (env.TERM_PROGRAM) {
|
|
2943
|
-
case "iTerm.app": return version$2 >= 3 ? 3 : 2;
|
|
2944
|
-
case "Apple_Terminal": return 2;
|
|
2945
|
-
}
|
|
2946
|
-
}
|
|
2947
|
-
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
2948
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
2949
|
-
if ("COLORTERM" in env) return 1;
|
|
2950
|
-
return min;
|
|
2951
|
-
}
|
|
2952
|
-
function createSupportsColor(stream, options = {}) {
|
|
2953
|
-
return translateLevel(_supportsColor(stream, {
|
|
2954
|
-
streamIsTTY: stream && stream.isTTY,
|
|
2955
|
-
...options
|
|
2956
|
-
}));
|
|
2957
|
-
}
|
|
2958
|
-
const supportsColor = {
|
|
2959
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
2960
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
2961
|
-
};
|
|
2962
|
-
var supports_color_default = supportsColor;
|
|
2963
|
-
|
|
2964
|
-
//#endregion
|
|
2965
|
-
//#region node_modules/chalk/source/utilities.js
|
|
2966
|
-
function stringReplaceAll(string$2, substring, replacer) {
|
|
2967
|
-
let index = string$2.indexOf(substring);
|
|
2968
|
-
if (index === -1) return string$2;
|
|
2969
|
-
const substringLength = substring.length;
|
|
2970
|
-
let endIndex = 0;
|
|
2971
|
-
let returnValue = "";
|
|
2972
|
-
do {
|
|
2973
|
-
returnValue += string$2.slice(endIndex, index) + substring + replacer;
|
|
2974
|
-
endIndex = index + substringLength;
|
|
2975
|
-
index = string$2.indexOf(substring, endIndex);
|
|
2976
|
-
} while (index !== -1);
|
|
2977
|
-
returnValue += string$2.slice(endIndex);
|
|
2978
|
-
return returnValue;
|
|
2979
|
-
}
|
|
2980
|
-
function stringEncaseCRLFWithFirstIndex(string$2, prefix, postfix, index) {
|
|
2981
|
-
let endIndex = 0;
|
|
2982
|
-
let returnValue = "";
|
|
2983
|
-
do {
|
|
2984
|
-
const gotCR = string$2[index - 1] === "\r";
|
|
2985
|
-
returnValue += string$2.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
2986
|
-
endIndex = index + 1;
|
|
2987
|
-
index = string$2.indexOf("\n", endIndex);
|
|
2988
|
-
} while (index !== -1);
|
|
2989
|
-
returnValue += string$2.slice(endIndex);
|
|
2990
|
-
return returnValue;
|
|
2991
|
-
}
|
|
2992
|
-
|
|
2993
|
-
//#endregion
|
|
2994
|
-
//#region node_modules/chalk/source/index.js
|
|
2995
|
-
const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
2996
|
-
const GENERATOR = Symbol("GENERATOR");
|
|
2997
|
-
const STYLER = Symbol("STYLER");
|
|
2998
|
-
const IS_EMPTY = Symbol("IS_EMPTY");
|
|
2999
|
-
const levelMapping = [
|
|
3000
|
-
"ansi",
|
|
3001
|
-
"ansi",
|
|
3002
|
-
"ansi256",
|
|
3003
|
-
"ansi16m"
|
|
3004
|
-
];
|
|
3005
|
-
const styles = Object.create(null);
|
|
3006
|
-
const applyOptions = (object$1, options = {}) => {
|
|
3007
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
|
|
3008
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
3009
|
-
object$1.level = options.level === void 0 ? colorLevel : options.level;
|
|
3010
|
-
};
|
|
3011
|
-
const chalkFactory = (options) => {
|
|
3012
|
-
const chalk$1 = (...strings) => strings.join(" ");
|
|
3013
|
-
applyOptions(chalk$1, options);
|
|
3014
|
-
Object.setPrototypeOf(chalk$1, createChalk.prototype);
|
|
3015
|
-
return chalk$1;
|
|
3016
|
-
};
|
|
3017
|
-
function createChalk(options) {
|
|
3018
|
-
return chalkFactory(options);
|
|
3019
|
-
}
|
|
3020
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
3021
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) styles[styleName] = { get() {
|
|
3022
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
3023
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
3024
|
-
return builder;
|
|
3025
|
-
} };
|
|
3026
|
-
styles.visible = { get() {
|
|
3027
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
3028
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
3029
|
-
return builder;
|
|
3030
|
-
} };
|
|
3031
|
-
const getModelAnsi = (model, level, type, ...arguments_) => {
|
|
3032
|
-
if (model === "rgb") {
|
|
3033
|
-
if (level === "ansi16m") return ansi_styles_default[type].ansi16m(...arguments_);
|
|
3034
|
-
if (level === "ansi256") return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
3035
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
3036
|
-
}
|
|
3037
|
-
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
3038
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
3039
|
-
};
|
|
3040
|
-
for (const model of [
|
|
3041
|
-
"rgb",
|
|
3042
|
-
"hex",
|
|
3043
|
-
"ansi256"
|
|
3044
|
-
]) {
|
|
3045
|
-
styles[model] = { get() {
|
|
3046
|
-
const { level } = this;
|
|
3047
|
-
return function(...arguments_) {
|
|
3048
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
3049
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
3050
|
-
};
|
|
3051
|
-
} };
|
|
3052
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
3053
|
-
styles[bgModel] = { get() {
|
|
3054
|
-
const { level } = this;
|
|
3055
|
-
return function(...arguments_) {
|
|
3056
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
3057
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
3058
|
-
};
|
|
3059
|
-
} };
|
|
3060
|
-
}
|
|
3061
|
-
const proto = Object.defineProperties(() => {}, {
|
|
3062
|
-
...styles,
|
|
3063
|
-
level: {
|
|
3064
|
-
enumerable: true,
|
|
3065
|
-
get() {
|
|
3066
|
-
return this[GENERATOR].level;
|
|
3067
|
-
},
|
|
3068
|
-
set(level) {
|
|
3069
|
-
this[GENERATOR].level = level;
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
});
|
|
3073
|
-
const createStyler = (open, close, parent) => {
|
|
3074
|
-
let openAll;
|
|
3075
|
-
let closeAll;
|
|
3076
|
-
if (parent === void 0) {
|
|
3077
|
-
openAll = open;
|
|
3078
|
-
closeAll = close;
|
|
3079
|
-
} else {
|
|
3080
|
-
openAll = parent.openAll + open;
|
|
3081
|
-
closeAll = close + parent.closeAll;
|
|
3082
|
-
}
|
|
3083
|
-
return {
|
|
3084
|
-
open,
|
|
3085
|
-
close,
|
|
3086
|
-
openAll,
|
|
3087
|
-
closeAll,
|
|
3088
|
-
parent
|
|
3089
|
-
};
|
|
3090
|
-
};
|
|
3091
|
-
const createBuilder = (self$1, _styler, _isEmpty) => {
|
|
3092
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
3093
|
-
Object.setPrototypeOf(builder, proto);
|
|
3094
|
-
builder[GENERATOR] = self$1;
|
|
3095
|
-
builder[STYLER] = _styler;
|
|
3096
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
3097
|
-
return builder;
|
|
3098
|
-
};
|
|
3099
|
-
const applyStyle = (self$1, string$2) => {
|
|
3100
|
-
if (self$1.level <= 0 || !string$2) return self$1[IS_EMPTY] ? "" : string$2;
|
|
3101
|
-
let styler = self$1[STYLER];
|
|
3102
|
-
if (styler === void 0) return string$2;
|
|
3103
|
-
const { openAll, closeAll } = styler;
|
|
3104
|
-
if (string$2.includes("\x1B")) while (styler !== void 0) {
|
|
3105
|
-
string$2 = stringReplaceAll(string$2, styler.close, styler.open);
|
|
3106
|
-
styler = styler.parent;
|
|
3107
|
-
}
|
|
3108
|
-
const lfIndex = string$2.indexOf("\n");
|
|
3109
|
-
if (lfIndex !== -1) string$2 = stringEncaseCRLFWithFirstIndex(string$2, closeAll, openAll, lfIndex);
|
|
3110
|
-
return openAll + string$2 + closeAll;
|
|
3111
|
-
};
|
|
3112
|
-
Object.defineProperties(createChalk.prototype, styles);
|
|
3113
|
-
const chalk = createChalk();
|
|
3114
|
-
const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
3115
|
-
var source_default = chalk;
|
|
3116
|
-
|
|
3117
2708
|
//#endregion
|
|
3118
2709
|
//#region node_modules/sisteransi/src/index.js
|
|
3119
2710
|
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -26187,10 +25778,436 @@ async function getUserInfo(accessToken) {
|
|
|
26187
25778
|
return result.data;
|
|
26188
25779
|
}
|
|
26189
25780
|
|
|
25781
|
+
//#endregion
|
|
25782
|
+
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
25783
|
+
const ANSI_BACKGROUND_OFFSET = 10;
|
|
25784
|
+
const wrapAnsi16 = (offset = 0) => (code$1) => `\u001B[${code$1 + offset}m`;
|
|
25785
|
+
const wrapAnsi256 = (offset = 0) => (code$1) => `\u001B[${38 + offset};5;${code$1}m`;
|
|
25786
|
+
const wrapAnsi16m = (offset = 0) => (red$1, green$1, blue$1) => `\u001B[${38 + offset};2;${red$1};${green$1};${blue$1}m`;
|
|
25787
|
+
const styles$1 = {
|
|
25788
|
+
modifier: {
|
|
25789
|
+
reset: [0, 0],
|
|
25790
|
+
bold: [1, 22],
|
|
25791
|
+
dim: [2, 22],
|
|
25792
|
+
italic: [3, 23],
|
|
25793
|
+
underline: [4, 24],
|
|
25794
|
+
overline: [53, 55],
|
|
25795
|
+
inverse: [7, 27],
|
|
25796
|
+
hidden: [8, 28],
|
|
25797
|
+
strikethrough: [9, 29]
|
|
25798
|
+
},
|
|
25799
|
+
color: {
|
|
25800
|
+
black: [30, 39],
|
|
25801
|
+
red: [31, 39],
|
|
25802
|
+
green: [32, 39],
|
|
25803
|
+
yellow: [33, 39],
|
|
25804
|
+
blue: [34, 39],
|
|
25805
|
+
magenta: [35, 39],
|
|
25806
|
+
cyan: [36, 39],
|
|
25807
|
+
white: [37, 39],
|
|
25808
|
+
blackBright: [90, 39],
|
|
25809
|
+
gray: [90, 39],
|
|
25810
|
+
grey: [90, 39],
|
|
25811
|
+
redBright: [91, 39],
|
|
25812
|
+
greenBright: [92, 39],
|
|
25813
|
+
yellowBright: [93, 39],
|
|
25814
|
+
blueBright: [94, 39],
|
|
25815
|
+
magentaBright: [95, 39],
|
|
25816
|
+
cyanBright: [96, 39],
|
|
25817
|
+
whiteBright: [97, 39]
|
|
25818
|
+
},
|
|
25819
|
+
bgColor: {
|
|
25820
|
+
bgBlack: [40, 49],
|
|
25821
|
+
bgRed: [41, 49],
|
|
25822
|
+
bgGreen: [42, 49],
|
|
25823
|
+
bgYellow: [43, 49],
|
|
25824
|
+
bgBlue: [44, 49],
|
|
25825
|
+
bgMagenta: [45, 49],
|
|
25826
|
+
bgCyan: [46, 49],
|
|
25827
|
+
bgWhite: [47, 49],
|
|
25828
|
+
bgBlackBright: [100, 49],
|
|
25829
|
+
bgGray: [100, 49],
|
|
25830
|
+
bgGrey: [100, 49],
|
|
25831
|
+
bgRedBright: [101, 49],
|
|
25832
|
+
bgGreenBright: [102, 49],
|
|
25833
|
+
bgYellowBright: [103, 49],
|
|
25834
|
+
bgBlueBright: [104, 49],
|
|
25835
|
+
bgMagentaBright: [105, 49],
|
|
25836
|
+
bgCyanBright: [106, 49],
|
|
25837
|
+
bgWhiteBright: [107, 49]
|
|
25838
|
+
}
|
|
25839
|
+
};
|
|
25840
|
+
const modifierNames = Object.keys(styles$1.modifier);
|
|
25841
|
+
const foregroundColorNames = Object.keys(styles$1.color);
|
|
25842
|
+
const backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
25843
|
+
const colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
25844
|
+
function assembleStyles() {
|
|
25845
|
+
const codes = /* @__PURE__ */ new Map();
|
|
25846
|
+
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
25847
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
25848
|
+
styles$1[styleName] = {
|
|
25849
|
+
open: `\u001B[${style[0]}m`,
|
|
25850
|
+
close: `\u001B[${style[1]}m`
|
|
25851
|
+
};
|
|
25852
|
+
group[styleName] = styles$1[styleName];
|
|
25853
|
+
codes.set(style[0], style[1]);
|
|
25854
|
+
}
|
|
25855
|
+
Object.defineProperty(styles$1, groupName, {
|
|
25856
|
+
value: group,
|
|
25857
|
+
enumerable: false
|
|
25858
|
+
});
|
|
25859
|
+
}
|
|
25860
|
+
Object.defineProperty(styles$1, "codes", {
|
|
25861
|
+
value: codes,
|
|
25862
|
+
enumerable: false
|
|
25863
|
+
});
|
|
25864
|
+
styles$1.color.close = "\x1B[39m";
|
|
25865
|
+
styles$1.bgColor.close = "\x1B[49m";
|
|
25866
|
+
styles$1.color.ansi = wrapAnsi16();
|
|
25867
|
+
styles$1.color.ansi256 = wrapAnsi256();
|
|
25868
|
+
styles$1.color.ansi16m = wrapAnsi16m();
|
|
25869
|
+
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
25870
|
+
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
25871
|
+
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
25872
|
+
Object.defineProperties(styles$1, {
|
|
25873
|
+
rgbToAnsi256: {
|
|
25874
|
+
value(red$1, green$1, blue$1) {
|
|
25875
|
+
if (red$1 === green$1 && green$1 === blue$1) {
|
|
25876
|
+
if (red$1 < 8) return 16;
|
|
25877
|
+
if (red$1 > 248) return 231;
|
|
25878
|
+
return Math.round((red$1 - 8) / 247 * 24) + 232;
|
|
25879
|
+
}
|
|
25880
|
+
return 16 + 36 * Math.round(red$1 / 255 * 5) + 6 * Math.round(green$1 / 255 * 5) + Math.round(blue$1 / 255 * 5);
|
|
25881
|
+
},
|
|
25882
|
+
enumerable: false
|
|
25883
|
+
},
|
|
25884
|
+
hexToRgb: {
|
|
25885
|
+
value(hex) {
|
|
25886
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
25887
|
+
if (!matches) return [
|
|
25888
|
+
0,
|
|
25889
|
+
0,
|
|
25890
|
+
0
|
|
25891
|
+
];
|
|
25892
|
+
let [colorString] = matches;
|
|
25893
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
25894
|
+
const integer$1 = Number.parseInt(colorString, 16);
|
|
25895
|
+
return [
|
|
25896
|
+
integer$1 >> 16 & 255,
|
|
25897
|
+
integer$1 >> 8 & 255,
|
|
25898
|
+
integer$1 & 255
|
|
25899
|
+
];
|
|
25900
|
+
},
|
|
25901
|
+
enumerable: false
|
|
25902
|
+
},
|
|
25903
|
+
hexToAnsi256: {
|
|
25904
|
+
value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
|
|
25905
|
+
enumerable: false
|
|
25906
|
+
},
|
|
25907
|
+
ansi256ToAnsi: {
|
|
25908
|
+
value(code$1) {
|
|
25909
|
+
if (code$1 < 8) return 30 + code$1;
|
|
25910
|
+
if (code$1 < 16) return 90 + (code$1 - 8);
|
|
25911
|
+
let red$1;
|
|
25912
|
+
let green$1;
|
|
25913
|
+
let blue$1;
|
|
25914
|
+
if (code$1 >= 232) {
|
|
25915
|
+
red$1 = ((code$1 - 232) * 10 + 8) / 255;
|
|
25916
|
+
green$1 = red$1;
|
|
25917
|
+
blue$1 = red$1;
|
|
25918
|
+
} else {
|
|
25919
|
+
code$1 -= 16;
|
|
25920
|
+
const remainder = code$1 % 36;
|
|
25921
|
+
red$1 = Math.floor(code$1 / 36) / 5;
|
|
25922
|
+
green$1 = Math.floor(remainder / 6) / 5;
|
|
25923
|
+
blue$1 = remainder % 6 / 5;
|
|
25924
|
+
}
|
|
25925
|
+
const value = Math.max(red$1, green$1, blue$1) * 2;
|
|
25926
|
+
if (value === 0) return 30;
|
|
25927
|
+
let result = 30 + (Math.round(blue$1) << 2 | Math.round(green$1) << 1 | Math.round(red$1));
|
|
25928
|
+
if (value === 2) result += 60;
|
|
25929
|
+
return result;
|
|
25930
|
+
},
|
|
25931
|
+
enumerable: false
|
|
25932
|
+
},
|
|
25933
|
+
rgbToAnsi: {
|
|
25934
|
+
value: (red$1, green$1, blue$1) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red$1, green$1, blue$1)),
|
|
25935
|
+
enumerable: false
|
|
25936
|
+
},
|
|
25937
|
+
hexToAnsi: {
|
|
25938
|
+
value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
|
|
25939
|
+
enumerable: false
|
|
25940
|
+
}
|
|
25941
|
+
});
|
|
25942
|
+
return styles$1;
|
|
25943
|
+
}
|
|
25944
|
+
const ansiStyles = assembleStyles();
|
|
25945
|
+
var ansi_styles_default = ansiStyles;
|
|
25946
|
+
|
|
25947
|
+
//#endregion
|
|
25948
|
+
//#region node_modules/chalk/source/vendor/supports-color/index.js
|
|
25949
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
|
|
25950
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
25951
|
+
const position = argv.indexOf(prefix + flag);
|
|
25952
|
+
const terminatorPosition = argv.indexOf("--");
|
|
25953
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
25954
|
+
}
|
|
25955
|
+
const { env } = y;
|
|
25956
|
+
let flagForceColor;
|
|
25957
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
25958
|
+
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
25959
|
+
function envForceColor() {
|
|
25960
|
+
if ("FORCE_COLOR" in env) {
|
|
25961
|
+
if (env.FORCE_COLOR === "true") return 1;
|
|
25962
|
+
if (env.FORCE_COLOR === "false") return 0;
|
|
25963
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
25964
|
+
}
|
|
25965
|
+
}
|
|
25966
|
+
function translateLevel(level) {
|
|
25967
|
+
if (level === 0) return false;
|
|
25968
|
+
return {
|
|
25969
|
+
level,
|
|
25970
|
+
hasBasic: true,
|
|
25971
|
+
has256: level >= 2,
|
|
25972
|
+
has16m: level >= 3
|
|
25973
|
+
};
|
|
25974
|
+
}
|
|
25975
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
25976
|
+
const noFlagForceColor = envForceColor();
|
|
25977
|
+
if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
|
|
25978
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
25979
|
+
if (forceColor === 0) return 0;
|
|
25980
|
+
if (sniffFlags) {
|
|
25981
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
25982
|
+
if (hasFlag("color=256")) return 2;
|
|
25983
|
+
}
|
|
25984
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
|
|
25985
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
25986
|
+
const min = forceColor || 0;
|
|
25987
|
+
if (env.TERM === "dumb") return min;
|
|
25988
|
+
if (y.platform === "win32") {
|
|
25989
|
+
const osRelease = os.release().split(".");
|
|
25990
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
25991
|
+
return 1;
|
|
25992
|
+
}
|
|
25993
|
+
if ("CI" in env) {
|
|
25994
|
+
if ([
|
|
25995
|
+
"GITHUB_ACTIONS",
|
|
25996
|
+
"GITEA_ACTIONS",
|
|
25997
|
+
"CIRCLECI"
|
|
25998
|
+
].some((key) => key in env)) return 3;
|
|
25999
|
+
if ([
|
|
26000
|
+
"TRAVIS",
|
|
26001
|
+
"APPVEYOR",
|
|
26002
|
+
"GITLAB_CI",
|
|
26003
|
+
"BUILDKITE",
|
|
26004
|
+
"DRONE"
|
|
26005
|
+
].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
|
|
26006
|
+
return min;
|
|
26007
|
+
}
|
|
26008
|
+
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
26009
|
+
if (env.COLORTERM === "truecolor") return 3;
|
|
26010
|
+
if (env.TERM === "xterm-kitty") return 3;
|
|
26011
|
+
if (env.TERM === "xterm-ghostty") return 3;
|
|
26012
|
+
if (env.TERM === "wezterm") return 3;
|
|
26013
|
+
if ("TERM_PROGRAM" in env) {
|
|
26014
|
+
const version$2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
26015
|
+
switch (env.TERM_PROGRAM) {
|
|
26016
|
+
case "iTerm.app": return version$2 >= 3 ? 3 : 2;
|
|
26017
|
+
case "Apple_Terminal": return 2;
|
|
26018
|
+
}
|
|
26019
|
+
}
|
|
26020
|
+
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
26021
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
26022
|
+
if ("COLORTERM" in env) return 1;
|
|
26023
|
+
return min;
|
|
26024
|
+
}
|
|
26025
|
+
function createSupportsColor(stream, options = {}) {
|
|
26026
|
+
return translateLevel(_supportsColor(stream, {
|
|
26027
|
+
streamIsTTY: stream && stream.isTTY,
|
|
26028
|
+
...options
|
|
26029
|
+
}));
|
|
26030
|
+
}
|
|
26031
|
+
const supportsColor = {
|
|
26032
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
26033
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
26034
|
+
};
|
|
26035
|
+
var supports_color_default = supportsColor;
|
|
26036
|
+
|
|
26037
|
+
//#endregion
|
|
26038
|
+
//#region node_modules/chalk/source/utilities.js
|
|
26039
|
+
function stringReplaceAll(string$2, substring, replacer) {
|
|
26040
|
+
let index = string$2.indexOf(substring);
|
|
26041
|
+
if (index === -1) return string$2;
|
|
26042
|
+
const substringLength = substring.length;
|
|
26043
|
+
let endIndex = 0;
|
|
26044
|
+
let returnValue = "";
|
|
26045
|
+
do {
|
|
26046
|
+
returnValue += string$2.slice(endIndex, index) + substring + replacer;
|
|
26047
|
+
endIndex = index + substringLength;
|
|
26048
|
+
index = string$2.indexOf(substring, endIndex);
|
|
26049
|
+
} while (index !== -1);
|
|
26050
|
+
returnValue += string$2.slice(endIndex);
|
|
26051
|
+
return returnValue;
|
|
26052
|
+
}
|
|
26053
|
+
function stringEncaseCRLFWithFirstIndex(string$2, prefix, postfix, index) {
|
|
26054
|
+
let endIndex = 0;
|
|
26055
|
+
let returnValue = "";
|
|
26056
|
+
do {
|
|
26057
|
+
const gotCR = string$2[index - 1] === "\r";
|
|
26058
|
+
returnValue += string$2.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
26059
|
+
endIndex = index + 1;
|
|
26060
|
+
index = string$2.indexOf("\n", endIndex);
|
|
26061
|
+
} while (index !== -1);
|
|
26062
|
+
returnValue += string$2.slice(endIndex);
|
|
26063
|
+
return returnValue;
|
|
26064
|
+
}
|
|
26065
|
+
|
|
26066
|
+
//#endregion
|
|
26067
|
+
//#region node_modules/chalk/source/index.js
|
|
26068
|
+
const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
26069
|
+
const GENERATOR = Symbol("GENERATOR");
|
|
26070
|
+
const STYLER = Symbol("STYLER");
|
|
26071
|
+
const IS_EMPTY = Symbol("IS_EMPTY");
|
|
26072
|
+
const levelMapping = [
|
|
26073
|
+
"ansi",
|
|
26074
|
+
"ansi",
|
|
26075
|
+
"ansi256",
|
|
26076
|
+
"ansi16m"
|
|
26077
|
+
];
|
|
26078
|
+
const styles = Object.create(null);
|
|
26079
|
+
const applyOptions = (object$1, options = {}) => {
|
|
26080
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
|
|
26081
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
26082
|
+
object$1.level = options.level === void 0 ? colorLevel : options.level;
|
|
26083
|
+
};
|
|
26084
|
+
const chalkFactory = (options) => {
|
|
26085
|
+
const chalk$1 = (...strings) => strings.join(" ");
|
|
26086
|
+
applyOptions(chalk$1, options);
|
|
26087
|
+
Object.setPrototypeOf(chalk$1, createChalk.prototype);
|
|
26088
|
+
return chalk$1;
|
|
26089
|
+
};
|
|
26090
|
+
function createChalk(options) {
|
|
26091
|
+
return chalkFactory(options);
|
|
26092
|
+
}
|
|
26093
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
26094
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) styles[styleName] = { get() {
|
|
26095
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
26096
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
26097
|
+
return builder;
|
|
26098
|
+
} };
|
|
26099
|
+
styles.visible = { get() {
|
|
26100
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
26101
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
26102
|
+
return builder;
|
|
26103
|
+
} };
|
|
26104
|
+
const getModelAnsi = (model, level, type, ...arguments_) => {
|
|
26105
|
+
if (model === "rgb") {
|
|
26106
|
+
if (level === "ansi16m") return ansi_styles_default[type].ansi16m(...arguments_);
|
|
26107
|
+
if (level === "ansi256") return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
26108
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
26109
|
+
}
|
|
26110
|
+
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
26111
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
26112
|
+
};
|
|
26113
|
+
for (const model of [
|
|
26114
|
+
"rgb",
|
|
26115
|
+
"hex",
|
|
26116
|
+
"ansi256"
|
|
26117
|
+
]) {
|
|
26118
|
+
styles[model] = { get() {
|
|
26119
|
+
const { level } = this;
|
|
26120
|
+
return function(...arguments_) {
|
|
26121
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
26122
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
26123
|
+
};
|
|
26124
|
+
} };
|
|
26125
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
26126
|
+
styles[bgModel] = { get() {
|
|
26127
|
+
const { level } = this;
|
|
26128
|
+
return function(...arguments_) {
|
|
26129
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
26130
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
26131
|
+
};
|
|
26132
|
+
} };
|
|
26133
|
+
}
|
|
26134
|
+
const proto = Object.defineProperties(() => {}, {
|
|
26135
|
+
...styles,
|
|
26136
|
+
level: {
|
|
26137
|
+
enumerable: true,
|
|
26138
|
+
get() {
|
|
26139
|
+
return this[GENERATOR].level;
|
|
26140
|
+
},
|
|
26141
|
+
set(level) {
|
|
26142
|
+
this[GENERATOR].level = level;
|
|
26143
|
+
}
|
|
26144
|
+
}
|
|
26145
|
+
});
|
|
26146
|
+
const createStyler = (open, close, parent) => {
|
|
26147
|
+
let openAll;
|
|
26148
|
+
let closeAll;
|
|
26149
|
+
if (parent === void 0) {
|
|
26150
|
+
openAll = open;
|
|
26151
|
+
closeAll = close;
|
|
26152
|
+
} else {
|
|
26153
|
+
openAll = parent.openAll + open;
|
|
26154
|
+
closeAll = close + parent.closeAll;
|
|
26155
|
+
}
|
|
26156
|
+
return {
|
|
26157
|
+
open,
|
|
26158
|
+
close,
|
|
26159
|
+
openAll,
|
|
26160
|
+
closeAll,
|
|
26161
|
+
parent
|
|
26162
|
+
};
|
|
26163
|
+
};
|
|
26164
|
+
const createBuilder = (self$1, _styler, _isEmpty) => {
|
|
26165
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
26166
|
+
Object.setPrototypeOf(builder, proto);
|
|
26167
|
+
builder[GENERATOR] = self$1;
|
|
26168
|
+
builder[STYLER] = _styler;
|
|
26169
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
26170
|
+
return builder;
|
|
26171
|
+
};
|
|
26172
|
+
const applyStyle = (self$1, string$2) => {
|
|
26173
|
+
if (self$1.level <= 0 || !string$2) return self$1[IS_EMPTY] ? "" : string$2;
|
|
26174
|
+
let styler = self$1[STYLER];
|
|
26175
|
+
if (styler === void 0) return string$2;
|
|
26176
|
+
const { openAll, closeAll } = styler;
|
|
26177
|
+
if (string$2.includes("\x1B")) while (styler !== void 0) {
|
|
26178
|
+
string$2 = stringReplaceAll(string$2, styler.close, styler.open);
|
|
26179
|
+
styler = styler.parent;
|
|
26180
|
+
}
|
|
26181
|
+
const lfIndex = string$2.indexOf("\n");
|
|
26182
|
+
if (lfIndex !== -1) string$2 = stringEncaseCRLFWithFirstIndex(string$2, closeAll, openAll, lfIndex);
|
|
26183
|
+
return openAll + string$2 + closeAll;
|
|
26184
|
+
};
|
|
26185
|
+
Object.defineProperties(createChalk.prototype, styles);
|
|
26186
|
+
const chalk = createChalk();
|
|
26187
|
+
const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
26188
|
+
var source_default = chalk;
|
|
26189
|
+
|
|
26190
|
+
//#endregion
|
|
26191
|
+
//#region src/cli/utils/theme.ts
|
|
26192
|
+
/**
|
|
26193
|
+
* Base44 CLI theme configuration
|
|
26194
|
+
*/
|
|
26195
|
+
const theme = {
|
|
26196
|
+
colors: {
|
|
26197
|
+
base44Orange: source_default.hex("#E86B3C"),
|
|
26198
|
+
shinyOrange: source_default.hex("#FFD700"),
|
|
26199
|
+
links: source_default.hex("#00D4FF"),
|
|
26200
|
+
white: source_default.white
|
|
26201
|
+
},
|
|
26202
|
+
styles: {
|
|
26203
|
+
header: source_default.dim,
|
|
26204
|
+
bold: source_default.bold,
|
|
26205
|
+
dim: source_default.dim
|
|
26206
|
+
}
|
|
26207
|
+
};
|
|
26208
|
+
|
|
26190
26209
|
//#endregion
|
|
26191
26210
|
//#region src/cli/utils/animate.ts
|
|
26192
|
-
const orange$2 = source_default.hex("#E86B3C");
|
|
26193
|
-
const gold = source_default.hex("#FFD700");
|
|
26194
26211
|
/**
|
|
26195
26212
|
* Sleep for a specified number of milliseconds.
|
|
26196
26213
|
*/
|
|
@@ -26207,13 +26224,13 @@ async function animateLineReveal(line, duration$2) {
|
|
|
26207
26224
|
const progress = step / steps;
|
|
26208
26225
|
const revealIndex = Math.floor(progress * line.length);
|
|
26209
26226
|
let output = "";
|
|
26210
|
-
for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output +=
|
|
26211
|
-
else if (i$1 === revealIndex) output +=
|
|
26212
|
-
else output +=
|
|
26227
|
+
for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output += theme.colors.base44Orange(line[i$1]);
|
|
26228
|
+
else if (i$1 === revealIndex) output += theme.colors.shinyOrange(line[i$1]);
|
|
26229
|
+
else output += theme.styles.dim(line[i$1]);
|
|
26213
26230
|
process.stdout.write(`\r${output}`);
|
|
26214
26231
|
await sleep(stepDuration);
|
|
26215
26232
|
}
|
|
26216
|
-
process.stdout.write(`\r${
|
|
26233
|
+
process.stdout.write(`\r${theme.colors.base44Orange(line)}\n`);
|
|
26217
26234
|
}
|
|
26218
26235
|
/**
|
|
26219
26236
|
* Quick shimmer pass over the entire banner.
|
|
@@ -26230,15 +26247,15 @@ async function shimmerPass(lines, duration$2) {
|
|
|
26230
26247
|
let output = "";
|
|
26231
26248
|
for (let i$1 = 0; i$1 < line.length; i$1++) {
|
|
26232
26249
|
const dist = Math.abs(i$1 - shimmerPos);
|
|
26233
|
-
if (dist < 3) output += dist === 0 ?
|
|
26234
|
-
else output +=
|
|
26250
|
+
if (dist < 3) output += dist === 0 ? theme.colors.white(line[i$1]) : theme.colors.shinyOrange(line[i$1]);
|
|
26251
|
+
else output += theme.colors.base44Orange(line[i$1]);
|
|
26235
26252
|
}
|
|
26236
26253
|
console.log(output);
|
|
26237
26254
|
}
|
|
26238
26255
|
await sleep(stepDuration);
|
|
26239
26256
|
}
|
|
26240
26257
|
process.stdout.write(moveUp);
|
|
26241
|
-
for (const line of lines) console.log(
|
|
26258
|
+
for (const line of lines) console.log(theme.colors.base44Orange(line));
|
|
26242
26259
|
}
|
|
26243
26260
|
/**
|
|
26244
26261
|
* Animate the output with a smooth line-by-line reveal.
|
|
@@ -26258,7 +26275,6 @@ async function printAnimatedLines(lines) {
|
|
|
26258
26275
|
|
|
26259
26276
|
//#endregion
|
|
26260
26277
|
//#region src/cli/utils/banner.ts
|
|
26261
|
-
const orange$1 = source_default.hex("#E86B3C");
|
|
26262
26278
|
const BANNER_LINES = [
|
|
26263
26279
|
"██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
|
|
26264
26280
|
"██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
|
|
@@ -26273,12 +26289,11 @@ const BANNER_LINES = [
|
|
|
26273
26289
|
*/
|
|
26274
26290
|
async function printBanner() {
|
|
26275
26291
|
if (process.stdout.isTTY) await printAnimatedLines(BANNER_LINES);
|
|
26276
|
-
else console.log(
|
|
26292
|
+
else console.log(theme.colors.base44Orange(BANNER_LINES.join("\n")));
|
|
26277
26293
|
}
|
|
26278
26294
|
|
|
26279
26295
|
//#endregion
|
|
26280
26296
|
//#region src/cli/utils/runCommand.ts
|
|
26281
|
-
const base44Color = source_default.bgHex("#E86B3C");
|
|
26282
26297
|
/**
|
|
26283
26298
|
* Wraps a command function with the Base44 intro/outro and error handling.
|
|
26284
26299
|
* All CLI commands should use this utility to ensure consistent branding.
|
|
@@ -26322,7 +26337,7 @@ async function runCommand(commandFn, options) {
|
|
|
26322
26337
|
if (options?.fullBanner) {
|
|
26323
26338
|
await printBanner();
|
|
26324
26339
|
Ie("");
|
|
26325
|
-
} else Ie(
|
|
26340
|
+
} else Ie(theme.colors.base44Orange(" Base 44 "));
|
|
26326
26341
|
await loadProjectEnv();
|
|
26327
26342
|
try {
|
|
26328
26343
|
if (options?.requireAuth) {
|
|
@@ -26414,7 +26429,7 @@ async function generateAndDisplayDeviceCode() {
|
|
|
26414
26429
|
successMessage: "Device code generated",
|
|
26415
26430
|
errorMessage: "Failed to generate device code"
|
|
26416
26431
|
});
|
|
26417
|
-
M.info(`Verification code: ${
|
|
26432
|
+
M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
|
|
26418
26433
|
return deviceCodeResponse;
|
|
26419
26434
|
}
|
|
26420
26435
|
async function waitForAuthentication(deviceCode, expiresIn, interval) {
|
|
@@ -26458,7 +26473,7 @@ async function login() {
|
|
|
26458
26473
|
const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
|
|
26459
26474
|
const userInfo = await getUserInfo(token.accessToken);
|
|
26460
26475
|
await saveAuthData(token, userInfo);
|
|
26461
|
-
return { outroMessage: `Successfully logged in as ${
|
|
26476
|
+
return { outroMessage: `Successfully logged in as ${theme.styles.bold(userInfo.email)}` };
|
|
26462
26477
|
}
|
|
26463
26478
|
const loginCommand = new Command("login").description("Authenticate with Base44").action(async () => {
|
|
26464
26479
|
await runCommand(login);
|
|
@@ -26468,7 +26483,7 @@ const loginCommand = new Command("login").description("Authenticate with Base44"
|
|
|
26468
26483
|
//#region src/cli/commands/auth/whoami.ts
|
|
26469
26484
|
async function whoami() {
|
|
26470
26485
|
const auth = await readAuth();
|
|
26471
|
-
return { outroMessage: `Logged in as: ${
|
|
26486
|
+
return { outroMessage: `Logged in as: ${theme.styles.bold(auth.email)}` };
|
|
26472
26487
|
}
|
|
26473
26488
|
const whoamiCommand = new Command("whoami").description("Display current authenticated user").action(async () => {
|
|
26474
26489
|
await runCommand(whoami, { requireAuth: true });
|
|
@@ -32112,7 +32127,7 @@ const green = format(32, 39);
|
|
|
32112
32127
|
const yellow = format(33, 39);
|
|
32113
32128
|
const blue = format(34, 39);
|
|
32114
32129
|
const magenta = format(35, 39);
|
|
32115
|
-
const cyan
|
|
32130
|
+
const cyan = format(36, 39);
|
|
32116
32131
|
const white = format(37, 39);
|
|
32117
32132
|
const gray = format(90, 39);
|
|
32118
32133
|
const bgBlack = format(40, 49);
|
|
@@ -38156,8 +38171,6 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38156
38171
|
//#endregion
|
|
38157
38172
|
//#region src/cli/commands/project/create.ts
|
|
38158
38173
|
var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
|
|
38159
|
-
const orange = source_default.hex("#E86B3C");
|
|
38160
|
-
const cyan = source_default.hex("#00D4FF");
|
|
38161
38174
|
const DEFAULT_TEMPLATE_ID = "backend-only";
|
|
38162
38175
|
async function getDefaultTemplate() {
|
|
38163
38176
|
const template = (await listTemplates()).find((t) => t.id === DEFAULT_TEMPLATE_ID);
|
|
@@ -38201,7 +38214,7 @@ async function createInteractive(options) {
|
|
|
38201
38214
|
projectPath: async ({ results }) => {
|
|
38202
38215
|
const suggestedPath = `./${(0, import_lodash.default)(results.name)}`;
|
|
38203
38216
|
return he({
|
|
38204
|
-
message: "Where should we create
|
|
38217
|
+
message: "Where should we create your project?",
|
|
38205
38218
|
placeholder: suggestedPath,
|
|
38206
38219
|
initialValue: suggestedPath
|
|
38207
38220
|
});
|
|
@@ -38237,7 +38250,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38237
38250
|
template
|
|
38238
38251
|
});
|
|
38239
38252
|
}, {
|
|
38240
|
-
successMessage:
|
|
38253
|
+
successMessage: theme.colors.base44Orange("Project created successfully"),
|
|
38241
38254
|
errorMessage: "Failed to create project"
|
|
38242
38255
|
});
|
|
38243
38256
|
await loadProjectEnv(resolvedPath);
|
|
@@ -38246,21 +38259,21 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38246
38259
|
if (entities.length > 0) {
|
|
38247
38260
|
let shouldPushEntities;
|
|
38248
38261
|
if (isInteractive) {
|
|
38249
|
-
const result = await ye({ message: "
|
|
38262
|
+
const result = await ye({ message: "Set up the backend data now? (This pushes the data models used by the template to Base44)" });
|
|
38250
38263
|
shouldPushEntities = !pD(result) && result;
|
|
38251
38264
|
} else shouldPushEntities = !!deploy;
|
|
38252
|
-
if (shouldPushEntities) await runTask(`Pushing ${entities.length}
|
|
38265
|
+
if (shouldPushEntities) await runTask(`Pushing ${entities.length} data models to Base44...`, async () => {
|
|
38253
38266
|
await pushEntities(entities);
|
|
38254
38267
|
}, {
|
|
38255
|
-
successMessage:
|
|
38256
|
-
errorMessage: "Failed to push
|
|
38268
|
+
successMessage: theme.colors.base44Orange("Data models pushed successfully"),
|
|
38269
|
+
errorMessage: "Failed to push data models"
|
|
38257
38270
|
});
|
|
38258
38271
|
}
|
|
38259
38272
|
if (project.site) {
|
|
38260
38273
|
const { installCommand, buildCommand, outputDirectory } = project.site;
|
|
38261
38274
|
let shouldDeploy;
|
|
38262
38275
|
if (isInteractive) {
|
|
38263
|
-
const result = await ye({ message: "Would you like to deploy the site now?" });
|
|
38276
|
+
const result = await ye({ message: "Would you like to deploy the site now? (Hosted on Base44)" });
|
|
38264
38277
|
shouldDeploy = !pD(result) && result;
|
|
38265
38278
|
} else shouldDeploy = !!deploy;
|
|
38266
38279
|
if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
|
|
@@ -38277,17 +38290,17 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38277
38290
|
updateMessage("Deploying site...");
|
|
38278
38291
|
return await deploySite(join(resolvedPath, outputDirectory));
|
|
38279
38292
|
}, {
|
|
38280
|
-
successMessage:
|
|
38293
|
+
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
38281
38294
|
errorMessage: "Failed to deploy site"
|
|
38282
38295
|
});
|
|
38283
38296
|
finalAppUrl = appUrl;
|
|
38284
38297
|
}
|
|
38285
38298
|
}
|
|
38286
38299
|
const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/preview`;
|
|
38287
|
-
M.message(`${
|
|
38288
|
-
M.message(`${
|
|
38289
|
-
if (finalAppUrl) M.message(`${
|
|
38290
|
-
return { outroMessage: "Your project is set and ready to use" };
|
|
38300
|
+
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38301
|
+
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38302
|
+
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38303
|
+
return { outroMessage: "Your project is set up and ready to use" };
|
|
38291
38304
|
}
|
|
38292
38305
|
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
|
|
38293
38306
|
await chooseCreate(options);
|
|
@@ -38316,7 +38329,7 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
|
|
|
38316
38329
|
|
|
38317
38330
|
//#endregion
|
|
38318
38331
|
//#region package.json
|
|
38319
|
-
var version = "0.0.
|
|
38332
|
+
var version = "0.0.10";
|
|
38320
38333
|
|
|
38321
38334
|
//#endregion
|
|
38322
38335
|
//#region src/cli/index.ts
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"templates": [
|
|
3
3
|
{
|
|
4
4
|
"id": "backend-only",
|
|
5
|
-
"name": "
|
|
6
|
-
"description": "Minimal Base44 backend
|
|
5
|
+
"name": "Create a basic project",
|
|
6
|
+
"description": "Minimal Base44 backend for defining your data models and logic",
|
|
7
7
|
"path": "backend-only"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"id": "backend-and-client",
|
|
11
|
-
"name": "
|
|
12
|
-
"description": "Full-stack example with Base44 backend and a Vite + React client application",
|
|
11
|
+
"name": "Start from a template",
|
|
12
|
+
"description": "Full-stack example with a Base44 backend and a Vite + React client application",
|
|
13
13
|
"path": "backend-and-client"
|
|
14
14
|
}
|
|
15
15
|
]
|