cli: pocket compile --aot in a source checkout reports the missing pocketjs.wasm without naming the command that builds it

Đang mở Phù hợp với người mới
#724 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, typescript, wasm
Lĩnh vực
cli

Hướng nghiên cứu

Mở tools/aot-compile.ts quanh các dòng 128-129, nơi oracle layout bị thiếu được nêu ra, và so sánh với cách diễn đạt đã dùng cho cùng tệp tại site/microts/lib/kit.ts:53. Tái hiện bằng lệnh biên dịch --aot trong một checkout không có platforms/web/pocketjs.wasm, sau đó viết lại lỗi để nó nêu tên bun tools/wasm.ts và yêu cầu rustup target add wasm32-unknown-unknown; tools/wasm.ts xuất ensureHostWasm() nếu bản sửa thay vào đó tự build asset. Hoàn tất nghĩa là thông báo cho người dùng checkout biết cách tạo ra tệp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Version

PocketJS v0.17.0 (83c6cac9, current main), used as a git submodule. macOS 27.2 arm64, Bun 1.4.2.

Repro

In a fresh clone of the repository (no platforms/web/pocketjs.wasm; the file is in .gitignore), compile any aot: true application:

bun $POCKETJS/tools/pocket.ts compile --config pocket.host.config.ts --aot --out gen

Actual

✓ pocket.host.config.ts app
✓ repro-esp32s3 hosts the application
✓ TypeScript (62 app module(s))
✓ ResolvedBuildPlan sha256:…
PocketJS: AOT: prebuilt layout oracle not found: <pocketjs>/platforms/web/pocketjs.wasm; install/build the compiler's wasm asset before compilation

cli.md states that a missing oracle is an error but not how to produce it. The npm package ships the file (files whitelist; CI runs bun tools/wasm.ts before publishing, skills/pocketjs-release/SKILL.md), so the case arises in checkouts: a framework clone, or a product that pins PocketJS as a submodule and runs the CLI from it, as an ESP-IDF build does.

Expected

In a checkout the message names the command and its requirement, for example:

AOT: the layout oracle platforms/web/pocketjs.wasm is missing; build it with `bun tools/wasm.ts` (needs `rustup target add wasm32-unknown-unknown`)

site/microts/lib/kit.ts:53 already reports the same file this way. Alternatively the CLI builds it: tools/wasm.ts exports ensureHostWasm().

Cause

tools/aot-compile.ts:128–129.

Workaround

Run bun tools/wasm.ts in the PocketJS checkout before the first AOT compile.

Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
88
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pocket-stack/pocketjs

Tất cả issue của pocket-stack/pocketjs

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.