@hot-updater/plugin-core 0.18.1 → 0.18.2

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.cjs CHANGED
@@ -104,7 +104,7 @@ var require_picocolors = __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1
104
104
 
105
105
  //#endregion
106
106
  //#region src/log.ts
107
- var import_picocolors$1 = __toESM(require_picocolors(), 1);
107
+ var import_picocolors$1 = __toESM(require_picocolors());
108
108
  const log = {
109
109
  normal: (message) => console.log(message),
110
110
  success: (message) => console.log(import_picocolors$1.default.green(message)),
@@ -159,7 +159,7 @@ var require_transitiveDeps = __commonJS({ "../../node_modules/.pnpm/workspace-to
159
159
  exports.getTransitiveProviders = exports.getTransitiveConsumers = exports.getDependentMap = void 0;
160
160
  const getPackageDependencies_1$2 = require_getPackageDependencies();
161
161
  const isCachingEnabled_1$4 = require_isCachingEnabled();
162
- const graphCache = new Map();
162
+ const graphCache = /* @__PURE__ */ new Map();
163
163
  function memoizedKey(packages, scope = []) {
164
164
  return JSON.stringify({
165
165
  packages,
@@ -171,7 +171,7 @@ var require_transitiveDeps = __commonJS({ "../../node_modules/.pnpm/workspace-to
171
171
  const key = memoizedKey(packages, scope);
172
172
  if ((0, isCachingEnabled_1$4.isCachingEnabled)() && graphCache.has(key)) return graphCache.get(key);
173
173
  const edges = [];
174
- const visited = new Set();
174
+ const visited = /* @__PURE__ */ new Set();
175
175
  const stack = scope.length > 0 ? [...scope] : Object.keys(packages);
176
176
  while (stack.length > 0) {
177
177
  const pkg = stack.pop();
@@ -190,9 +190,9 @@ var require_transitiveDeps = __commonJS({ "../../node_modules/.pnpm/workspace-to
190
190
  }
191
191
  function getDependentMap$1(packages) {
192
192
  const graph = getPackageGraph(packages);
193
- const map = new Map();
193
+ const map = /* @__PURE__ */ new Map();
194
194
  for (const [from, to] of graph) {
195
- if (!map.has(to)) map.set(to, new Set());
195
+ if (!map.has(to)) map.set(to, /* @__PURE__ */ new Set());
196
196
  if (from) map.get(to).add(from);
197
197
  }
198
198
  return map;
@@ -206,7 +206,7 @@ var require_transitiveDeps = __commonJS({ "../../node_modules/.pnpm/workspace-to
206
206
  function getTransitiveConsumers(targets, packages, scope = []) {
207
207
  const graph = getPackageGraph(packages, scope);
208
208
  const pkgQueue = [...targets];
209
- const visited = new Set();
209
+ const visited = /* @__PURE__ */ new Set();
210
210
  while (pkgQueue.length > 0) {
211
211
  const pkg = pkgQueue.shift();
212
212
  if (!visited.has(pkg)) {
@@ -226,7 +226,7 @@ var require_transitiveDeps = __commonJS({ "../../node_modules/.pnpm/workspace-to
226
226
  function getTransitiveProviders(targets, packages) {
227
227
  const graph = getPackageGraph(packages);
228
228
  const pkgQueue = [...targets];
229
- const visited = new Set();
229
+ const visited = /* @__PURE__ */ new Set();
230
230
  while (pkgQueue.length > 0) {
231
231
  const pkg = pkgQueue.shift();
232
232
  if (!visited.has(pkg)) {
@@ -1308,7 +1308,7 @@ var require_gitUtilities = __commonJS({ "../../node_modules/.pnpm/workspace-tool
1308
1308
  }
1309
1309
  exports.stageAndCommit = stageAndCommit;
1310
1310
  function revertLocalChanges(cwd) {
1311
- const stash = `workspace-tools_${new Date().getTime()}`;
1311
+ const stash = `workspace-tools_${(/* @__PURE__ */ new Date()).getTime()}`;
1312
1312
  (0, git_1$3.git)([
1313
1313
  "stash",
1314
1314
  "push",
@@ -1550,7 +1550,7 @@ var require_getWorkspaceManagerAndRoot = __commonJS({ "../../node_modules/.pnpm/
1550
1550
  const path_1$10 = __importDefault$13(require("path"));
1551
1551
  const paths_1$1 = require_paths();
1552
1552
  const isCachingEnabled_1$3 = require_isCachingEnabled();
1553
- const workspaceCache = new Map();
1553
+ const workspaceCache = /* @__PURE__ */ new Map();
1554
1554
  /**
1555
1555
  * Files indicating the workspace root for each manager.
1556
1556
  *
@@ -4638,9 +4638,9 @@ var require_micromatch$1 = __commonJS({ "../../node_modules/.pnpm/micromatch@4.0
4638
4638
  const micromatch$2 = (list, patterns, options) => {
4639
4639
  patterns = [].concat(patterns);
4640
4640
  list = [].concat(list);
4641
- let omit = new Set();
4642
- let keep = new Set();
4643
- let items = new Set();
4641
+ let omit = /* @__PURE__ */ new Set();
4642
+ let keep = /* @__PURE__ */ new Set();
4643
+ let items = /* @__PURE__ */ new Set();
4644
4644
  let negatives = 0;
4645
4645
  let onResult = (state) => {
4646
4646
  items.add(state.output);
@@ -4734,7 +4734,7 @@ var require_micromatch$1 = __commonJS({ "../../node_modules/.pnpm/micromatch@4.0
4734
4734
  */
4735
4735
  micromatch$2.not = (list, patterns, options = {}) => {
4736
4736
  patterns = [].concat(patterns).map(String);
4737
- let result = new Set();
4737
+ let result = /* @__PURE__ */ new Set();
4738
4738
  let items = [];
4739
4739
  let onResult = (state) => {
4740
4740
  if (options.onResult) options.onResult(state);
@@ -6355,7 +6355,7 @@ var require_sync$3 = __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2
6355
6355
  super(...arguments);
6356
6356
  this._scandir = fsScandir$1.scandirSync;
6357
6357
  this._storage = [];
6358
- this._queue = new Set();
6358
+ this._queue = /* @__PURE__ */ new Set();
6359
6359
  }
6360
6360
  read() {
6361
6361
  this._pushToQueue(this._root, this._settings.basePath);
@@ -6742,7 +6742,7 @@ var require_entry$1 = __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.2/nod
6742
6742
  constructor(_settings, _micromatchOptions) {
6743
6743
  this._settings = _settings;
6744
6744
  this._micromatchOptions = _micromatchOptions;
6745
- this.index = new Map();
6745
+ this.index = /* @__PURE__ */ new Map();
6746
6746
  }
6747
6747
  getFilter(positive, negative) {
6748
6748
  const positiveRe = utils$36.pattern.convertPatternsToRe(positive, this._micromatchOptions);
@@ -11063,16 +11063,16 @@ var require_createDependencyMap = __commonJS({ "../../node_modules/.pnpm/workspa
11063
11063
  withPeerDependencies: false
11064
11064
  }) {
11065
11065
  const map = {
11066
- dependencies: new Map(),
11067
- dependents: new Map()
11066
+ dependencies: /* @__PURE__ */ new Map(),
11067
+ dependents: /* @__PURE__ */ new Map()
11068
11068
  };
11069
11069
  const internalPackages = new Set(Object.keys(packages));
11070
11070
  for (const [pkg, info] of Object.entries(packages)) {
11071
11071
  const deps = (0, getPackageDependencies_1.getPackageDependencies)(info, internalPackages, options);
11072
11072
  for (const dep of deps) {
11073
- if (!map.dependencies.has(pkg)) map.dependencies.set(pkg, new Set());
11073
+ if (!map.dependencies.has(pkg)) map.dependencies.set(pkg, /* @__PURE__ */ new Set());
11074
11074
  map.dependencies.get(pkg).add(dep);
11075
- if (!map.dependents.has(dep)) map.dependents.set(dep, new Set());
11075
+ if (!map.dependents.has(dep)) map.dependents.set(dep, /* @__PURE__ */ new Set());
11076
11076
  map.dependents.get(dep).add(pkg);
11077
11077
  }
11078
11078
  }
@@ -11816,9 +11816,9 @@ var require_micromatch = __commonJS({ "../../node_modules/.pnpm/micromatch@4.0.8
11816
11816
  const micromatch = (list, patterns, options) => {
11817
11817
  patterns = [].concat(patterns);
11818
11818
  list = [].concat(list);
11819
- let omit = new Set();
11820
- let keep = new Set();
11821
- let items = new Set();
11819
+ let omit = /* @__PURE__ */ new Set();
11820
+ let keep = /* @__PURE__ */ new Set();
11821
+ let items = /* @__PURE__ */ new Set();
11822
11822
  let negatives = 0;
11823
11823
  let onResult = (state) => {
11824
11824
  items.add(state.output);
@@ -11912,7 +11912,7 @@ var require_micromatch = __commonJS({ "../../node_modules/.pnpm/micromatch@4.0.8
11912
11912
  */
11913
11913
  micromatch.not = (list, patterns, options = {}) => {
11914
11914
  patterns = [].concat(patterns).map(String);
11915
- let result = new Set();
11915
+ let result = /* @__PURE__ */ new Set();
11916
11916
  let items = [];
11917
11917
  let onResult = (state) => {
11918
11918
  if (options.onResult) options.onResult(state);
@@ -12194,10 +12194,10 @@ var require_createPackageGraph = __commonJS({ "../../node_modules/.pnpm/workspac
12194
12194
  const micromatch_1$2 = __importDefault$4(require_micromatch());
12195
12195
  function createPackageGraph(packages, filters) {
12196
12196
  /** set of packages being accumulated as the graph is filtered */
12197
- const packageSet = new Set();
12197
+ const packageSet = /* @__PURE__ */ new Set();
12198
12198
  /** array of package names & its dependency being accumulated as the graph is filtered */
12199
12199
  const edges = [];
12200
- const edgeKeys = new Set();
12200
+ const edgeKeys = /* @__PURE__ */ new Set();
12201
12201
  let dependencyMapWithPeerDevDeps = void 0;
12202
12202
  let dependencyMapWithPeerDeps = void 0;
12203
12203
  let dependencyMapWithDevDeps = void 0;
@@ -12268,13 +12268,13 @@ var require_createPackageGraph = __commonJS({ "../../node_modules/.pnpm/workspac
12268
12268
  }
12269
12269
  exports.createPackageGraph = createPackageGraph;
12270
12270
  function visitPackageGraph(packages, dependencyMap, visitor, filter) {
12271
- const visited = new Set();
12271
+ const visited = /* @__PURE__ */ new Set();
12272
12272
  const packageNames = Object.keys(packages);
12273
12273
  const stack = filter ? (0, micromatch_1$2.default)(packageNames, filter.namePatterns) : packageNames;
12274
12274
  while (stack.length > 0) {
12275
12275
  const pkg = stack.pop();
12276
12276
  if (visited.has(pkg)) continue;
12277
- const nextPkgs = new Set();
12277
+ const nextPkgs = /* @__PURE__ */ new Set();
12278
12278
  let dependencies = [];
12279
12279
  let dependents = [];
12280
12280
  if (!filter || filter.includeDependencies) {
@@ -12686,7 +12686,7 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
12686
12686
  };
12687
12687
  })();
12688
12688
  const artifactFiles = new Set(events.artifactFiles || []);
12689
- const files = new Set();
12689
+ const files = /* @__PURE__ */ new Set();
12690
12690
  for (var _iterator = queue$1, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
12691
12691
  var _ref2;
12692
12692
  if (_isArray) {
@@ -12890,7 +12890,7 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
12890
12890
  };
12891
12891
  })();
12892
12892
  const artifactFiles = new Set(events.artifactFiles || []);
12893
- const files = new Set();
12893
+ const files = /* @__PURE__ */ new Set();
12894
12894
  for (var _iterator7 = queue$1, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
12895
12895
  var _ref10;
12896
12896
  if (_isArray7) {
@@ -12958,14 +12958,14 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
12958
12958
  const events = {
12959
12959
  onStart: _events && _events.onStart || noop$1,
12960
12960
  onProgress: _events && _events.onProgress || noop$1,
12961
- possibleExtraneous: _events ? _events.possibleExtraneous : new Set(),
12961
+ possibleExtraneous: _events ? _events.possibleExtraneous : /* @__PURE__ */ new Set(),
12962
12962
  ignoreBasenames: _events && _events.ignoreBasenames || [],
12963
12963
  artifactFiles: _events && _events.artifactFiles || []
12964
12964
  };
12965
12965
  const actions = yield buildActionsForCopy(queue$1, events, events.possibleExtraneous, reporter);
12966
12966
  events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
12967
12967
  const fileActions = actions.file;
12968
- const currentlyWriting = new Map();
12968
+ const currentlyWriting = /* @__PURE__ */ new Map();
12969
12969
  yield (_promise || _load_promise()).queue(fileActions, (() => {
12970
12970
  var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
12971
12971
  let writePromise;
@@ -12998,7 +12998,7 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
12998
12998
  const events = {
12999
12999
  onStart: _events && _events.onStart || noop$1,
13000
13000
  onProgress: _events && _events.onProgress || noop$1,
13001
- possibleExtraneous: _events ? _events.possibleExtraneous : new Set(),
13001
+ possibleExtraneous: _events ? _events.possibleExtraneous : /* @__PURE__ */ new Set(),
13002
13002
  artifactFiles: _events && _events.artifactFiles || [],
13003
13003
  ignoreBasenames: []
13004
13004
  };
@@ -13115,7 +13115,7 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
13115
13115
  };
13116
13116
  })();
13117
13117
  let walk$1 = exports$1.walk = (() => {
13118
- var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) {
13118
+ var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = /* @__PURE__ */ new Set()) {
13119
13119
  let files = [];
13120
13120
  let filenames = yield readdir$2(dir);
13121
13121
  if (ignoreBasenames.size) filenames = filenames.filter(function(name) {
@@ -13750,7 +13750,7 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
13750
13750
  }
13751
13751
  getLockfile(patterns) {
13752
13752
  const lockfile = {};
13753
- const seen = new Map();
13753
+ const seen = /* @__PURE__ */ new Map();
13754
13754
  const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha);
13755
13755
  for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
13756
13756
  var _ref;
@@ -16246,7 +16246,7 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
16246
16246
  function debug$1() {
16247
16247
  if (!debug$1.enabled) return;
16248
16248
  var self$1 = debug$1;
16249
- var curr = +new Date();
16249
+ var curr = +/* @__PURE__ */ new Date();
16250
16250
  var ms = curr - (prevTime || curr);
16251
16251
  self$1.diff = ms;
16252
16252
  self$1.prev = prevTime;
@@ -18426,7 +18426,7 @@ var require_lockfile$1 = __commonJS({ "../../node_modules/.pnpm/@yarnpkg+lockfil
18426
18426
  }
18427
18427
  function getDate() {
18428
18428
  if (exports$1.inspectOpts.hideDate) return "";
18429
- else return new Date().toISOString() + " ";
18429
+ else return (/* @__PURE__ */ new Date()).toISOString() + " ";
18430
18430
  }
18431
18431
  /**
18432
18432
  * Invokes `util.format()` with the specified arguments and writes to stderr.
@@ -19517,7 +19517,7 @@ var require_scope = __commonJS({ "../../node_modules/.pnpm/workspace-tools@0.36.
19517
19517
  */
19518
19518
  function getScopedPackages(search, packages) {
19519
19519
  const packageNames = Array.isArray(packages) ? packages : Object.keys(packages);
19520
- const results = new Set();
19520
+ const results = /* @__PURE__ */ new Set();
19521
19521
  const scopedSearch = search.filter((needle) => needle.startsWith("@") || needle.startsWith("!@"));
19522
19522
  if (scopedSearch.length > 0) {
19523
19523
  const matched = (0, micromatch_1$1.default)(packageNames, scopedSearch, { nocase: true });
@@ -19634,7 +19634,7 @@ var require_getPackagesByFiles = __commonJS({ "../../node_modules/.pnpm/workspac
19634
19634
  const workspaceInfo = (0, getWorkspaces_1.getWorkspaces)(workspaceRoot);
19635
19635
  const ignoreSet = new Set((0, micromatch_1.default)(files, ignoreGlobs));
19636
19636
  files = files.filter((change) => !ignoreSet.has(change));
19637
- const packages = new Set();
19637
+ const packages = /* @__PURE__ */ new Set();
19638
19638
  for (const file of files) {
19639
19639
  const candidates = workspaceInfo.filter((pkgPath) => file.indexOf(path_1$1.default.relative(workspaceRoot, pkgPath.path).replace(/\\/g, "/")) === 0);
19640
19640
  if (candidates && candidates.length > 0) {
@@ -19739,7 +19739,7 @@ var require_getAllPackageJsonFiles = __commonJS({ "../../node_modules/.pnpm/work
19739
19739
  const path_1 = __importDefault(require("path"));
19740
19740
  const getWorkspacePackagePaths_1 = require_getWorkspacePackagePaths();
19741
19741
  const isCachingEnabled_1$1 = require_isCachingEnabled();
19742
- const cache = new Map();
19742
+ const cache = /* @__PURE__ */ new Map();
19743
19743
  /**
19744
19744
  * Get paths to every package.json in the workspace, given a cwd.
19745
19745
  */
@@ -19856,7 +19856,7 @@ var require_lib$3 = __commonJS({ "../../node_modules/.pnpm/workspace-tools@0.36.
19856
19856
 
19857
19857
  //#endregion
19858
19858
  //#region src/cwd.ts
19859
- var import_lib$1 = __toESM(require_lib$3(), 1);
19859
+ var import_lib$1 = __toESM(require_lib$3());
19860
19860
  const getCwd = () => (0, import_lib$1.findPackageRoot)(process.cwd());
19861
19861
 
19862
19862
  //#endregion
@@ -19888,7 +19888,7 @@ function orderBy(arr, criteria, orders) {
19888
19888
  //#endregion
19889
19889
  //#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/memoize.mjs
19890
19890
  function memoize(fn, options = {}) {
19891
- const { cache: cache$1 = new Map(), getCacheKey } = options;
19891
+ const { cache: cache$1 = /* @__PURE__ */ new Map(), getCacheKey } = options;
19892
19892
  const memoizedFn = function(arg) {
19893
19893
  const key = getCacheKey ? getCacheKey(arg) : arg;
19894
19894
  if (cache$1.has(key)) return cache$1.get(key);
@@ -20033,7 +20033,7 @@ const copyDirToTmp = async (dir, childDirname) => {
20033
20033
  * @returns A function that creates a database plugin instance
20034
20034
  */
20035
20035
  function createDatabasePlugin(name, abstractPlugin, hooks) {
20036
- const changedMap = new Map();
20036
+ const changedMap = /* @__PURE__ */ new Map();
20037
20037
  const markChanged = (operation, data) => {
20038
20038
  changedMap.set(data.id, {
20039
20039
  operation,
@@ -20098,7 +20098,7 @@ function ansiRegex$1({ onlyFirst = false } = {}) {
20098
20098
  //#endregion
20099
20099
  //#region ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
20100
20100
  const regex = ansiRegex$1();
20101
- function stripAnsi$1(string$1) {
20101
+ function stripAnsi(string$1) {
20102
20102
  if (typeof string$1 !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string$1}\``);
20103
20103
  return string$1.replace(regex, "");
20104
20104
  }
@@ -20139,10 +20139,10 @@ var require_emoji_regex$1 = __commonJS({ "../../node_modules/.pnpm/emoji-regex@1
20139
20139
  var import_emoji_regex = __toESM(require_emoji_regex$1(), 1);
20140
20140
  const segmenter = new Intl.Segmenter();
20141
20141
  const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
20142
- function stringWidth$2(string$1, options = {}) {
20142
+ function stringWidth(string$1, options = {}) {
20143
20143
  if (typeof string$1 !== "string" || string$1.length === 0) return 0;
20144
20144
  const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
20145
- if (!countAnsiEscapeCodes) string$1 = stripAnsi$1(string$1);
20145
+ if (!countAnsiEscapeCodes) string$1 = stripAnsi(string$1);
20146
20146
  if (string$1.length === 0) return 0;
20147
20147
  let width = 0;
20148
20148
  const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
@@ -20227,7 +20227,7 @@ const foregroundColorNames$1 = Object.keys(styles$2.color);
20227
20227
  const backgroundColorNames$1 = Object.keys(styles$2.bgColor);
20228
20228
  const colorNames$1 = [...foregroundColorNames$1, ...backgroundColorNames$1];
20229
20229
  function assembleStyles$1() {
20230
- const codes = new Map();
20230
+ const codes = /* @__PURE__ */ new Map();
20231
20231
  for (const [groupName, group] of Object.entries(styles$2)) {
20232
20232
  for (const [styleName, style] of Object.entries(group)) {
20233
20233
  styles$2[styleName] = {
@@ -20576,7 +20576,7 @@ var source_default = chalk;
20576
20576
  //#region ../../node_modules/.pnpm/widest-line@5.0.0/node_modules/widest-line/index.js
20577
20577
  function widestLine(string$1) {
20578
20578
  let lineWidth = 0;
20579
- for (const line of string$1.split("\n")) lineWidth = Math.max(lineWidth, stringWidth$2(line));
20579
+ for (const line of string$1.split("\n")) lineWidth = Math.max(lineWidth, stringWidth(line));
20580
20580
  return lineWidth;
20581
20581
  }
20582
20582
 
@@ -20784,12 +20784,12 @@ var require_emoji_regex = __commonJS({ "../../node_modules/.pnpm/emoji-regex@8.0
20784
20784
  //#endregion
20785
20785
  //#region ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
20786
20786
  var require_string_width = __commonJS({ "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports, module) {
20787
- const stripAnsi = require_strip_ansi();
20787
+ const stripAnsi$1 = require_strip_ansi();
20788
20788
  const isFullwidthCodePoint = require_is_fullwidth_code_point();
20789
20789
  const emojiRegex = require_emoji_regex();
20790
- const stringWidth$1 = (string$1) => {
20790
+ const stringWidth$2 = (string$1) => {
20791
20791
  if (typeof string$1 !== "string" || string$1.length === 0) return 0;
20792
- string$1 = stripAnsi(string$1);
20792
+ string$1 = stripAnsi$1(string$1);
20793
20793
  if (string$1.length === 0) return 0;
20794
20794
  string$1 = string$1.replace(emojiRegex(), " ");
20795
20795
  let width = 0;
@@ -20802,14 +20802,14 @@ var require_string_width = __commonJS({ "../../node_modules/.pnpm/string-width@4
20802
20802
  }
20803
20803
  return width;
20804
20804
  };
20805
- module.exports = stringWidth$1;
20806
- module.exports.default = stringWidth$1;
20805
+ module.exports = stringWidth$2;
20806
+ module.exports.default = stringWidth$2;
20807
20807
  } });
20808
20808
 
20809
20809
  //#endregion
20810
20810
  //#region ../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js
20811
20811
  var require_ansi_align = __commonJS({ "../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js"(exports, module) {
20812
- const stringWidth = require_string_width();
20812
+ const stringWidth$1 = require_string_width();
20813
20813
  function ansiAlign$1(text, opts) {
20814
20814
  if (!text) return text;
20815
20815
  opts = opts || {};
@@ -20827,7 +20827,7 @@ var require_ansi_align = __commonJS({ "../../node_modules/.pnpm/ansi-align@3.0.1
20827
20827
  let maxWidth = 0;
20828
20828
  text = text.map(function(str) {
20829
20829
  str = String(str);
20830
- width = stringWidth(str);
20830
+ width = stringWidth$1(str);
20831
20831
  maxWidth = Math.max(width, maxWidth);
20832
20832
  return {
20833
20833
  str,
@@ -20920,7 +20920,7 @@ const foregroundColorNames = Object.keys(styles.color);
20920
20920
  const backgroundColorNames = Object.keys(styles.bgColor);
20921
20921
  const colorNames = [...foregroundColorNames, ...backgroundColorNames];
20922
20922
  function assembleStyles() {
20923
- const codes = new Map();
20923
+ const codes = /* @__PURE__ */ new Map();
20924
20924
  for (const [groupName, group] of Object.entries(styles)) {
20925
20925
  for (const [styleName, style] of Object.entries(group)) {
20926
20926
  styles[styleName] = {
@@ -21033,14 +21033,14 @@ const ANSI_SGR_TERMINATOR = "m";
21033
21033
  const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
21034
21034
  const wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
21035
21035
  const wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
21036
- const wordLengths = (string$1) => string$1.split(" ").map((character) => stringWidth$2(character));
21036
+ const wordLengths = (string$1) => string$1.split(" ").map((character) => stringWidth(character));
21037
21037
  const wrapWord = (rows, word, columns) => {
21038
21038
  const characters = [...word];
21039
21039
  let isInsideEscape = false;
21040
21040
  let isInsideLinkEscape = false;
21041
- let visible = stringWidth$2(stripAnsi$1(rows.at(-1)));
21041
+ let visible = stringWidth(stripAnsi(rows.at(-1)));
21042
21042
  for (const [index, character] of characters.entries()) {
21043
- const characterLength = stringWidth$2(character);
21043
+ const characterLength = stringWidth(character);
21044
21044
  if (visible + characterLength <= columns) rows[rows.length - 1] += character;
21045
21045
  else {
21046
21046
  rows.push(character);
@@ -21072,7 +21072,7 @@ const stringVisibleTrimSpacesRight = (string$1) => {
21072
21072
  const words = string$1.split(" ");
21073
21073
  let last = words.length;
21074
21074
  while (last > 0) {
21075
- if (stringWidth$2(words[last - 1]) > 0) break;
21075
+ if (stringWidth(words[last - 1]) > 0) break;
21076
21076
  last--;
21077
21077
  }
21078
21078
  if (last === words.length) return string$1;
@@ -21087,7 +21087,7 @@ const exec = (string$1, columns, options = {}) => {
21087
21087
  let rows = [""];
21088
21088
  for (const [index, word] of string$1.split(" ").entries()) {
21089
21089
  if (options.trim !== false) rows[rows.length - 1] = rows.at(-1).trimStart();
21090
- let rowLength = stringWidth$2(rows.at(-1));
21090
+ let rowLength = stringWidth(rows.at(-1));
21091
21091
  if (index !== 0) {
21092
21092
  if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
21093
21093
  rows.push("");
@@ -21211,7 +21211,7 @@ const getBorderChars = (borderStyle) => {
21211
21211
  };
21212
21212
  const makeTitle = (text, horizontal, alignment) => {
21213
21213
  let title = "";
21214
- const textWidth = stringWidth$2(text);
21214
+ const textWidth = stringWidth(text);
21215
21215
  switch (alignment) {
21216
21216
  case "left": {
21217
21217
  title = text + horizontal.slice(textWidth);
@@ -21246,7 +21246,7 @@ const makeContentText = (text, { padding, width, textAlignment, height }) => {
21246
21246
  const createdLines = wrapAnsi(line, max, { hard: true });
21247
21247
  const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
21248
21248
  const alignedLinesArray = alignedLines.split("\n");
21249
- const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth$2(s)));
21249
+ const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
21250
21250
  for (const alignedLine of alignedLinesArray) {
21251
21251
  let paddedLine;
21252
21252
  switch (textAlignment) {
@@ -21274,7 +21274,7 @@ const makeContentText = (text, { padding, width, textAlignment, height }) => {
21274
21274
  const paddingRight = PAD.repeat(padding.right);
21275
21275
  lines = lines.map((line) => {
21276
21276
  const newLine = paddingLeft + line + paddingRight;
21277
- return newLine + PAD.repeat(width - stringWidth$2(newLine));
21277
+ return newLine + PAD.repeat(width - stringWidth(newLine));
21278
21278
  });
21279
21279
  if (padding.top > 0) lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
21280
21280
  if (padding.bottom > 0) lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
@@ -21336,7 +21336,7 @@ const determineDimensions = (text, options) => {
21336
21336
  options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
21337
21337
  if (options.title) {
21338
21338
  options.title = formatTitle(options.title, options.borderStyle);
21339
- if (stringWidth$2(options.title) > widest) options.width = stringWidth$2(options.title);
21339
+ if (stringWidth(options.title) > widest) options.width = stringWidth(options.title);
21340
21340
  }
21341
21341
  }
21342
21342
  options.width ||= widest;
@@ -21385,7 +21385,7 @@ function boxen(text, options) {
21385
21385
 
21386
21386
  //#endregion
21387
21387
  //#region src/banner.ts
21388
- var import_picocolors = __toESM(require_picocolors(), 1);
21388
+ var import_picocolors = __toESM(require_picocolors());
21389
21389
  const link = (url) => {
21390
21390
  return import_picocolors.default.green(import_picocolors.default.underline(url));
21391
21391
  };
@@ -21437,7 +21437,7 @@ const makeEnv = async (newEnvVars, filePath = ".env") => {
21437
21437
  try {
21438
21438
  const existingContent = await fs_promises.default.readFile(filePath, "utf-8").catch(() => "");
21439
21439
  const lines = existingContent ? existingContent.split("\n") : [];
21440
- const processedKeys = new Set();
21440
+ const processedKeys = /* @__PURE__ */ new Set();
21441
21441
  const updatedLines = [];
21442
21442
  for (let i$3 = 0; i$3 < lines.length; i$3++) {
21443
21443
  const line = lines[i$3] ?? "";
@@ -29510,7 +29510,7 @@ var require_object = __commonJS({ "../../node_modules/.pnpm/jszip@3.10.1/node_mo
29510
29510
  var fileAdd = function(name, data, originalOptions) {
29511
29511
  var dataType = utils$9.getTypeOf(data), parent;
29512
29512
  var o = utils$9.extend(originalOptions || {}, defaults);
29513
- o.date = o.date || new Date();
29513
+ o.date = o.date || /* @__PURE__ */ new Date();
29514
29514
  if (o.compression !== null) o.compression = o.compression.toUpperCase();
29515
29515
  if (typeof o.unixPermissions === "string") o.unixPermissions = parseInt(o.unixPermissions, 8);
29516
29516
  if (o.unixPermissions && o.unixPermissions & 16384) o.dir = true;
@@ -30282,7 +30282,7 @@ var require_lib = __commonJS({ "../../node_modules/.pnpm/jszip@3.10.1/node_modul
30282
30282
 
30283
30283
  //#endregion
30284
30284
  //#region src/createZip.ts
30285
- var import_lib = __toESM(require_lib(), 1);
30285
+ var import_lib = __toESM(require_lib());
30286
30286
  const createZipTargetFiles = async ({ outfile, targetFiles }) => {
30287
30287
  const zip$1 = new import_lib.default();
30288
30288
  await fs_promises.default.rm(outfile, { force: true });
@@ -30343,7 +30343,7 @@ const createZip = async ({ outfile, targetDir, excludeExts = [] }) => {
30343
30343
  }
30344
30344
  await addFiles(targetDir, zip$1);
30345
30345
  zip$1.forEach((_, file) => {
30346
- file.date = new Date(0);
30346
+ file.date = /* @__PURE__ */ new Date(0);
30347
30347
  });
30348
30348
  const content = await zip$1.generateAsync({
30349
30349
  type: "nodebuffer",
@@ -30355,6 +30355,33 @@ const createZip = async ({ outfile, targetDir, excludeExts = [] }) => {
30355
30355
  return outfile;
30356
30356
  };
30357
30357
 
30358
+ //#endregion
30359
+ //#region src/calculatePagination.ts
30360
+ /**
30361
+ * Calculate pagination information based on total count, limit, and offset
30362
+ */
30363
+ function calculatePagination(total, options) {
30364
+ const { limit, offset } = options;
30365
+ if (total === 0) return {
30366
+ total: 0,
30367
+ hasNextPage: false,
30368
+ hasPreviousPage: false,
30369
+ currentPage: 1,
30370
+ totalPages: 0
30371
+ };
30372
+ const currentPage = Math.floor(offset / limit) + 1;
30373
+ const totalPages = Math.ceil(total / limit);
30374
+ const hasNextPage = offset + limit < total;
30375
+ const hasPreviousPage = offset > 0;
30376
+ return {
30377
+ total,
30378
+ hasNextPage,
30379
+ hasPreviousPage,
30380
+ currentPage,
30381
+ totalPages
30382
+ };
30383
+ }
30384
+
30358
30385
  //#endregion
30359
30386
  //#region src/createBlobDatabasePlugin.ts
30360
30387
  function removeBundleInternalKeys(bundle) {
@@ -30373,8 +30400,8 @@ function removeBundleInternalKeys(bundle) {
30373
30400
  * @returns
30374
30401
  */
30375
30402
  const createBlobDatabasePlugin = ({ name, getContext, listObjects, loadObject, uploadObject, deleteObject, invalidatePaths, hooks, apiBasePath }) => {
30376
- const bundlesMap = new Map();
30377
- const pendingBundlesMap = new Map();
30403
+ const bundlesMap = /* @__PURE__ */ new Map();
30404
+ const pendingBundlesMap = /* @__PURE__ */ new Map();
30378
30405
  const PLATFORMS = ["ios", "android"];
30379
30406
  async function reloadBundles(context) {
30380
30407
  bundlesMap.clear();
@@ -30409,7 +30436,7 @@ const createBlobDatabasePlugin = ({ name, getContext, listObjects, loadObject, u
30409
30436
  acc[channel$1].push(key);
30410
30437
  return acc;
30411
30438
  }, {});
30412
- const updatedTargetFiles = new Set();
30439
+ const updatedTargetFiles = /* @__PURE__ */ new Set();
30413
30440
  for (const channel$1 of Object.keys(keysByChannel)) {
30414
30441
  const updateKeys = keysByChannel[channel$1];
30415
30442
  const targetKey = `${channel$1}/${platform}/target-app-versions.json`;
@@ -30446,24 +30473,38 @@ const createBlobDatabasePlugin = ({ name, getContext, listObjects, loadObject, u
30446
30473
  return bundles.find((bundle$1) => bundle$1.id === bundleId) ?? null;
30447
30474
  },
30448
30475
  async getBundles(context, options) {
30449
- let bundles = await reloadBundles(context);
30450
- const { where, limit, offset = 0 } = options ?? {};
30451
- if (where) bundles = bundles.filter((bundle) => {
30476
+ let allBundles = await reloadBundles(context);
30477
+ const { where, limit, offset } = options;
30478
+ if (where) allBundles = allBundles.filter((bundle) => {
30452
30479
  return Object.entries(where).every(([key, value]) => value === void 0 || value === null || bundle[key] === value);
30453
30480
  });
30454
- if (offset > 0) bundles = bundles.slice(offset);
30455
- if (limit) bundles = bundles.slice(0, limit);
30456
- return bundles.map(removeBundleInternalKeys);
30481
+ const total = allBundles.length;
30482
+ const cleanBundles = allBundles.map(removeBundleInternalKeys);
30483
+ let paginatedData = cleanBundles;
30484
+ if (offset > 0) paginatedData = paginatedData.slice(offset);
30485
+ if (limit) paginatedData = paginatedData.slice(0, limit);
30486
+ return {
30487
+ data: paginatedData,
30488
+ pagination: calculatePagination(total, {
30489
+ limit,
30490
+ offset
30491
+ })
30492
+ };
30457
30493
  },
30458
30494
  async getChannels(context) {
30459
- const allBundles = await this.getBundles(context);
30460
- return [...new Set(allBundles.map((bundle) => bundle.channel))];
30495
+ const allBundles = await reloadBundles(context);
30496
+ const total = allBundles.length;
30497
+ const result = await this.getBundles(context, {
30498
+ limit: total,
30499
+ offset: 0
30500
+ });
30501
+ return [...new Set(result.data.map((bundle) => bundle.channel))];
30461
30502
  },
30462
30503
  async commitBundle(context, { changedSets }) {
30463
30504
  if (changedSets.length === 0) return;
30464
30505
  const changedBundlesByKey = {};
30465
30506
  const removalsByKey = {};
30466
- const pathsToInvalidate = new Set();
30507
+ const pathsToInvalidate = /* @__PURE__ */ new Set();
30467
30508
  let isTargetAppVersionChanged = false;
30468
30509
  for (const { operation, data } of changedSets) {
30469
30510
  if (data.targetAppVersion !== void 0) isTargetAppVersionChanged = true;
@@ -30545,7 +30586,7 @@ const createBlobDatabasePlugin = ({ name, getContext, listObjects, loadObject, u
30545
30586
  currentBundles.sort((a, b) => b.id.localeCompare(a.id));
30546
30587
  await uploadObject(context, key, currentBundles);
30547
30588
  })();
30548
- const updatedTargetFilePaths = new Set();
30589
+ const updatedTargetFilePaths = /* @__PURE__ */ new Set();
30549
30590
  if (isTargetAppVersionChanged) for (const platform of PLATFORMS) {
30550
30591
  const updatedPaths = await updateTargetVersionsForPlatform(context, platform);
30551
30592
  for (const path$13 of updatedPaths) updatedTargetFilePaths.add(path$13);
@@ -30565,7 +30606,7 @@ var ConfigBuilder = class {
30565
30606
  storageInfo = null;
30566
30607
  databaseInfo = null;
30567
30608
  intermediateCode = "";
30568
- collectedImports = new Map();
30609
+ collectedImports = /* @__PURE__ */ new Map();
30569
30610
  constructor() {
30570
30611
  this.addImport({
30571
30612
  pkg: "dotenv/config",
@@ -30680,6 +30721,7 @@ export default defineConfig({
30680
30721
  //#endregion
30681
30722
  exports.ConfigBuilder = ConfigBuilder;
30682
30723
  exports.banner = banner;
30724
+ exports.calculatePagination = calculatePagination;
30683
30725
  exports.copyDirToTmp = copyDirToTmp;
30684
30726
  exports.createBlobDatabasePlugin = createBlobDatabasePlugin;
30685
30727
  exports.createDatabasePlugin = createDatabasePlugin;