@primitive.ai/prim 0.1.0-alpha.1 → 0.1.0-alpha.7
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 +10 -5
- package/package.json +17 -16
package/dist/index.js
CHANGED
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
} from "./chunk-3APLWTLB.js";
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
15
|
+
import { dirname as dirname2, resolve as resolve2 } from "path";
|
|
16
|
+
import { fileURLToPath } from "url";
|
|
14
17
|
import { Command } from "commander";
|
|
15
18
|
|
|
16
19
|
// src/commands/auth.ts
|
|
@@ -100,10 +103,10 @@ function registerAuthCommands(program2) {
|
|
|
100
103
|
process.exit(1);
|
|
101
104
|
});
|
|
102
105
|
});
|
|
103
|
-
const port = await new Promise((
|
|
106
|
+
const port = await new Promise((resolve3) => {
|
|
104
107
|
server.listen(CALLBACK_PORT, LOCALHOST, () => {
|
|
105
108
|
const addr = server.address();
|
|
106
|
-
|
|
109
|
+
resolve3(typeof addr === "object" && addr ? addr.port : 0);
|
|
107
110
|
});
|
|
108
111
|
});
|
|
109
112
|
const redirectUri = `http://${LOCALHOST}:${port}/callback`;
|
|
@@ -357,8 +360,8 @@ function detectHusky(gitRoot) {
|
|
|
357
360
|
const pkgPath = resolve(gitRoot, "package.json");
|
|
358
361
|
if (existsSync2(pkgPath)) {
|
|
359
362
|
try {
|
|
360
|
-
const
|
|
361
|
-
const scripts =
|
|
363
|
+
const pkg2 = JSON.parse(readFileSync3(pkgPath, "utf-8"));
|
|
364
|
+
const scripts = pkg2.scripts ?? {};
|
|
362
365
|
if (/husky/i.test(scripts.prepare ?? "") || /husky/i.test(scripts.postinstall ?? "")) {
|
|
363
366
|
return true;
|
|
364
367
|
}
|
|
@@ -596,8 +599,10 @@ function registerTaskCommands(program2) {
|
|
|
596
599
|
}
|
|
597
600
|
|
|
598
601
|
// src/index.ts
|
|
602
|
+
var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
603
|
+
var pkg = JSON.parse(readFileSync5(resolve2(__dirname, "../package.json"), "utf-8"));
|
|
599
604
|
var program = new Command();
|
|
600
|
-
program.name("prim").description("CLI for managing Primitive specs and contexts").version(
|
|
605
|
+
program.name("prim").description("CLI for managing Primitive specs and contexts").version(pkg.version);
|
|
601
606
|
registerAuthCommands(program);
|
|
602
607
|
registerContextCommands(program);
|
|
603
608
|
registerSpecCommands(program);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitive.ai/prim",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"description": "CLI for managing Primitive specs, contexts, and git hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/campus-ai/prim.git"
|
|
9
|
+
"url": "git+https://github.com/campus-ai/prim.git"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://github.com/campus-ai/prim#readme",
|
|
12
12
|
"bugs": {
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=20.0.0"
|
|
28
28
|
},
|
|
29
|
+
"packageManager": "pnpm@9.15.9",
|
|
29
30
|
"bin": {
|
|
30
|
-
"prim": "
|
|
31
|
-
"prim-pre-commit": "
|
|
31
|
+
"prim": "dist/index.js",
|
|
32
|
+
"prim-pre-commit": "dist/hooks/pre-commit.js"
|
|
32
33
|
},
|
|
33
34
|
"main": "./dist/index.js",
|
|
34
35
|
"files": [
|
|
@@ -36,17 +37,6 @@
|
|
|
36
37
|
"LICENSE",
|
|
37
38
|
"README.md"
|
|
38
39
|
],
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"commander": "^12.1.0"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@biomejs/biome": "^1.9.0",
|
|
44
|
-
"@types/node": "^25.5.0",
|
|
45
|
-
"@vitest/coverage-v8": "^3.1.0",
|
|
46
|
-
"tsup": "^8.0.0",
|
|
47
|
-
"typescript": "^5.5.0",
|
|
48
|
-
"vitest": "^3.1.0"
|
|
49
|
-
},
|
|
50
40
|
"scripts": {
|
|
51
41
|
"build": "tsup src/index.ts src/hooks/pre-commit.ts --format esm --clean",
|
|
52
42
|
"postbuild": "chmod +x ./dist/index.js ./dist/hooks/pre-commit.js",
|
|
@@ -59,5 +49,16 @@
|
|
|
59
49
|
"test": "vitest run",
|
|
60
50
|
"test:watch": "vitest",
|
|
61
51
|
"test:coverage": "vitest run --coverage"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"commander": "^12.1.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@biomejs/biome": "^1.9.0",
|
|
58
|
+
"@types/node": "^25.5.0",
|
|
59
|
+
"@vitest/coverage-v8": "^3.1.0",
|
|
60
|
+
"tsup": "^8.0.0",
|
|
61
|
+
"typescript": "^5.5.0",
|
|
62
|
+
"vitest": "^3.1.0"
|
|
62
63
|
}
|
|
63
|
-
}
|
|
64
|
+
}
|