Skip to content

Commit

Permalink
Merge pull request #1 from dotcore64/chore/maintenance-2021
Browse files Browse the repository at this point in the history
Maintenance 2021
  • Loading branch information
perrin4869 authored Oct 31, 2021
2 parents a2f8698 + 0fb0a19 commit 38a3520
Show file tree
Hide file tree
Showing 22 changed files with 28,455 additions and 11,632 deletions.
18 changes: 10 additions & 8 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
module.exports = api => ({
module.exports = ({ env }) => ({
presets: [
(api.env() !== 'test') ? '@babel/env' : ['@babel/env', {
targets: {
browsers: ['chrome >= 60', 'firefox >= 56'], // Test in these browsers is enough
},
['@babel/env', {
...(env('test') ? {
targets: {
browsers: ['chrome >= 60', 'firefox >= 56'], // Test in these browsers is enough
}
} : {}),
}],
'@babel/react',
],
env('test') && ['@babel/react', { runtime: 'automatic' }],
].filter(Boolean),
plugins: [
'dev-expression',
api.env() === 'test' && ['istanbul', { exclude: ['test/*.jsx'] }],
env('test') && ['istanbul', { exclude: ['test/**'] }],
].filter(Boolean),
});
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
dist/*.js
node_modules/
coverage/
examples/public/client.js
19 changes: 0 additions & 19 deletions .eslintrc.js

This file was deleted.

32 changes: 32 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"extends": ["airbnb", "plugin:react/jsx-runtime"],
"env": {
"browser": true
},
"rules": {
"max-len": ["error", { "code": 100, "ignoreComments": true }],
"import/no-extraneous-dependencies": ["error", {
"devDependencies": [
"test/**",
"karma.conf.js",
"rollup.config.js",
"examples/rollup.config.js"
]
}]
},
"overrides": [
{
"files": ["test/{,**}/*.js?(x)"],
"extends": ["plugin:mocha/recommended"],
"plugins": ["mocha"],
"env": {
"mocha": true,
"browser": true
},
"rules": {
"mocha/no-mocha-arrows": 0,
"import/no-extraneous-dependencies": [2, { "devDependencies": true }]
}
}
]
}
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: npm
directory: "/"
versioning-strategy: increase
schedule:
interval: daily
reviewers:
- perrin4869
assignees:
- perrin4869
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release
on:
release:
types: [published]

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: browser-actions/setup-firefox@latest

- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

# help the linter
- name: Install example dependencies
working-directory: ./examples
run: npm ci

- name: Lint
run: npm run lint

- name: Test
run: npm test

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: test
on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version:
- 12.x
- 14.x
- 16.x
react-version:
- ^16.8.0
- ^17.0.0

steps:
- uses: actions/checkout@v2

- uses: browser-actions/setup-firefox@latest

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

- name: Install dependencies
run: npm ci

# examples dir ci will fail on npm@6
- name: Install npm@8
run: npm install -g npm@8

# help the linter
- name: Install example dependencies
working-directory: ./examples
run: npm ci

- name: Install react
run: npm install --no-save react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}

- name: Lint
run: npm run lint

- name: Test
uses: nick-invision/retry@v1 # tests are somewhat flakey
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: "github"
COVERALLS_GIT_COMMIT: ${{ github.sha }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}
COVERALLS_SERVICE_JOB_ID: ${{ github.run_id }}
with:
timeout_minutes: 1 # Tests run for about 45s
max_attempts: 3
command: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist
coverage
examples/public/*
!examples/public/index.html
.eslintcache
4 changes: 0 additions & 4 deletions .mocharc.js

This file was deleted.

4 changes: 4 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"reporter": "spec",
"ui": "bdd"
}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ An object with the events to inject to the controlled element.

See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).

[build-badge]: https://img.shields.io/travis/perrin4869/react-scroll-ondrag/master.svg?style=flat-square
[build]: https://travis-ci.org/perrin4869/react-scroll-ondrag
[build-badge]: https://img.shields.io/github/workflow/status/dotcore64/react-scroll-ondrag/test/master?style=flat-square
[build]: https://github.com/dotcore64/react-scroll-ondrag/actions

[npm-badge]: https://img.shields.io/npm/v/react-scroll-ondrag.svg?style=flat-square
[npm]: https://www.npmjs.org/package/react-scroll-ondrag
Expand Down
Loading

0 comments on commit 38a3520

Please sign in to comment.