@base44-preview/cli 0.0.9-pr.75.b644c97 → 0.0.11-pr.78.84de648
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 +475 -446
- 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) => {
|
|
@@ -17239,7 +16830,10 @@ function toDeployPayloadItem(fn) {
|
|
|
17239
16830
|
async function deployFunctions(functions) {
|
|
17240
16831
|
const appClient = getAppClient();
|
|
17241
16832
|
const payload = { functions: functions.map(toDeployPayloadItem) };
|
|
17242
|
-
const response = await appClient.put("backend-functions", {
|
|
16833
|
+
const response = await appClient.put("backend-functions", {
|
|
16834
|
+
json: payload,
|
|
16835
|
+
timeout: 3e4
|
|
16836
|
+
});
|
|
17243
16837
|
return DeployFunctionsResponseSchema.parse(await response.json());
|
|
17244
16838
|
}
|
|
17245
16839
|
|
|
@@ -26196,10 +25790,436 @@ async function getUserInfo(accessToken) {
|
|
|
26196
25790
|
return result.data;
|
|
26197
25791
|
}
|
|
26198
25792
|
|
|
25793
|
+
//#endregion
|
|
25794
|
+
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
25795
|
+
const ANSI_BACKGROUND_OFFSET = 10;
|
|
25796
|
+
const wrapAnsi16 = (offset = 0) => (code$1) => `\u001B[${code$1 + offset}m`;
|
|
25797
|
+
const wrapAnsi256 = (offset = 0) => (code$1) => `\u001B[${38 + offset};5;${code$1}m`;
|
|
25798
|
+
const wrapAnsi16m = (offset = 0) => (red$1, green$1, blue$1) => `\u001B[${38 + offset};2;${red$1};${green$1};${blue$1}m`;
|
|
25799
|
+
const styles$1 = {
|
|
25800
|
+
modifier: {
|
|
25801
|
+
reset: [0, 0],
|
|
25802
|
+
bold: [1, 22],
|
|
25803
|
+
dim: [2, 22],
|
|
25804
|
+
italic: [3, 23],
|
|
25805
|
+
underline: [4, 24],
|
|
25806
|
+
overline: [53, 55],
|
|
25807
|
+
inverse: [7, 27],
|
|
25808
|
+
hidden: [8, 28],
|
|
25809
|
+
strikethrough: [9, 29]
|
|
25810
|
+
},
|
|
25811
|
+
color: {
|
|
25812
|
+
black: [30, 39],
|
|
25813
|
+
red: [31, 39],
|
|
25814
|
+
green: [32, 39],
|
|
25815
|
+
yellow: [33, 39],
|
|
25816
|
+
blue: [34, 39],
|
|
25817
|
+
magenta: [35, 39],
|
|
25818
|
+
cyan: [36, 39],
|
|
25819
|
+
white: [37, 39],
|
|
25820
|
+
blackBright: [90, 39],
|
|
25821
|
+
gray: [90, 39],
|
|
25822
|
+
grey: [90, 39],
|
|
25823
|
+
redBright: [91, 39],
|
|
25824
|
+
greenBright: [92, 39],
|
|
25825
|
+
yellowBright: [93, 39],
|
|
25826
|
+
blueBright: [94, 39],
|
|
25827
|
+
magentaBright: [95, 39],
|
|
25828
|
+
cyanBright: [96, 39],
|
|
25829
|
+
whiteBright: [97, 39]
|
|
25830
|
+
},
|
|
25831
|
+
bgColor: {
|
|
25832
|
+
bgBlack: [40, 49],
|
|
25833
|
+
bgRed: [41, 49],
|
|
25834
|
+
bgGreen: [42, 49],
|
|
25835
|
+
bgYellow: [43, 49],
|
|
25836
|
+
bgBlue: [44, 49],
|
|
25837
|
+
bgMagenta: [45, 49],
|
|
25838
|
+
bgCyan: [46, 49],
|
|
25839
|
+
bgWhite: [47, 49],
|
|
25840
|
+
bgBlackBright: [100, 49],
|
|
25841
|
+
bgGray: [100, 49],
|
|
25842
|
+
bgGrey: [100, 49],
|
|
25843
|
+
bgRedBright: [101, 49],
|
|
25844
|
+
bgGreenBright: [102, 49],
|
|
25845
|
+
bgYellowBright: [103, 49],
|
|
25846
|
+
bgBlueBright: [104, 49],
|
|
25847
|
+
bgMagentaBright: [105, 49],
|
|
25848
|
+
bgCyanBright: [106, 49],
|
|
25849
|
+
bgWhiteBright: [107, 49]
|
|
25850
|
+
}
|
|
25851
|
+
};
|
|
25852
|
+
const modifierNames = Object.keys(styles$1.modifier);
|
|
25853
|
+
const foregroundColorNames = Object.keys(styles$1.color);
|
|
25854
|
+
const backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
25855
|
+
const colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
25856
|
+
function assembleStyles() {
|
|
25857
|
+
const codes = /* @__PURE__ */ new Map();
|
|
25858
|
+
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
25859
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
25860
|
+
styles$1[styleName] = {
|
|
25861
|
+
open: `\u001B[${style[0]}m`,
|
|
25862
|
+
close: `\u001B[${style[1]}m`
|
|
25863
|
+
};
|
|
25864
|
+
group[styleName] = styles$1[styleName];
|
|
25865
|
+
codes.set(style[0], style[1]);
|
|
25866
|
+
}
|
|
25867
|
+
Object.defineProperty(styles$1, groupName, {
|
|
25868
|
+
value: group,
|
|
25869
|
+
enumerable: false
|
|
25870
|
+
});
|
|
25871
|
+
}
|
|
25872
|
+
Object.defineProperty(styles$1, "codes", {
|
|
25873
|
+
value: codes,
|
|
25874
|
+
enumerable: false
|
|
25875
|
+
});
|
|
25876
|
+
styles$1.color.close = "\x1B[39m";
|
|
25877
|
+
styles$1.bgColor.close = "\x1B[49m";
|
|
25878
|
+
styles$1.color.ansi = wrapAnsi16();
|
|
25879
|
+
styles$1.color.ansi256 = wrapAnsi256();
|
|
25880
|
+
styles$1.color.ansi16m = wrapAnsi16m();
|
|
25881
|
+
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
25882
|
+
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
25883
|
+
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
25884
|
+
Object.defineProperties(styles$1, {
|
|
25885
|
+
rgbToAnsi256: {
|
|
25886
|
+
value(red$1, green$1, blue$1) {
|
|
25887
|
+
if (red$1 === green$1 && green$1 === blue$1) {
|
|
25888
|
+
if (red$1 < 8) return 16;
|
|
25889
|
+
if (red$1 > 248) return 231;
|
|
25890
|
+
return Math.round((red$1 - 8) / 247 * 24) + 232;
|
|
25891
|
+
}
|
|
25892
|
+
return 16 + 36 * Math.round(red$1 / 255 * 5) + 6 * Math.round(green$1 / 255 * 5) + Math.round(blue$1 / 255 * 5);
|
|
25893
|
+
},
|
|
25894
|
+
enumerable: false
|
|
25895
|
+
},
|
|
25896
|
+
hexToRgb: {
|
|
25897
|
+
value(hex) {
|
|
25898
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
25899
|
+
if (!matches) return [
|
|
25900
|
+
0,
|
|
25901
|
+
0,
|
|
25902
|
+
0
|
|
25903
|
+
];
|
|
25904
|
+
let [colorString] = matches;
|
|
25905
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
25906
|
+
const integer$1 = Number.parseInt(colorString, 16);
|
|
25907
|
+
return [
|
|
25908
|
+
integer$1 >> 16 & 255,
|
|
25909
|
+
integer$1 >> 8 & 255,
|
|
25910
|
+
integer$1 & 255
|
|
25911
|
+
];
|
|
25912
|
+
},
|
|
25913
|
+
enumerable: false
|
|
25914
|
+
},
|
|
25915
|
+
hexToAnsi256: {
|
|
25916
|
+
value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
|
|
25917
|
+
enumerable: false
|
|
25918
|
+
},
|
|
25919
|
+
ansi256ToAnsi: {
|
|
25920
|
+
value(code$1) {
|
|
25921
|
+
if (code$1 < 8) return 30 + code$1;
|
|
25922
|
+
if (code$1 < 16) return 90 + (code$1 - 8);
|
|
25923
|
+
let red$1;
|
|
25924
|
+
let green$1;
|
|
25925
|
+
let blue$1;
|
|
25926
|
+
if (code$1 >= 232) {
|
|
25927
|
+
red$1 = ((code$1 - 232) * 10 + 8) / 255;
|
|
25928
|
+
green$1 = red$1;
|
|
25929
|
+
blue$1 = red$1;
|
|
25930
|
+
} else {
|
|
25931
|
+
code$1 -= 16;
|
|
25932
|
+
const remainder = code$1 % 36;
|
|
25933
|
+
red$1 = Math.floor(code$1 / 36) / 5;
|
|
25934
|
+
green$1 = Math.floor(remainder / 6) / 5;
|
|
25935
|
+
blue$1 = remainder % 6 / 5;
|
|
25936
|
+
}
|
|
25937
|
+
const value = Math.max(red$1, green$1, blue$1) * 2;
|
|
25938
|
+
if (value === 0) return 30;
|
|
25939
|
+
let result = 30 + (Math.round(blue$1) << 2 | Math.round(green$1) << 1 | Math.round(red$1));
|
|
25940
|
+
if (value === 2) result += 60;
|
|
25941
|
+
return result;
|
|
25942
|
+
},
|
|
25943
|
+
enumerable: false
|
|
25944
|
+
},
|
|
25945
|
+
rgbToAnsi: {
|
|
25946
|
+
value: (red$1, green$1, blue$1) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red$1, green$1, blue$1)),
|
|
25947
|
+
enumerable: false
|
|
25948
|
+
},
|
|
25949
|
+
hexToAnsi: {
|
|
25950
|
+
value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
|
|
25951
|
+
enumerable: false
|
|
25952
|
+
}
|
|
25953
|
+
});
|
|
25954
|
+
return styles$1;
|
|
25955
|
+
}
|
|
25956
|
+
const ansiStyles = assembleStyles();
|
|
25957
|
+
var ansi_styles_default = ansiStyles;
|
|
25958
|
+
|
|
25959
|
+
//#endregion
|
|
25960
|
+
//#region node_modules/chalk/source/vendor/supports-color/index.js
|
|
25961
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
|
|
25962
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
25963
|
+
const position = argv.indexOf(prefix + flag);
|
|
25964
|
+
const terminatorPosition = argv.indexOf("--");
|
|
25965
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
25966
|
+
}
|
|
25967
|
+
const { env } = y;
|
|
25968
|
+
let flagForceColor;
|
|
25969
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
25970
|
+
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
25971
|
+
function envForceColor() {
|
|
25972
|
+
if ("FORCE_COLOR" in env) {
|
|
25973
|
+
if (env.FORCE_COLOR === "true") return 1;
|
|
25974
|
+
if (env.FORCE_COLOR === "false") return 0;
|
|
25975
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
25976
|
+
}
|
|
25977
|
+
}
|
|
25978
|
+
function translateLevel(level) {
|
|
25979
|
+
if (level === 0) return false;
|
|
25980
|
+
return {
|
|
25981
|
+
level,
|
|
25982
|
+
hasBasic: true,
|
|
25983
|
+
has256: level >= 2,
|
|
25984
|
+
has16m: level >= 3
|
|
25985
|
+
};
|
|
25986
|
+
}
|
|
25987
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
25988
|
+
const noFlagForceColor = envForceColor();
|
|
25989
|
+
if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
|
|
25990
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
25991
|
+
if (forceColor === 0) return 0;
|
|
25992
|
+
if (sniffFlags) {
|
|
25993
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
25994
|
+
if (hasFlag("color=256")) return 2;
|
|
25995
|
+
}
|
|
25996
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
|
|
25997
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
25998
|
+
const min = forceColor || 0;
|
|
25999
|
+
if (env.TERM === "dumb") return min;
|
|
26000
|
+
if (y.platform === "win32") {
|
|
26001
|
+
const osRelease = os.release().split(".");
|
|
26002
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
26003
|
+
return 1;
|
|
26004
|
+
}
|
|
26005
|
+
if ("CI" in env) {
|
|
26006
|
+
if ([
|
|
26007
|
+
"GITHUB_ACTIONS",
|
|
26008
|
+
"GITEA_ACTIONS",
|
|
26009
|
+
"CIRCLECI"
|
|
26010
|
+
].some((key) => key in env)) return 3;
|
|
26011
|
+
if ([
|
|
26012
|
+
"TRAVIS",
|
|
26013
|
+
"APPVEYOR",
|
|
26014
|
+
"GITLAB_CI",
|
|
26015
|
+
"BUILDKITE",
|
|
26016
|
+
"DRONE"
|
|
26017
|
+
].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
|
|
26018
|
+
return min;
|
|
26019
|
+
}
|
|
26020
|
+
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
26021
|
+
if (env.COLORTERM === "truecolor") return 3;
|
|
26022
|
+
if (env.TERM === "xterm-kitty") return 3;
|
|
26023
|
+
if (env.TERM === "xterm-ghostty") return 3;
|
|
26024
|
+
if (env.TERM === "wezterm") return 3;
|
|
26025
|
+
if ("TERM_PROGRAM" in env) {
|
|
26026
|
+
const version$2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
26027
|
+
switch (env.TERM_PROGRAM) {
|
|
26028
|
+
case "iTerm.app": return version$2 >= 3 ? 3 : 2;
|
|
26029
|
+
case "Apple_Terminal": return 2;
|
|
26030
|
+
}
|
|
26031
|
+
}
|
|
26032
|
+
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
26033
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
26034
|
+
if ("COLORTERM" in env) return 1;
|
|
26035
|
+
return min;
|
|
26036
|
+
}
|
|
26037
|
+
function createSupportsColor(stream, options = {}) {
|
|
26038
|
+
return translateLevel(_supportsColor(stream, {
|
|
26039
|
+
streamIsTTY: stream && stream.isTTY,
|
|
26040
|
+
...options
|
|
26041
|
+
}));
|
|
26042
|
+
}
|
|
26043
|
+
const supportsColor = {
|
|
26044
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
26045
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
26046
|
+
};
|
|
26047
|
+
var supports_color_default = supportsColor;
|
|
26048
|
+
|
|
26049
|
+
//#endregion
|
|
26050
|
+
//#region node_modules/chalk/source/utilities.js
|
|
26051
|
+
function stringReplaceAll(string$2, substring, replacer) {
|
|
26052
|
+
let index = string$2.indexOf(substring);
|
|
26053
|
+
if (index === -1) return string$2;
|
|
26054
|
+
const substringLength = substring.length;
|
|
26055
|
+
let endIndex = 0;
|
|
26056
|
+
let returnValue = "";
|
|
26057
|
+
do {
|
|
26058
|
+
returnValue += string$2.slice(endIndex, index) + substring + replacer;
|
|
26059
|
+
endIndex = index + substringLength;
|
|
26060
|
+
index = string$2.indexOf(substring, endIndex);
|
|
26061
|
+
} while (index !== -1);
|
|
26062
|
+
returnValue += string$2.slice(endIndex);
|
|
26063
|
+
return returnValue;
|
|
26064
|
+
}
|
|
26065
|
+
function stringEncaseCRLFWithFirstIndex(string$2, prefix, postfix, index) {
|
|
26066
|
+
let endIndex = 0;
|
|
26067
|
+
let returnValue = "";
|
|
26068
|
+
do {
|
|
26069
|
+
const gotCR = string$2[index - 1] === "\r";
|
|
26070
|
+
returnValue += string$2.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
26071
|
+
endIndex = index + 1;
|
|
26072
|
+
index = string$2.indexOf("\n", endIndex);
|
|
26073
|
+
} while (index !== -1);
|
|
26074
|
+
returnValue += string$2.slice(endIndex);
|
|
26075
|
+
return returnValue;
|
|
26076
|
+
}
|
|
26077
|
+
|
|
26078
|
+
//#endregion
|
|
26079
|
+
//#region node_modules/chalk/source/index.js
|
|
26080
|
+
const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
26081
|
+
const GENERATOR = Symbol("GENERATOR");
|
|
26082
|
+
const STYLER = Symbol("STYLER");
|
|
26083
|
+
const IS_EMPTY = Symbol("IS_EMPTY");
|
|
26084
|
+
const levelMapping = [
|
|
26085
|
+
"ansi",
|
|
26086
|
+
"ansi",
|
|
26087
|
+
"ansi256",
|
|
26088
|
+
"ansi16m"
|
|
26089
|
+
];
|
|
26090
|
+
const styles = Object.create(null);
|
|
26091
|
+
const applyOptions = (object$1, options = {}) => {
|
|
26092
|
+
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");
|
|
26093
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
26094
|
+
object$1.level = options.level === void 0 ? colorLevel : options.level;
|
|
26095
|
+
};
|
|
26096
|
+
const chalkFactory = (options) => {
|
|
26097
|
+
const chalk$1 = (...strings) => strings.join(" ");
|
|
26098
|
+
applyOptions(chalk$1, options);
|
|
26099
|
+
Object.setPrototypeOf(chalk$1, createChalk.prototype);
|
|
26100
|
+
return chalk$1;
|
|
26101
|
+
};
|
|
26102
|
+
function createChalk(options) {
|
|
26103
|
+
return chalkFactory(options);
|
|
26104
|
+
}
|
|
26105
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
26106
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) styles[styleName] = { get() {
|
|
26107
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
26108
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
26109
|
+
return builder;
|
|
26110
|
+
} };
|
|
26111
|
+
styles.visible = { get() {
|
|
26112
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
26113
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
26114
|
+
return builder;
|
|
26115
|
+
} };
|
|
26116
|
+
const getModelAnsi = (model, level, type, ...arguments_) => {
|
|
26117
|
+
if (model === "rgb") {
|
|
26118
|
+
if (level === "ansi16m") return ansi_styles_default[type].ansi16m(...arguments_);
|
|
26119
|
+
if (level === "ansi256") return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
26120
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
26121
|
+
}
|
|
26122
|
+
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
26123
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
26124
|
+
};
|
|
26125
|
+
for (const model of [
|
|
26126
|
+
"rgb",
|
|
26127
|
+
"hex",
|
|
26128
|
+
"ansi256"
|
|
26129
|
+
]) {
|
|
26130
|
+
styles[model] = { get() {
|
|
26131
|
+
const { level } = this;
|
|
26132
|
+
return function(...arguments_) {
|
|
26133
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
26134
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
26135
|
+
};
|
|
26136
|
+
} };
|
|
26137
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
26138
|
+
styles[bgModel] = { get() {
|
|
26139
|
+
const { level } = this;
|
|
26140
|
+
return function(...arguments_) {
|
|
26141
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
26142
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
26143
|
+
};
|
|
26144
|
+
} };
|
|
26145
|
+
}
|
|
26146
|
+
const proto = Object.defineProperties(() => {}, {
|
|
26147
|
+
...styles,
|
|
26148
|
+
level: {
|
|
26149
|
+
enumerable: true,
|
|
26150
|
+
get() {
|
|
26151
|
+
return this[GENERATOR].level;
|
|
26152
|
+
},
|
|
26153
|
+
set(level) {
|
|
26154
|
+
this[GENERATOR].level = level;
|
|
26155
|
+
}
|
|
26156
|
+
}
|
|
26157
|
+
});
|
|
26158
|
+
const createStyler = (open, close, parent) => {
|
|
26159
|
+
let openAll;
|
|
26160
|
+
let closeAll;
|
|
26161
|
+
if (parent === void 0) {
|
|
26162
|
+
openAll = open;
|
|
26163
|
+
closeAll = close;
|
|
26164
|
+
} else {
|
|
26165
|
+
openAll = parent.openAll + open;
|
|
26166
|
+
closeAll = close + parent.closeAll;
|
|
26167
|
+
}
|
|
26168
|
+
return {
|
|
26169
|
+
open,
|
|
26170
|
+
close,
|
|
26171
|
+
openAll,
|
|
26172
|
+
closeAll,
|
|
26173
|
+
parent
|
|
26174
|
+
};
|
|
26175
|
+
};
|
|
26176
|
+
const createBuilder = (self$1, _styler, _isEmpty) => {
|
|
26177
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
26178
|
+
Object.setPrototypeOf(builder, proto);
|
|
26179
|
+
builder[GENERATOR] = self$1;
|
|
26180
|
+
builder[STYLER] = _styler;
|
|
26181
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
26182
|
+
return builder;
|
|
26183
|
+
};
|
|
26184
|
+
const applyStyle = (self$1, string$2) => {
|
|
26185
|
+
if (self$1.level <= 0 || !string$2) return self$1[IS_EMPTY] ? "" : string$2;
|
|
26186
|
+
let styler = self$1[STYLER];
|
|
26187
|
+
if (styler === void 0) return string$2;
|
|
26188
|
+
const { openAll, closeAll } = styler;
|
|
26189
|
+
if (string$2.includes("\x1B")) while (styler !== void 0) {
|
|
26190
|
+
string$2 = stringReplaceAll(string$2, styler.close, styler.open);
|
|
26191
|
+
styler = styler.parent;
|
|
26192
|
+
}
|
|
26193
|
+
const lfIndex = string$2.indexOf("\n");
|
|
26194
|
+
if (lfIndex !== -1) string$2 = stringEncaseCRLFWithFirstIndex(string$2, closeAll, openAll, lfIndex);
|
|
26195
|
+
return openAll + string$2 + closeAll;
|
|
26196
|
+
};
|
|
26197
|
+
Object.defineProperties(createChalk.prototype, styles);
|
|
26198
|
+
const chalk = createChalk();
|
|
26199
|
+
const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
26200
|
+
var source_default = chalk;
|
|
26201
|
+
|
|
26202
|
+
//#endregion
|
|
26203
|
+
//#region src/cli/utils/theme.ts
|
|
26204
|
+
/**
|
|
26205
|
+
* Base44 CLI theme configuration
|
|
26206
|
+
*/
|
|
26207
|
+
const theme = {
|
|
26208
|
+
colors: {
|
|
26209
|
+
base44Orange: source_default.hex("#E86B3C"),
|
|
26210
|
+
shinyOrange: source_default.hex("#FFD700"),
|
|
26211
|
+
links: source_default.hex("#00D4FF"),
|
|
26212
|
+
white: source_default.white
|
|
26213
|
+
},
|
|
26214
|
+
styles: {
|
|
26215
|
+
header: source_default.dim,
|
|
26216
|
+
bold: source_default.bold,
|
|
26217
|
+
dim: source_default.dim
|
|
26218
|
+
}
|
|
26219
|
+
};
|
|
26220
|
+
|
|
26199
26221
|
//#endregion
|
|
26200
26222
|
//#region src/cli/utils/animate.ts
|
|
26201
|
-
const orange$2 = source_default.hex("#E86B3C");
|
|
26202
|
-
const gold = source_default.hex("#FFD700");
|
|
26203
26223
|
/**
|
|
26204
26224
|
* Sleep for a specified number of milliseconds.
|
|
26205
26225
|
*/
|
|
@@ -26216,13 +26236,13 @@ async function animateLineReveal(line, duration$2) {
|
|
|
26216
26236
|
const progress = step / steps;
|
|
26217
26237
|
const revealIndex = Math.floor(progress * line.length);
|
|
26218
26238
|
let output = "";
|
|
26219
|
-
for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output +=
|
|
26220
|
-
else if (i$1 === revealIndex) output +=
|
|
26221
|
-
else output +=
|
|
26239
|
+
for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output += theme.colors.base44Orange(line[i$1]);
|
|
26240
|
+
else if (i$1 === revealIndex) output += theme.colors.shinyOrange(line[i$1]);
|
|
26241
|
+
else output += theme.styles.dim(line[i$1]);
|
|
26222
26242
|
process.stdout.write(`\r${output}`);
|
|
26223
26243
|
await sleep(stepDuration);
|
|
26224
26244
|
}
|
|
26225
|
-
process.stdout.write(`\r${
|
|
26245
|
+
process.stdout.write(`\r${theme.colors.base44Orange(line)}\n`);
|
|
26226
26246
|
}
|
|
26227
26247
|
/**
|
|
26228
26248
|
* Quick shimmer pass over the entire banner.
|
|
@@ -26239,15 +26259,15 @@ async function shimmerPass(lines, duration$2) {
|
|
|
26239
26259
|
let output = "";
|
|
26240
26260
|
for (let i$1 = 0; i$1 < line.length; i$1++) {
|
|
26241
26261
|
const dist = Math.abs(i$1 - shimmerPos);
|
|
26242
|
-
if (dist < 3) output += dist === 0 ?
|
|
26243
|
-
else output +=
|
|
26262
|
+
if (dist < 3) output += dist === 0 ? theme.colors.white(line[i$1]) : theme.colors.shinyOrange(line[i$1]);
|
|
26263
|
+
else output += theme.colors.base44Orange(line[i$1]);
|
|
26244
26264
|
}
|
|
26245
26265
|
console.log(output);
|
|
26246
26266
|
}
|
|
26247
26267
|
await sleep(stepDuration);
|
|
26248
26268
|
}
|
|
26249
26269
|
process.stdout.write(moveUp);
|
|
26250
|
-
for (const line of lines) console.log(
|
|
26270
|
+
for (const line of lines) console.log(theme.colors.base44Orange(line));
|
|
26251
26271
|
}
|
|
26252
26272
|
/**
|
|
26253
26273
|
* Animate the output with a smooth line-by-line reveal.
|
|
@@ -26267,7 +26287,6 @@ async function printAnimatedLines(lines) {
|
|
|
26267
26287
|
|
|
26268
26288
|
//#endregion
|
|
26269
26289
|
//#region src/cli/utils/banner.ts
|
|
26270
|
-
const orange$1 = source_default.hex("#E86B3C");
|
|
26271
26290
|
const BANNER_LINES = [
|
|
26272
26291
|
"██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
|
|
26273
26292
|
"██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
|
|
@@ -26282,12 +26301,11 @@ const BANNER_LINES = [
|
|
|
26282
26301
|
*/
|
|
26283
26302
|
async function printBanner() {
|
|
26284
26303
|
if (process.stdout.isTTY) await printAnimatedLines(BANNER_LINES);
|
|
26285
|
-
else console.log(
|
|
26304
|
+
else console.log(theme.colors.base44Orange(BANNER_LINES.join("\n")));
|
|
26286
26305
|
}
|
|
26287
26306
|
|
|
26288
26307
|
//#endregion
|
|
26289
26308
|
//#region src/cli/utils/runCommand.ts
|
|
26290
|
-
const base44Color = source_default.bgHex("#E86B3C");
|
|
26291
26309
|
/**
|
|
26292
26310
|
* Wraps a command function with the Base44 intro/outro and error handling.
|
|
26293
26311
|
* All CLI commands should use this utility to ensure consistent branding.
|
|
@@ -26331,7 +26349,7 @@ async function runCommand(commandFn, options) {
|
|
|
26331
26349
|
if (options?.fullBanner) {
|
|
26332
26350
|
await printBanner();
|
|
26333
26351
|
Ie("");
|
|
26334
|
-
} else Ie(
|
|
26352
|
+
} else Ie(theme.colors.base44Orange(" Base 44 "));
|
|
26335
26353
|
await loadProjectEnv();
|
|
26336
26354
|
try {
|
|
26337
26355
|
if (options?.requireAuth) {
|
|
@@ -26423,7 +26441,7 @@ async function generateAndDisplayDeviceCode() {
|
|
|
26423
26441
|
successMessage: "Device code generated",
|
|
26424
26442
|
errorMessage: "Failed to generate device code"
|
|
26425
26443
|
});
|
|
26426
|
-
M.info(`Verification code: ${
|
|
26444
|
+
M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
|
|
26427
26445
|
return deviceCodeResponse;
|
|
26428
26446
|
}
|
|
26429
26447
|
async function waitForAuthentication(deviceCode, expiresIn, interval) {
|
|
@@ -26467,7 +26485,7 @@ async function login() {
|
|
|
26467
26485
|
const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
|
|
26468
26486
|
const userInfo = await getUserInfo(token.accessToken);
|
|
26469
26487
|
await saveAuthData(token, userInfo);
|
|
26470
|
-
return { outroMessage: `Successfully logged in as ${
|
|
26488
|
+
return { outroMessage: `Successfully logged in as ${theme.styles.bold(userInfo.email)}` };
|
|
26471
26489
|
}
|
|
26472
26490
|
const loginCommand = new Command("login").description("Authenticate with Base44").action(async () => {
|
|
26473
26491
|
await runCommand(login);
|
|
@@ -26477,7 +26495,7 @@ const loginCommand = new Command("login").description("Authenticate with Base44"
|
|
|
26477
26495
|
//#region src/cli/commands/auth/whoami.ts
|
|
26478
26496
|
async function whoami() {
|
|
26479
26497
|
const auth = await readAuth();
|
|
26480
|
-
return { outroMessage: `Logged in as: ${
|
|
26498
|
+
return { outroMessage: `Logged in as: ${theme.styles.bold(auth.email)}` };
|
|
26481
26499
|
}
|
|
26482
26500
|
const whoamiCommand = new Command("whoami").description("Display current authenticated user").action(async () => {
|
|
26483
26501
|
await runCommand(whoami, { requireAuth: true });
|
|
@@ -31512,7 +31530,7 @@ async function deployFunctionsAction() {
|
|
|
31512
31530
|
if (result.deployed.length > 0) M.success(`Deployed: ${result.deployed.join(", ")}`);
|
|
31513
31531
|
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31514
31532
|
if (result.errors && result.errors.length > 0) {
|
|
31515
|
-
const errorMessages = result.errors.map((e$1) => `
|
|
31533
|
+
const errorMessages = result.errors.map((e$1) => `'${e$1.name}' function: ${e$1.message}`).join("\n");
|
|
31516
31534
|
throw new Error(`Function deployment errors:\n${errorMessages}`);
|
|
31517
31535
|
}
|
|
31518
31536
|
return {};
|
|
@@ -32145,7 +32163,7 @@ const green = format(32, 39);
|
|
|
32145
32163
|
const yellow = format(33, 39);
|
|
32146
32164
|
const blue = format(34, 39);
|
|
32147
32165
|
const magenta = format(35, 39);
|
|
32148
|
-
const cyan
|
|
32166
|
+
const cyan = format(36, 39);
|
|
32149
32167
|
const white = format(37, 39);
|
|
32150
32168
|
const gray = format(90, 39);
|
|
32151
32169
|
const bgBlack = format(40, 49);
|
|
@@ -38189,8 +38207,6 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38189
38207
|
//#endregion
|
|
38190
38208
|
//#region src/cli/commands/project/create.ts
|
|
38191
38209
|
var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
|
|
38192
|
-
const orange = source_default.hex("#E86B3C");
|
|
38193
|
-
const cyan = source_default.hex("#00D4FF");
|
|
38194
38210
|
const DEFAULT_TEMPLATE_ID = "backend-only";
|
|
38195
38211
|
async function getDefaultTemplate() {
|
|
38196
38212
|
const template = (await listTemplates()).find((t) => t.id === DEFAULT_TEMPLATE_ID);
|
|
@@ -38234,7 +38250,7 @@ async function createInteractive(options) {
|
|
|
38234
38250
|
projectPath: async ({ results }) => {
|
|
38235
38251
|
const suggestedPath = `./${(0, import_lodash.default)(results.name)}`;
|
|
38236
38252
|
return he({
|
|
38237
|
-
message: "Where should we create
|
|
38253
|
+
message: "Where should we create your project?",
|
|
38238
38254
|
placeholder: suggestedPath,
|
|
38239
38255
|
initialValue: suggestedPath
|
|
38240
38256
|
});
|
|
@@ -38270,30 +38286,43 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38270
38286
|
template
|
|
38271
38287
|
});
|
|
38272
38288
|
}, {
|
|
38273
|
-
successMessage:
|
|
38289
|
+
successMessage: theme.colors.base44Orange("Project created successfully"),
|
|
38274
38290
|
errorMessage: "Failed to create project"
|
|
38275
38291
|
});
|
|
38276
38292
|
await loadProjectEnv(resolvedPath);
|
|
38277
|
-
const { project, entities } = await readProjectConfig(resolvedPath);
|
|
38293
|
+
const { project, entities, functions } = await readProjectConfig(resolvedPath);
|
|
38278
38294
|
let finalAppUrl;
|
|
38279
38295
|
if (entities.length > 0) {
|
|
38280
38296
|
let shouldPushEntities;
|
|
38281
38297
|
if (isInteractive) {
|
|
38282
|
-
const result = await ye({ message: "
|
|
38298
|
+
const result = await ye({ message: "Set up the backend data now? (This pushes the data models used by the template to Base44)" });
|
|
38283
38299
|
shouldPushEntities = !pD(result) && result;
|
|
38284
38300
|
} else shouldPushEntities = !!deploy;
|
|
38285
|
-
if (shouldPushEntities) await runTask(`Pushing ${entities.length}
|
|
38301
|
+
if (shouldPushEntities) await runTask(`Pushing ${entities.length} data models to Base44...`, async () => {
|
|
38286
38302
|
await pushEntities(entities);
|
|
38287
38303
|
}, {
|
|
38288
|
-
successMessage:
|
|
38289
|
-
errorMessage: "Failed to push
|
|
38304
|
+
successMessage: theme.colors.base44Orange("Data models pushed successfully"),
|
|
38305
|
+
errorMessage: "Failed to push data models"
|
|
38306
|
+
});
|
|
38307
|
+
}
|
|
38308
|
+
if (functions.length > 0) {
|
|
38309
|
+
let shouldPushFunctions;
|
|
38310
|
+
if (isInteractive) {
|
|
38311
|
+
const result = await ye({ message: "Deploy backend functions now? (This pushes the functions used by the template to Base44)" });
|
|
38312
|
+
shouldPushFunctions = !pD(result) && result;
|
|
38313
|
+
} else shouldPushFunctions = !!deploy;
|
|
38314
|
+
if (shouldPushFunctions) await runTask(`Deploying ${functions.length} backend ${functions.length === 1 ? "function" : "functions"} to Base44...`, async () => {
|
|
38315
|
+
await pushFunctions(functions);
|
|
38316
|
+
}, {
|
|
38317
|
+
successMessage: theme.colors.base44Orange("Functions deployed successfully"),
|
|
38318
|
+
errorMessage: "Failed to deploy functions"
|
|
38290
38319
|
});
|
|
38291
38320
|
}
|
|
38292
38321
|
if (project.site) {
|
|
38293
38322
|
const { installCommand, buildCommand, outputDirectory } = project.site;
|
|
38294
38323
|
let shouldDeploy;
|
|
38295
38324
|
if (isInteractive) {
|
|
38296
|
-
const result = await ye({ message: "Would you like to deploy the site now?" });
|
|
38325
|
+
const result = await ye({ message: "Would you like to deploy the site now? (Hosted on Base44)" });
|
|
38297
38326
|
shouldDeploy = !pD(result) && result;
|
|
38298
38327
|
} else shouldDeploy = !!deploy;
|
|
38299
38328
|
if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
|
|
@@ -38310,17 +38339,17 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38310
38339
|
updateMessage("Deploying site...");
|
|
38311
38340
|
return await deploySite(join(resolvedPath, outputDirectory));
|
|
38312
38341
|
}, {
|
|
38313
|
-
successMessage:
|
|
38342
|
+
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
38314
38343
|
errorMessage: "Failed to deploy site"
|
|
38315
38344
|
});
|
|
38316
38345
|
finalAppUrl = appUrl;
|
|
38317
38346
|
}
|
|
38318
38347
|
}
|
|
38319
38348
|
const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/preview`;
|
|
38320
|
-
M.message(`${
|
|
38321
|
-
M.message(`${
|
|
38322
|
-
if (finalAppUrl) M.message(`${
|
|
38323
|
-
return { outroMessage: "Your project is set and ready to use" };
|
|
38349
|
+
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38350
|
+
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38351
|
+
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38352
|
+
return { outroMessage: "Your project is set up and ready to use" };
|
|
38324
38353
|
}
|
|
38325
38354
|
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) => {
|
|
38326
38355
|
await chooseCreate(options);
|
|
@@ -38349,7 +38378,7 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
|
|
|
38349
38378
|
|
|
38350
38379
|
//#endregion
|
|
38351
38380
|
//#region package.json
|
|
38352
|
-
var version = "0.0.
|
|
38381
|
+
var version = "0.0.11";
|
|
38353
38382
|
|
|
38354
38383
|
//#endregion
|
|
38355
38384
|
//#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
|
]
|
package/package.json
CHANGED