uuki / lit-issue-reporter

Web application debugger. Provides form UI and issue submission functionality.

Home Page:https://lit-issue-reporter.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lit-issue-reporter

main branch parameter Downloads Version License Vercel deployment

This library allows anyone to submit issues directly from a web application.
It is made of web-component (lit), provided as an ES module, and can be used in various FWs and designs.

Vanilla JS, React, Vue, Svelte ...

DEMO

demo.mp4

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Edge last 2 versions last 2 versions
  • Currently, some custom components are not supported, and Safari does not work.

πŸ€” Why is this needed?

During application development, when reporting a problem, it may not be easy for a non-engineer to intuitively imagine the information needed for verification.

This library, in addition to GitHub's Issue Template feature, automatically supplements the user's environment information to aid reproducibility.

✨ Features

  • πŸ“ Provide a form for the web application to submit a form (using GitHub API v4)
  • πŸ—‚οΈ Issue Templates configured in the repository can be used
  • πŸ”¦ Automatically adds information such as location, browser, OS, screen size, and monitor resolution
  • 🌏 All text in the form UI can be replaced with arbitrary text
  • πŸ“Έ Additional screenshot data can be added (available but in development)

πŸ“¦ Install

yarn add lit-issue-reporter

🐣 Usage

Prepare

You must first issue a personal access token (PAT) with access permission to any repository from settings/tokens.

  • Please be careful when handling it, as it requires a repo scope!
  • It is recommended that PAT not be pushed to the remote side. for example, manage it in the .env variable and then ignore the build file.
    Also, be sure to use it in a restricted environment, as it will be embedded in your application.

Setup

if (process.env.NODE_ENV !== 'production') {
  import('lit-issue-reporter').then(({ createReporter }) => {
    createReporter({
      token: process.env.GITHUB_TOKEN,
      owner: '<GITHUB_USER_NAME>',
      repository: '<GITHUB_REPOSITORY_NAME>',
    })
  })
}

Then add to any position.

...
<issue-reporter></issue-reporter>
</body>

Finally, add a style.

@import 'lit-issue-reporter/dist/style.css';

Options

key type default description
lang 'ja' | 'en' 'ja' i18n by lit-translate
stringsLoader (lang) => Promise<Strings> (lang) => import(./locales/${lang}.json) Can be replaced by specifying any loader
noticeDuration number 4000 Notification time to open issues
insertFrom boolean true The following text will be inserted at the end of the body. Sent by lit-issue-repoter

License

lit-issue-reporter is available under the MIT License.

About

Web application debugger. Provides form UI and issue submission functionality.

https://lit-issue-reporter.vercel.app/

License:MIT License


Languages

Language:TypeScript 99.4%Language:CSS 0.4%Language:HTML 0.1%Language:JavaScript 0.1%Language:Shell 0.0%