Skip to content

Conversation

AbijahKaj
Copy link

@AbijahKaj AbijahKaj commented Jul 26, 2025

This pull request introduces several key updates to improve the KiCanvas project, including enhancements to NPM package support, documentation, and code structure. The changes focus on enabling NPM distribution, refining TypeScript support, and streamlining the codebase for better maintainability and usability.

NPM Package Enhancements:

  • Updated package.json to include NPM-specific properties such as main, types, exports, and files for proper packaging and distribution. Added prepublishOnly and pack scripts to automate the build and packaging process. [1] [2]
  • Added .npmignore to exclude unnecessary files like source code, test files, and build artifacts from the published NPM package.
  • Solves this issue: Example of using KiCanvas with Typescript #102

Documentation Updates:

  • Created a comprehensive docs/docs/npm-usage.md guide for using KiCanvas as an NPM package, including installation instructions, usage examples, and TypeScript support details.
  • Updated docs/mkdocs.yml to include the new "NPM Package Usage" documentation in the navigation menu.

Codebase Improvements:

  • Refactored src/index.ts to export all major modules, components, and utilities in a structured format for easier imports and better organization.
  • Updated src/kicad/parser.ts to export the Kind enum for external use, improving modularity.

Web Component Refinements:

  • Simplified CustomElement class in src/base/web-components/custom-element.ts by making updateComplete and disposables public and removing the protected modifier from queryAssignedElements. [1] [2]

Minor Configuration Changes:

  • Adjusted .vscode/settings.json to remove the exclusion of the build/ directory, simplifying the development environment.

@theacodes
Copy link
Owner

Hello, a quick question before I review: did you use AI in creating this pull request?

@AbijahKaj
Copy link
Author

Hello @theacodes ! Yes I used AI, the pull request overview was generated by copilot (I edited a bit but not much), for the code cursor helped me to make sure I was exporting other important components and not just what I needed.

@theacodes
Copy link
Owner

Great. Thank you for your honesty.

However, I will not be accepting any contributions to this repository that use generative AI in any form.

Furthermore, this PR does entirely too many things and does several things that are explicitly against the goals of the project. I wish you'd filed an issue first to discuss - in fact, the very first thing mentioned in the contributing documentation says:

Contributions are welcome! However, since KiCanvas is in a super early stage please file an issue before you start working on something so we can coordinate.

I'm closing this pull request and will not be providing any additional feedback on AI-generated code.

@theacodes theacodes closed this Jul 27, 2025
@AbijahKaj AbijahKaj deleted the main branch August 3, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants