Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Fix the widget `require` export that points at the browser bundle

Đã đóng
#179 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/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ệ
node.js, typescript
Lĩnh vực
build-system, devtools

Hướng nghiên cứu

Start with packages/widget/package.json and inspect its exports, main, and dist/chatcops.min.js entries; then read CONTRIBUTING.md for the pnpm build workflow. Check the root package scripts and CI configuration to see how the three packages are built and validated. Done when publint passes for core, server, and widget, the widget export has only types and import, the quick start script tag still works, and a patch changeset is added.

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

Mô tả

bug good first issue hacktoberfest widget

packages/widget/package.json maps require to ./dist/chatcops.min.js (line 13). That file is the IIFE for script tags: it assigns window.ChatCops and never sets module.exports. The package is also "type": "module", so Node loads that file as ESM anyway. require('@chatcops/widget') therefore never returns the widget API.

What to do

  • Remove the require condition, so CommonJS consumers get a clear error (or use Node's require(esm) on the import file) instead of a silent empty object.
  • Leave main and the dist/chatcops.min.js path alone: the CDN snippet in the docs links to that file directly.
  • Add publint as a root dev dependency and a pnpm publint script that checks all three packages, and run it in CI after the build.

Acceptance criteria

  • exports["."] in the widget has types and import only
  • pnpm publint passes for core, server and widget (fix or explain anything else it reports)
  • The script tag snippet from the quick start still works with the built file
  • Changeset for @chatcops/widget (patch)

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

Ngôn ngữ chính
TypeScript
Star
13
Fork
7
Merge trung bình
4 giờ 11 phút
Pull request đã merge (30 ngày)
122

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

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 codercops/chatcops

Tất cả issue của codercops/chatcops

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.