Skip to content

Commit

Permalink
Merge pull request #171 from iamdevlinph/v4-publish
Browse files Browse the repository at this point in the history
Additional changes before finalizing v4
  • Loading branch information
iamdevlinph authored Sep 23, 2022
2 parents 2806fdb + bea610e commit 98db2ea
Show file tree
Hide file tree
Showing 32 changed files with 2,278 additions and 2,789 deletions.
8 changes: 5 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ module.exports = {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
ignorePatterns: ['lint-staged.config.js', 'src/**/*.js', 'scripts/**/*.js'], // ignore all js files for now
ignorePatterns: ['lint-staged.config.js'], // ignore all js files for now
overrides: [
{
files: ['**/*.tsx', '**/*.ts', '**/*.js'],
rules: {},
files: ['scripts/*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
globals: {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Running code coverage

on: [push, pull_request]
on: [push]

jobs:
setup:
Expand All @@ -13,7 +13,7 @@ jobs:
node-version: '10.x'

unit-test:
name: Unit test
name: Code coverage
runs-on: ubuntu-latest
needs: setup # Need to wait for setup
steps:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Running deployment of documentation to gh-pages

on:
release:
types: [created]

jobs:
setup:
name: Setup environment
runs-on: ubuntu-latest
steps:
- name: Installing node.js
uses: actions/setup-node@v1 # Used to install node environment
with:
node-version: '10.x'

run-documentation:
name: Run documentation
runs-on: ubuntu-latest
needs: setup # Need to wait for setup
steps:
- uses: actions/checkout@v1 # Get last commit pushed

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Run documentation create
run: yarn docu:create

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs # The folder the action should deploy.
43 changes: 43 additions & 0 deletions .github/workflows/format-check-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Running lint checks and build

on:
push:
branches-ignore:
- 'main'

jobs:
setup:
name: Setup environment
runs-on: ubuntu-latest
steps:
- name: Installing node.js
uses: actions/setup-node@v1 # Used to install node environment
with:
node-version: '10.x'

format-check:
name: Check code format and build app
runs-on: ubuntu-latest
needs: setup # Need to wait for setup
steps:
- uses: actions/checkout@v1 # Get last commit pushed

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Run linter
run: yarn format:check

- name: Build the app
run: yarn build
44 changes: 44 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Running publish package

on:
release:
types: [created]

jobs:
setup:
name: Setup environment
runs-on: ubuntu-latest
steps:
- name: Installing node.js
uses: actions/setup-node@v1 # Used to install node environment
with:
node-version: '10.x'

publish-package:
name: Run publish package
runs-on: ubuntu-latest
needs: setup # Need to wait for setup
steps:
- uses: actions/checkout@v1 # Get last commit pushed

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Build the app
run: yarn build

- name: Publish the package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Running code tests

on:
push:
branches-ignore:
- 'main'

jobs:
setup:
name: Setup environment
runs-on: ubuntu-latest
steps:
- name: Installing node.js
uses: actions/setup-node@v1 # Used to install node environment
with:
node-version: '10.x'

run-tests:
name: Run code tests
runs-on: ubuntu-latest
needs: setup # Need to wait for setup
steps:
- uses: actions/checkout@v1 # Get last commit pushed

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Run tests
run: yarn test:ci
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ A package of commonly used JavaScript utilities.
![code size](https://img.shields.io/github/languages/code-size/iamdevlinph/common-utils-pkg.svg?style=flat-square&maxAge=7200)
[![contributors][contributor-img]][contributor-url]

# :tada: `Version 3` is here
# :tada: `v4` is here

v4 is just migrating the code base to TypeScript. Kindly refer to the [changelog](https://common-utils-pkg.js.org/changelog.html) for more info.

## `v3` is here

Version 3 introduces a code-breaking change. Each method is exported independently instead of having them under a "category utility". Read more on how to use it [here](https://iamdevlinph.github.io/common-utils-pkg/usage.html).

## Installation
Expand Down
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ codecov:
coverage:
precision: 2
round: down
range: "90...100"
range: "70...100"
status:
patch: off
project:
default:
# basic
target: 90%
target: 70%
7 changes: 7 additions & 0 deletions docs/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
{
"version": "4.0.0",
"description": [
"Migrated to TypeScript",
"Removes the feature where an error is thrown when a wrong type is supplied since we're already on TypeScript"
]
},
{
"version": "3.1.1",
"description": [
Expand Down
Loading

0 comments on commit 98db2ea

Please sign in to comment.