Skip to content

Commit

Permalink
Merge branch 'master' into feature/custom-input-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mgm793 committed Sep 5, 2022
2 parents 4d9b682 + b7bad38 commit 5fdfd3e
Show file tree
Hide file tree
Showing 59 changed files with 1,136 additions and 517 deletions.
8 changes: 8 additions & 0 deletions .babelrc
Expand Up @@ -3,6 +3,14 @@
"test": {
"presets": [["airbnb", { looseClasses: true }]],
"plugins": [
["import-path-replace", {
"rules": [
{
"match": "../src/",
"replacement": "../lib/"
}
]
}],
["inline-react-svg", {
"svgo": false
}],
Expand Down
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

22 changes: 16 additions & 6 deletions .eslintrc
Expand Up @@ -3,21 +3,30 @@

"extends": [
"airbnb",
"plugin:react-with-styles/recommended"
"plugin:react-with-styles/recommended",
],

"plugins": [
"react-with-styles"
"react-with-styles",
],

"env": {
"browser": true,
"node": true
"node": true,
},

"parser": "babel-eslint",
"ignorePatterns": [
"lib/",
".storybook/",
"test/_helpers/",
"webpack.config.js",
],

"parser": "@babel/eslint-parser",

"rules": {
"max-len": "off",

"react/forbid-foreign-prop-types": 2, // For babel-plugin-transform-react-remove-prop-types

"jsx-a11y/click-events-have-key-events": 1, // TODO: enable
Expand All @@ -44,13 +53,14 @@
//"devDependencies": true
//}],
"indent": [2, 2, {
"MemberExpression": "off"
"MemberExpression": "off",
}],
"react/function-component-definition": "off",
},
},
],

"settings": {
"propWrapperFunctions": ["forbidExtraProps", "exact", "Object.freeze"],
}
},
}
37 changes: 37 additions & 0 deletions .github/workflows/node-pretest.yml
@@ -0,0 +1,37 @@
name: 'Tests: pretest/posttest/build'

on: [pull_request, push]

jobs:
pretest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run pretest

# posttest:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v2
# - uses: ljharb/actions/node/install@main
# name: 'nvm install lts/* && npm install'
# with:
# node-version: 'lts/*'
# - run: npm run posttest

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run build
87 changes: 87 additions & 0 deletions .github/workflows/node.yml
@@ -0,0 +1,87 @@
name: 'Tests: node.js'

on: [pull_request, push]

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
type: 'majors'
versionsAsRoot: true
preset: '>=4'

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
with:
node-version: 'lts/*'
- uses: actions/cache@v2
id: cache
with:
path: |
lib
esm
test-build
key: ${{ runner.os }}-${{ hashFiles('package.json', 'src/**', 'test/**', 'scripts/buildCSS.js') }}
- run: npm run build
if: steps.cache.outputs.cache-hit != 'true'
- run: npm run build:test
if: steps.cache.outputs.cache-hit != 'true'


majors:
needs: [build, matrix]
name: 'latest minors'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
react:
- '16'
- '16.9'
- '16.3'
- '16.0'
- '15'
- '15.5'
- '15.0'
- '0.14'

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
skip-ls-check: ${{ !startsWith(matrix.node-version, '5.') && !startsWith(matrix.node-version, '4.') && 'true' || 'false' }}
- uses: actions/cache@v2
id: cache
with:
path: |
lib
esm
test-build
key: ${{ runner.os }}-${{ hashFiles('package.json', 'src/**', 'test/**', 'scripts/buildCSS.js') }}
- run: npm run react
env:
REACT: ${{ matrix.react }}
- run: npm run tests-only
env:
REACT: ${{ matrix.react }}
- uses: codecov/codecov-action@v2

node:
name: 'node.js'
needs: [majors]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
15 changes: 15 additions & 0 deletions .github/workflows/rebase.yml
@@ -0,0 +1,15 @@
name: Automatic Rebase

on: [pull_request_target]

jobs:
_:
name: "Automatic Rebase"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/require-allow-edits.yml
@@ -0,0 +1,12 @@
name: Require “Allow Edits”

on: [pull_request_target]

jobs:
_:
name: "Require “Allow Edits”"

runs-on: ubuntu-latest

steps:
- uses: ljharb/require-allow-edits@main
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -35,6 +35,7 @@ node_modules
# build folder
lib
esm
test-build
.idea

# gh-pages
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -44,5 +44,6 @@ public
react-dates-demo.gif
stories
test
test-build
css
!lib/css
7 changes: 1 addition & 6 deletions .nycrc
Expand Up @@ -7,18 +7,13 @@
"src"
],
"require": [
"@babel/register"
],
"reporter": [
"text",
"html",
"lcov"
],
"all": true,
"check-coverage": true,
"statements": 83,
"branches": 73,
"lines": 83,
"functions": 67.8,
"sourceMap": false,
"instrument": false
}
6 changes: 3 additions & 3 deletions .storybook-css/config.js
Expand Up @@ -21,8 +21,8 @@ function getLink(href, text) {
return `<a href=${href} rel="noopener noreferrer" target="_blank">${text}</a>`;
}

const README = getLink('https://github.com/airbnb/react-dates/blob/master/README.md', 'README');
const wrapperSource = getLink('https://github.com/airbnb/react-dates/tree/master/examples', 'wrapper source');
const README = getLink('https://github.com/react-dates/react-dates/blob/HEAD/README.md', 'README');
const wrapperSource = getLink('https://github.com/react-dates/react-dates/tree/HEAD/examples', 'wrapper source');

const helperText = `All examples are built using a wrapper component that is not exported by
react-dates. Please see the ${README} for more information about minimal setup or explore
Expand Down Expand Up @@ -52,7 +52,7 @@ addDecorator(story => (

setOptions({
name: 'REACT-DATES',
url: 'https://github.com/airbnb/react-dates',
url: 'https://github.com/react-dates/react-dates',
});

function loadStories() {
Expand Down
6 changes: 3 additions & 3 deletions .storybook/config.js
Expand Up @@ -27,8 +27,8 @@ function getLink(href, text) {
return `<a href=${href} rel="noopener noreferrer" target="_blank">${text}</a>`;
}

const README = getLink('https://github.com/airbnb/react-dates/blob/master/README.md', 'README');
const wrapperSource = getLink('https://github.com/airbnb/react-dates/tree/master/examples', 'wrapper source');
const README = getLink('https://github.com/react-dates/react-dates/blob/HEAD/README.md', 'README');
const wrapperSource = getLink('https://github.com/react-dates/react-dates/tree/HEAD/examples', 'wrapper source');

const helperText = `All examples are built using a wrapper component that is not exported by
react-dates. Please see the ${README} for more information about minimal setup or explore
Expand Down Expand Up @@ -58,7 +58,7 @@ addDecorator(story => (

setOptions({
name: 'REACT-DATES',
url: 'https://github.com/airbnb/react-dates',
url: 'https://github.com/react-dates/react-dates',
});

function loadStories() {
Expand Down
38 changes: 4 additions & 34 deletions .travis.yml
@@ -1,43 +1,13 @@
language: node_js
node_js:
- 14
- 12
- 10
- 8
- 6
node_js: lts/*
before_install:
- 'nvm install-latest-npm'
- nvm install-latest-npm
services:
- xvfb
before_script:
- 'if [ -n "${KARMA-}" ]; then export DISPLAY=:99.0; fi'
script:
- 'if [ -n "${LINT-}" ]; then npm run lint ; fi'
- 'if [ -n "${BUILD-}" ]; then npm run build ; fi'
- 'if [ "${TEST-}" = true ]; then npm run tests-only ; fi'
- 'if [ -n "${KARMA-}" ]; then npm run tests-karma ; fi'
- 'if [ -n "${COVERAGE-}" ] && [ "${TRAVIS_BRANCH-}" = "master" ]; then npm run cover; cat ./coverage/lcov.info | ./node_modules/.bin/coveralls ; fi'
install:
- 'if [ -n "${LINT-}" ]; then NPM_CONFIG_LEGACY_PEER_DEPS=true npm install --legacy-bundling ; else npm install ; fi'
- npm run tests-karma
env:
global:
- TEST=true
matrix:
- REACT=0.14
- REACT=15
- REACT=16
- DISPLAY=:99.0
sudo: false
matrix:
fast_finish: true
include:
- node_js: "lts/*"
env: LINT=true TEST=false
- node_js: "lts/*"
env: BUILD=true TEST=false
- node_js: "lts/*"
env: COVERAGE=true TEST=false
- node_js: "lts/*"
env: KARMA=true TEST=false
allow_failures:
- node_js: "10"
env: REACT=16

0 comments on commit 5fdfd3e

Please sign in to comment.