Skip to content

Commit b53be97

Browse files
Import template
0 parents  commit b53be97

24 files changed

Lines changed: 1106 additions & 0 deletions

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# .editorconfig
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.{js,json,md,yml,yaml}]
11+
indent_style = tab
12+
indent_size = 4
13+
14+
[*.{yml,yaml}]
15+
indent_style = space
16+
indent_size = 2

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text=auto eol=lf
2+
*.js text eol=lf
3+
*.json text eol=lf
4+
*.md text eol=lf
5+
*.yml text eol=lf
6+
*.yaml text eol=lf
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
## Expected Behavior
21+
22+
A clear and concise description of what you expected to happen.
23+
24+
## Actual Behavior
25+
26+
A clear and concise description of what actually happened.
27+
28+
## Screenshots
29+
30+
If applicable, add screenshots to help explain your problem.
31+
32+
## Environment
33+
34+
- Browser: [e.g. Chrome 120, Firefox 121, Safari 17]
35+
- OS: [e.g. macOS 14.0, Windows 11, Ubuntu 22.04]
36+
- Component Version: [e.g. 1.0.0]
37+
38+
## Additional Context
39+
40+
Add any other context about the problem here.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Problem Statement
10+
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
## Proposed Solution
14+
15+
A clear and concise description of what you want to happen.
16+
17+
## Alternatives Considered
18+
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
## Additional Context
22+
23+
Add any other context or screenshots about the feature request here.
24+
25+
## Possible Implementation
26+
27+
If you have ideas about how this could be implemented, please share them here.

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "npm"
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linter
30+
run: npm run lint
31+
32+
- name: Run tests
33+
run: npm run test:run
34+
35+
- name: Generate coverage report
36+
run: npm run test:coverage
37+
if: matrix.node-version == '20.x'

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "20.x"
23+
registry-url: "https://registry.npmjs.org"
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run tests
29+
run: npm run test:run
30+
31+
- name: Publish to npm
32+
run: npm publish --provenance
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
package-lock.json

.npmignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules/
2+
package-lock.json
3+
test/
4+
demo/
5+
scripts/
6+
.prettierrc
7+
.editorconfig
8+
.gitattributes
9+
eslint.config.js
10+
vitest.config.js
11+
.git
12+
.gitignore
13+
.github/
14+
SETUP.md
15+
TEMPLATE_README.md
16+
CONTRIBUTING.md
17+
coverage/

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"arrowParens": "always",
3+
"singleQuote": true,
4+
"tabWidth": 4,
5+
"useTabs": true
6+
}

COMPONENT-NAME.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* ComponentNameElement - COMPONENT_DESCRIPTION
3+
*
4+
* @element COMPONENT-NAME
5+
*
6+
* @attr {string} example-attribute - Description of the attribute
7+
*
8+
* @fires COMPONENT-NAME:event-name - Description of the event
9+
*
10+
* @slot - Default slot for content
11+
*
12+
* @cssprop --component-name-color - Description of CSS custom property
13+
*/
14+
export class ComponentNameElement extends HTMLElement {
15+
static get observedAttributes() {
16+
return ['example-attribute'];
17+
}
18+
19+
constructor() {
20+
super();
21+
this.attachShadow({ mode: 'open' });
22+
}
23+
24+
connectedCallback() {
25+
this.render();
26+
}
27+
28+
attributeChangedCallback(name, oldValue, newValue) {
29+
if (oldValue !== newValue) {
30+
this.render();
31+
}
32+
}
33+
34+
render() {
35+
this.shadowRoot.innerHTML = `
36+
<style>
37+
:host {
38+
display: block;
39+
}
40+
</style>
41+
<slot></slot>
42+
`;
43+
}
44+
}

0 commit comments

Comments
 (0)