Skip to content

Commit

Permalink
chore: scaffolding (#1)
Browse files Browse the repository at this point in the history
* build: add linting, prettier, git hooks and bundling

* docs: add license

* docs: add contributing guide

* ci: add pull request template

* ci: add issue templates

* ci: add pull request checks workflow

* ci: add release workflow

* build: add script to generate index

* build: add example

* build: add browser list configuration

* feat: setup kibisisconnect

* chore: squash

* build: specify tsconfig file for types check

* ci: add deploy example

* docs: add readme
  • Loading branch information
kieranroneill authored Oct 23, 2024
1 parent 574f875 commit 9a4eb07
Show file tree
Hide file tree
Showing 67 changed files with 27,236 additions and 0 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fully supports addeventlistener and fully supports customevent and fully supports dispatchevent
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
env: {
browser: true,
es2020: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'prettier'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'prefer-const': 'off',
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
},
],
},
};
90 changes: 90 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: "\U0001F41B Bug Report"
description: "File a bug report"
title: "[Bug]: "
labels: ["\U0001F41B bug"]
assignees:
- kieranroneill
body:
# welcome
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report, all issues are welcome and remember, you're awesome!
# contact
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: e.g. [email protected]
validations:
required: false
# version
- type: dropdown
id: version
attributes:
label: Version
description: What version of the software are you running?
options:
- 1.0.0
validations:
required: true
# browser
- type: dropdown
id: browsers
attributes:
label: What browser are you seeing the problem on?
multiple: true
options:
- Brave
- Chrome
- Edge
- Firefox
validations:
required: true
# description
- type: textarea
id: description
attributes:
label: Description
description: A detailed description of what is occurring.
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
# steps to reproduce
- type: textarea
id: reproduction
attributes:
label: Steps To Reproduce
description: Use a simple bulleted pointed list of the steps to reproduce.
placeholder: "* Light a small spark..."
validations:
required: true
# expected Results
- type: textarea
id: expected
attributes:
label: Expected Results
description: What you expected to happen.
placeholder: A really cool looking piece of UI ;P
validations:
required: true
# actual Results
- type: textarea
id: actual
attributes:
label: Actual Results
description: What actually occurs.
placeholder: The quantum realm is threatened and we must miniaturize to save it!
validations:
required: true
# logs
- type: textarea
id: browser-console-logs
attributes:
label: Relevant browser console output
description: Please copy and paste any relevant browser console output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "✨ Feature Request"
description: Suggest an idea or feature for Kibisis Connect Kit
title: "[Feature]: "
labels: ["✨ feature"]
assignees:
- kibi-bot

body:
# welcome
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request, all features are welcome and remember, you're awesome!
- type: textarea
attributes:
label: What is your idea or feature suggestion?
description: Tell us, what idea or feature you suggest to be added to the Kibisis Connect Kit.
validations:
required: true

- type: textarea
attributes:
label: Benefits
description: Tell us, how this this will be beneficial to Kibisis Connect Kit.
validations:
required: false

- type: textarea
attributes:
label: Where can we find information about this?
description: If you are proposing an integration or third-party plugins, please add relevant links and documentation.
validations:
required: false

- type: dropdown
attributes:
label: Are you willing to provide a PR to address this?
options:
- "Yes"
- "No"
12 changes: 12 additions & 0 deletions .github/actions/install-yq/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Install yq"

description: "Downloads and installs yq"

runs:
using: "composite"
steps:
- name: "📦 Install yq"
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
shell: bash
22 changes: 22 additions & 0 deletions .github/actions/use-yarn-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Use Yarn Dependencies"

description: "Checks if the dependencies have been cached with the hash of the yarn.lock file."

runs:
using: "composite"
steps:
- name: "🔧 Setup"
uses: actions/setup-node@v4
with:
node-version: 20.9.0
cache: 'yarn'
- name: "💾 Cache dependencies"
uses: actions/cache@v4
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
- name: "📦 Install"
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: yarn install --ignore-scripts
shell: bash
Binary file added .github/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
The title should summarise what the purpose of this change,
⚠️**NOTE:** The title must conform to the conventional commit message format outlined in CONTRIBUTING.md document, at the root of the project. This is to ensure the merge commit to the main branch is picked up by the CI and creates an entry in the CHANGELOG.md.
-->

# Description
<!-- Describe your changes in detail -->

# Type of change
<!-- What type of change does this change introduce? Put an 'x' in all the boxes that apply. -->

- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 🏗️ Build configuration (CI configuration, scaffolding etc.)
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] 📝 Documentation update(s)
- [ ] 📦 Dependency update(s)
- [ ] 👩🏽‍💻 Improve developer experience
- [ ] ⚡ Improve performance
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] ♻ Refactor
- [ ] ⏪ Revert changes
- [ ] 🧪 New tests or updates to existing tests
47 changes: 47 additions & 0 deletions .github/workflows/deploy_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Deploy"

on:
release:
types: [released] # triggered on main branch releases

jobs:
install:
name: "Install"
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies


build:
name: "Build"
needs: install
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies
- name: "🏗️ Build"
run: yarn build
- name: "📤 Upload artifact"
uses: actions/upload-pages-artifact@v3
with:
path: ./.example

deploy:
name: "Deploy"
needs: [install, build]
permissions:
pages: write # to deploy to pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: "🚀 Deploy"
id: deployment
uses: actions/deploy-pages@v4
74 changes: 74 additions & 0 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Pull Request Checks"

on:
pull_request:

jobs:
##
# install
##

install:
name: "Install"
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies

##
# validation
##

validate_pr_title:
name: "Validate PR Title"
needs: install
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies
- name: "✅ Validate"
run: echo ${{ github.event.pull_request.title }} | yarn commitlint

##
# lint, check types and test
##

lint:
name: "Lint"
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies
- name: "👕 Lint"
run: yarn lint

check_types:
name: "Type Check"
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies
- name: "🔍 Type Check"
run: yarn check:types

test:
name: "Test"
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies
- name: "🧪 Test"
run: yarn test
Loading

0 comments on commit 9a4eb07

Please sign in to comment.