Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…React into patch-5

� Conflicts:
�	docs/src/components/ComponentDoc/ComponentExample/ComponentExample.js
�	package.json
�	src/modules/Modal/Modal.js
�	yarn.lock
  • Loading branch information
layershifter committed Jul 31, 2020
2 parents db62023 + 5ee5915 commit 19a1082
Show file tree
Hide file tree
Showing 258 changed files with 10,906 additions and 9,472 deletions.
21 changes: 14 additions & 7 deletions .babel-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const plugins = [
'@babel/plugin-transform-runtime',
{
regenerator: isDocsBuild,
useESModules: isESBuild,
// https://github.com/babel/babel/issues/10261
version: require('@babel/runtime/package.json').version,
},
],
// Plugins that allow to reduce the target bundle size
Expand All @@ -36,13 +39,6 @@ const plugins = [
removeImport: isUMDBuild,
},
],
// A plugin for react-static
isDocsBuild && [
'universal-import',
{
disableWarnings: true,
},
],
// A plugin for removal of debug in production builds
isLibBuild && [
'filter-imports',
Expand Down Expand Up @@ -76,4 +72,15 @@ module.exports = () => ({
plugins: [['istanbul', { include: ['src'] }]],
},
},
overrides: [
// A workaround to avoid collisions between "babel-plugin-dynamic-import-node" & "universal-import"
{
test: /react-static-routes.js/,
plugins: [
['universal-import', { disableWarnings: true }],
'@babel/plugin-transform-modules-commonjs',
],
presets: [['@babel/env', { modules: false }]],
},
],
})
103 changes: 68 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,87 @@
version: 2
version: 2.1

general:
branches:
ignore:
- gh-pages

docker_defaults: &docker_defaults
docker:
- image: circleci/node:12-browsers
working_directory: ~/project/semantic-ui-react

restore_node_modules: &restore_node_modules
restore_cache:
name: Restore node_modules cache
keys:
- v3-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v3-node-{{ .Branch }}-
- v3-node-

jobs:
build:
docker:
- image: circleci/node:8-browsers
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
bootstrap:
<<: *docker_defaults
steps:
- run:
name: Update yarn
command: |
# remove default yarn
sudo rm -rf $(dirname $(which yarn))/yarn*
# download latest
rm -rf ~/.yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
echo 'export PATH="${PATH}:${HOME}/.yarn/bin"' >> $BASH_ENV
- checkout
# because we don't invoke npm (we use yarn) we need to add npm bin to PATH manually
- run:
name: Add npm bin to PATH
command: echo 'export PATH="${PATH}:$(npm bin)"' >> $BASH_ENV
- restore_cache:
keys:
- v2-dependencies-{{ checksum "yarn.lock" }}
- *restore_node_modules
- run:
name: Install Dependencies
command: yarn
command: yarn install --frozen-lockfile
- save_cache:
key: v2-dependencies-{{ checksum "yarn.lock" }}
name: Save yarn cache
key: v3-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Lint TypeScript
command: yarn tsd:lint
- run:
name: Test TypeScript
command: yarn tsd:test
- .cache/yarn
- save_cache:
name: Save node_modules cache
key: v3-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/
- run:
name: Lint JavaScript
command: yarn lint
name: Remove node_modules to cleanup workspace
command: rm -r node_modules/
- persist_to_workspace:
root: ~/project
paths:
- semantic-ui-react

test:
<<: *docker_defaults
steps:
- attach_workspace:
at: ~/project
- *restore_node_modules
- run:
name: Test JavaScript
command: yarn test
- run:
name: Report coverage
command: bash <(curl -s https://codecov.io/bash)
- run:
name: Test TypeScript
command: yarn tsd:test
- run:
name: Test UMD bundle
command: yarn test:umd

lint:
<<: *docker_defaults
steps:
- attach_workspace:
at: ~/project
- *restore_node_modules
- run:
name: Report coverage
command: bash <(curl -s https://codecov.io/bash)
name: Lint
command: yarn lint

workflows:
version: 2
main:
jobs:
- bootstrap
- test:
requires:
- bootstrap
- lint:
requires:
- bootstrap
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bundle-size/dist/*
coverage/*
dist/*
docs/dist/*
Expand Down
45 changes: 36 additions & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"root": true,
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"env": {
Expand All @@ -15,11 +16,14 @@
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"no-return-assign": ["error", "except-parens"],
"no-underscore-dangle": "off",
"padded-blocks": ["error", {
"blocks": "never",
"switches": "never",
"classes": "never"
}],
"padded-blocks": [
"error",
{
"blocks": "never",
"switches": "never",
"classes": "never"
}
],
"prefer-destructuring": "off",
"jsx-a11y/alt-text": "warn",
"jsx-a11y/anchor-is-valid": "off",
Expand All @@ -28,6 +32,8 @@
"jsx-a11y/label-has-associated-control": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/role-has-required-aria-props": "warn",
"import/named": "off",
"import/no-cycle": "off",
"import/no-dynamic-require": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
Expand All @@ -36,11 +42,32 @@
"react/button-has-type": "off",
"react/destructuring-assignment": "off",
"react/forbid-prop-types": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-filename-extension": [2, { "extensions": [".js"] }],
"react/jsx-curly-newline": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-filename-extension": ["error", { "extensions": [".js", ".tsx"] }],
"react/jsx-props-no-spreading": "off",
"react/jsx-wrap-multilines": "off",
"react/prefer-stateless-function": "off",
"react/no-unused-prop-types": "off",
"react/sort-comp": "off",
"react/require-default-props":"off"
}
"react/state-in-constructor": "off",
"react/require-default-props": "off"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off"
}
}
]
}
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cd Semantic-UI-React
yarn
```

>Note, we use `yarn` because `npm` has unfortunately become unreliable. Get it [here][16].
>Note: we use `yarn` and advise you do too while contributing. Get it [here](https://yarnpkg.com/). You can use `npm install / npm ci` but we don't include a `package-lock.json` in the repository, so you may end up with slightly out of sync dependencies.
Add our repo as a git remote so you can pull/rebase your fork with our latest updates:

Expand Down Expand Up @@ -516,7 +516,7 @@ Label.propTypes = {

### Examples

>This section is lacking in instruction as the the docs are set to be overhauled (PRs welcome!).
>This section is lacking in instruction as the docs are set to be overhauled (PRs welcome!).
Usage examples for a component live in `docs/src/examples`. The examples follow the SUI doc site examples.

Expand Down
33 changes: 0 additions & 33 deletions .github/stale.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pr-health.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR Health
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
with:
mode: exactly
count: 1
labels: "PR: Breaking Change :boom:, PR: New Feature :rocket:, PR: Bug Fix :bug:, PR: Docs :memo:, PR: Internal :house:"
35 changes: 35 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bundle Size
on:
pull_request:
branches:
- master

jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Cache node_modules
uses: actions/cache@v1
id: yarn-cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-yarn-cache-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-node-modules-
- name: Yarn install
if: steps.yarn-cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- uses: andresz1/[email protected]
with:
build_script: build:size
github_token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 0 additions & 6 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
"parser": "json"
}
},
{
"files": "*.{ts,tsx}",
"options": {
"semi": true
}
},
{
"files": "docs/src/examples/**/*.js",
"options": {
Expand Down
5 changes: 5 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = require('glob')
.sync('bundle-size/dist/*.size.js', {
cwd: __dirname,
})
.map((file) => ({ path: file, gzip: false }))
Loading

0 comments on commit 19a1082

Please sign in to comment.