@hot-updater/rock 0.29.3 → 0.29.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
@@ -22,6 +22,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  enumerable: true
23
23
  }) : target, mod));
24
24
  //#endregion
25
+ let fs_promises = require("fs/promises");
26
+ fs_promises = __toESM(fs_promises);
27
+ let path = require("path");
28
+ path = __toESM(path);
25
29
  let _hot_updater_cli_tools = require("@hot-updater/cli-tools");
26
30
  let node_url = require("node:url");
27
31
  let node_child_process = require("node:child_process");
@@ -33,8 +37,6 @@ let node_tty = require("node:tty");
33
37
  node_tty = __toESM(node_tty);
34
38
  let node_path = require("node:path");
35
39
  node_path = __toESM(node_path);
36
- let path = require("path");
37
- path = __toESM(path);
38
40
  let node_timers_promises = require("node:timers/promises");
39
41
  let node_os = require("node:os");
40
42
  let node_events = require("node:events");
@@ -43,8 +45,6 @@ let node_fs = require("node:fs");
43
45
  let node_stream_promises = require("node:stream/promises");
44
46
  let node_stream = require("node:stream");
45
47
  let node_buffer = require("node:buffer");
46
- let fs_promises = require("fs/promises");
47
- fs_promises = __toESM(fs_promises);
48
48
  let uuidv7 = require("uuidv7");
49
49
  //#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
50
50
  function isPlainObject(value) {
package/dist/index.mjs CHANGED
@@ -1,4 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
+ import fs from "fs/promises";
3
+ import path from "path";
2
4
  import { log } from "@hot-updater/cli-tools";
3
5
  import { fileURLToPath } from "node:url";
4
6
  import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
@@ -6,8 +8,7 @@ import { StringDecoder } from "node:string_decoder";
6
8
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
7
9
  import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
8
10
  import tty from "node:tty";
9
- import path from "node:path";
10
- import path$1 from "path";
11
+ import path$1 from "node:path";
11
12
  import { scheduler, setImmediate, setTimeout } from "node:timers/promises";
12
13
  import { constants } from "node:os";
13
14
  import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
@@ -16,7 +17,6 @@ import { appendFileSync, createReadStream, createWriteStream, readFileSync, stat
16
17
  import { finished } from "node:stream/promises";
17
18
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
18
19
  import { Buffer as Buffer$1 } from "node:buffer";
19
- import fs from "fs/promises";
20
20
  import { uuidv7 } from "uuidv7";
21
21
  //#region \0rolldown/runtime.js
22
22
  var __create = Object.create;
@@ -1213,33 +1213,33 @@ function toPath(urlOrPath) {
1213
1213
  }
1214
1214
  function traversePathUp(startPath) {
1215
1215
  return { *[Symbol.iterator]() {
1216
- let currentPath = path.resolve(toPath(startPath));
1216
+ let currentPath = path$1.resolve(toPath(startPath));
1217
1217
  let previousPath;
1218
1218
  while (previousPath !== currentPath) {
1219
1219
  yield currentPath;
1220
1220
  previousPath = currentPath;
1221
- currentPath = path.resolve(currentPath, "..");
1221
+ currentPath = path$1.resolve(currentPath, "..");
1222
1222
  }
1223
1223
  } };
1224
1224
  }
1225
1225
  //#endregion
1226
1226
  //#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
1227
1227
  const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath = process$1.execPath, addExecPath = true } = {}) => {
1228
- const cwdPath = path.resolve(toPath(cwd));
1228
+ const cwdPath = path$1.resolve(toPath(cwd));
1229
1229
  const result = [];
1230
- const pathParts = pathOption.split(path.delimiter);
1230
+ const pathParts = pathOption.split(path$1.delimiter);
1231
1231
  if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
1232
1232
  if (addExecPath) applyExecPath(result, pathParts, execPath, cwdPath);
1233
- return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
1233
+ return pathOption === "" || pathOption === path$1.delimiter ? `${result.join(path$1.delimiter)}${pathOption}` : [...result, pathOption].join(path$1.delimiter);
1234
1234
  };
1235
1235
  const applyPreferLocal = (result, pathParts, cwdPath) => {
1236
1236
  for (const directory of traversePathUp(cwdPath)) {
1237
- const pathPart = path.join(directory, "node_modules/.bin");
1237
+ const pathPart = path$1.join(directory, "node_modules/.bin");
1238
1238
  if (!pathParts.includes(pathPart)) result.push(pathPart);
1239
1239
  }
1240
1240
  };
1241
1241
  const applyExecPath = (result, pathParts, execPath, cwdPath) => {
1242
- const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
1242
+ const pathPart = path$1.resolve(cwdPath, toPath(execPath), "..");
1243
1243
  if (!pathParts.includes(pathPart)) result.push(pathPart);
1244
1244
  };
1245
1245
  const npmRunPathEnv = ({ env = process$1.env, ...options } = {}) => {
@@ -2249,7 +2249,7 @@ const mapNode = ({ options }) => {
2249
2249
  const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath, ...options }) => {
2250
2250
  if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
2251
2251
  const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
2252
- const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
2252
+ const resolvedNodePath = path$1.resolve(cwd, normalizedNodePath);
2253
2253
  const newOptions = {
2254
2254
  ...options,
2255
2255
  nodePath: resolvedNodePath,
@@ -2261,7 +2261,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
2261
2261
  commandArguments,
2262
2262
  newOptions
2263
2263
  ];
2264
- if (path.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
2264
+ if (path$1.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
2265
2265
  return [
2266
2266
  resolvedNodePath,
2267
2267
  [
@@ -2345,7 +2345,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
2345
2345
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
2346
2346
  const normalizeCwd = (cwd = getDefaultCwd()) => {
2347
2347
  const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
2348
- return path.resolve(cwdString);
2348
+ return path$1.resolve(cwdString);
2349
2349
  };
2350
2350
  const getDefaultCwd = () => {
2351
2351
  try {
@@ -2383,7 +2383,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
2383
2383
  options.killSignal = normalizeKillSignal(options.killSignal);
2384
2384
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
2385
2385
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
2386
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
2386
+ if (process$1.platform === "win32" && path$1.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
2387
2387
  return {
2388
2388
  file,
2389
2389
  commandArguments,
@@ -6203,7 +6203,7 @@ const { sendMessage, getOneMessage, getEachMessage, getCancelSignal } = getIpcEx
6203
6203
  //#region src/index.ts
6204
6204
  const runBundle = async ({ entryFile, cwd, platform, buildPath, sourcemap, hermes }) => {
6205
6205
  const filename = `index.${platform}`;
6206
- const bundleOutput = path$1.join(buildPath, `${filename}.bundle`);
6206
+ const bundleOutput = path.join(buildPath, `${filename}.bundle`);
6207
6207
  const bundleId = uuidv7();
6208
6208
  const args = [
6209
6209
  "rock",
@@ -6245,7 +6245,7 @@ const rock = (config = {
6245
6245
  const { outDir = "dist", sourcemap = false, entryFile = "index.js", hermes = true } = config;
6246
6246
  return {
6247
6247
  build: async ({ platform }) => {
6248
- const buildPath = path$1.join(cwd, outDir);
6248
+ const buildPath = path.join(cwd, outDir);
6249
6249
  await fs.rm(buildPath, {
6250
6250
  recursive: true,
6251
6251
  force: true
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/rock",
3
3
  "type": "module",
4
- "version": "0.29.3",
4
+ "version": "0.29.4",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.mjs",
@@ -22,8 +22,8 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "uuidv7": "^1.0.2",
25
- "@hot-updater/plugin-core": "0.29.3",
26
- "@hot-updater/cli-tools": "0.29.3"
25
+ "@hot-updater/cli-tools": "0.29.4",
26
+ "@hot-updater/plugin-core": "0.29.4"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^20",