@xudesheng/conflu 0.5.11 → 0.5.12

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/bin/conflu.js CHANGED
@@ -4,10 +4,12 @@ import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
 
7
+ import { NATIVE_BINARY_DIR } from "../lib/layout.mjs";
8
+
7
9
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
10
  const packageRoot = path.resolve(__dirname, "..");
9
11
  const binaryName = process.platform === "win32" ? "conflu.exe" : "conflu";
10
- const binaryPath = path.join(packageRoot, ".conflu-bin", binaryName);
12
+ const binaryPath = path.join(packageRoot, NATIVE_BINARY_DIR, binaryName);
11
13
 
12
14
  if (!fs.existsSync(binaryPath)) {
13
15
  console.error(
package/lib/install.mjs CHANGED
@@ -10,6 +10,7 @@ import AdmZip from "adm-zip";
10
10
  import * as tar from "tar";
11
11
 
12
12
  import { InstallError } from "./diagnostics.mjs";
13
+ import { NATIVE_BINARY_DIR } from "./layout.mjs";
13
14
  import { resolvePlatform } from "./platform.mjs";
14
15
 
15
16
  function releaseBase(version) {
@@ -196,7 +197,7 @@ export async function installBinary(version, packageRoot) {
196
197
  );
197
198
  }
198
199
 
199
- const binDir = path.join(packageRoot, ".conflu-bin");
200
+ const binDir = path.join(packageRoot, NATIVE_BINARY_DIR);
200
201
  const targetBinary = path.join(binDir, resolved.binaryName);
201
202
  await fs.mkdir(binDir, { recursive: true });
202
203
  await fs.copyFile(sourceBinary, targetBinary);
package/lib/layout.mjs ADDED
@@ -0,0 +1,2 @@
1
+ /** Package-private directory containing the downloaded native Conflu binary. */
2
+ export const NATIVE_BINARY_DIR = ".conflu-bin";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xudesheng/conflu",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "Thin npm wrapper for Conflu native binaries",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {