Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: initial release #1

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
116 changes: 116 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"plugins": [
"@typescript-eslint",
"import"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
},
"env": {
"node": true,
"jest": true,
"es6": true,
"browser": true
},
"settings": {
"react": {
"version": "latest"
}
},
"rules": {
"camelcase": [
"error",
{
"properties": "always"
}
],
"quotes": [
"error",
"single",
"avoid-escape"
],
"key-spacing": [
"error",
{
"singleLine": {
"beforeColon": false,
"afterColon": true
},
"multiLine": {
"beforeColon": false,
"afterColon": true
}
}
],
"eqeqeq": "error",
"block-scoped-var": "error",
"complexity": [
"error",
{
"maximum": 20
}
],
"default-case": "error",
"dot-location": [
"error",
"property"
],
"guard-for-in": "error",
"no-eval": "error",
"block-spacing": "error",
"brace-style": "error",
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"space-before-function-paren": [
"error",
"never"
],
"space-before-blocks": "error",
"prefer-const": "error",
"no-var": "error",
"arrow-body-style": "off",
"arrow-spacing": "error",
"strict": [
"error"
],
"no-warning-comments": [
"warn",
{
"terms": [
"todo",
"fixme",
"hack"
],
"location": "anywhere"
}
],
"semi": [
"error"
],
"sort-imports": 0,
"import/order": [2, {
"groups": ["type", "builtin", "external", "internal", "parent", "sibling", "index", "object"],
"alphabetize": { "order": "asc", "caseInsensitive": true }
}],
"@typescript-eslint/no-non-null-assertion": "off"
}
}
3 changes: 3 additions & 0 deletions .github/card-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Backlog:
'In progress':
- 'Status: In Progress'
26 changes: 26 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
javascript:
- '**/*.js'
typescript:
- '**/*.ts'
php:
- '**/*.php'
python:
- '**/*.py'
cpp:
- '**/*.cpp'
- '**/*.cxx'
- '**/*.cc'
- '**/*.cp'

'Type: Testing':
- '**/tests/*'
- '**/test/*'
- '**/__tests__/*'

'Type: Documentation':
- '**/*.md'

'Type: CI/CD':
- '.github/workflows/*.yml'
- '.circleci/*'
- '.travis.yml'
13 changes: 13 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14
# Label requiring a response
responseRequiredLabel: "Status: More Information Needed"
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
6 changes: 6 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'Type: Feature': ['feature/*', 'feat/*']
'Type: Bug': fix/*
'Type: Maintenance': ['patch/*', 'chore/*']
'Type: Release': release/*
'Type: Refactoring': ['refactor/*', 'refactoring/*']
'Type: Documentation': ['docs/*', 'doc/*']
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 30
# Issues with these labels will never be considered stale
exemptLabels:
- "Priority: Critical"
- "Type: Security"
# Label to use when marking an issue as stale
staleLabel: "Status: Abandoned"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
21 changes: 21 additions & 0 deletions .github/workflows/actions_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release GitHub Actions

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the release"
required: true

permissions:
contents: read

jobs:
release:
permissions:
actions: read
id-token: write
contents: write
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
with:
tag: "${{ github.event.inputs.tag }}"
118 changes: 118 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
on: push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

name: CI

jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LINT: 1
steps:
- name: Set running flag
run: echo "RUNNING=1" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: technote-space/get-git-comment-action@v1
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: +(src|__tests__)/**/*.+(js|ts)
FILES: |
yarn.lock
.eslintrc
if: "! contains(env.COMMIT_MESSAGE, '[skip ci]') && ! contains(env.COMMIT_MESSAGE, '[ci skip]')"
- name: Set running flag
run: echo "RUNNING=" >> $GITHUB_ENV
if: "! env.GIT_DIFF"

- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
if: env.RUNNING
- name: Install Package dependencies
run: yarn install
if: env.RUNNING
- name: Check code style
run: yarn eslint ${{ env.GIT_DIFF_FILTERED }}
if: env.RUNNING && !env.MATCHED_FILES
- name: Check code style
run: yarn lint
if: env.RUNNING && env.MATCHED_FILES

cover:
name: Coverage
needs: eslint
runs-on: ${{matrix.os}}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest, macos-latest]
steps:
- name: Set running flag
run: echo "RUNNING=1" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: technote-space/get-git-comment-action@v1
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: +(src|__tests__)/**/*.+(js|ts|snap)
FILES: |
yarn.lock
jest.config.js
vite.config.ts
if: "! contains(env.COMMIT_MESSAGE, '[skip ci]') && ! contains(env.COMMIT_MESSAGE, '[ci skip]')"
- name: Set running flag
run: echo "RUNNING=" >> $GITHUB_ENV
if: "! env.GIT_DIFF"
- name: Set running flag
if: "matrix.os == 'ubuntu-latest' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)"
run: echo "RUNNING=1" >> $GITHUB_ENV
- name: Set running flag
if: "matrix.os == 'ubuntu-latest' && ! startsWith(github.ref, 'refs/tags/') && startsWith(github.base_ref, 'refs/heads/develop/v')"
run: echo "RUNNING=1" >> $GITHUB_ENV
- name: Set running flag
if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/v')
run: echo "RUNNING=1" >> $GITHUB_ENV
- name: Set running flag
run: |
if [[ ! -f package.json ]] || ! < package.json jq -r '.scripts | keys[]' | grep -qe '^cover$'; then
echo "RUNNING=" >> $GITHUB_ENV
fi

- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
if: env.RUNNING
- name: Install Package dependencies
run: yarn install
if: env.RUNNING
- name: Run tests
run: yarn cover
if: env.RUNNING
- name: Codecov
run: |
if [ -n "$CODECOV_TOKEN" ]; then
curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
fi
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERAGE_FILE: ./coverage/lcov.info
if: env.RUNNING && matrix.os == 'ubuntu-latest'

slack:
name: Slack
runs-on: ubuntu-latest
timeout-minutes: 3
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@gh-actions
- uses: 8398a7/action-slack@v3
with:
status: failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: env.WORKFLOW_CONCLUSION == 'failure' && env.SLACK_WEBHOOK_URL
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.idea
/node_modules
/.yarn
/coverage
/lib
/.work
.eslintcache
.envs
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,ts,tsx}": "yarn lint:fix"
}
7 changes: 7 additions & 0 deletions .releasegarc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"inputs": {
"OUTPUT_BUILD_INFO_FILENAME": "build.json",
"TEST_TAG_PREFIX": "test/",
"CLEAN_TEST_TAG": "true"
}
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2020 Technote
Copyright (c) 2023 StepSecurity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading
Loading