chore: migrate to Yarn 2 (#2316)

* chore: migrate to Yarn 2

* Update config.yml
This commit is contained in:
ylemkimon
2020-08-03 18:24:56 +09:00
committed by GitHub
parent 591bc7b4be
commit f97c5454f8
15 changed files with 22802 additions and 16898 deletions

View File

@@ -33,15 +33,16 @@ commands:
steps:
- restore_cache:
keys:
- yarn-deps-v3-{{ checksum "yarn.lock" }}
- yarn-deps-v3-
- yarn-deps-v5-{{ checksum "yarn.lock" }}
- yarn-deps-v5-
- run:
name: Install dependencies
command: yarn --frozen-lockfile
command: yarn --immutable
- save_cache:
key: yarn-deps-v3-{{ checksum "yarn.lock" }}
key: yarn-deps-v5-{{ checksum "yarn.lock" }}
paths:
- node_modules
- .yarn
- .pnp.js
jobs:
test:
@@ -73,7 +74,7 @@ jobs:
yarn test:jest --coverage --runInBand
- run:
name: Upload code coverage reports to Codecov
command: ./node_modules/.bin/codecov
command: yarn codecov
screenshotter:
parameters:
@@ -88,7 +89,7 @@ jobs:
- run:
name: Verify screenshots and generate diffs and new screenshots
command: node dockers/screenshotter/screenshotter.js --selenium-ip localhost -b $CIRCLE_JOB --verify --diff --new
command: yarn node dockers/screenshotter/screenshotter.js --selenium-ip localhost -b $CIRCLE_JOB --verify --diff --new
- store_artifacts:
path: test/screenshotter/new
destination: new

View File

@@ -93,6 +93,14 @@
"node": false,
"jest": false
}
}, {
"files": ["website/**/*.js"],
"extends": [
"plugin:react/recommended"
],
"rules": {
"react/prop-types": 0
}
}],
"root": true
}

13
.gitignore vendored
View File

@@ -27,3 +27,16 @@ website/static/static/katex.*
website/static/static/fonts
website/static/static/copy-tex.*
website/static/static/mhchem.*
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
website/.yarn/*
!website/.yarn/releases
!website/.yarn/plugins
!website/.yarn/sdks
!website/.yarn/versions

86
.yarn/releases/yarn-berry.js vendored Executable file

File diff suppressed because one or more lines are too long

1
.yarnrc.yml Normal file
View File

@@ -0,0 +1 @@
yarnPath: ".yarn/releases/yarn-berry.js"

View File

@@ -21,7 +21,7 @@ are encouraged to reproduce the steps from `screenshotter.sh`
manually. Example run for Firefox:
container=$(docker run -d -P selenium/standalone-firefox:2.46.0)
node dockers/screenshotter/screenshotter.js -b firefox -c ${container}
yarn node dockers/screenshotter/screenshotter.js -b firefox -c ${container}
# possibly repeat the above command as often as you need, then eventually
docker stop ${container}
docker rm ${container}
@@ -33,7 +33,7 @@ For Chrome, simply replace both occurrences of `firefox` with `chrome`.
It is possible to run `screenshotter.js` without the use of Docker:
yarn add selenium-webdriver
node dockers/screenshotter/screenshotter.js
yarn node dockers/screenshotter/screenshotter.js
This will generate screenshots using the Firefox installed on your system.
Browsers other than Firefox can be targeted using the `--browser` option.
@@ -62,7 +62,7 @@ to specify a list of cases which are not being processed.
Examples:
node dockers/screenshotter/screenshotter.js -i Sqrt,SqrtRoot
yarn node dockers/screenshotter/screenshotter.js -i Sqrt,SqrtRoot
dockers/screenshotter/screenshotter.sh --exclude=GreekLetters
# How to run screenshotter tests

View File

@@ -24,7 +24,7 @@ for browserTag in firefox:2.48.2 chrome:2.48.2; do
container=$(docker run -d -P ${image})
[[ ${container} ]] || continue
echo "Container ${container:0:12} started, creating screenshots..."
if node "$(dirname "$0")"/screenshotter.js \
if yarn node "$(dirname "$0")"/screenshotter.js \
--browser="${browser}" --container="${container}" "$@"; then
res=Done
else

View File

@@ -61,6 +61,7 @@
"mini-css-extract-plugin": "^0.9.0",
"mkdirp": "^1.0.4",
"pako": "^1.0.8",
"pnp-webpack-plugin": "^1.6.4",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.0.5",

View File

@@ -140,7 +140,7 @@ if [[ ! $PUBLISH ]]; then
# Update the version number in CDN URLs included in the README and the documentation,
# and regenerate the Subresource Integrity hash for these files.
node update-sri.js "$VERSION" README.md contrib/*/README.md \
yarn node update-sri.js "$VERSION" README.md contrib/*/README.md \
docs/*.md docs/*.md.bak website/pages/index.html
# Generate a new version of the docs
@@ -157,7 +157,7 @@ if [[ ! $PUBLISH ]]; then
git checkout package.json
# Regenerate the Subresource Integrity hash in the README and the documentation
node update-sri.js "$VERSION" README.md contrib/*/README.md \
yarn node update-sri.js "$VERSION" README.md contrib/*/README.md \
docs/*.md website/pages/index.html website/versioned_docs/version-$VERSION/*.md
fi
@@ -196,7 +196,7 @@ else
rm -f .gitignore.bak
# Check Subresource Integrity hashes
node update-sri.js check README.md contrib/*/README.md
yarn node update-sri.js check README.md contrib/*/README.md
# Make the commit and tag, and push them.
git add package.json .gitignore dist/

View File

@@ -1,5 +1,6 @@
// @flow
const {targets, createConfig} = require('./webpack.common');
// $FlowIgnore
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// dev minify

View File

@@ -1,11 +1,17 @@
// @flow
const path = require('path');
// $FlowIgnore
const TerserPlugin = require('terser-webpack-plugin');
// $FlowIgnore
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// $FlowIgnore
const PnpWebpackPlugin = require('pnp-webpack-plugin');
const {version} = require("./package.json");
// $FlowIgnore
const browserslist = require('browserslist')();
// $FlowIgnore
const caniuse = require('caniuse-lite');
// from the least supported to the most supported
@@ -61,9 +67,11 @@ function createConfig(target /*: Target */, dev /*: boolean */,
options: {importLoaders: 1},
}, {
loader: 'postcss-loader',
// $FlowIgnore
options: {plugins: [require('postcss-preset-env')()]},
}];
if (minimize) {
// $FlowIgnore
cssLoaders[1].options.plugins.push(require('cssnano')());
}
@@ -160,6 +168,12 @@ function createConfig(target /*: Target */, dev /*: boolean */,
performance: {
hints: false,
},
resolve: {
plugins: [PnpWebpackPlugin],
},
resolveLoader: {
plugins: [PnpWebpackPlugin.moduleLoader(module)],
},
};
}

View File

@@ -1,8 +0,0 @@
{
"extends": [
"plugin:react/recommended"
],
"rules": {
"react/prop-types": 0
}
}

View File

@@ -11,5 +11,9 @@
"fs-extra": "^9.0.1",
"react": "^16.8.4"
},
"dependencies": {}
"dependenciesMeta": {
"docusaurus": {
"unplugged": true
}
}
}

File diff suppressed because it is too large Load Diff

23872
yarn.lock

File diff suppressed because it is too large Load Diff