Skip to content

Commit

Permalink
chores
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Jan 27, 2024
1 parent a77812d commit 398c12d
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "\U0001F41B Bug Report"
description: Report an issue or possible bug
labels: []
assignees: []
body:
- type: markdown
attributes:
value: |
## Quick Checklist
Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.
✅ I am using the **latest version of the Bag of Tricks**
✅ I have searched all issues here to see if this has already been reported
- type: textarea
id: bug-description
attributes:
label: Describe the Bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: bug-expectation
attributes:
label: What's the expected result?
description: Describe what you expect to happen.
validations:
required: true
- type: input
id: bug-reproduction
attributes:
label: Link to Minimal Reproducible Example
description: '**A minimal reproduction is required** so that others can help debug your issue.'
placeholder: 'https://github.com/you/your-minimal-repo'
validations:
required: true
- type: checkboxes
id: will-pr
attributes:
label: Participation
options:
- label: I am willing to submit a pull request for this issue.
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Issue or feature request
url: https://github.com/martrapp/astro-vtbot/issues/new/choose
about: Report bugs or request a new trick for the bag using this link.
- name: GitHub Discussions
url: https://github.com/martrapp/astro-vtbot/discussions
about: Does the issue involve a lot of explanation, or are you not sure how it can be split into actionable tasks? Consider starting a discussion first.
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- 🙌 Thanks for contributing to the astro-vtbot package! -->
### Description

- Summarize your changes in one or two sentences.
- Don't forget `npm changeset`

### Tests

- How was this change tested?


### Docs & Examples

- Does your change here require changes to the astro-vtbot-website?
23 changes: 23 additions & 0 deletions components/derive-css-selector.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export function deriveCSSSelector(element: Element, useIds = true) {
let path: string[] = [];
while (element && element.nodeType === Node.ELEMENT_NODE) {
let selector = element.nodeName.toLowerCase();
if (useIds && element.id) {
selector = '#' + element.id;
path.unshift(selector);
break;
} else {
let sibling = element;
let nth = 1;
while ((sibling = sibling.previousElementSibling as Element)) {
if (sibling.nodeName.toLowerCase() === selector) nth++;
}
if (nth !== 1) {
selector += ':nth-of-type(' + nth + ')';
}
}
path.unshift(selector);
element = element.parentNode as Element;
}
return path.join(' > ');
}

0 comments on commit 398c12d

Please sign in to comment.