Skip to content

Commit

Permalink
breaking: Update client interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalanamini committed Oct 20, 2021
1 parent 1760df0 commit 61877e5
Show file tree
Hide file tree
Showing 24 changed files with 4,849 additions and 841 deletions.
40 changes: 40 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
env:
browser: true
es2021: true
node: true
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 12
sourceType: module
plugins:
- '@typescript-eslint'
- import
rules:
indent: off
"@typescript-eslint/indent":
- error
- 2
- SwitchCase: 1
quotes: off
"@typescript-eslint/quotes":
- error
- double
- avoidEscape: true
semi: off
"@typescript-eslint/semi":
- error
- always
comma-dangle: off
"@typescript-eslint/comma-dangle":
- error
- always-multiline
max-len:
- error
- 120
import/extensions:
- error
- always
- ignorePackages: true
131 changes: 131 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
test:
name: Test

timeout-minutes: 20

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node-version:
- 14
- 16

env:
OS: ${{ matrix.os }}
NODE_VERSION: ${{ matrix.node-version }}
RELEASE: ${{ github.ref }}

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install packages
run: npm ci

- name: Lint
run: npm run lint

- name: Build for CommonJS
run: npm run build

- name: Build for ECMAScript
run: npm run build:es

release:
name: Create Release

runs-on: ubuntu-latest

needs:
- test

steps:
- uses: actions/checkout@v2

- name: Changelog
id: changelog
uses: ardalanamini/auto-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: softprops/action-gh-release@v1
with:
body: |
${{ steps.changelog.outputs.changelog }}
publish-npm:
name: Publish to NPM

permissions:
contents: read
packages: write

runs-on: ubuntu-latest

needs:
- release

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org

- run: npm ci

- run: npm run build:hybrid

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-gpr:
name: Publish to GitHub

permissions:
contents: read
packages: write

runs-on: ubuntu-latest

needs:
- release

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://npm.pkg.github.com
scope: '@ardalanamini'

- run: sed -i 's/"name":\ "kutt"/"name":\ "@ardalanamini\/kutt"/g' package.json package-lock.json

- run: npm ci

- run: npm run build:hybrid

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Test

on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- master
pull_request:

jobs:
test:
name: Test

timeout-minutes: 15

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node-version:
- 14
- 16

env:
OS: ${{ matrix.os }}
NODE_VERSION: ${{ matrix.node-version }}

steps:
- uses: actions/checkout@v2

- name: Setup Cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ matrix.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install packages
run: npm i

- name: Lint
run: npm run lint

- name: Build for CommonJS
run: npm run build

- name: Build for ECMAScript
run: npm run build:es
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,11 @@ typings/
# next.js build output
.next

dist
# IDE
.idea/
.vscode/

# Build
*.tsbuildinfo
cjs/
es/
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2019 Ardalan Amini
Copyright (c) 2018-2021 Ardalan Amini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 61877e5

Please sign in to comment.