@ksm0709/context 0.0.15 → 0.0.17
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/cli/index.js +41 -18
- package/dist/index.js +4 -3
- package/package.json +4 -3
package/dist/cli/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var LIMITS = {
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "@ksm0709/context",
|
|
36
|
-
version: "0.0.
|
|
36
|
+
version: "0.0.17",
|
|
37
37
|
author: {
|
|
38
38
|
name: "TaehoKang",
|
|
39
39
|
email: "ksm07091@gmail.com"
|
|
@@ -60,7 +60,8 @@ var package_default = {
|
|
|
60
60
|
scripts: {
|
|
61
61
|
build: "bun build ./src/index.ts --outdir dist --target bun && bun build ./src/cli/index.ts --outdir dist/cli --target bun",
|
|
62
62
|
test: "vitest run",
|
|
63
|
-
lint: "eslint src --ext .ts"
|
|
63
|
+
lint: "eslint src --ext .ts",
|
|
64
|
+
prepublishOnly: "bun build ./src/index.ts --outdir dist --target bun && bun build ./src/cli/index.ts --outdir dist/cli --target bun"
|
|
64
65
|
},
|
|
65
66
|
files: [
|
|
66
67
|
"dist"
|
|
@@ -69,23 +70,22 @@ var package_default = {
|
|
|
69
70
|
"@opencode-ai/plugin": ">=1.0.0"
|
|
70
71
|
},
|
|
71
72
|
dependencies: {
|
|
72
|
-
"@ksm0709/context": "
|
|
73
|
+
"@ksm0709/context": "0.0.17",
|
|
73
74
|
"jsonc-parser": "^3.0.0"
|
|
74
75
|
},
|
|
75
76
|
devDependencies: {
|
|
76
|
-
"@eslint/js": "^9.39.1",
|
|
77
77
|
"@opencode-ai/plugin": "^1.2.10",
|
|
78
|
+
"@eslint/js": "^9.39.1",
|
|
78
79
|
"@types/node": "^20.11.5",
|
|
79
80
|
"@typescript-eslint/eslint-plugin": "8.47.0",
|
|
80
81
|
"@typescript-eslint/parser": "8.47.0",
|
|
81
|
-
"@vitest/coverage-v8": "^4.0.18",
|
|
82
82
|
"bun-types": "latest",
|
|
83
83
|
eslint: "^9.39.1",
|
|
84
84
|
"eslint-config-prettier": "10.1.8",
|
|
85
85
|
"eslint-plugin-prettier": "^5.1.3",
|
|
86
86
|
prettier: "^3.2.4",
|
|
87
87
|
"typescript-eslint": "^8.47.0",
|
|
88
|
-
vitest: "^
|
|
88
|
+
vitest: "^3.2.4"
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
@@ -604,30 +604,51 @@ function detectPackageManager() {
|
|
|
604
604
|
return "npm";
|
|
605
605
|
return "bun";
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
const
|
|
609
|
-
|
|
607
|
+
function detectGlobalInstalls() {
|
|
608
|
+
const installs = [];
|
|
609
|
+
const bunGlobalBin = join2(homedir(), ".bun", "bin", "context");
|
|
610
|
+
if (existsSync2(bunGlobalBin)) {
|
|
611
|
+
installs.push({ pm: "bun", label: "bun global", installCmd: ["bun", "install", "-g"] });
|
|
612
|
+
}
|
|
613
|
+
const spawnSync = globalThis.Bun?.spawnSync;
|
|
614
|
+
if (spawnSync) {
|
|
615
|
+
const whichResult = spawnSync(["which", "context"]);
|
|
616
|
+
if (whichResult.exitCode === 0) {
|
|
617
|
+
const binPath = whichResult.stdout.toString().trim();
|
|
618
|
+
if (binPath && !binPath.includes(".bun") && !binPath.includes("node_modules")) {
|
|
619
|
+
installs.push({ pm: "npm", label: "npm global", installCmd: ["npm", "install", "-g"] });
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
return installs;
|
|
610
624
|
}
|
|
611
625
|
function runUpdatePlugin(version) {
|
|
612
626
|
const pkg = `@ksm0709/context@${version}`;
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
process.
|
|
627
|
+
const spawnSync = globalThis.Bun?.spawnSync;
|
|
628
|
+
if (!spawnSync) {
|
|
629
|
+
process.stderr.write(`Bun runtime required for plugin updates.
|
|
630
|
+
`);
|
|
631
|
+
process.exit(1);
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
const globalInstalls = detectGlobalInstalls();
|
|
635
|
+
for (const { label, installCmd } of globalInstalls) {
|
|
636
|
+
process.stdout.write(`Updating ${label} ${pkg}...
|
|
616
637
|
`);
|
|
617
|
-
const
|
|
618
|
-
if (
|
|
619
|
-
process.stderr.write(`Failed to update
|
|
638
|
+
const result = spawnSync([...installCmd, pkg]);
|
|
639
|
+
if (result.exitCode !== 0) {
|
|
640
|
+
process.stderr.write(`Failed to update ${label}: ${result.stderr.toString()}
|
|
620
641
|
`);
|
|
621
642
|
process.exit(1);
|
|
622
643
|
return;
|
|
623
644
|
}
|
|
624
|
-
process.stdout.write(`Successfully updated
|
|
645
|
+
process.stdout.write(`Successfully updated ${label} ${pkg}.
|
|
625
646
|
`);
|
|
626
647
|
}
|
|
627
648
|
const pm = detectPackageManager();
|
|
628
649
|
process.stdout.write(`Updating local ${pkg} using ${pm}...
|
|
629
650
|
`);
|
|
630
|
-
const localResult =
|
|
651
|
+
const localResult = spawnSync([pm, "add", pkg]);
|
|
631
652
|
if (localResult.exitCode !== 0) {
|
|
632
653
|
process.stderr.write(`Failed to update local: ${localResult.stderr.toString()}
|
|
633
654
|
`);
|
|
@@ -687,7 +708,9 @@ function runCli(argv) {
|
|
|
687
708
|
process.exit(1);
|
|
688
709
|
}
|
|
689
710
|
}
|
|
690
|
-
|
|
711
|
+
var isBunRuntime = typeof Bun !== "undefined";
|
|
712
|
+
var isMainModule = isBunRuntime && import.meta.path === globalThis.Bun?.main;
|
|
713
|
+
if (isMainModule) {
|
|
691
714
|
runCli(process.argv.slice(2));
|
|
692
715
|
}
|
|
693
716
|
export {
|
package/dist/index.js
CHANGED
|
@@ -1100,7 +1100,7 @@ import { join as join3 } from "path";
|
|
|
1100
1100
|
// package.json
|
|
1101
1101
|
var package_default = {
|
|
1102
1102
|
name: "@ksm0709/context",
|
|
1103
|
-
version: "0.0.
|
|
1103
|
+
version: "0.0.17",
|
|
1104
1104
|
author: {
|
|
1105
1105
|
name: "TaehoKang",
|
|
1106
1106
|
email: "ksm07091@gmail.com"
|
|
@@ -1127,7 +1127,8 @@ var package_default = {
|
|
|
1127
1127
|
scripts: {
|
|
1128
1128
|
build: "bun build ./src/index.ts --outdir dist --target bun && bun build ./src/cli/index.ts --outdir dist/cli --target bun",
|
|
1129
1129
|
test: "vitest run",
|
|
1130
|
-
lint: "eslint src --ext .ts"
|
|
1130
|
+
lint: "eslint src --ext .ts",
|
|
1131
|
+
prepublishOnly: "bun build ./src/index.ts --outdir dist --target bun && bun build ./src/cli/index.ts --outdir dist/cli --target bun"
|
|
1131
1132
|
},
|
|
1132
1133
|
files: [
|
|
1133
1134
|
"dist"
|
|
@@ -1136,7 +1137,7 @@ var package_default = {
|
|
|
1136
1137
|
"@opencode-ai/plugin": ">=1.0.0"
|
|
1137
1138
|
},
|
|
1138
1139
|
dependencies: {
|
|
1139
|
-
"@ksm0709/context": "
|
|
1140
|
+
"@ksm0709/context": "0.0.17",
|
|
1140
1141
|
"jsonc-parser": "^3.0.0"
|
|
1141
1142
|
},
|
|
1142
1143
|
devDependencies: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ksm0709/context",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "TaehoKang",
|
|
6
6
|
"email": "ksm07091@gmail.com"
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "bun build ./src/index.ts --outdir dist --target bun && bun build ./src/cli/index.ts --outdir dist/cli --target bun",
|
|
29
29
|
"test": "vitest run",
|
|
30
|
-
"lint": "eslint src --ext .ts"
|
|
30
|
+
"lint": "eslint src --ext .ts",
|
|
31
|
+
"prepublishOnly": "bun build ./src/index.ts --outdir dist --target bun && bun build ./src/cli/index.ts --outdir dist/cli --target bun"
|
|
31
32
|
},
|
|
32
33
|
"files": [
|
|
33
34
|
"dist"
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"@opencode-ai/plugin": ">=1.0.0"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@ksm0709/context": "
|
|
40
|
+
"@ksm0709/context": "0.0.17",
|
|
40
41
|
"jsonc-parser": "^3.0.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|