@meowlynxsea/koi 0.2.10 → 0.2.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meowlynxsea/koi",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "A coding agent built on Pi SDK with TUI + Bun runtime",
5
5
  "module": "src/main.tsx",
6
6
  "type": "module",
@@ -34,7 +34,7 @@
34
34
  "scripts": {
35
35
  "dev": "bun run src/main.tsx",
36
36
  "postinstall": "bun run scripts/postinstall.ts",
37
- "build": "bun build src/main.tsx --outdir dist --target bun && cp node_modules/@opentui/core/parser.worker.js dist/ && cp -r node_modules/@opentui/core/assets dist/opentui-assets && mkdir -p dist/cce-frontend && cp -r src/cce/web/frontend/dist/* dist/cce-frontend/ && mkdir -p dist/onnx-bin/napi-v3/darwin/arm64 && cp node_modules/onnxruntime-node/bin/napi-v3/darwin/arm64/* dist/onnx-bin/napi-v3/darwin/arm64/ && cp src/cce/core/schema.sql dist/ && bun run scripts/postbuild.ts",
37
+ "build": "bun build src/main.tsx --outdir dist --target bun && cp node_modules/@opentui/core/parser.worker.js dist/ && cp -r node_modules/@opentui/core/assets dist/opentui-assets && mkdir -p dist/cce-frontend && cp -r src/cce/web/frontend/dist/* dist/cce-frontend/ && mkdir -p dist/onnx-bin/napi-v3/darwin/arm64 && cp node_modules/onnxruntime-node/bin/napi-v3/darwin/arm64/* dist/onnx-bin/napi-v3/darwin/arm64/ && cp src/cce/core/schema.sql dist/ && mkdir -p dist/node_modules && for pkg in '@opentui/core-darwin-arm64' '@opentui/core-darwin-x64' '@opentui/core-linux-arm64' '@opentui/core-linux-x64' '@opentui/core-win32-arm64' '@opentui/core-win32-x64'; do if [ -d \"node_modules/$pkg\" ]; then mkdir -p \"dist/node_modules/$pkg\" && cp -r \"node_modules/$pkg/\"* \"dist/node_modules/$pkg/\"; fi; done && bun run scripts/postbuild.ts",
38
38
  "check": "tsc --noEmit",
39
39
  "lint": "eslint src/",
40
40
  "lint:fix": "eslint src/ --fix"
@@ -27,7 +27,9 @@ const platformModules = [
27
27
 
28
28
  // Platform modules installation is now handled by the installer scripts
29
29
  // to avoid infinite recursion when using bun add in postinstall
30
- // This script only creates the shim files for existing platform modules
30
+ // This script creates shim files AND copies platform modules to dist/node_modules
31
+
32
+ import { mkdirSync, cpSync } from "fs";
31
33
 
32
34
  const indexJsContent = `const module = await import("./libopentui.dylib", { with: { type: "file" } });
33
35
  export default module.default;
@@ -63,6 +65,14 @@ for (const moduleName of platformModules) {
63
65
  console.log(`Updated ${moduleName}/package.json`);
64
66
  }
65
67
  }
68
+
69
+ // Copy platform module to dist/node_modules for proper module resolution
70
+ const distNodeModules = join(rootDir, "dist", "node_modules", moduleName);
71
+ if (!existsSync(distNodeModules)) {
72
+ mkdirSync(dirname(distNodeModules), { recursive: true });
73
+ cpSync(modulePath, distNodeModules, { recursive: true });
74
+ console.log(`Copied ${moduleName} to dist/node_modules/`);
75
+ }
66
76
  }
67
77
 
68
78
  // Fix @opentui/core's dynamic import to use .js instead of .ts