@hot-updater/plugin-core 0.20.3 → 0.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -16396,7 +16396,7 @@ const getDefaultPlatformConfig = () => {
16396
16396
  const getDefaultConfig = () => {
16397
16397
  return {
16398
16398
  releaseChannel: "production",
16399
- updateStrategy: "fingerprint",
16399
+ updateStrategy: "appVersion",
16400
16400
  fingerprint: {
16401
16401
  extraSources: [],
16402
16402
  ignorePaths: []
@@ -16803,7 +16803,6 @@ function assembleStyles$1() {
16803
16803
  return styles$2;
16804
16804
  }
16805
16805
  const ansiStyles$1 = assembleStyles$1();
16806
- var ansi_styles_default$1 = ansiStyles$1;
16807
16806
 
16808
16807
  //#endregion
16809
16808
  //#region ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
@@ -16892,7 +16891,6 @@ const supportsColor = {
16892
16891
  stdout: createSupportsColor({ isTTY: node_tty.default.isatty(1) }),
16893
16892
  stderr: createSupportsColor({ isTTY: node_tty.default.isatty(2) })
16894
16893
  };
16895
- var supports_color_default = supportsColor;
16896
16894
 
16897
16895
  //#endregion
16898
16896
  //#region ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js
@@ -16925,7 +16923,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
16925
16923
 
16926
16924
  //#endregion
16927
16925
  //#region ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js
16928
- const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
16926
+ const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
16929
16927
  const GENERATOR = Symbol("GENERATOR");
16930
16928
  const STYLER = Symbol("STYLER");
16931
16929
  const IS_EMPTY = Symbol("IS_EMPTY");
@@ -16951,7 +16949,7 @@ function createChalk(options) {
16951
16949
  return chalkFactory(options);
16952
16950
  }
16953
16951
  Object.setPrototypeOf(createChalk.prototype, Function.prototype);
16954
- for (const [styleName, style] of Object.entries(ansi_styles_default$1)) styles$1[styleName] = { get() {
16952
+ for (const [styleName, style] of Object.entries(ansiStyles$1)) styles$1[styleName] = { get() {
16955
16953
  const builder$1 = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
16956
16954
  Object.defineProperty(this, styleName, { value: builder$1 });
16957
16955
  return builder$1;
@@ -16963,12 +16961,12 @@ styles$1.visible = { get() {
16963
16961
  } };
16964
16962
  const getModelAnsi = (model, level, type, ...arguments_) => {
16965
16963
  if (model === "rgb") {
16966
- if (level === "ansi16m") return ansi_styles_default$1[type].ansi16m(...arguments_);
16967
- if (level === "ansi256") return ansi_styles_default$1[type].ansi256(ansi_styles_default$1.rgbToAnsi256(...arguments_));
16968
- return ansi_styles_default$1[type].ansi(ansi_styles_default$1.rgbToAnsi(...arguments_));
16964
+ if (level === "ansi16m") return ansiStyles$1[type].ansi16m(...arguments_);
16965
+ if (level === "ansi256") return ansiStyles$1[type].ansi256(ansiStyles$1.rgbToAnsi256(...arguments_));
16966
+ return ansiStyles$1[type].ansi(ansiStyles$1.rgbToAnsi(...arguments_));
16969
16967
  }
16970
- if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default$1.hexToRgb(...arguments_));
16971
- return ansi_styles_default$1[type][model](...arguments_);
16968
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles$1.hexToRgb(...arguments_));
16969
+ return ansiStyles$1[type][model](...arguments_);
16972
16970
  };
16973
16971
  const usedModels = [
16974
16972
  "rgb",
@@ -16979,7 +16977,7 @@ for (const model of usedModels) {
16979
16977
  styles$1[model] = { get() {
16980
16978
  const { level } = this;
16981
16979
  return function(...arguments_) {
16982
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default$1.color.close, this[STYLER]);
16980
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles$1.color.close, this[STYLER]);
16983
16981
  return createBuilder(this, styler, this[IS_EMPTY]);
16984
16982
  };
16985
16983
  } };
@@ -16987,7 +16985,7 @@ for (const model of usedModels) {
16987
16985
  styles$1[bgModel] = { get() {
16988
16986
  const { level } = this;
16989
16987
  return function(...arguments_) {
16990
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default$1.bgColor.close, this[STYLER]);
16988
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles$1.bgColor.close, this[STYLER]);
16991
16989
  return createBuilder(this, styler, this[IS_EMPTY]);
16992
16990
  };
16993
16991
  } };
@@ -17046,7 +17044,6 @@ const applyStyle = (self$1, string) => {
17046
17044
  Object.defineProperties(createChalk.prototype, styles$1);
17047
17045
  const chalk = createChalk();
17048
17046
  const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
17049
- var source_default = chalk;
17050
17047
 
17051
17048
  //#endregion
17052
17049
  //#region ../../node_modules/.pnpm/widest-line@5.0.0/node_modules/widest-line/index.js
@@ -17498,7 +17495,6 @@ function assembleStyles() {
17498
17495
  return styles;
17499
17496
  }
17500
17497
  const ansiStyles = assembleStyles();
17501
- var ansi_styles_default = ansiStyles;
17502
17498
 
17503
17499
  //#endregion
17504
17500
  //#region ../../node_modules/.pnpm/wrap-ansi@9.0.0/node_modules/wrap-ansi/index.js
@@ -17610,7 +17606,7 @@ const exec = (string, columns, options = {}) => {
17610
17606
  escapeCode = code$1 === END_CODE ? void 0 : code$1;
17611
17607
  } else if (groups.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
17612
17608
  }
17613
- const code = ansi_styles_default.codes.get(Number(escapeCode));
17609
+ const code = ansiStyles.codes.get(Number(escapeCode));
17614
17610
  if (pre[index + 1] === "\n") {
17615
17611
  if (escapeUrl) returnValue += wrapAnsiHyperlink("");
17616
17612
  if (escapeCode && code) returnValue += wrapAnsiCode(code);
@@ -17755,7 +17751,7 @@ const makeContentText = (text, { padding, width, textAlignment, height }) => {
17755
17751
  const boxContent = (content, contentWidth, options) => {
17756
17752
  const colorizeBorder = (border) => {
17757
17753
  const newBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;
17758
- return options.dimBorder ? source_default.dim(newBorder) : newBorder;
17754
+ return options.dimBorder ? chalk.dim(newBorder) : newBorder;
17759
17755
  };
17760
17756
  const colorizeContent = (content$1) => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(content$1) : content$1;
17761
17757
  const chars = getBorderChars(options.borderStyle);
@@ -17830,9 +17826,9 @@ const determineDimensions = (text, options) => {
17830
17826
  return options;
17831
17827
  };
17832
17828
  const isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
17833
- const isColorValid = (color) => typeof color === "string" && (source_default[color] ?? isHex(color));
17834
- const getColorFunction = (color) => isHex(color) ? source_default.hex(color) : source_default[color];
17835
- const getBGColorFunction = (color) => isHex(color) ? source_default.bgHex(color) : source_default[camelCase(["bg", color])];
17829
+ const isColorValid = (color) => typeof color === "string" && (chalk[color] ?? isHex(color));
17830
+ const getColorFunction = (color) => isHex(color) ? chalk.hex(color) : chalk[color];
17831
+ const getBGColorFunction = (color) => isHex(color) ? chalk.bgHex(color) : chalk[camelCase(["bg", color])];
17836
17832
  function boxen(text, options) {
17837
17833
  options = {
17838
17834
  padding: 0,
@@ -27158,7 +27154,7 @@ var ConfigBuilder = class {
27158
27154
  if (!this.buildType) throw new Error("Build type must be set using .setBuildType()");
27159
27155
  switch (this.buildType) {
27160
27156
  case "bare": return "bare({ enableHermes: true })";
27161
- case "rnef": return "rnef()";
27157
+ case "rock": return "rock()";
27162
27158
  case "expo": return "expo()";
27163
27159
  default: throw new Error(`Invalid build type: ${this.buildType}`);
27164
27160
  }
@@ -27210,7 +27206,7 @@ export default defineConfig({
27210
27206
  build: ${buildConfigString},
27211
27207
  storage: ${this.storageInfo.configString},
27212
27208
  database: ${this.databaseInfo.configString},
27213
- updateStrategy: "fingerprint",
27209
+ updateStrategy: "appVersion", // or "fingerprint"
27214
27210
  });
27215
27211
  `.trim();
27216
27212
  }
package/dist/index.d.cts CHANGED
@@ -159,9 +159,11 @@ type ConfigInput = {
159
159
  * The strategy used to update the app.
160
160
  *
161
161
  * If `fingerprint`, the bundle will be updated if the fingerprint of the app is changed.
162
- * If `app-version`, the bundle will be updated if the target app version is valid.
162
+ * @docs https://hot-updater.dev/guide/update-strategy/1_fingerprint
163
+ * If `appVersion`, the bundle will be updated if the target app version is valid.
164
+ * @docs https://hot-updater.dev/guide/update-strategy/2_app-version
163
165
  *
164
- * @default "fingerprint"
166
+ * @default "appVersion"
165
167
  */
166
168
  updateStrategy: "fingerprint" | "appVersion";
167
169
  /**
@@ -364,7 +366,7 @@ declare const createBlobDatabasePlugin: <TContext = object>({
364
366
  }) => (options: BasePluginArgs) => DatabasePlugin;
365
367
  //#endregion
366
368
  //#region src/ConfigBuilder.d.ts
367
- type BuildType = "bare" | "rnef" | "expo";
369
+ type BuildType = "bare" | "rock" | "expo";
368
370
  type ImportInfo = {
369
371
  pkg: string;
370
372
  named?: string[];
@@ -376,7 +378,7 @@ type ProviderConfig = {
376
378
  configString: string;
377
379
  };
378
380
  interface IConfigBuilder {
379
- /** Sets the build type ('bare' or 'rnef' or 'expo') and adds necessary build imports. */
381
+ /** Sets the build type ('bare' or 'rock' or 'expo') and adds necessary build imports. */
380
382
  setBuildType(buildType: BuildType): this;
381
383
  /** Sets the storage configuration and adds its required imports. */
382
384
  setStorage(storageConfig: ProviderConfig): this;
package/dist/index.d.ts CHANGED
@@ -159,9 +159,11 @@ type ConfigInput = {
159
159
  * The strategy used to update the app.
160
160
  *
161
161
  * If `fingerprint`, the bundle will be updated if the fingerprint of the app is changed.
162
- * If `app-version`, the bundle will be updated if the target app version is valid.
162
+ * @docs https://hot-updater.dev/guide/update-strategy/1_fingerprint
163
+ * If `appVersion`, the bundle will be updated if the target app version is valid.
164
+ * @docs https://hot-updater.dev/guide/update-strategy/2_app-version
163
165
  *
164
- * @default "fingerprint"
166
+ * @default "appVersion"
165
167
  */
166
168
  updateStrategy: "fingerprint" | "appVersion";
167
169
  /**
@@ -364,7 +366,7 @@ declare const createBlobDatabasePlugin: <TContext = object>({
364
366
  }) => (options: BasePluginArgs) => DatabasePlugin;
365
367
  //#endregion
366
368
  //#region src/ConfigBuilder.d.ts
367
- type BuildType = "bare" | "rnef" | "expo";
369
+ type BuildType = "bare" | "rock" | "expo";
368
370
  type ImportInfo = {
369
371
  pkg: string;
370
372
  named?: string[];
@@ -376,7 +378,7 @@ type ProviderConfig = {
376
378
  configString: string;
377
379
  };
378
380
  interface IConfigBuilder {
379
- /** Sets the build type ('bare' or 'rnef' or 'expo') and adds necessary build imports. */
381
+ /** Sets the build type ('bare' or 'rock' or 'expo') and adds necessary build imports. */
380
382
  setBuildType(buildType: BuildType): this;
381
383
  /** Sets the storage configuration and adds its required imports. */
382
384
  setStorage(storageConfig: ProviderConfig): this;
package/dist/index.js CHANGED
@@ -16398,7 +16398,7 @@ const getDefaultPlatformConfig = () => {
16398
16398
  const getDefaultConfig = () => {
16399
16399
  return {
16400
16400
  releaseChannel: "production",
16401
- updateStrategy: "fingerprint",
16401
+ updateStrategy: "appVersion",
16402
16402
  fingerprint: {
16403
16403
  extraSources: [],
16404
16404
  ignorePaths: []
@@ -16805,7 +16805,6 @@ function assembleStyles$1() {
16805
16805
  return styles$2;
16806
16806
  }
16807
16807
  const ansiStyles$1 = assembleStyles$1();
16808
- var ansi_styles_default$1 = ansiStyles$1;
16809
16808
 
16810
16809
  //#endregion
16811
16810
  //#region ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
@@ -16894,7 +16893,6 @@ const supportsColor = {
16894
16893
  stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
16895
16894
  stderr: createSupportsColor({ isTTY: tty.isatty(2) })
16896
16895
  };
16897
- var supports_color_default = supportsColor;
16898
16896
 
16899
16897
  //#endregion
16900
16898
  //#region ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js
@@ -16927,7 +16925,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
16927
16925
 
16928
16926
  //#endregion
16929
16927
  //#region ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js
16930
- const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
16928
+ const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
16931
16929
  const GENERATOR = Symbol("GENERATOR");
16932
16930
  const STYLER = Symbol("STYLER");
16933
16931
  const IS_EMPTY = Symbol("IS_EMPTY");
@@ -16953,7 +16951,7 @@ function createChalk(options) {
16953
16951
  return chalkFactory(options);
16954
16952
  }
16955
16953
  Object.setPrototypeOf(createChalk.prototype, Function.prototype);
16956
- for (const [styleName, style] of Object.entries(ansi_styles_default$1)) styles$1[styleName] = { get() {
16954
+ for (const [styleName, style] of Object.entries(ansiStyles$1)) styles$1[styleName] = { get() {
16957
16955
  const builder$1 = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
16958
16956
  Object.defineProperty(this, styleName, { value: builder$1 });
16959
16957
  return builder$1;
@@ -16965,12 +16963,12 @@ styles$1.visible = { get() {
16965
16963
  } };
16966
16964
  const getModelAnsi = (model, level, type, ...arguments_) => {
16967
16965
  if (model === "rgb") {
16968
- if (level === "ansi16m") return ansi_styles_default$1[type].ansi16m(...arguments_);
16969
- if (level === "ansi256") return ansi_styles_default$1[type].ansi256(ansi_styles_default$1.rgbToAnsi256(...arguments_));
16970
- return ansi_styles_default$1[type].ansi(ansi_styles_default$1.rgbToAnsi(...arguments_));
16966
+ if (level === "ansi16m") return ansiStyles$1[type].ansi16m(...arguments_);
16967
+ if (level === "ansi256") return ansiStyles$1[type].ansi256(ansiStyles$1.rgbToAnsi256(...arguments_));
16968
+ return ansiStyles$1[type].ansi(ansiStyles$1.rgbToAnsi(...arguments_));
16971
16969
  }
16972
- if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default$1.hexToRgb(...arguments_));
16973
- return ansi_styles_default$1[type][model](...arguments_);
16970
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles$1.hexToRgb(...arguments_));
16971
+ return ansiStyles$1[type][model](...arguments_);
16974
16972
  };
16975
16973
  const usedModels = [
16976
16974
  "rgb",
@@ -16981,7 +16979,7 @@ for (const model of usedModels) {
16981
16979
  styles$1[model] = { get() {
16982
16980
  const { level } = this;
16983
16981
  return function(...arguments_) {
16984
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default$1.color.close, this[STYLER]);
16982
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles$1.color.close, this[STYLER]);
16985
16983
  return createBuilder(this, styler, this[IS_EMPTY]);
16986
16984
  };
16987
16985
  } };
@@ -16989,7 +16987,7 @@ for (const model of usedModels) {
16989
16987
  styles$1[bgModel] = { get() {
16990
16988
  const { level } = this;
16991
16989
  return function(...arguments_) {
16992
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default$1.bgColor.close, this[STYLER]);
16990
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles$1.bgColor.close, this[STYLER]);
16993
16991
  return createBuilder(this, styler, this[IS_EMPTY]);
16994
16992
  };
16995
16993
  } };
@@ -17048,7 +17046,6 @@ const applyStyle = (self$1, string) => {
17048
17046
  Object.defineProperties(createChalk.prototype, styles$1);
17049
17047
  const chalk = createChalk();
17050
17048
  const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
17051
- var source_default = chalk;
17052
17049
 
17053
17050
  //#endregion
17054
17051
  //#region ../../node_modules/.pnpm/widest-line@5.0.0/node_modules/widest-line/index.js
@@ -17500,7 +17497,6 @@ function assembleStyles() {
17500
17497
  return styles;
17501
17498
  }
17502
17499
  const ansiStyles = assembleStyles();
17503
- var ansi_styles_default = ansiStyles;
17504
17500
 
17505
17501
  //#endregion
17506
17502
  //#region ../../node_modules/.pnpm/wrap-ansi@9.0.0/node_modules/wrap-ansi/index.js
@@ -17612,7 +17608,7 @@ const exec = (string, columns, options = {}) => {
17612
17608
  escapeCode = code$1 === END_CODE ? void 0 : code$1;
17613
17609
  } else if (groups.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
17614
17610
  }
17615
- const code = ansi_styles_default.codes.get(Number(escapeCode));
17611
+ const code = ansiStyles.codes.get(Number(escapeCode));
17616
17612
  if (pre[index + 1] === "\n") {
17617
17613
  if (escapeUrl) returnValue += wrapAnsiHyperlink("");
17618
17614
  if (escapeCode && code) returnValue += wrapAnsiCode(code);
@@ -17757,7 +17753,7 @@ const makeContentText = (text, { padding, width, textAlignment, height }) => {
17757
17753
  const boxContent = (content, contentWidth, options) => {
17758
17754
  const colorizeBorder = (border) => {
17759
17755
  const newBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;
17760
- return options.dimBorder ? source_default.dim(newBorder) : newBorder;
17756
+ return options.dimBorder ? chalk.dim(newBorder) : newBorder;
17761
17757
  };
17762
17758
  const colorizeContent = (content$1) => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(content$1) : content$1;
17763
17759
  const chars = getBorderChars(options.borderStyle);
@@ -17832,9 +17828,9 @@ const determineDimensions = (text, options) => {
17832
17828
  return options;
17833
17829
  };
17834
17830
  const isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
17835
- const isColorValid = (color) => typeof color === "string" && (source_default[color] ?? isHex(color));
17836
- const getColorFunction = (color) => isHex(color) ? source_default.hex(color) : source_default[color];
17837
- const getBGColorFunction = (color) => isHex(color) ? source_default.bgHex(color) : source_default[camelCase(["bg", color])];
17831
+ const isColorValid = (color) => typeof color === "string" && (chalk[color] ?? isHex(color));
17832
+ const getColorFunction = (color) => isHex(color) ? chalk.hex(color) : chalk[color];
17833
+ const getBGColorFunction = (color) => isHex(color) ? chalk.bgHex(color) : chalk[camelCase(["bg", color])];
17838
17834
  function boxen(text, options) {
17839
17835
  options = {
17840
17836
  padding: 0,
@@ -27160,7 +27156,7 @@ var ConfigBuilder = class {
27160
27156
  if (!this.buildType) throw new Error("Build type must be set using .setBuildType()");
27161
27157
  switch (this.buildType) {
27162
27158
  case "bare": return "bare({ enableHermes: true })";
27163
- case "rnef": return "rnef()";
27159
+ case "rock": return "rock()";
27164
27160
  case "expo": return "expo()";
27165
27161
  default: throw new Error(`Invalid build type: ${this.buildType}`);
27166
27162
  }
@@ -27212,7 +27208,7 @@ export default defineConfig({
27212
27208
  build: ${buildConfigString},
27213
27209
  storage: ${this.storageInfo.configString},
27214
27210
  database: ${this.databaseInfo.configString},
27215
- updateStrategy: "fingerprint",
27211
+ updateStrategy: "appVersion", // or "fingerprint"
27216
27212
  });
27217
27213
  `.trim();
27218
27214
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "0.20.3",
3
+ "version": "0.20.4",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -46,7 +46,7 @@
46
46
  "cosmiconfig-typescript-loader": "5.0.0",
47
47
  "fast-glob": "3.3.3",
48
48
  "oxc-transform": "0.82.1",
49
- "@hot-updater/core": "0.20.3"
49
+ "@hot-updater/core": "0.20.4"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.7.5",
@@ -56,7 +56,7 @@
56
56
  "picocolors": "^1.0.0",
57
57
  "typescript": "5.8.2",
58
58
  "workspace-tools": "^0.36.4",
59
- "@hot-updater/plugin-core": "0.20.3"
59
+ "@hot-updater/plugin-core": "0.20.4"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsdown",