@midsummerai/vault 0.1.0

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.
Files changed (2) hide show
  1. package/install.js +47 -0
  2. package/package.json +19 -0
package/install.js ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { existsSync, mkdirSync, copyFileSync, chmodSync } = require("fs");
4
+ const { join } = require("path");
5
+
6
+ const PLATFORMS = {
7
+ "darwin-arm64": "@midsummerai/vault-darwin-arm64",
8
+ "darwin-x64": "@midsummerai/vault-darwin-x64",
9
+ "linux-x64": "@midsummerai/vault-linux-x64",
10
+ "linux-arm64": "@midsummerai/vault-linux-arm64",
11
+ "win32-x64": "@midsummerai/vault-win32-x64",
12
+ };
13
+
14
+ const platform = `${process.platform}-${process.arch}`;
15
+ const pkg = PLATFORMS[platform];
16
+
17
+ if (!pkg) {
18
+ console.error(`Unsupported platform: ${platform}`);
19
+ process.exit(1);
20
+ }
21
+
22
+ try {
23
+ const binaryName = process.platform === "win32" ? "vault.exe" : "vault";
24
+ const sourcePath = join(
25
+ require.resolve(`${pkg}/package.json`),
26
+ "..",
27
+ "bin",
28
+ binaryName
29
+ );
30
+
31
+ if (!existsSync(sourcePath)) {
32
+ console.error(`Binary not found: ${sourcePath}`);
33
+ process.exit(1);
34
+ }
35
+
36
+ const binDir = join(__dirname, "bin");
37
+ if (!existsSync(binDir)) {
38
+ mkdirSync(binDir, { recursive: true });
39
+ }
40
+
41
+ const destPath = join(binDir, binaryName);
42
+ copyFileSync(sourcePath, destPath);
43
+ chmodSync(destPath, 0o755);
44
+ } catch (err) {
45
+ console.error(`Failed to install vault binary: ${err.message}`);
46
+ process.exit(1);
47
+ }
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@midsummerai/vault",
3
+ "version": "0.1.0",
4
+ "description": "Midsummer Vault CLI — secret injection for exported projects",
5
+ "bin": {
6
+ "vault": "bin/vault"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node install.js"
10
+ },
11
+ "optionalDependencies": {
12
+ "@midsummerai/vault-darwin-arm64": "0.1.0",
13
+ "@midsummerai/vault-darwin-x64": "0.1.0",
14
+ "@midsummerai/vault-linux-x64": "0.1.0",
15
+ "@midsummerai/vault-linux-arm64": "0.1.0",
16
+ "@midsummerai/vault-win32-x64": "0.1.0"
17
+ },
18
+ "license": "MIT"
19
+ }