ocx 1.0.1 → 1.0.2
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/dist/index.js +8 -10
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4510,7 +4510,7 @@ var {
|
|
|
4510
4510
|
// src/commands/add.ts
|
|
4511
4511
|
import { createHash } from "crypto";
|
|
4512
4512
|
import { existsSync } from "fs";
|
|
4513
|
-
import { mkdir,
|
|
4513
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
4514
4514
|
import { dirname, join } from "path";
|
|
4515
4515
|
|
|
4516
4516
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
@@ -10552,17 +10552,15 @@ function registerAddCommand(program2) {
|
|
|
10552
10552
|
}
|
|
10553
10553
|
async function runAdd(componentNames, options2) {
|
|
10554
10554
|
const cwd = options2.cwd ?? process.cwd();
|
|
10555
|
-
const configPath = join(cwd, "ocx.jsonc");
|
|
10556
10555
|
const lockPath = join(cwd, "ocx.lock");
|
|
10557
|
-
|
|
10556
|
+
const config = await readOcxConfig(cwd);
|
|
10557
|
+
if (!config) {
|
|
10558
10558
|
throw new ConfigError("No ocx.jsonc found. Run 'ocx init' first.");
|
|
10559
10559
|
}
|
|
10560
|
-
const configContent = await readFile(configPath, "utf-8");
|
|
10561
|
-
const config = ocxConfigSchema.parse(JSON.parse(configContent));
|
|
10562
10560
|
let lock = { lockVersion: 1, installed: {} };
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
lock =
|
|
10561
|
+
const existingLock = await readOcxLock(cwd);
|
|
10562
|
+
if (existingLock) {
|
|
10563
|
+
lock = existingLock;
|
|
10566
10564
|
}
|
|
10567
10565
|
const spin = options2.quiet ? null : createSpinner({ text: "Resolving dependencies..." });
|
|
10568
10566
|
spin?.start();
|
|
@@ -11929,7 +11927,7 @@ function registerSearchCommand(program2) {
|
|
|
11929
11927
|
}
|
|
11930
11928
|
|
|
11931
11929
|
// src/index.ts
|
|
11932
|
-
var version =
|
|
11930
|
+
var version = "1.0.2";
|
|
11933
11931
|
async function main2() {
|
|
11934
11932
|
const program2 = new Command().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(version);
|
|
11935
11933
|
registerInitCommand(program2);
|
|
@@ -11944,4 +11942,4 @@ main2().catch((err) => {
|
|
|
11944
11942
|
handleError(err);
|
|
11945
11943
|
});
|
|
11946
11944
|
|
|
11947
|
-
//# debugId=
|
|
11945
|
+
//# debugId=E1F0036F628E968A64756E2164756E21
|