hot-updater 0.19.4 → 0.19.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.
@@ -1,32 +1,5 @@
1
- import { createRequire } from "node:module";
1
+ import { __commonJS } from "./chunk-BLXvPPr8.js";
2
2
 
3
- //#region rolldown:runtime
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __commonJS = (cb, mod) => function() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
28
-
29
- //#endregion
30
3
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
31
4
  var require_picocolors = __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
32
5
  let p = process || {}, argv = p.argv || [], env = p.env || {};
@@ -96,4 +69,4 @@ var require_picocolors = __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1
96
69
  } });
97
70
 
98
71
  //#endregion
99
- export { __commonJS, __require, __toESM, require_picocolors };
72
+ export { require_picocolors };
@@ -1,4 +1,5 @@
1
- import { __toESM, require_picocolors } from "../picocolors-OFVOrezl.js";
1
+ import { __toESM } from "../chunk-BLXvPPr8.js";
2
+ import { require_picocolors } from "../picocolors-DR-zskCv.js";
2
3
  import fs from "fs";
3
4
  import path from "path";
4
5
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hot-updater",
3
3
  "type": "module",
4
- "version": "0.19.4",
4
+ "version": "0.19.6",
5
5
  "bin": {
6
6
  "hot-updater": "./dist/index.js"
7
7
  },
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@bacons/xcode": "1.0.0-alpha.24",
52
- "@clack/prompts": "^0.10.0",
52
+ "@clack/prompts": "0.10.0",
53
53
  "@commander-js/extra-typings": "^14.0.0",
54
54
  "@expo/fingerprint": "0.12.4",
55
55
  "commander": "^14.0.0",
@@ -58,9 +58,9 @@
58
58
  "es-git": "^0.2.0",
59
59
  "fast-glob": "^3.3.3",
60
60
  "fast-xml-parser": "^5.2.3",
61
- "@hot-updater/console": "0.19.4",
62
- "@hot-updater/core": "0.19.4",
63
- "@hot-updater/plugin-core": "0.19.4"
61
+ "@hot-updater/console": "0.19.6",
62
+ "@hot-updater/core": "0.19.6",
63
+ "@hot-updater/plugin-core": "0.19.6"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@babel/core": "7.26.0",
@@ -86,10 +86,10 @@
86
86
  "read-package-up": "^11.0.0",
87
87
  "semver": "^7.6.3",
88
88
  "uuidv7": "^1.0.2",
89
- "@hot-updater/aws": "0.19.4",
90
- "@hot-updater/cloudflare": "0.19.4",
91
- "@hot-updater/firebase": "0.19.4",
92
- "@hot-updater/supabase": "0.19.4"
89
+ "@hot-updater/aws": "0.19.6",
90
+ "@hot-updater/cloudflare": "0.19.6",
91
+ "@hot-updater/supabase": "0.19.6",
92
+ "@hot-updater/firebase": "0.19.6"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@hot-updater/aws": "*",
@@ -1,140 +0,0 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const __hot_updater_plugin_core = require_chunk.__toESM(require("@hot-updater/plugin-core"));
3
- const fs = require_chunk.__toESM(require("fs"));
4
- const path = require_chunk.__toESM(require("path"));
5
- const __clack_prompts = require_chunk.__toESM(require("@clack/prompts"));
6
- const __expo_fingerprint = require_chunk.__toESM(require("@expo/fingerprint"));
7
- const node_fs = require_chunk.__toESM(require("node:fs"));
8
- const fast_glob = require_chunk.__toESM(require("fast-glob"));
9
-
10
- //#region src/utils/fingerprint/processExtraSources.ts
11
- /**
12
- * Processes extra source files and directories for fingerprinting.
13
- * @param extraSources Array of file paths, directory paths, or glob patterns
14
- * @param cwd Current working directory for resolving paths
15
- * @param ignorePaths Optional array of paths to ignore
16
- * @returns Array of processed sources with their contents or directory information
17
- */
18
- function processExtraSources(extraSources, cwd, ignorePaths) {
19
- const processedSources = [];
20
- for (const source of extraSources) try {
21
- const matches = fast_glob.default.globSync(source, {
22
- cwd,
23
- ignore: ignorePaths ?? [],
24
- absolute: true,
25
- onlyFiles: false
26
- });
27
- for (const absolutePath of matches) if (node_fs.default.existsSync(absolutePath)) {
28
- const stats = node_fs.default.statSync(absolutePath);
29
- if (stats.isDirectory()) processedSources.push({
30
- type: "dir",
31
- filePath: absolutePath,
32
- reasons: ["custom-user-config"]
33
- });
34
- else processedSources.push({
35
- type: "contents",
36
- id: absolutePath,
37
- contents: node_fs.default.readFileSync(absolutePath, "utf-8"),
38
- reasons: ["custom-user-config"]
39
- });
40
- }
41
- } catch (error) {
42
- console.warn(`Error processing extra source "${source}": ${error}`);
43
- }
44
- return processedSources;
45
- }
46
-
47
- //#endregion
48
- //#region src/utils/fingerprint/index.ts
49
- /**
50
- * Calculates the fingerprint of the native parts project of the project.
51
- */
52
- async function nativeFingerprint(path$2, options) {
53
- const platform = options.platform;
54
- return (0, __expo_fingerprint.createFingerprintAsync)(path$2, {
55
- platforms: [platform],
56
- ignorePaths: [
57
- "**/android/**/strings.xml",
58
- "**/ios/**/Info.plist",
59
- ...options.ignorePaths
60
- ],
61
- extraSources: processExtraSources(options.extraSources, path$2, options.ignorePaths),
62
- debug: options.debug
63
- });
64
- }
65
- const ensureFingerprintConfig = async () => {
66
- const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
67
- if (config.updateStrategy === "appVersion") {
68
- __clack_prompts.log.error("The updateStrategy in hot-updater.config.ts is set to 'appVersion'. This command only works with 'fingerprint' strategy.");
69
- process.exit(1);
70
- }
71
- return config.fingerprint;
72
- };
73
- const generateFingerprints = async () => {
74
- const fingerprintConfig = await ensureFingerprintConfig();
75
- const [ios, android] = await Promise.all([nativeFingerprint((0, __hot_updater_plugin_core.getCwd)(), {
76
- platform: "ios",
77
- ...fingerprintConfig
78
- }), nativeFingerprint((0, __hot_updater_plugin_core.getCwd)(), {
79
- platform: "android",
80
- ...fingerprintConfig
81
- })]);
82
- return {
83
- ios,
84
- android
85
- };
86
- };
87
- const generateFingerprint = async (platform) => {
88
- const fingerprintConfig = await ensureFingerprintConfig();
89
- return nativeFingerprint((0, __hot_updater_plugin_core.getCwd)(), {
90
- platform,
91
- ...fingerprintConfig
92
- });
93
- };
94
- const createFingerprintJson = async () => {
95
- const FINGERPRINT_FILE_PATH = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "fingerprint.json");
96
- const newFingerprint = await generateFingerprints();
97
- await fs.default.promises.writeFile(FINGERPRINT_FILE_PATH, JSON.stringify(newFingerprint, null, 2));
98
- return newFingerprint;
99
- };
100
- const readLocalFingerprint = async () => {
101
- const FINGERPRINT_FILE_PATH = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "fingerprint.json");
102
- try {
103
- const content = await fs.default.promises.readFile(FINGERPRINT_FILE_PATH, "utf-8");
104
- return JSON.parse(content);
105
- } catch {
106
- return null;
107
- }
108
- };
109
-
110
- //#endregion
111
- Object.defineProperty(exports, 'createFingerprintJson', {
112
- enumerable: true,
113
- get: function () {
114
- return createFingerprintJson;
115
- }
116
- });
117
- Object.defineProperty(exports, 'generateFingerprint', {
118
- enumerable: true,
119
- get: function () {
120
- return generateFingerprint;
121
- }
122
- });
123
- Object.defineProperty(exports, 'generateFingerprints', {
124
- enumerable: true,
125
- get: function () {
126
- return generateFingerprints;
127
- }
128
- });
129
- Object.defineProperty(exports, 'nativeFingerprint', {
130
- enumerable: true,
131
- get: function () {
132
- return nativeFingerprint;
133
- }
134
- });
135
- Object.defineProperty(exports, 'readLocalFingerprint', {
136
- enumerable: true,
137
- get: function () {
138
- return readLocalFingerprint;
139
- }
140
- });
@@ -1,110 +0,0 @@
1
- import { getCwd, loadConfig } from "@hot-updater/plugin-core";
2
- import fs from "fs";
3
- import path from "path";
4
- import * as p from "@clack/prompts";
5
- import { createFingerprintAsync } from "@expo/fingerprint";
6
- import fs$1 from "node:fs";
7
- import fg from "fast-glob";
8
-
9
- //#region src/utils/fingerprint/processExtraSources.ts
10
- /**
11
- * Processes extra source files and directories for fingerprinting.
12
- * @param extraSources Array of file paths, directory paths, or glob patterns
13
- * @param cwd Current working directory for resolving paths
14
- * @param ignorePaths Optional array of paths to ignore
15
- * @returns Array of processed sources with their contents or directory information
16
- */
17
- function processExtraSources(extraSources, cwd, ignorePaths) {
18
- const processedSources = [];
19
- for (const source of extraSources) try {
20
- const matches = fg.globSync(source, {
21
- cwd,
22
- ignore: ignorePaths ?? [],
23
- absolute: true,
24
- onlyFiles: false
25
- });
26
- for (const absolutePath of matches) if (fs$1.existsSync(absolutePath)) {
27
- const stats = fs$1.statSync(absolutePath);
28
- if (stats.isDirectory()) processedSources.push({
29
- type: "dir",
30
- filePath: absolutePath,
31
- reasons: ["custom-user-config"]
32
- });
33
- else processedSources.push({
34
- type: "contents",
35
- id: absolutePath,
36
- contents: fs$1.readFileSync(absolutePath, "utf-8"),
37
- reasons: ["custom-user-config"]
38
- });
39
- }
40
- } catch (error) {
41
- console.warn(`Error processing extra source "${source}": ${error}`);
42
- }
43
- return processedSources;
44
- }
45
-
46
- //#endregion
47
- //#region src/utils/fingerprint/index.ts
48
- /**
49
- * Calculates the fingerprint of the native parts project of the project.
50
- */
51
- async function nativeFingerprint(path$1, options) {
52
- const platform = options.platform;
53
- return createFingerprintAsync(path$1, {
54
- platforms: [platform],
55
- ignorePaths: [
56
- "**/android/**/strings.xml",
57
- "**/ios/**/Info.plist",
58
- ...options.ignorePaths
59
- ],
60
- extraSources: processExtraSources(options.extraSources, path$1, options.ignorePaths),
61
- debug: options.debug
62
- });
63
- }
64
- const ensureFingerprintConfig = async () => {
65
- const config = await loadConfig(null);
66
- if (config.updateStrategy === "appVersion") {
67
- p.log.error("The updateStrategy in hot-updater.config.ts is set to 'appVersion'. This command only works with 'fingerprint' strategy.");
68
- process.exit(1);
69
- }
70
- return config.fingerprint;
71
- };
72
- const generateFingerprints = async () => {
73
- const fingerprintConfig = await ensureFingerprintConfig();
74
- const [ios, android] = await Promise.all([nativeFingerprint(getCwd(), {
75
- platform: "ios",
76
- ...fingerprintConfig
77
- }), nativeFingerprint(getCwd(), {
78
- platform: "android",
79
- ...fingerprintConfig
80
- })]);
81
- return {
82
- ios,
83
- android
84
- };
85
- };
86
- const generateFingerprint = async (platform) => {
87
- const fingerprintConfig = await ensureFingerprintConfig();
88
- return nativeFingerprint(getCwd(), {
89
- platform,
90
- ...fingerprintConfig
91
- });
92
- };
93
- const createFingerprintJson = async () => {
94
- const FINGERPRINT_FILE_PATH = path.join(getCwd(), "fingerprint.json");
95
- const newFingerprint = await generateFingerprints();
96
- await fs.promises.writeFile(FINGERPRINT_FILE_PATH, JSON.stringify(newFingerprint, null, 2));
97
- return newFingerprint;
98
- };
99
- const readLocalFingerprint = async () => {
100
- const FINGERPRINT_FILE_PATH = path.join(getCwd(), "fingerprint.json");
101
- try {
102
- const content = await fs.promises.readFile(FINGERPRINT_FILE_PATH, "utf-8");
103
- return JSON.parse(content);
104
- } catch {
105
- return null;
106
- }
107
- };
108
-
109
- //#endregion
110
- export { createFingerprintJson, generateFingerprint, generateFingerprints, nativeFingerprint, readLocalFingerprint };