bsmnt 0.6.2 → 0.6.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/package.json +1 -1
- package/src/modules/features/env/dotenvx/files/save-key.mjs +24 -12
- package/src/templates/next-default/components.json +24 -0
- package/src/templates/next-experiments/components.json +24 -0
- package/src/templates/next-pagebuilder/components.json +24 -0
- package/src/templates/next-webgl/components.json +24 -0
package/package.json
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
// bun run env:save
|
|
5
5
|
|
|
6
6
|
import { spawnSync } from "node:child_process";
|
|
7
|
-
import {
|
|
7
|
+
import { randomUUID } from "node:crypto";
|
|
8
|
+
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { tmpdir } from "node:os";
|
|
10
|
+
import { join } from "node:path";
|
|
8
11
|
import { createInterface } from "node:readline/promises";
|
|
9
12
|
|
|
10
13
|
const VAULT = "Development";
|
|
@@ -87,8 +90,9 @@ if (existing.status === 0) {
|
|
|
87
90
|
);
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
// 5. Create from a
|
|
91
|
-
//
|
|
93
|
+
// 5. Create the item from a temp template file (0600, unlinked after). Not stdin
|
|
94
|
+
// — bun's spawnSync drops `input`, leaving an empty note; not assignments —
|
|
95
|
+
// those leak the key into argv. The field needs an `id` or op drops it.
|
|
92
96
|
const template = {
|
|
93
97
|
title,
|
|
94
98
|
category: "SECURE_NOTE",
|
|
@@ -97,15 +101,23 @@ const template = {
|
|
|
97
101
|
{ id: "private-key", type: "CONCEALED", label: "private-key", value: privateKey },
|
|
98
102
|
],
|
|
99
103
|
};
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
const templatePath = join(tmpdir(), `bsmnt-op-${randomUUID()}.json`);
|
|
105
|
+
let created;
|
|
106
|
+
try {
|
|
107
|
+
// Inside the try so a partial write is still cleaned up by `finally`.
|
|
108
|
+
writeFileSync(templatePath, JSON.stringify(template), { mode: 0o600 });
|
|
109
|
+
created = spawnSync(
|
|
110
|
+
"op",
|
|
111
|
+
["item", "create", "--template", templatePath, "--vault", VAULT, "--format", "json"],
|
|
112
|
+
{ encoding: "utf-8", stdio: ["ignore", "pipe", "inherit"] },
|
|
113
|
+
);
|
|
114
|
+
} finally {
|
|
115
|
+
try {
|
|
116
|
+
unlinkSync(templatePath);
|
|
117
|
+
} catch {
|
|
118
|
+
// best-effort cleanup
|
|
119
|
+
}
|
|
120
|
+
}
|
|
109
121
|
if (created.status !== 0) fail("\nFailed to create the 1Password item.");
|
|
110
122
|
|
|
111
123
|
// 6. Reference the item by id (stable; survives renames), falling back to title.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "lib/styles/global.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/styles/cn",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/lib/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "phosphor",
|
|
21
|
+
"registries": {
|
|
22
|
+
"@basement": "https://basement-registry.vercel.app/r/{name}.json"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "lib/styles/global.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/styles/cn",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/lib/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "phosphor",
|
|
21
|
+
"registries": {
|
|
22
|
+
"@basement": "https://basement-registry.vercel.app/r/{name}.json"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "lib/styles/global.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/styles/cn",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/lib/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "phosphor",
|
|
21
|
+
"registries": {
|
|
22
|
+
"@basement": "https://basement-registry.vercel.app/r/{name}.json"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "lib/styles/global.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/styles/cn",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/lib/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "phosphor",
|
|
21
|
+
"registries": {
|
|
22
|
+
"@basement": "https://basement-registry.vercel.app/r/{name}.json"
|
|
23
|
+
}
|
|
24
|
+
}
|