Skip to content

Commit

Permalink
Merge branch 'master' into phab_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer authored May 2, 2020
2 parents 3d22a07 + 1cc205c commit dda3977
Show file tree
Hide file tree
Showing 1,337 changed files with 66,032 additions and 31,679 deletions.
17 changes: 10 additions & 7 deletions .azure-pipelines-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ steps:
- checkout: self
path: jest

# Ensure Node.js 10 is active
# Ensure Node.js 12 is active
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Use Node.js 10'
versionSpec: '12.x'
displayName: 'Use Node.js 12'

# Ensure Python 2.7 is active
- task: UsePythonVersion@0
Expand All @@ -22,11 +22,14 @@ steps:
- script: node scripts/remove-postinstall
displayName: 'Remove postinstall script'

- script: yarn --no-progress --frozen-lockfile
displayName: 'Install dependencies'
- task: CacheBeta@0
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages

- script: node scripts/build
displayName: 'Build'
- script: yarn install-no-ts-build
displayName: 'Install dependencies'

# Run test-ci-partial
- script: yarn run test-ci-partial
Expand Down
4 changes: 3 additions & 1 deletion .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- job: macOS
pool:
vmImage: macos-10.13
vmImage: macos-10.15
steps:
# This step can be removed once Mercurial gets installed on the macOS image. See https://github.com/Microsoft/azure-pipelines-image-generation/issues/604
- script: HOMEBREW_NO_AUTO_UPDATE=1 brew install mercurial
Expand All @@ -34,3 +34,5 @@ variables:

# Ensures the handful of tests that should be skipped during CI are
CI: true

YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
61 changes: 17 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,42 @@ aliases:
- &filter-ignore-gh-pages
branches:
ignore: gh-pages
- &install node scripts/remove-postinstall && yarn --no-progress --frozen-lockfile --ignore-engines && node scripts/build
- &install yarn install-no-ts-build

version: 2
jobs:
lint-and-typecheck:
test-node-10:
working_directory: ~/jest
docker:
- image: circleci/node:10
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run: yarn lint --format junit -o reports/junit/js-lint-results.xml && yarn lint-es5-build --format junit -o reports/junit/js-es5-lint-results.xml && yarn lint:md:ci && yarn check-copyright-headers
- store_test_results:
path: reports/junit

test-node-6:
working_directory: ~/jest
docker:
- image: circleci/node:6
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
# react-native does not work with node 6
command: rm -rf examples/react-native && yarn test-ci-partial
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-8:
test-jest-circus:
working_directory: ~/jest
docker:
- image: circleci/node:8
- image: circleci/node:12
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
command: yarn test-ci-partial
command: JEST_CIRCUS=1 yarn test-ci-partial && JEST_CIRCUS=1 yarn test-leak
- store_test_results:
path: reports/junit

test-node-10:
test-node-12:
working_directory: ~/jest
docker:
- image: circleci/node:10
- image: circleci/node:12
steps:
- checkout
- restore-cache: *restore-cache
Expand All @@ -74,24 +60,24 @@ jobs:
- store_test_results:
path: reports/junit

test-jest-circus:
test-node-13:
working_directory: ~/jest
docker:
- image: circleci/node:10
- image: circleci/node:13
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
command: JEST_CIRCUS=1 yarn test-ci-partial
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-11:
test-node-14:
working_directory: ~/jest
docker:
- image: circleci/node:11
- image: circleci/node:14
steps:
- checkout
- restore-cache: *restore-cache
Expand All @@ -102,21 +88,10 @@ jobs:
- store_test_results:
path: reports/junit

test-browser:
working_directory: ~/jest
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run: yarn test-ci-es5-build-in-browser

test-or-deploy-website:
working_directory: ~/jest
docker:
- image: circleci/node:10
- image: circleci/node:12
resource_class: large
steps:
- checkout
Expand All @@ -132,12 +107,10 @@ workflows:
version: 2
build-and-deploy:
jobs:
- lint-and-typecheck
- test-node-6
- test-node-8
- test-node-10
- test-node-12
- test-node-13
- test-node-14 # current
- test-jest-circus
- test-node-11 # current
- test-browser
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
12 changes: 8 additions & 4 deletions .circleci/website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

git diff-tree --no-commit-id --name-only -r HEAD > files_changed.txt
if ! grep -E "(^docs\/.*)|(^website\/.*)" files_changed.txt; then
if ! grep -E "(^docs\/.*)|(^website\/.*)|(^\.circleci/website\.sh$)" files_changed.txt; then
echo "Skipping deploy & test. No relevant website files have changed"
else
echo "Relevant website files have changed"
Expand All @@ -13,19 +13,23 @@ else
git config --global user.name "Website Deployment Script"
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
# install Docusaurus and generate file of English strings
yarn && cd website && yarn write-translations
yarn && cd website && node fetchSupporters.js && yarn write-translations
# crowdin install
sudo apt-get update
sudo apt-get install default-jre rsync
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
# translations upload/download
yarn crowdin-upload
yarn crowdin-download
# download only enabled languages
for lang in ja es-ES ro zh-CN pt-BR ru uk
do
yarn crowdin-download -l $lang
done
# build and publish website
GIT_USER=docusaurus-bot USE_SSH=false yarn publish-gh-pages
else
echo "Skipping deploy. Test website build"
cd website && yarn && yarn build
cd website && yarn && node fetchSupporters.js && yarn build
fi
fi
10 changes: 9 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
#
# Some of these options are also respected by Prettier

root = true

[*]
indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.md,*.snap}]
[*.{md,snap}]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
bin/
flow-typed/**
packages/*/build/**
packages/*/build-es5/**
packages/jest-diff/src/cleanupSemantic.ts
website/blog
website/build
website/node_modules
website/i18n/*.js
website/translated_docs
website/static
!.eslintrc.js
55 changes: 48 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@ module.exports = {
extends: [
'./packages/eslint-config-fb-strict/index.js',
'plugin:import/errors',
'plugin:import/typescript',
'prettier',
'prettier/flowtype',
'plugin:eslint-comments/recommended',
],
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
'@typescript-eslint/array-type': ['error', 'generic'],
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'},
],
// Since we do `export =`. Remove for Jest 25
'import/default': 'off',
'import/order': 'error',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
Expand Down Expand Up @@ -64,11 +68,40 @@ module.exports = {
},
},
{
files: ['packages/jest-types/**/*'],
files: 'packages/jest-types/**/*',
rules: {
'import/no-extraneous-dependencies': 0,
},
},
{
files: 'packages/**/*.ts',
rules: {
'@typescript-eslint/explicit-module-boundary-types': 2,
},
},
{
files: [
'**/__tests__/**',
'**/__mocks__/**',
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'**/vendor/**/*',
],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
},
},
{
files: [
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'**/vendor/**/*',
],
rules: {
'eslint-comments/disable-enable-pair': 0,
'eslint-comments/no-unlimited-disable': 0,
},
},
{
files: [
'website/**',
Expand All @@ -82,9 +115,10 @@ module.exports = {
},
],
parser: 'babel-eslint',
plugins: ['markdown', 'import', 'prettier'],
plugins: ['markdown', 'import', 'prettier', 'eslint-comments'],
rules: {
'arrow-body-style': 2,
'eslint-comments/no-unused-disable': 2,
'flowtype/boolean-style': 2,
'flowtype/no-primitive-constructor-types': 2,
'flowtype/require-valid-file-annotation': 2,
Expand All @@ -97,21 +131,28 @@ module.exports = {
'**/__mocks__/**',
'**/?(*.)(spec|test).js?(x)',
'scripts/**',
'eslintImportResolver.js',
'babel.config.js',
'testSetupFile.js',
],
},
],
'import/no-unresolved': [2, {ignore: ['fsevents']}],
// This has to be disabled until all type and module imports are combined
// https://github.com/benmosher/eslint-plugin-import/issues/645
'import/order': 0,
'no-console': 0,
'no-restricted-imports': [
2,
{
message: 'Please use graceful-fs instead.',
name: 'fs',
},
],
'no-unused-vars': 2,
'prettier/prettier': 2,
'sort-imports': [2, {ignoreDeclarationSort: true}],
},
settings: {
'import/resolver': {
'eslint-import-resolver-typescript': true,
},
'import/ignore': ['react-native'],
},
};
Loading

0 comments on commit dda3977

Please sign in to comment.