Comments (7)
For the memory part, I would like to implement a size checker before running. If the file size exceeds a limit, the tool will ask you to confirm, with a hint that guides users on how to configure the memory limit to prevent OOM.
from wakaru.
I think the simple solution is to add a contribution guide and an issue template like what @0xdevalias said. Collecting code snippets anonymously seems impossible.
from wakaru.
Let me finalize what we can do in this issue:
- Automatically catch exceptions and create URLs where issues can be submitted
- Implement a size checker before running. If the file size exceeds a limit, the tool give a hint that guides users on how to configure the memory limit to prevent OOM.
from wakaru.
For 2, you mean like collecting what rules users tend to enable?
For 3, I don't have any plan to do i18n on CLI tbh π€
from wakaru.
For 2, you mean like collecting what rules users tend to enable?
yes, or collect some minimal chunks of code that have not been hit by any rule for updating new rules.
It can also be used, for example, for packaged code that is not known but can be identified as a jsx (known component).
from wakaru.
or collect some minimal chunks of code that have not been hit by any rule for updating new rules
This part sounds like it could be rather hard to automate; it seems like the kind of thing that would be better suited to being done manually; but perhaps a special issue template could be added to help guide users with the right info to provide for it:
from wakaru.
There are a few basic CLI type patterns that could potentially be done to 'guide' the user towards creating an issue; and prefilling some of the information as well. I haven't deeply explored it, but here is a quick high level ChatGPT query/response for it:
Details
My Prompt
For a CLI written in node, I want to be able to make it easy for end users to open relevant GitHub issues for bugs/etc.
- How could I go about implementing this?
- Are there any standard patterns for how other tools do it?
- Are there any libraries that can help me?
ChatGPT's Response
To implement a feature in your Node.js CLI application that allows end users to easily open relevant GitHub issues for bugs or other concerns, you can follow these steps:
Steps to Implement the Feature
Capture Error Information: When an error or issue occurs in your application, capture relevant details such as the error message, stack trace, and any specific application context.
Prompt the User: When an error is detected, prompt the user with an option to report the issue. You can use libraries like
inquirer.js
for interactive CLI prompts.Format Issue Details: Format the captured error information into a readable and useful format for the issue report.
Generate GitHub Issue URL: Create a URL to open a new issue on your GitHub repository, prefilling details using query parameters. The URL format is:
https://github.com/[username]/[repository]/issues/new?title=[issue_title]&body=[issue_body]
Open the URL in Userβs Browser: Use a Node.js library like
open
to open the generated URL in the user's default web browser.Example Code Snippet
const open = require('open'); const inquirer = require('inquirer'); function reportIssue(error) { const issueTitle = encodeURIComponent("Bug Report: " + error.message); const issueBody = encodeURIComponent("Error Details:\n" + error.stack + "\n\nContext:\n..."); const githubUrl = `https://github.com/yourusername/yourrepo/issues/new?title=${issueTitle}&body=${issueBody}`; inquirer.prompt([{ type: 'confirm', name: 'openIssue', message: 'Would you like to report this issue to GitHub?', }]).then(answers => { if (answers.openIssue) { open(githubUrl); } }); } // Example usage try { // Your code logic } catch (error) { reportIssue(error); }Standard Patterns and Libraries
- Libraries:
inquirer.js
for CLI interactions,open
to open URLs in a browser.- Standard Pattern: Many CLI tools prompt the user to report the issue with pre-filled details on encountering an error. The approach of formatting the error and opening a GitHub issue URL is fairly standard.
Additional Considerations
- User Consent: Always get user consent before opening the browser, as it can be intrusive.
- Sensitive Information: Be cautious about including sensitive information in automated error reports.
- Customization: Allow users to add additional comments or details before submitting the issue.
This approach aligns with standard practices and uses popular Node.js libraries for implementation. Remember to replace
yourusername
andyourrepo
with your actual GitHub username and repository name in the URL.
from wakaru.
Related Issues (20)
- [unpacker] SyntaxError: Private name #Y is not defined HOT 7
- [unminify-bugs] Multiple errors during unminify with CLI 0.0.5 HOT 18
- Support `--perf-output` in CLI
- Improve CJS / ESM transformation (`un-esm`
- Next.js webpackJsonp_N_E HOT 1
- @wakaru/ide:build: RollupError: Identifier "a" has already been declared HOT 2
- infinite loop? wakaru unminify runs forever HOT 2
- wakaru removes unused imports HOT 1
- document.createElement is converted to JSX HOT 12
- inline constant tag name in JSX transformation HOT 4
- CLI: add support for config files HOT 7
- broken output code: ReferenceError: x is not defined HOT 1
- smart-rename is missing some renames HOT 7
- Explore creating a 'reverse engineered' records.json / stats.json file from a webpack build HOT 1
- un-sequence-expression is incorrect HOT 1
- wrong position for default parameters HOT 1
- Contexts that are too large are not further parsed for objects within the array. HOT 1
- feat: support Webpack SplitChunksPlugin HOT 6
- BrowserFS Deprecated HOT 1
- React 19 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wakaru.