Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/nanoid-3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cycjimmy committed Mar 23, 2022
2 parents 38ceb55 + eb73d79 commit 32a4183
Show file tree
Hide file tree
Showing 25 changed files with 5,157 additions and 3,961 deletions.
14 changes: 1 addition & 13 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
"@babel/preset-env"
]
],
"env": {
"test": {
"presets": [
[
"@babel/preset-env"
]
]
}
},
"plugins": []
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist/*
coverage/*
package/*
8 changes: 3 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"root": true,
"extends": "airbnb-base",
"env": {
"browser": true,
"node": true,
"es6": true
"node": true
},
"parserOptions": {
"sourceType": "module"
}
"rules": {}
}
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

- package-ecosystem: npm
directory: /
schedule:
interval: daily
8 changes: 5 additions & 3 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ on:
push:
branches:
- master
- main

pull_request:
branches:
- master
- main

jobs:
coveralls:
name: coveralls
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'

Expand All @@ -28,6 +30,6 @@ jobs:
npm run coveralls
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Deploy
name: Deploy To gh-pages

on:
push:
branches:
- master

- main
jobs:
deploy-gh-pages:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'

Expand Down
41 changes: 36 additions & 5 deletions .github/workflows/nodeTestCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request:
branches:
- master
- main
- next
- next-major
- alpha
- beta

schedule:
- cron: 0 2 * * 0
Expand All @@ -14,15 +19,41 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [ '16', '17' ]
os: [ ubuntu-latest, windows-latest, macOS-latest ]
node: [ '16' ]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run package

- name: Semantic Release Test
uses: cycjimmy/semantic-release-action@v3
with:
dry_run: true
branches: |
[
'master',
'main',
'next',
'next-major',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
@semantic-release/exec
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
49 changes: 37 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,72 @@ name: Release

on:
push:
branches:
- master
- main
- next
- next-major
- alpha
- beta

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install dependencies
run: npm ci

- name: Test
run: npm run test
- run: npm run test
- run: npm run package

release:
name: release
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run package

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
uses: cycjimmy/semantic-release-action@v3
id: semantic
with:
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'master',
'main',
'next',
'next-major',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
Expand All @@ -51,21 +77,20 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Setup Node.js with GitHub Package Registry
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 16
registry-url: 'https://npm.pkg.github.com'
scope: 'cycjimmy'

- name: Publish To GitHub Package Registry
if: steps.semantic.outputs.new_release_published == 'true'
run: npm publish
run: npm publish ./.release
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push updates to branch for major version
if: ${{ steps.semantic.outputs.new_release_published == 'true' && !steps.semantic.outputs.new_release_channel }}
if: steps.semantic.outputs.new_release_published == 'true'
run: git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ node_modules/
.publish/
dist/
temp/
coverage

coverage/
.release/
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Contributing
The repository is released under the MIT license, and follows a standard Github development process, using Github tracker for issues and merging pull requests into master.
The repository is released under the MIT license, and follows a standard Github development process, using Github tracker for issues and merging pull requests into main.
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) 2019 cycjimmy
Copyright (c) 2019-2022 cycjimmy

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
1 change: 1 addition & 0 deletions __test__/index.test.mjs → __test__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint no-undef: off */
import helloWorld from '../src/index';

describe('helloWorld', () => {
Expand Down
40 changes: 40 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
## [6.2.2](https://github.com/cycjimmy/hello-github-package-npm/compare/v6.2.1...v6.2.2) (2022-03-23)


### Bug Fixes

* test release ([bccd0b0](https://github.com/cycjimmy/hello-github-package-npm/commit/bccd0b0795d939cf02e720e9d5034a8af1dbc4d1))

## [6.2.1](https://github.com/cycjimmy/hello-github-package-npm/compare/v6.2.0...v6.2.1) (2022-03-23)


### Bug Fixes

* fix release ([ef9c569](https://github.com/cycjimmy/hello-github-package-npm/commit/ef9c569487c0e79a38b414232a086c4c92e2de6c))

# [6.2.0](https://github.com/cycjimmy/hello-github-package-npm/compare/v6.1.0...v6.2.0) (2022-03-23)


### Features

* refactoring build tasks ([9c59052](https://github.com/cycjimmy/hello-github-package-npm/commit/9c59052aee23312ed110d3ab8f5d1189ef18e206))

# [6.1.0](https://github.com/cycjimmy/hello-github-package-npm/compare/v6.0.0...v6.1.0) (2022-03-23)


### Features

* add exports config and change commonJs files extension to `.cjs`; ([2579e0d](https://github.com/cycjimmy/hello-github-package-npm/commit/2579e0dd023650c78307912717de2d7e88e8ad42))

# [6.0.0](https://github.com/cycjimmy/hello-github-package-npm/compare/v5.0.2...v6.0.0) (2022-03-23)


### Features

* change to module mode ([1d1c4a8](https://github.com/cycjimmy/hello-github-package-npm/commit/1d1c4a86aa258b23bf2e6986ad171087dc3ef01b))


### BREAKING CHANGES

* change to module mode

## [5.0.2](https://github.com/cycjimmy/hello-github-package-npm/compare/v5.0.1...v5.0.2) (2021-11-15)


Expand Down
15 changes: 5 additions & 10 deletions jest.config.mjs → jest.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
export default {
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(mjs?|jsx?|js?|tsx?|ts?)$',
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.mjs$': 'babel-jest',
},
moduleFileExtensions: ['js', 'jsx', 'mjs'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.mjs',
'\\.(css|less|scss|sass)$': '<rootDir>/__mocks__/styleMock.mjs'
'\\.(css|less|scss|sass)$': '<rootDir>/__mocks__/styleMock.mjs',
},
testEnvironment: 'jsdom',
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50
}
}
statements: 50,
},
},
};
Loading

0 comments on commit 32a4183

Please sign in to comment.