Skip to content

Commit

Permalink
chore!: v2
Browse files Browse the repository at this point in the history
Closes #29

BREAKING-CHANGE: Minimum supported Node version is now 16

feat(build): built with `vite` and produces both `umd` and `esm` builds

feat(docs): new homepage deployed to Github Pages (check that out)

chore: using release-please for release and changelog management
  • Loading branch information
alioguzhan committed Oct 18, 2023
1 parent 2a0f296 commit 0bcef24
Show file tree
Hide file tree
Showing 33 changed files with 7,405 additions and 7,039 deletions.
28 changes: 0 additions & 28 deletions .commitlintrc.js

This file was deleted.

41 changes: 12 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,18 @@
module.exports = {
env: {
browser: true,
es6: true,
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'prettier', 'react-hooks'],
root: true,
env: { browser: true, es2020: true },
extends: [
'plugin:react/recommended',
'standard',
'prettier',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': 'off',
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
};
}
55 changes: 55 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy to Github Pages

on:
push:
branches: ['master']

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm ci

- name: Build
run: npm run build
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './example/build'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
40 changes: 40 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
push:
branches:
- master

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
release-type: node

- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}

- name: Install dependencies
run: npm ci
if: ${{ steps.release.outputs.release_created }}
env:
HUSKY: 0

- name: Build the project
run: npm run build
if: ${{ steps.release.outputs.release_created }}

- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
17 changes: 7 additions & 10 deletions .github/workflows/nodejs.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Tests

on:
pull_request:
Expand All @@ -10,23 +10,20 @@ on:

jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [10, 11, 12]
node: [16, 18, 20]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: npm install, build, test and coverage
env:
SKIP_PREFLIGHT_CHECK: true
CODECOV_TOKEN: ${{ secrets.codecov_token }}
run: |
npm install
npm run build --if-present
npm run test:ci
npm run coverage
npm ci
npm run test
152 changes: 15 additions & 137 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,148 +1,26 @@

# Created by https://www.gitignore.io/api/node,react,macos,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,react,macos,visualstudiocode

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# react / gatsby
public/

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

build
### react ###
.DS_*
**/*.backup.*
**/*.back.*

node_modules
bower_componets

*.sublime*

psd
thumb
sketch
dist
dist-example
dist-ssr
*.local
build

### VisualStudioCode ###
# Editor directories and files
.vscode/*

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

# End of https://www.gitignore.io/api/node,react,macos,visualstudiocode
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.18.2
lts/*
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.1.3"
}
Loading

0 comments on commit 0bcef24

Please sign in to comment.