Skip to content

Commit

Permalink
Merge branch 'main' into eui-icon-early-setstate
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed May 12, 2022
2 parents aacc737 + 5a75a75 commit 55a9684
Show file tree
Hide file tree
Showing 5,836 changed files with 175,725 additions and 162,499 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
15 changes: 15 additions & 0 deletions .babelrc-optimize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// See `wiki/consuming.md` for rationale and consumer requirements.

const baseConfig = require('./.babelrc.js');
// Skip `propType` generation.
baseConfig.plugins.splice(
baseConfig.plugins.indexOf(
`${__dirname}/scripts/babel/proptypes-from-ts-props`
),
1
);
// Transform runtimes using babel plugin.
// Requires consuming applications to use `@babel/runtime`.
baseConfig.plugins.push('@babel/plugin-transform-runtime');
baseConfig.env = {};
module.exports = baseConfig;
24 changes: 21 additions & 3 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ module.exports = {
"modules": process.env.BABEL_MODULES ? process.env.BABEL_MODULES === 'false' ? false : process.env.BABEL_MODULES : "commonjs" // babel's default is commonjs
}],
["@babel/typescript", { isTSX: true, allExtensions: true }],
"@babel/react"
"@babel/react",
[
"@emotion/babel-preset-css-prop",
{
"autoLabel": "always",
"labelFormat": "[local]"
},
],
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"pegjs-inline-precompile",
"./scripts/babel/proptypes-from-ts-props",
`${__dirname}/scripts/babel/proptypes-from-ts-props`,
"add-module-exports",
// stage 3
"@babel/proposal-object-rest-spread",
Expand All @@ -36,4 +42,16 @@ module.exports = {
}
],
],
// Used for Cypress code coverage - note that the env has to be Cypress-specific, otherwise Jest --coverage throws errors
"env": {
"cypress_test": {
"plugins": ["istanbul"]
}
},
"overrides": [
{
"include": `${__dirname}/src/components/search_bar/query/default_syntax.ts`,
"plugins": ["pegjs-inline-precompile"],
}
]
};
2 changes: 1 addition & 1 deletion .ci/jobs/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
parameters:
- string:
name: branch_specifier
default: refs/heads/master
default: refs/heads/main
description: the Git branch specifier to build (<branchName>,
<tagName>, <commitId>, etc.)
wrappers:
Expand Down
12 changes: 9 additions & 3 deletions .ci/jobs/elastic+eui+pull-request-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
#!/usr/local/bin/runbld
export NVM_DIR="/var/lib/jenkins/.nvm"
[[ -s "$NVM_DIR/nvm.sh" ]] && . "$NVM_DIR/nvm.sh"
NPM_VERSION=10
nvm install ${NPM_VERSION}
nvm use ${NPM_VERSION} --delete-prefix
NODE_VERSION=16.14.2
nvm install ${NODE_VERSION}
nvm use ${NODE_VERSION} --delete-prefix
npm run test-docker
publishers:
- archive:
artifacts: 'cypress/screenshots/**/*.png'
latest-only: false
allow-empty: true
only-if-success: false
11 changes: 7 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ lib
test-env
types
eui.d.ts
**/*.snap.js
**/assets/**/*.js
package.json
src-docs/src/views/icon/icon_example.js
packages/react-datepicker/examples
docs
packages
scripts
generator-eui
cypress
react-datepicker
.eslintrc.js
57 changes: 19 additions & 38 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,17 @@
const SSPL_ELASTIC_2_0_LICENSE_HEADER = `
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

const APACHE_2_0_LICENSE_HEADER = `
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
`;

module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json', './tsconfig-cypress.json'],
ecmaFeatures: {
jsx: true,
},
Expand All @@ -67,7 +38,7 @@ module.exports = {
'prettier/standard',
'plugin:prettier/recommended',
],
plugins: ['jsx-a11y', 'prettier', 'local', 'react-hooks'],
plugins: ['jsx-a11y', 'prettier', 'local', 'react-hooks', '@emotion'],
rules: {
'prefer-template': 'error',
'local/i18n': 'error',
Expand All @@ -76,7 +47,7 @@ module.exports = {
'local/require-license-header': [
'warn',
{
license: APACHE_2_0_LICENSE_HEADER,
license: SSPL_ELASTIC_2_0_LICENSE_HEADER,
},
],
'no-use-before-define': 'off',
Expand Down Expand Up @@ -140,6 +111,10 @@ module.exports = {
'ts-expect-error': 'allow-with-description',
},
],
'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: false },
],
},
env: {
jest: true,
Expand All @@ -153,5 +128,11 @@ module.exports = {
'react/prefer-stateless-function': 'off',
},
},
{
globals: {
cy: true,
},
files: ['*.spec.js'],
},
],
};
13 changes: 7 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ Provide a detailed summary of your PR. Explain how you arrived at your solution.

### Checklist

- [ ] Check against **all themes** for compatibility in both light and dark modes
- [ ] Checked in both **light and dark** modes
- [ ] Checked in **mobile**
- [ ] Checked in **Chrome**, **Safari**, **Edge**, and **Firefox**
- [ ] Props have proper **autodocs** and **[playground toggles](https://github.com/elastic/eui/blob/master/wiki/documentation-guidelines.md#adding-playground-toggles)**
- [ ] Added **[documentation](https://github.com/elastic/eui/blob/master/wiki/documentation-guidelines.md)**
- [ ] Checked **[Code Sandbox](https://codesandbox.io/)** works for the any docs examples
- [ ] Added or updated **[jest tests](https://github.com/elastic/eui/blob/master/wiki/testing.md)**
- [ ] Props have proper **autodocs** and **[playground toggles](https://github.com/elastic/eui/blob/main/wiki/documentation-guidelines.md#adding-playground-toggles)**
- [ ] Added **[documentation](https://github.com/elastic/eui/blob/main/wiki/documentation-guidelines.md)**
- [ ] Checked **[Code Sandbox](https://codesandbox.io/)** works for any docs examples
- [ ] Added or updated **[jest](https://github.com/elastic/eui/blob/main/wiki/testing.md) and [cypress](https://github.com/elastic/eui/blob/main/wiki/cypress-testing.md) tests**
- [ ] Checked for **breaking changes** and labeled appropriately
- [ ] Checked for **accessibility** including keyboard-only and screenreader modes
- [ ] A **[changelog](https://github.com/elastic/eui/blob/master/wiki/documentation-guidelines.md#changelog)** entry exists and is marked appropriately
- [ ] Updated the **[Figma](https://www.figma.com/community/file/964536385682658129)** library counterpart
- [ ] A **[changelog](https://github.com/elastic/eui/blob/main/wiki/documentation-guidelines.md#changelog)** entry exists and is marked appropriately
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Changelog required"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
branches: [ master ]
branches: [ main ]

jobs:
# Enforces the update of a changelog file on every pull request
Expand All @@ -12,6 +12,6 @@ jobs:
- uses: actions/checkout@v2
- uses: dangoslen/changelog-enforcer@v2
with:
changeLogPath: 'CHANGELOG.md'
changeLogPath: "upcoming_changelogs/${{ github.event.pull_request.number }}.md"
skipLabels: 'skip-changelog'
missingUpdateErrorMessage: 'You need to edit the changelog.md file in this PR before it can be merged. Use the `skip-changelog` label to bypass this check.'
missingUpdateErrorMessage: 'You need to add a changelog to this PR before it can be merged. @see https://github.com/elastic/eui/blob/main/wiki/documentation-guidelines.md#changelog'
8 changes: 7 additions & 1 deletion .github/workflows/stale_issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ on:
schedule:
- cron: '0 */8 * * *'

permissions:
contents: read

jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
Expand All @@ -22,7 +28,7 @@ jobs:
stale-pr-label: 'stale-pr'
close-pr-label: 'stale-pr-closed'
exempt-pr-labels: 'skip-stale-check,meta'
exempt-assignees: true
exempt-all-assignees: true
operations-per-run: 1000
remove-stale-when-updated: true
enable-statistics: true
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ test/spec/screenshots/baseline/**/*.png
test/spec/screenshots/diff/**/*.png
test/spec/screenshots/screen/**/*.png
test/failure-screenshots/**/*.png
cypress/screenshots
cypress/videos

coverage/
reports/
.nyc_output/
tmp/
dist/
lib/
es/
optimize/
test-env/
.idea
.vscode/
Expand Down
32 changes: 0 additions & 32 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
16.14.2
4 changes: 1 addition & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"jsxBracketSameLine": true,
"jsxSingleQuote": false,
"parser": "typescript",
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"trailingComma": "es5"
}
3 changes: 2 additions & 1 deletion .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ files:
ignore:
# These are themes of outside libraries we import
- 'src/components/series_chart/**/*.s+(a|c)ss'
- 'src/components/date_picker/**/*.s+(a|c)ss'
- 'src/global_styling/react_date_picker/**/*.s+(a|c)ss'
- 'src/components/date_picker/react-datepicker/**/*.s+(a|c)ss'
rules:
quotes:
- 2
Expand Down
11 changes: 9 additions & 2 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@
"rules": {
"number-leading-zero": "never",
"color-hex-case": "upper"
}
}
},
"ignoreFiles": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.md"
]
}
Loading

0 comments on commit 55a9684

Please sign in to comment.