@hot-updater/plugin-core 0.16.4 → 0.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8912,6 +8912,538 @@ var __webpack_modules__ = {
8912
8912
  return new RegExp(pattern, onlyFirst ? void 0 : 'g');
8913
8913
  };
8914
8914
  },
8915
+ "../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
8916
+ const stringify = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.js");
8917
+ const compile = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.js");
8918
+ const expand = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.js");
8919
+ const parse = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.js");
8920
+ const braces = (input, options = {})=>{
8921
+ let output = [];
8922
+ if (Array.isArray(input)) for (let pattern of input){
8923
+ let result = braces.create(pattern, options);
8924
+ if (Array.isArray(result)) output.push(...result);
8925
+ else output.push(result);
8926
+ }
8927
+ else output = [].concat(braces.create(input, options));
8928
+ if (options && true === options.expand && true === options.nodupes) output = [
8929
+ ...new Set(output)
8930
+ ];
8931
+ return output;
8932
+ };
8933
+ braces.parse = (input, options = {})=>parse(input, options);
8934
+ braces.stringify = (input, options = {})=>{
8935
+ if ('string' == typeof input) return stringify(braces.parse(input, options), options);
8936
+ return stringify(input, options);
8937
+ };
8938
+ braces.compile = (input, options = {})=>{
8939
+ if ('string' == typeof input) input = braces.parse(input, options);
8940
+ return compile(input, options);
8941
+ };
8942
+ braces.expand = (input, options = {})=>{
8943
+ if ('string' == typeof input) input = braces.parse(input, options);
8944
+ let result = expand(input, options);
8945
+ if (true === options.noempty) result = result.filter(Boolean);
8946
+ if (true === options.nodupes) result = [
8947
+ ...new Set(result)
8948
+ ];
8949
+ return result;
8950
+ };
8951
+ braces.create = (input, options = {})=>{
8952
+ if ('' === input || input.length < 3) return [
8953
+ input
8954
+ ];
8955
+ return true !== options.expand ? braces.compile(input, options) : braces.expand(input, options);
8956
+ };
8957
+ module.exports = braces;
8958
+ },
8959
+ "../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.js": function(module, __unused_webpack_exports, __webpack_require__) {
8960
+ const fill = __webpack_require__("../../node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.js");
8961
+ const utils = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js");
8962
+ const compile = (ast, options = {})=>{
8963
+ let walk = (node, parent = {})=>{
8964
+ let invalidBlock = utils.isInvalidBrace(parent);
8965
+ let invalidNode = true === node.invalid && true === options.escapeInvalid;
8966
+ let invalid = true === invalidBlock || true === invalidNode;
8967
+ let prefix = true === options.escapeInvalid ? '\\' : '';
8968
+ let output = '';
8969
+ if (true === node.isOpen) return prefix + node.value;
8970
+ if (true === node.isClose) return prefix + node.value;
8971
+ if ('open' === node.type) return invalid ? prefix + node.value : '(';
8972
+ if ('close' === node.type) return invalid ? prefix + node.value : ')';
8973
+ if ('comma' === node.type) return 'comma' === node.prev.type ? '' : invalid ? node.value : '|';
8974
+ if (node.value) return node.value;
8975
+ if (node.nodes && node.ranges > 0) {
8976
+ let args = utils.reduce(node.nodes);
8977
+ let range = fill(...args, {
8978
+ ...options,
8979
+ wrap: false,
8980
+ toRegex: true
8981
+ });
8982
+ if (0 !== range.length) return args.length > 1 && range.length > 1 ? `(${range})` : range;
8983
+ }
8984
+ if (node.nodes) for (let child of node.nodes)output += walk(child, node);
8985
+ return output;
8986
+ };
8987
+ return walk(ast);
8988
+ };
8989
+ module.exports = compile;
8990
+ },
8991
+ "../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.js": function(module) {
8992
+ module.exports = {
8993
+ MAX_LENGTH: 65536,
8994
+ CHAR_0: '0',
8995
+ CHAR_9: '9',
8996
+ CHAR_UPPERCASE_A: 'A',
8997
+ CHAR_LOWERCASE_A: 'a',
8998
+ CHAR_UPPERCASE_Z: 'Z',
8999
+ CHAR_LOWERCASE_Z: 'z',
9000
+ CHAR_LEFT_PARENTHESES: '(',
9001
+ CHAR_RIGHT_PARENTHESES: ')',
9002
+ CHAR_ASTERISK: '*',
9003
+ CHAR_AMPERSAND: '&',
9004
+ CHAR_AT: '@',
9005
+ CHAR_BACKSLASH: '\\',
9006
+ CHAR_BACKTICK: '`',
9007
+ CHAR_CARRIAGE_RETURN: '\r',
9008
+ CHAR_CIRCUMFLEX_ACCENT: '^',
9009
+ CHAR_COLON: ':',
9010
+ CHAR_COMMA: ',',
9011
+ CHAR_DOLLAR: '$',
9012
+ CHAR_DOT: '.',
9013
+ CHAR_DOUBLE_QUOTE: '"',
9014
+ CHAR_EQUAL: '=',
9015
+ CHAR_EXCLAMATION_MARK: '!',
9016
+ CHAR_FORM_FEED: '\f',
9017
+ CHAR_FORWARD_SLASH: '/',
9018
+ CHAR_HASH: '#',
9019
+ CHAR_HYPHEN_MINUS: '-',
9020
+ CHAR_LEFT_ANGLE_BRACKET: '<',
9021
+ CHAR_LEFT_CURLY_BRACE: '{',
9022
+ CHAR_LEFT_SQUARE_BRACKET: '[',
9023
+ CHAR_LINE_FEED: '\n',
9024
+ CHAR_NO_BREAK_SPACE: '\u00A0',
9025
+ CHAR_PERCENT: '%',
9026
+ CHAR_PLUS: '+',
9027
+ CHAR_QUESTION_MARK: '?',
9028
+ CHAR_RIGHT_ANGLE_BRACKET: '>',
9029
+ CHAR_RIGHT_CURLY_BRACE: '}',
9030
+ CHAR_RIGHT_SQUARE_BRACKET: ']',
9031
+ CHAR_SEMICOLON: ';',
9032
+ CHAR_SINGLE_QUOTE: '\'',
9033
+ CHAR_SPACE: ' ',
9034
+ CHAR_TAB: '\t',
9035
+ CHAR_UNDERSCORE: '_',
9036
+ CHAR_VERTICAL_LINE: '|',
9037
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF'
9038
+ };
9039
+ },
9040
+ "../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.js": function(module, __unused_webpack_exports, __webpack_require__) {
9041
+ const fill = __webpack_require__("../../node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.js");
9042
+ const stringify = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.js");
9043
+ const utils = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js");
9044
+ const append = (queue = '', stash = '', enclose = false)=>{
9045
+ let result = [];
9046
+ queue = [].concat(queue);
9047
+ stash = [].concat(stash);
9048
+ if (!stash.length) return queue;
9049
+ if (!queue.length) return enclose ? utils.flatten(stash).map((ele)=>`{${ele}}`) : stash;
9050
+ for (let item of queue)if (Array.isArray(item)) for (let value1 of item)result.push(append(value1, stash, enclose));
9051
+ else for (let ele of stash){
9052
+ if (true === enclose && 'string' == typeof ele) ele = `{${ele}}`;
9053
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
9054
+ }
9055
+ return utils.flatten(result);
9056
+ };
9057
+ const expand = (ast, options = {})=>{
9058
+ let rangeLimit = void 0 === options.rangeLimit ? 1000 : options.rangeLimit;
9059
+ let walk = (node, parent = {})=>{
9060
+ node.queue = [];
9061
+ let p = parent;
9062
+ let q = parent.queue;
9063
+ while('brace' !== p.type && 'root' !== p.type && p.parent){
9064
+ p = p.parent;
9065
+ q = p.queue;
9066
+ }
9067
+ if (node.invalid || node.dollar) return void q.push(append(q.pop(), stringify(node, options)));
9068
+ if ('brace' === node.type && true !== node.invalid && 2 === node.nodes.length) return void q.push(append(q.pop(), [
9069
+ '{}'
9070
+ ]));
9071
+ if (node.nodes && node.ranges > 0) {
9072
+ let args = utils.reduce(node.nodes);
9073
+ if (utils.exceedsLimit(...args, options.step, rangeLimit)) throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
9074
+ let range = fill(...args, options);
9075
+ if (0 === range.length) range = stringify(node, options);
9076
+ q.push(append(q.pop(), range));
9077
+ node.nodes = [];
9078
+ return;
9079
+ }
9080
+ let enclose = utils.encloseBrace(node);
9081
+ let queue = node.queue;
9082
+ let block = node;
9083
+ while('brace' !== block.type && 'root' !== block.type && block.parent){
9084
+ block = block.parent;
9085
+ queue = block.queue;
9086
+ }
9087
+ for(let i = 0; i < node.nodes.length; i++){
9088
+ let child = node.nodes[i];
9089
+ if ('comma' === child.type && 'brace' === node.type) {
9090
+ if (1 === i) queue.push('');
9091
+ queue.push('');
9092
+ continue;
9093
+ }
9094
+ if ('close' === child.type) {
9095
+ q.push(append(q.pop(), queue, enclose));
9096
+ continue;
9097
+ }
9098
+ if (child.value && 'open' !== child.type) {
9099
+ queue.push(append(queue.pop(), child.value));
9100
+ continue;
9101
+ }
9102
+ if (child.nodes) walk(child, node);
9103
+ }
9104
+ return queue;
9105
+ };
9106
+ return utils.flatten(walk(ast));
9107
+ };
9108
+ module.exports = expand;
9109
+ },
9110
+ "../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.js": function(module, __unused_webpack_exports, __webpack_require__) {
9111
+ const stringify = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.js");
9112
+ const { MAX_LENGTH, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA, CHAR_DOT, CHAR_LEFT_PARENTHESES, CHAR_RIGHT_PARENTHESES, CHAR_LEFT_CURLY_BRACE, CHAR_RIGHT_CURLY_BRACE, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.js");
9113
+ const parse = (input, options = {})=>{
9114
+ if ('string' != typeof input) throw new TypeError('Expected a string');
9115
+ let opts = options || {};
9116
+ let max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
9117
+ if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
9118
+ let ast = {
9119
+ type: 'root',
9120
+ input,
9121
+ nodes: []
9122
+ };
9123
+ let stack = [
9124
+ ast
9125
+ ];
9126
+ let block = ast;
9127
+ let prev = ast;
9128
+ let brackets = 0;
9129
+ let length = input.length;
9130
+ let index = 0;
9131
+ let depth = 0;
9132
+ let value1;
9133
+ const advance = ()=>input[index++];
9134
+ const push = (node)=>{
9135
+ if ('text' === node.type && 'dot' === prev.type) prev.type = 'text';
9136
+ if (prev && 'text' === prev.type && 'text' === node.type) {
9137
+ prev.value += node.value;
9138
+ return;
9139
+ }
9140
+ block.nodes.push(node);
9141
+ node.parent = block;
9142
+ node.prev = prev;
9143
+ prev = node;
9144
+ return node;
9145
+ };
9146
+ push({
9147
+ type: 'bos'
9148
+ });
9149
+ while(index < length){
9150
+ block = stack[stack.length - 1];
9151
+ value1 = advance();
9152
+ if (value1 === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value1 === CHAR_NO_BREAK_SPACE) continue;
9153
+ if (value1 === CHAR_BACKSLASH) {
9154
+ push({
9155
+ type: 'text',
9156
+ value: (options.keepEscaping ? value1 : '') + advance()
9157
+ });
9158
+ continue;
9159
+ }
9160
+ if (value1 === CHAR_RIGHT_SQUARE_BRACKET) {
9161
+ push({
9162
+ type: 'text',
9163
+ value: '\\' + value1
9164
+ });
9165
+ continue;
9166
+ }
9167
+ if (value1 === CHAR_LEFT_SQUARE_BRACKET) {
9168
+ brackets++;
9169
+ let next;
9170
+ while(index < length && (next = advance())){
9171
+ value1 += next;
9172
+ if (next === CHAR_LEFT_SQUARE_BRACKET) {
9173
+ brackets++;
9174
+ continue;
9175
+ }
9176
+ if (next === CHAR_BACKSLASH) {
9177
+ value1 += advance();
9178
+ continue;
9179
+ }
9180
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
9181
+ brackets--;
9182
+ if (0 === brackets) break;
9183
+ }
9184
+ }
9185
+ push({
9186
+ type: 'text',
9187
+ value: value1
9188
+ });
9189
+ continue;
9190
+ }
9191
+ if (value1 === CHAR_LEFT_PARENTHESES) {
9192
+ block = push({
9193
+ type: 'paren',
9194
+ nodes: []
9195
+ });
9196
+ stack.push(block);
9197
+ push({
9198
+ type: 'text',
9199
+ value: value1
9200
+ });
9201
+ continue;
9202
+ }
9203
+ if (value1 === CHAR_RIGHT_PARENTHESES) {
9204
+ if ('paren' !== block.type) {
9205
+ push({
9206
+ type: 'text',
9207
+ value: value1
9208
+ });
9209
+ continue;
9210
+ }
9211
+ block = stack.pop();
9212
+ push({
9213
+ type: 'text',
9214
+ value: value1
9215
+ });
9216
+ block = stack[stack.length - 1];
9217
+ continue;
9218
+ }
9219
+ if (value1 === CHAR_DOUBLE_QUOTE || value1 === CHAR_SINGLE_QUOTE || value1 === CHAR_BACKTICK) {
9220
+ let open = value1;
9221
+ let next;
9222
+ if (true !== options.keepQuotes) value1 = '';
9223
+ while(index < length && (next = advance())){
9224
+ if (next === CHAR_BACKSLASH) {
9225
+ value1 += next + advance();
9226
+ continue;
9227
+ }
9228
+ if (next === open) {
9229
+ if (true === options.keepQuotes) value1 += next;
9230
+ break;
9231
+ }
9232
+ value1 += next;
9233
+ }
9234
+ push({
9235
+ type: 'text',
9236
+ value: value1
9237
+ });
9238
+ continue;
9239
+ }
9240
+ if (value1 === CHAR_LEFT_CURLY_BRACE) {
9241
+ depth++;
9242
+ let dollar = prev.value && '$' === prev.value.slice(-1) || true === block.dollar;
9243
+ let brace = {
9244
+ type: 'brace',
9245
+ open: true,
9246
+ close: false,
9247
+ dollar,
9248
+ depth,
9249
+ commas: 0,
9250
+ ranges: 0,
9251
+ nodes: []
9252
+ };
9253
+ block = push(brace);
9254
+ stack.push(block);
9255
+ push({
9256
+ type: 'open',
9257
+ value: value1
9258
+ });
9259
+ continue;
9260
+ }
9261
+ if (value1 === CHAR_RIGHT_CURLY_BRACE) {
9262
+ if ('brace' !== block.type) {
9263
+ push({
9264
+ type: 'text',
9265
+ value: value1
9266
+ });
9267
+ continue;
9268
+ }
9269
+ let type = 'close';
9270
+ block = stack.pop();
9271
+ block.close = true;
9272
+ push({
9273
+ type,
9274
+ value: value1
9275
+ });
9276
+ depth--;
9277
+ block = stack[stack.length - 1];
9278
+ continue;
9279
+ }
9280
+ if (value1 === CHAR_COMMA && depth > 0) {
9281
+ if (block.ranges > 0) {
9282
+ block.ranges = 0;
9283
+ let open = block.nodes.shift();
9284
+ block.nodes = [
9285
+ open,
9286
+ {
9287
+ type: 'text',
9288
+ value: stringify(block)
9289
+ }
9290
+ ];
9291
+ }
9292
+ push({
9293
+ type: 'comma',
9294
+ value: value1
9295
+ });
9296
+ block.commas++;
9297
+ continue;
9298
+ }
9299
+ if (value1 === CHAR_DOT && depth > 0 && 0 === block.commas) {
9300
+ let siblings = block.nodes;
9301
+ if (0 === depth || 0 === siblings.length) {
9302
+ push({
9303
+ type: 'text',
9304
+ value: value1
9305
+ });
9306
+ continue;
9307
+ }
9308
+ if ('dot' === prev.type) {
9309
+ block.range = [];
9310
+ prev.value += value1;
9311
+ prev.type = 'range';
9312
+ if (3 !== block.nodes.length && 5 !== block.nodes.length) {
9313
+ block.invalid = true;
9314
+ block.ranges = 0;
9315
+ prev.type = 'text';
9316
+ continue;
9317
+ }
9318
+ block.ranges++;
9319
+ block.args = [];
9320
+ continue;
9321
+ }
9322
+ if ('range' === prev.type) {
9323
+ siblings.pop();
9324
+ let before = siblings[siblings.length - 1];
9325
+ before.value += prev.value + value1;
9326
+ prev = before;
9327
+ block.ranges--;
9328
+ continue;
9329
+ }
9330
+ push({
9331
+ type: 'dot',
9332
+ value: value1
9333
+ });
9334
+ continue;
9335
+ }
9336
+ push({
9337
+ type: 'text',
9338
+ value: value1
9339
+ });
9340
+ }
9341
+ do {
9342
+ block = stack.pop();
9343
+ if ('root' !== block.type) {
9344
+ block.nodes.forEach((node)=>{
9345
+ if (!node.nodes) {
9346
+ if ('open' === node.type) node.isOpen = true;
9347
+ if ('close' === node.type) node.isClose = true;
9348
+ if (!node.nodes) node.type = 'text';
9349
+ node.invalid = true;
9350
+ }
9351
+ });
9352
+ let parent = stack[stack.length - 1];
9353
+ let index = parent.nodes.indexOf(block);
9354
+ parent.nodes.splice(index, 1, ...block.nodes);
9355
+ }
9356
+ }while (stack.length > 0);
9357
+ push({
9358
+ type: 'eos'
9359
+ });
9360
+ return ast;
9361
+ };
9362
+ module.exports = parse;
9363
+ },
9364
+ "../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.js": function(module, __unused_webpack_exports, __webpack_require__) {
9365
+ const utils = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js");
9366
+ module.exports = (ast, options = {})=>{
9367
+ let stringify = (node, parent = {})=>{
9368
+ let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
9369
+ let invalidNode = true === node.invalid && true === options.escapeInvalid;
9370
+ let output = '';
9371
+ if (node.value) {
9372
+ if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) return '\\' + node.value;
9373
+ return node.value;
9374
+ }
9375
+ if (node.value) return node.value;
9376
+ if (node.nodes) for (let child of node.nodes)output += stringify(child);
9377
+ return output;
9378
+ };
9379
+ return stringify(ast);
9380
+ };
9381
+ },
9382
+ "../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js": function(__unused_webpack_module, exports) {
9383
+ exports.isInteger = (num)=>{
9384
+ if ('number' == typeof num) return Number.isInteger(num);
9385
+ if ('string' == typeof num && '' !== num.trim()) return Number.isInteger(Number(num));
9386
+ return false;
9387
+ };
9388
+ exports.find = (node, type)=>node.nodes.find((node)=>node.type === type);
9389
+ exports.exceedsLimit = (min, max, step = 1, limit)=>{
9390
+ if (false === limit) return false;
9391
+ if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
9392
+ return (Number(max) - Number(min)) / Number(step) >= limit;
9393
+ };
9394
+ exports.escapeNode = (block, n = 0, type)=>{
9395
+ let node = block.nodes[n];
9396
+ if (!node) return;
9397
+ if (type && node.type === type || 'open' === node.type || 'close' === node.type) {
9398
+ if (true !== node.escaped) {
9399
+ node.value = '\\' + node.value;
9400
+ node.escaped = true;
9401
+ }
9402
+ }
9403
+ };
9404
+ exports.encloseBrace = (node)=>{
9405
+ if ('brace' !== node.type) return false;
9406
+ if (node.commas >> 0 + node.ranges >> 0 === 0) {
9407
+ node.invalid = true;
9408
+ return true;
9409
+ }
9410
+ return false;
9411
+ };
9412
+ exports.isInvalidBrace = (block)=>{
9413
+ if ('brace' !== block.type) return false;
9414
+ if (true === block.invalid || block.dollar) return true;
9415
+ if (block.commas >> 0 + block.ranges >> 0 === 0) {
9416
+ block.invalid = true;
9417
+ return true;
9418
+ }
9419
+ if (true !== block.open || true !== block.close) {
9420
+ block.invalid = true;
9421
+ return true;
9422
+ }
9423
+ return false;
9424
+ };
9425
+ exports.isOpenOrClose = (node)=>{
9426
+ if ('open' === node.type || 'close' === node.type) return true;
9427
+ return true === node.open || true === node.close;
9428
+ };
9429
+ exports.reduce = (nodes)=>nodes.reduce((acc, node)=>{
9430
+ if ('text' === node.type) acc.push(node.value);
9431
+ if ('range' === node.type) node.type = 'text';
9432
+ return acc;
9433
+ }, []);
9434
+ exports.flatten = (...args)=>{
9435
+ const result = [];
9436
+ const flat = (arr)=>{
9437
+ for(let i = 0; i < arr.length; i++){
9438
+ let ele = arr[i];
9439
+ Array.isArray(ele) ? flat(ele, result) : void 0 !== ele && result.push(ele);
9440
+ }
9441
+ return result;
9442
+ };
9443
+ flat(args);
9444
+ return result;
9445
+ };
9446
+ },
8915
9447
  "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
8916
9448
  const stringify = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js");
8917
9449
  const compile = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js");
@@ -10813,7 +11345,7 @@ var __webpack_modules__ = {
10813
11345
  exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
10814
11346
  const path = __webpack_require__("path");
10815
11347
  const globParent = __webpack_require__("../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js");
10816
- const micromatch = __webpack_require__("../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js");
11348
+ const micromatch = __webpack_require__("../../node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.js");
10817
11349
  const GLOBSTAR = '**';
10818
11350
  const ESCAPE_SYMBOL = '\\';
10819
11351
  const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
@@ -11187,6 +11719,177 @@ var __webpack_modules__ = {
11187
11719
  module.exports = fastqueue;
11188
11720
  module.exports.promise = queueAsPromised;
11189
11721
  },
11722
+ "../../node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
11723
+ /*!
11724
+ * fill-range <https://github.com/jonschlinkert/fill-range>
11725
+ *
11726
+ * Copyright (c) 2014-present, Jon Schlinkert.
11727
+ * Licensed under the MIT License.
11728
+ */ const util = __webpack_require__("util");
11729
+ const toRegexRange = __webpack_require__("../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js");
11730
+ const isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val);
11731
+ const transform = (toNumber)=>(value1)=>true === toNumber ? Number(value1) : String(value1);
11732
+ const isValidValue = (value1)=>'number' == typeof value1 || 'string' == typeof value1 && '' !== value1;
11733
+ const isNumber = (num)=>Number.isInteger(+num);
11734
+ const zeros = (input)=>{
11735
+ let value1 = `${input}`;
11736
+ let index = -1;
11737
+ if ('-' === value1[0]) value1 = value1.slice(1);
11738
+ if ('0' === value1) return false;
11739
+ while('0' === value1[++index]);
11740
+ return index > 0;
11741
+ };
11742
+ const stringify = (start, end, options)=>{
11743
+ if ('string' == typeof start || 'string' == typeof end) return true;
11744
+ return true === options.stringify;
11745
+ };
11746
+ const pad = (input, maxLength, toNumber)=>{
11747
+ if (maxLength > 0) {
11748
+ let dash = '-' === input[0] ? '-' : '';
11749
+ if (dash) input = input.slice(1);
11750
+ input = dash + input.padStart(dash ? maxLength - 1 : maxLength, '0');
11751
+ }
11752
+ if (false === toNumber) return String(input);
11753
+ return input;
11754
+ };
11755
+ const toMaxLen = (input, maxLength)=>{
11756
+ let negative = '-' === input[0] ? '-' : '';
11757
+ if (negative) {
11758
+ input = input.slice(1);
11759
+ maxLength--;
11760
+ }
11761
+ while(input.length < maxLength)input = '0' + input;
11762
+ return negative ? '-' + input : input;
11763
+ };
11764
+ const toSequence = (parts, options)=>{
11765
+ parts.negatives.sort((a, b)=>a < b ? -1 : a > b ? 1 : 0);
11766
+ parts.positives.sort((a, b)=>a < b ? -1 : a > b ? 1 : 0);
11767
+ let prefix = options.capture ? '' : '?:';
11768
+ let positives = '';
11769
+ let negatives = '';
11770
+ let result;
11771
+ if (parts.positives.length) positives = parts.positives.join('|');
11772
+ if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.join('|')})`;
11773
+ result = positives && negatives ? `${positives}|${negatives}` : positives || negatives;
11774
+ if (options.wrap) return `(${prefix}${result})`;
11775
+ return result;
11776
+ };
11777
+ const toRange = (a, b, isNumbers, options)=>{
11778
+ if (isNumbers) return toRegexRange(a, b, {
11779
+ wrap: false,
11780
+ ...options
11781
+ });
11782
+ let start = String.fromCharCode(a);
11783
+ if (a === b) return start;
11784
+ let stop = String.fromCharCode(b);
11785
+ return `[${start}-${stop}]`;
11786
+ };
11787
+ const toRegex = (start, end, options)=>{
11788
+ if (Array.isArray(start)) {
11789
+ let wrap = true === options.wrap;
11790
+ let prefix = options.capture ? '' : '?:';
11791
+ return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
11792
+ }
11793
+ return toRegexRange(start, end, options);
11794
+ };
11795
+ const rangeError = (...args)=>new RangeError('Invalid range arguments: ' + util.inspect(...args));
11796
+ const invalidRange = (start, end, options)=>{
11797
+ if (true === options.strictRanges) throw rangeError([
11798
+ start,
11799
+ end
11800
+ ]);
11801
+ return [];
11802
+ };
11803
+ const invalidStep = (step, options)=>{
11804
+ if (true === options.strictRanges) throw new TypeError(`Expected step "${step}" to be a number`);
11805
+ return [];
11806
+ };
11807
+ const fillNumbers = (start, end, step = 1, options = {})=>{
11808
+ let a = Number(start);
11809
+ let b = Number(end);
11810
+ if (!Number.isInteger(a) || !Number.isInteger(b)) {
11811
+ if (true === options.strictRanges) throw rangeError([
11812
+ start,
11813
+ end
11814
+ ]);
11815
+ return [];
11816
+ }
11817
+ if (0 === a) a = 0;
11818
+ if (0 === b) b = 0;
11819
+ let descending = a > b;
11820
+ let startString = String(start);
11821
+ let endString = String(end);
11822
+ let stepString = String(step);
11823
+ step = Math.max(Math.abs(step), 1);
11824
+ let padded = zeros(startString) || zeros(endString) || zeros(stepString);
11825
+ let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
11826
+ let toNumber = false === padded && false === stringify(start, end, options);
11827
+ let format = options.transform || transform(toNumber);
11828
+ if (options.toRegex && 1 === step) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
11829
+ let parts = {
11830
+ negatives: [],
11831
+ positives: []
11832
+ };
11833
+ let push = (num)=>parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num));
11834
+ let range = [];
11835
+ let index = 0;
11836
+ while(descending ? a >= b : a <= b){
11837
+ if (true === options.toRegex && step > 1) push(a);
11838
+ else range.push(pad(format(a, index), maxLen, toNumber));
11839
+ a = descending ? a - step : a + step;
11840
+ index++;
11841
+ }
11842
+ if (true === options.toRegex) return step > 1 ? toSequence(parts, options) : toRegex(range, null, {
11843
+ wrap: false,
11844
+ ...options
11845
+ });
11846
+ return range;
11847
+ };
11848
+ const fillLetters = (start, end, step = 1, options = {})=>{
11849
+ if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options);
11850
+ let format = options.transform || ((val)=>String.fromCharCode(val));
11851
+ let a = `${start}`.charCodeAt(0);
11852
+ let b = `${end}`.charCodeAt(0);
11853
+ let descending = a > b;
11854
+ let min = Math.min(a, b);
11855
+ let max = Math.max(a, b);
11856
+ if (options.toRegex && 1 === step) return toRange(min, max, false, options);
11857
+ let range = [];
11858
+ let index = 0;
11859
+ while(descending ? a >= b : a <= b){
11860
+ range.push(format(a, index));
11861
+ a = descending ? a - step : a + step;
11862
+ index++;
11863
+ }
11864
+ if (true === options.toRegex) return toRegex(range, null, {
11865
+ wrap: false,
11866
+ options
11867
+ });
11868
+ return range;
11869
+ };
11870
+ const fill = (start, end, step, options = {})=>{
11871
+ if (null == end && isValidValue(start)) return [
11872
+ start
11873
+ ];
11874
+ if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options);
11875
+ if ('function' == typeof step) return fill(start, end, 1, {
11876
+ transform: step
11877
+ });
11878
+ if (isObject(step)) return fill(start, end, 0, step);
11879
+ let opts = {
11880
+ ...options
11881
+ };
11882
+ if (true === opts.capture) opts.wrap = true;
11883
+ step = step || opts.step || 1;
11884
+ if (!isNumber(step)) {
11885
+ if (null != step && !isObject(step)) return invalidStep(step, opts);
11886
+ return fill(start, end, 1, step);
11887
+ }
11888
+ if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
11889
+ return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
11890
+ };
11891
+ module.exports = fill;
11892
+ },
11190
11893
  "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
11191
11894
  /*!
11192
11895
  * fill-range <https://github.com/jonschlinkert/fill-range>
@@ -17638,6 +18341,144 @@ var __webpack_modules__ = {
17638
18341
  return streams;
17639
18342
  }
17640
18343
  },
18344
+ "../../node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
18345
+ const util = __webpack_require__("util");
18346
+ const braces = __webpack_require__("../../node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.js");
18347
+ const picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js");
18348
+ const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js");
18349
+ const isEmptyString = (val)=>'' === val || './' === val;
18350
+ const micromatch = (list, patterns, options)=>{
18351
+ patterns = [].concat(patterns);
18352
+ list = [].concat(list);
18353
+ let omit = new Set();
18354
+ let keep = new Set();
18355
+ let items = new Set();
18356
+ let negatives = 0;
18357
+ let onResult = (state)=>{
18358
+ items.add(state.output);
18359
+ if (options && options.onResult) options.onResult(state);
18360
+ };
18361
+ for(let i = 0; i < patterns.length; i++){
18362
+ let isMatch = picomatch(String(patterns[i]), {
18363
+ ...options,
18364
+ onResult
18365
+ }, true);
18366
+ let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
18367
+ if (negated) negatives++;
18368
+ for (let item of list){
18369
+ let matched = isMatch(item, true);
18370
+ let match = negated ? !matched.isMatch : matched.isMatch;
18371
+ if (match) if (negated) omit.add(matched.output);
18372
+ else {
18373
+ omit.delete(matched.output);
18374
+ keep.add(matched.output);
18375
+ }
18376
+ }
18377
+ }
18378
+ let result = negatives === patterns.length ? [
18379
+ ...items
18380
+ ] : [
18381
+ ...keep
18382
+ ];
18383
+ let matches = result.filter((item)=>!omit.has(item));
18384
+ if (options && 0 === matches.length) {
18385
+ if (true === options.failglob) throw new Error(`No matches found for "${patterns.join(', ')}"`);
18386
+ if (true === options.nonull || true === options.nullglob) return options.unescape ? patterns.map((p)=>p.replace(/\\/g, '')) : patterns;
18387
+ }
18388
+ return matches;
18389
+ };
18390
+ micromatch.match = micromatch;
18391
+ micromatch.matcher = (pattern, options)=>picomatch(pattern, options);
18392
+ micromatch.isMatch = (str, patterns, options)=>picomatch(patterns, options)(str);
18393
+ micromatch.any = micromatch.isMatch;
18394
+ micromatch.not = (list, patterns, options = {})=>{
18395
+ patterns = [].concat(patterns).map(String);
18396
+ let result = new Set();
18397
+ let items = [];
18398
+ let onResult = (state)=>{
18399
+ if (options.onResult) options.onResult(state);
18400
+ items.push(state.output);
18401
+ };
18402
+ let matches = new Set(micromatch(list, patterns, {
18403
+ ...options,
18404
+ onResult
18405
+ }));
18406
+ for (let item of items)if (!matches.has(item)) result.add(item);
18407
+ return [
18408
+ ...result
18409
+ ];
18410
+ };
18411
+ micromatch.contains = (str, pattern, options)=>{
18412
+ if ('string' != typeof str) throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
18413
+ if (Array.isArray(pattern)) return pattern.some((p)=>micromatch.contains(str, p, options));
18414
+ if ('string' == typeof pattern) {
18415
+ if (isEmptyString(str) || isEmptyString(pattern)) return false;
18416
+ if (str.includes(pattern) || str.startsWith('./') && str.slice(2).includes(pattern)) return true;
18417
+ }
18418
+ return micromatch.isMatch(str, pattern, {
18419
+ ...options,
18420
+ contains: true
18421
+ });
18422
+ };
18423
+ micromatch.matchKeys = (obj, patterns, options)=>{
18424
+ if (!utils.isObject(obj)) throw new TypeError('Expected the first argument to be an object');
18425
+ let keys = micromatch(Object.keys(obj), patterns, options);
18426
+ let res = {};
18427
+ for (let key of keys)res[key] = obj[key];
18428
+ return res;
18429
+ };
18430
+ micromatch.some = (list, patterns, options)=>{
18431
+ let items = [].concat(list);
18432
+ for (let pattern of [].concat(patterns)){
18433
+ let isMatch = picomatch(String(pattern), options);
18434
+ if (items.some((item)=>isMatch(item))) return true;
18435
+ }
18436
+ return false;
18437
+ };
18438
+ micromatch.every = (list, patterns, options)=>{
18439
+ let items = [].concat(list);
18440
+ for (let pattern of [].concat(patterns)){
18441
+ let isMatch = picomatch(String(pattern), options);
18442
+ if (!items.every((item)=>isMatch(item))) return false;
18443
+ }
18444
+ return true;
18445
+ };
18446
+ micromatch.all = (str, patterns, options)=>{
18447
+ if ('string' != typeof str) throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
18448
+ return [].concat(patterns).every((p)=>picomatch(p, options)(str));
18449
+ };
18450
+ micromatch.capture = (glob, input, options)=>{
18451
+ let posix = utils.isWindows(options);
18452
+ let regex = picomatch.makeRe(String(glob), {
18453
+ ...options,
18454
+ capture: true
18455
+ });
18456
+ let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
18457
+ if (match) return match.slice(1).map((v)=>void 0 === v ? '' : v);
18458
+ };
18459
+ micromatch.makeRe = (...args)=>picomatch.makeRe(...args);
18460
+ micromatch.scan = (...args)=>picomatch.scan(...args);
18461
+ micromatch.parse = (patterns, options)=>{
18462
+ let res = [];
18463
+ for (let pattern of [].concat(patterns || []))for (let str of braces(String(pattern), options))res.push(picomatch.parse(str, options));
18464
+ return res;
18465
+ };
18466
+ micromatch.braces = (pattern, options)=>{
18467
+ if ('string' != typeof pattern) throw new TypeError('Expected a string');
18468
+ if (options && true === options.nobrace || !/\{.*\}/.test(pattern)) return [
18469
+ pattern
18470
+ ];
18471
+ return braces(pattern, options);
18472
+ };
18473
+ micromatch.braceExpand = (pattern, options)=>{
18474
+ if ('string' != typeof pattern) throw new TypeError('Expected a string');
18475
+ return micromatch.braces(pattern, {
18476
+ ...options,
18477
+ expand: true
18478
+ });
18479
+ };
18480
+ module.exports = micromatch;
18481
+ },
17641
18482
  "../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
17642
18483
  const util = __webpack_require__("util");
17643
18484
  const braces = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js");
@@ -21588,51 +22429,6 @@ var __webpack_modules__ = {
21588
22429
  parseUrl.MAX_INPUT_LENGTH = 2048;
21589
22430
  module.exports = parseUrl;
21590
22431
  },
21591
- "../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js": function(module, __unused_webpack_exports, __webpack_require__) {
21592
- let tty = __webpack_require__("tty");
21593
- let isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || "win32" === process.platform || tty.isatty(1) && "dumb" !== process.env.TERM || "CI" in process.env);
21594
- let formatter = (open, close, replace = open)=>(input)=>{
21595
- let string = "" + input;
21596
- let index = string.indexOf(close, open.length);
21597
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
21598
- };
21599
- let replaceClose = (string, close, replace, index)=>{
21600
- let start = string.substring(0, index) + replace;
21601
- let end = string.substring(index + close.length);
21602
- let nextIndex = end.indexOf(close);
21603
- return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
21604
- };
21605
- let createColors = (enabled = isColorSupported)=>({
21606
- isColorSupported: enabled,
21607
- reset: enabled ? (s)=>`\x1b[0m${s}\x1b[0m` : String,
21608
- bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String,
21609
- dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String,
21610
- italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String,
21611
- underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String,
21612
- inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String,
21613
- hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String,
21614
- strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String,
21615
- black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String,
21616
- red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String,
21617
- green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String,
21618
- yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String,
21619
- blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String,
21620
- magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String,
21621
- cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String,
21622
- white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String,
21623
- gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String,
21624
- bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String,
21625
- bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String,
21626
- bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String,
21627
- bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String,
21628
- bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String,
21629
- bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String,
21630
- bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String,
21631
- bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String
21632
- });
21633
- module.exports = createColors();
21634
- module.exports.createColors = createColors;
21635
- },
21636
22432
  "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
21637
22433
  let p = process || {}, argv = p.argv || [], env = p.env || {};
21638
22434
  let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
@@ -82362,7 +83158,7 @@ function __webpack_require__(moduleId) {
82362
83158
  (()=>{
82363
83159
  __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
82364
83160
  })();
82365
- var picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js");
83161
+ var picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
82366
83162
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
82367
83163
  const log = {
82368
83164
  normal: (message)=>console.log(message),
@@ -84270,4 +85066,126 @@ const createBlobDatabasePlugin = ({ name, listObjects, loadObject, uploadObject,
84270
85066
  }
84271
85067
  }, hooks);
84272
85068
  };
84273
- export { banner, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createZip, createZipTargetFiles, getCwd, banner_link as link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate, transformTsEnv };
85069
+ class ConfigBuilder {
85070
+ buildType = null;
85071
+ storageInfo = null;
85072
+ databaseInfo = null;
85073
+ intermediateCode = "";
85074
+ collectedImports = new Map();
85075
+ constructor(){
85076
+ this.addImport({
85077
+ pkg: "dotenv/config",
85078
+ sideEffect: true
85079
+ });
85080
+ this.addImport({
85081
+ pkg: "hot-updater",
85082
+ named: [
85083
+ "defineConfig"
85084
+ ]
85085
+ });
85086
+ }
85087
+ addImport(info) {
85088
+ const pkg = info.pkg;
85089
+ const existing = this.collectedImports.get(pkg);
85090
+ if (existing) {
85091
+ if (info.named) for (const n of info.named)existing.named.add(n);
85092
+ if (info.defaultOrNamespace && !existing.defaultOrNamespace) existing.defaultOrNamespace = info.defaultOrNamespace;
85093
+ if (info.sideEffect && !existing.sideEffect) existing.sideEffect = true;
85094
+ } else this.collectedImports.set(pkg, {
85095
+ named: new Set(info.named ?? []),
85096
+ defaultOrNamespace: info.defaultOrNamespace,
85097
+ sideEffect: info.sideEffect ?? false
85098
+ });
85099
+ return this;
85100
+ }
85101
+ addImports(imports) {
85102
+ for (const imp of imports)this.addImport(imp);
85103
+ }
85104
+ generateImportStatements() {
85105
+ const importLines = [];
85106
+ const sortedPackages = Array.from(this.collectedImports.keys()).sort((a, b)=>{
85107
+ const isABuild = a.startsWith("@hot-updater/");
85108
+ const isBBuild = b.startsWith("@hot-updater/");
85109
+ if (isABuild !== isBBuild) return isABuild ? -1 : 1;
85110
+ if ("dotenv/config" === a) return -1;
85111
+ if ("dotenv/config" === b) return 1;
85112
+ const isAdminA = "firebase-admin" === a;
85113
+ const isAdminB = "firebase-admin" === b;
85114
+ if (isAdminA !== isAdminB) return isAdminA ? -1 : 1;
85115
+ return a.localeCompare(b);
85116
+ });
85117
+ for (const pkg of sortedPackages){
85118
+ const info = this.collectedImports.get(pkg);
85119
+ if (info.sideEffect) importLines.push(`import "${pkg}";`);
85120
+ else if (info.defaultOrNamespace) if ("firebase-admin" === pkg && info.named.size > 0) importLines.push(`import ${info.defaultOrNamespace}, { ${Array.from(info.named).sort().join(", ")} } from "${pkg}";`);
85121
+ else importLines.push(`import ${info.defaultOrNamespace} from "${pkg}";`);
85122
+ else if (info.named.size > 0) {
85123
+ const namedPart = Array.from(info.named).sort().join(", ");
85124
+ importLines.push(`import { ${namedPart} } from "${pkg}";`);
85125
+ }
85126
+ }
85127
+ return importLines.join("\n");
85128
+ }
85129
+ generateBuildConfigString() {
85130
+ if (!this.buildType) throw new Error("Build type must be set using .setBuildType()");
85131
+ switch(this.buildType){
85132
+ case "bare":
85133
+ return "bare({ enableHermes: true })";
85134
+ case "rnef":
85135
+ return "rnef()";
85136
+ default:
85137
+ throw new Error(`Invalid build type: ${this.buildType}`);
85138
+ }
85139
+ }
85140
+ setBuildType(buildType) {
85141
+ if (this.buildType) console.warn("Build type is being set multiple times. Overwriting previous value.");
85142
+ this.buildType = buildType;
85143
+ this.addImport({
85144
+ pkg: `@hot-updater/${buildType}`,
85145
+ named: [
85146
+ buildType
85147
+ ]
85148
+ });
85149
+ return this;
85150
+ }
85151
+ setStorage(storageConfig) {
85152
+ this.storageInfo = storageConfig;
85153
+ this.addImports(storageConfig.imports);
85154
+ if (storageConfig.imports.some((imp)=>imp.pkg.includes("firebase"))) this.addImport({
85155
+ pkg: "firebase-admin",
85156
+ defaultOrNamespace: "* as admin"
85157
+ });
85158
+ return this;
85159
+ }
85160
+ setDatabase(databaseConfig) {
85161
+ this.databaseInfo = databaseConfig;
85162
+ this.addImports(databaseConfig.imports);
85163
+ if (databaseConfig.imports.some((imp)=>imp.pkg.includes("firebase"))) this.addImport({
85164
+ pkg: "firebase-admin",
85165
+ defaultOrNamespace: "* as admin"
85166
+ });
85167
+ return this;
85168
+ }
85169
+ setIntermediateCode(code) {
85170
+ this.intermediateCode = code.trim();
85171
+ return this;
85172
+ }
85173
+ getResult() {
85174
+ if (!this.buildType) throw new Error("Build type must be set using .setBuildType()");
85175
+ if (!this.storageInfo) throw new Error("Storage config must be set using .setStorage()");
85176
+ if (!this.databaseInfo) throw new Error("Database config must be set using .setDatabase()");
85177
+ const importStatements = this.generateImportStatements();
85178
+ const buildConfigString = this.generateBuildConfigString();
85179
+ return `
85180
+ ${importStatements}
85181
+
85182
+ ${this.intermediateCode ? `${this.intermediateCode}\n` : ""}
85183
+ export default defineConfig({
85184
+ build: ${buildConfigString},
85185
+ storage: ${this.storageInfo.configString},
85186
+ database: ${this.databaseInfo.configString},
85187
+ });
85188
+ `.trim();
85189
+ }
85190
+ }
85191
+ export { ConfigBuilder, banner, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createZip, createZipTargetFiles, getCwd, banner_link as link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate, transformTsEnv };