Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update @svgr/webpack to version 6 #5958

Merged
merged 6 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 17 additions & 14 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,22 @@ jobs:
- name: Installation
run: yarn
- name: Generate test-website project against main branch
run: |
KEEP_CONTAINER=true yarn test:build:website -s
mv test-website ../test-website
run: yarn test:build:website -s
env:
KEEP_CONTAINER: true
- name: Install test-website project with Yarn v1
run: cd ../test-website && yarn install
run: yarn install
working-directory: ../test-website
env:
npm_config_registry: http://localhost:4873
- name: Start test-website project
run: cd ../test-website && yarn start --no-open
run: yarn start --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
run: cd ../test-website && yarn build
run: yarn build
working-directory: ../test-website
env:
CI: true

Expand All @@ -63,15 +66,12 @@ jobs:
cache: yarn
- name: Installation
run: yarn

- name: Generate test-website project against main branch
run: |
KEEP_CONTAINER=true yarn test:build:website -s
mv test-website ../test-website
run: yarn test:build:website -s
env:
KEEP_CONTAINER: true
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
run: |
cd ../test-website

# we have to switch to berry first before setting the version we want
yarn set version berry
# temporary using canary for #5342
Expand All @@ -84,13 +84,16 @@ jobs:
yarn config set enableGlobalCache true

yarn install
working-directory: ../test-website
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false # Yarn berry should create the lockfile, despite CI env
- name: Start test-website project
run: cd ../test-website && yarn start --no-open
run: yarn start --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
run: cd ../test-website && yarn build
run: yarn build
working-directory: ../test-website
env:
CI: true
4 changes: 4 additions & 0 deletions admin/scripts/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ npx --no-install lerna publish --exact --yes --no-verify-access --no-git-reset -
# Revert version changes
git diff --name-only -- '*.json' | sed 's, ,\\&,g' | xargs git checkout --


# The website is generated outside the repo to minimize chances of yarn resolving the wrong version
cd ..

# Build skeleton website with new version
npm_config_registry="$CUSTOM_REGISTRY_URL" npm init docusaurus@"$NEW_VERSION" test-website classic $EXTRA_OPTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/preset-classic": "2.0.0-beta.9",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"@svgr/webpack": "^6.0.0",
"clsx": "^1.1.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/preset-classic": "2.0.0-beta.9",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"@svgr/webpack": "^6.0.0",
"clsx": "^1.1.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/preset-classic": "2.0.0-beta.9",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"@svgr/webpack": "^6.0.0",
"clsx": "^1.1.1",
"file-loader": "^6.2.0",
"react": "^17.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@docusaurus/utils-common": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
"@svgr/webpack": "^5.5.0",
"@svgr/webpack": "^6.0.0",
"autoprefixer": "^10.3.5",
"babel-loader": "^8.2.2",
"babel-plugin-dynamic-import-node": "2.3.0",
Expand Down
11 changes: 10 additions & 1 deletion packages/docusaurus/src/webpack/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,16 @@ describe('getFileLoaderUtils()', () => {
loader: '@svgr/webpack',
options: expect.objectContaining({
svgoConfig: {
plugins: [{removeViewBox: false}],
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
},
}),
}),
Expand Down
11 changes: 10 additions & 1 deletion packages/docusaurus/src/webpack/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,16 @@ export function getFileLoaderUtils(): FileLoaderUtils {
prettier: false,
svgo: true,
svgoConfig: {
plugins: [{removeViewBox: false}],
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
},
titleProp: true,
ref: ![path],
Expand Down