Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku authored Dec 12, 2023
0 parents commit c1d448e
Show file tree
Hide file tree
Showing 39 changed files with 33,838 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
lib/
node_modules/
test/

vite.config.ts
52 changes: 52 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ "accessibility": "no-public" }
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true
}
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/** -diff linguist-generated=true
/.yarn/releases/** binary
/.yarn/plugins/** binary
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---

name: Report an Issue
description: Issue form for reporting issues and requesting new features.

body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this issue!

- type: dropdown
id: type
attributes:
label: Type of issue
multiple: false
options:
- 'Bug Report'
- 'Feature Request'
- 'other'
validations:
required: false

- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the problem is. E.g. I'm always frustrated when [...]
validations:
required: false

- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: false

...
15 changes: 15 additions & 0 deletions .github/advanced-issue-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# syntax - https://github.com/redhat-plumbers-in-action/advanced-issue-labeler#policy
---

policy:
- section:
- id: ['type']
block-list: ['other']
label:
- name: bug 🐛
keys: ['Bug Report']

- name: RFE 🎁
keys: ['Feature Request']

...
63 changes: 63 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---

name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

template: |
# What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: 'Breaking'
label: 'type: breaking'

- title: 'New'
label: 'type: feature'

- title: 'Bug Fixes'
label: 'type: bugfix'

- title: 'Maintenance'
labels:
- 'type: maintenance'
- 'type: performance'

- title: 'Documentation'
label: 'type: documentation'

- title: 'Other changes'

- title: 'Automation and CI changes'
label: 'type: ci'

- title: 'Dependency Updates'
label: 'type: dependencies'
collapse-after: 5

version-resolver:
major:
labels:
- 'type: breaking'

minor:
labels:
- 'type: feature'

patch:
labels:
- 'type: bug'
- 'type: maintenance'
- 'type: documentation'
- 'type: ci'
- 'type: dependencies'
- 'type: security'

default: patch

exclude-labels:
- 'skip-changelog'

...
61 changes: 61 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
---

name: Check dist/

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:

permissions:
contents: read

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn install

- name: Rebuild the dist/ directory
run: |
yarn run build
yarn run package
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/

...
46 changes: 46 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---

name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '31 7 * * 3'

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'TypeScript' ]

permissions:
actions: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
source-root: src

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

...
37 changes: 37 additions & 0 deletions .github/workflows/issue-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---

name: Issue labeler
on:
issues:
types: [ opened ]

permissions:
contents: read

jobs:
label-component:
runs-on: ubuntu-latest

permissions:
issues: write

strategy:
matrix:
template: [ issue-template.yml ]

steps:
- uses: actions/checkout@v4

- name: Parse issue form
uses: stefanbuck/github-issue-parser@v3
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/${{ matrix.template }}

- name: Set labels based on type input
uses: redhat-plumbers-in-action/advanced-issue-labeler@v2
with:
issue-form: ${{ steps.issue-parser.outputs.jsonString }}
token: ${{ secrets.GITHUB_TOKEN }}

...
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

name: Linting suite

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
name: Linters
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn

- name: Install
run: yarn install

- name: Build
run: yarn build

- name: Prettier
run: yarn run format-check

- name: ESLint
run: yarn run lint

...
Loading

0 comments on commit c1d448e

Please sign in to comment.