Skip to content

Commit 8fe7199

Browse files
committed
Prepare for npm publish: @fellow/relay-dedup
1 parent 7abfb5a commit 8fe7199

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ A high-performance tool to deduplicate Relay-generated artifact files, reducing
66

77
```bash
88
# pnpm
9-
pnpm add github:fellowapp/relay-dedup
9+
pnpm add -D @fellow/relay-dedup
1010

1111
# npm
12-
npm install github:fellowapp/relay-dedup
12+
npm install --save-dev @fellow/relay-dedup
1313

1414
# yarn
15-
yarn add github:fellowapp/relay-dedup
15+
yarn add --dev @fellow/relay-dedup
1616
```
1717

1818
The postinstall script automatically downloads the correct pre-built binary for your platform (macOS/Linux, x64/ARM64).

bin/relay-dedup

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ const fs = require("fs");
77
const binaryPath = path.join(__dirname, "relay-dedup-binary");
88

99
if (!fs.existsSync(binaryPath)) {
10-
console.error(
11-
"relay-dedup binary not found. Please run: npm run postinstall"
12-
);
10+
console.error("relay-dedup binary not found. Try running 'pnpm install' again.");
1311
process.exit(1);
1412
}
1513

@@ -22,4 +20,3 @@ try {
2220
console.error(error.message);
2321
process.exit(1);
2422
}
25-

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "relay-dedup",
2+
"name": "@fellow/relay-dedup",
33
"version": "0.1.0",
44
"description": "Deduplicate Relay-generated artifact files by extracting repeated structures into a shared module",
55
"license": "MIT",

scripts/postinstall.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const https = require("https");
44
const fs = require("fs");
55
const path = require("path");
6-
const { execSync } = require("child_process");
76
const zlib = require("zlib");
87

98
// GitHub repo info
@@ -76,8 +75,7 @@ async function downloadBinary() {
7675
// Extract tar.gz
7776
const tar = zlib.gunzipSync(tarGz);
7877

79-
// Simple tar extraction (binary is first file, starts at byte 512)
80-
// TAR header is 512 bytes, then file content
78+
// Simple tar extraction
8179
const binaryContent = extractTarFile(tar, BINARY_NAME);
8280

8381
// Write binary
@@ -90,13 +88,12 @@ async function downloadBinary() {
9088

9189
console.log(`✓ Installed ${BINARY_NAME} to ${binaryPath}`);
9290
} catch (error) {
91+
console.error(`\nError: Failed to download binary for ${getPlatformKey()}`);
92+
console.error(` ${error.message}`);
9393
if (error.message.includes("404")) {
94-
console.error(`\nError: No prebuilt binary found for ${getPlatformKey()}`);
95-
console.error(`Release v${version} may not exist or may not have binaries yet.`);
96-
console.error(`\nYou can build from source with: cargo build --release`);
97-
} else {
98-
console.error(`\nError downloading binary: ${error.message}`);
94+
console.error(`\nRelease v${version} may not exist yet.`);
9995
}
96+
console.error(`\nYou can build from source with: cargo build --release`);
10097
process.exit(1);
10198
}
10299
}
@@ -129,4 +126,3 @@ function extractTarFile(tarBuffer, filename) {
129126
}
130127

131128
downloadBinary();
132-

0 commit comments

Comments
 (0)