@bobfrankston/mailx 1.0.28 → 1.0.29

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,8 +1,43 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * mailx postinstall — sets binary permissions on Linux/Mac.
4
- * Tries shared rust-builder; falls back to inline logic if not available.
3
+ * mailx postinstall:
4
+ * 1. Link workspace packages so Node can resolve them after npm install
5
+ * 2. Set binary permissions on Linux/Mac
5
6
  */
7
+ import fs from "node:fs";
8
+ import path from "node:path";
9
+ import { fileURLToPath } from "url";
10
+
11
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
+ const root = path.join(__dirname, "..", "..");
13
+
14
+ // Link workspace packages into node_modules so imports resolve
15
+ const nodeModules = path.join(root, "node_modules", "@bobfrankston");
16
+ const packagesDir = path.join(root, "packages");
17
+ if (fs.existsSync(packagesDir)) {
18
+ fs.mkdirSync(nodeModules, { recursive: true });
19
+ for (const pkg of fs.readdirSync(packagesDir)) {
20
+ const pkgDir = path.join(packagesDir, pkg);
21
+ const pkgJson = path.join(pkgDir, "package.json");
22
+ if (!fs.existsSync(pkgJson)) continue;
23
+ try {
24
+ const meta = JSON.parse(fs.readFileSync(pkgJson, "utf-8"));
25
+ const name = meta.name?.replace("@bobfrankston/", "");
26
+ if (!name) continue;
27
+ const link = path.join(nodeModules, name);
28
+ if (!fs.existsSync(link)) {
29
+ // Use junction on Windows (no admin needed), symlink on Unix
30
+ if (process.platform === "win32") {
31
+ fs.symlinkSync(pkgDir, link, "junction");
32
+ } else {
33
+ fs.symlinkSync(pkgDir, link, "dir");
34
+ }
35
+ }
36
+ } catch { /* skip */ }
37
+ }
38
+ }
39
+
40
+ // Set binary permissions
6
41
  try {
7
42
  const { runPostinstall } = await import("@bobfrankston/rust-builder/postinstall");
8
43
  const path = await import("path");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",