Browse Source

Merge branch 'master' into fix/issue-345

zero 3 months ago
parent
commit
f4afcb9bd7
5 changed files with 24 additions and 8 deletions
  1. 9 0
      .all-contributorsrc
  2. 2 1
      README.md
  3. 4 1
      bun.lock
  4. 8 5
      package.json
  5. 1 1
      src/hooks/image-hook.ts

+ 9 - 0
.all-contributorsrc

@@ -371,6 +371,15 @@
       "contributions": [
         "code"
       ]
+    },
+    {
+      "login": "zuuky",
+      "name": "zero",
+      "avatar_url": "https://avatars.githubusercontent.com/u/6713415?v=4",
+      "profile": "https://github.com/zuuky",
+      "contributions": [
+        "code"
+      ]
     }
   ],
   "commitConvention": "angular"

+ 2 - 1
README.md

@@ -483,7 +483,7 @@ Use this section as a map: start with installation, then jump to features, confi
   <p><sub>Every merged contribution leaves a mark on the realm.</sub></p>
 
   <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
-[![All Contributors](https://img.shields.io/badge/all_contributors-40-orange.svg?style=flat-square)](#contributors-)
+[![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors-)
 <!-- ALL-CONTRIBUTORS-BADGE:END -->
 </div>
 
@@ -547,6 +547,7 @@ Use this section as a map: start with installation, then jump to features, confi
       <td align="center" valign="top" width="16.66%"><a href="https://github.com/jwcrystal"><img src="https://avatars.githubusercontent.com/u/121911854?v=4?s=100" width="100px;" alt="jwcrystal"/><br /><sub><b>jwcrystal</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=jwcrystal" title="Code">💻</a></td>
       <td align="center" valign="top" width="16.66%"><a href="https://zenstudio.cv/"><img src="https://avatars.githubusercontent.com/u/10528635?v=4?s=100" width="100px;" alt="Nguyen Canh Toan"/><br /><sub><b>Nguyen Canh Toan</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=ZenStudioLab" title="Code">💻</a></td>
       <td align="center" valign="top" width="16.66%"><a href="https://github.com/tom-dyar"><img src="https://avatars.githubusercontent.com/u/8899513?v=4?s=100" width="100px;" alt="Thomas Dyar"/><br /><sub><b>Thomas Dyar</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=tom-dyar" title="Code">💻</a></td>
+      <td align="center" valign="top" width="16.66%"><a href="https://github.com/zuuky"><img src="https://avatars.githubusercontent.com/u/6713415?v=4?s=100" width="100px;" alt="zero"/><br /><sub><b>zero</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=zuuky" title="Code">💻</a></td>
     </tr>
   </tbody>
 </table>

+ 4 - 1
bun.lock

@@ -16,7 +16,6 @@
         "vscode-jsonrpc": "^8.2.1",
         "vscode-languageserver-protocol": "^3.17.5",
         "which": "^6.0.1",
-        "zod": "^4.3.6",
       },
       "devDependencies": {
         "@biomejs/biome": "2.4.11",
@@ -27,6 +26,10 @@
         "all-contributors-cli": "^6.26.1",
         "bun-types": "1.3.12",
         "typescript": "^5.9.3",
+        "zod": "^4.3.6",
+      },
+      "peerDependencies": {
+        "zod": "^4.0.0",
       },
     },
   },

+ 8 - 5
package.json

@@ -36,8 +36,8 @@
     "LICENSE"
   ],
   "scripts": {
-    "build:plugin": "bun build src/index.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom",
-    "build:cli": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom",
+    "build:plugin": "bun build src/index.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom --external zod",
+    "build:cli": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom --external zod",
     "build": "bun run build:plugin && bun run build:cli && tsc --emitDeclarationOnly && bun run generate-schema",
     "prepare": "bun run build",
     "contributors:add": "all-contributors add",
@@ -69,8 +69,7 @@
     "turndown": "^7.2.4",
     "vscode-jsonrpc": "^8.2.1",
     "vscode-languageserver-protocol": "^3.17.5",
-    "which": "^6.0.1",
-    "zod": "^4.3.6"
+    "which": "^6.0.1"
   },
   "devDependencies": {
     "@biomejs/biome": "2.4.11",
@@ -80,7 +79,11 @@
     "@types/which": "^3.0.4",
     "all-contributors-cli": "^6.26.1",
     "bun-types": "1.3.12",
-    "typescript": "^5.9.3"
+    "typescript": "^5.9.3",
+    "zod": "^4.3.6"
+  },
+  "peerDependencies": {
+    "zod": "^4.0.0"
   },
   "trustedDependencies": [
     "@ast-grep/cli"

+ 1 - 1
src/hooks/image-hook.ts

@@ -108,7 +108,7 @@ function writeUniqueFile(
   const base = basename(name, ext) || name;
   let candidate = join(dir, name);
   if (existsSync(candidate)) {
-    return null;
+    return candidate;
   }
   let counter = 0;