Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gregberge/svgr
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.0-alpha.2
Choose a base ref
...
head repository: gregberge/svgr
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 51,011 additions and 35,716 deletions.
  1. +12 −13 .github/workflows/ci.yml
  2. +1 −1 .gitignore
  3. +1 −1 .nvmrc
  4. +3 −1 .prettierignore
  5. +256 −250 CHANGELOG.md
  6. +9 −6 CONTRIBUTING.md
  7. +12 −14 README.md
  8. +1 −1 __fixtures__/custom-index-template.js
  9. +12 −0 __fixtures__/withSvgoConfig/svgo.config.cjs
  10. +8 −5 api/api/svgr.js
  11. +1 −0 api/package.json
  12. +1,079 −0 api/pnpm-lock.yaml
  13. +2 −0 api/pnpm-workspace.yaml
  14. +5 −9 babel.config.js
  15. +0 −20 build/build.sh
  16. +13 −3 build/{rollup.config.js → rollup.config.mjs}
  17. +1,366 −0 deprecated-packages/svgr/package-lock.json
  18. +16 −0 examples/mocha-esm/CHANGELOG.md
  19. +1 −0 examples/mocha-esm/__mocks__/svg.js
  20. +3 −0 examples/mocha-esm/example.js
  21. +7 −0 examples/mocha-esm/example.test.js
  22. 0 examples/mocha-esm/icon.svg
  23. +12 −0 examples/mocha-esm/mock-loader.js
  24. +12 −0 examples/mocha-esm/package.json
  25. +0 −2 examples/parcel/.gitignore
  26. +0 −20 examples/parcel/file.svg
  27. +0 −5 examples/parcel/index.html
  28. +0 −3 examples/parcel/index.js
  29. +0 −8 examples/parcel/package.json
  30. +32 −0 examples/webpack/CHANGELOG.md
  31. +13 −6 examples/webpack/package.json
  32. 0 examples/webpack/{main.js → src/index.js}
  33. 0 examples/webpack/{ → src}/star.simple.svg
  34. 0 examples/webpack/{ → src}/star.url.svg
  35. +6 −6 examples/webpack/webpack.config.js
  36. +1 −1 jest.config.js
  37. +2 −4 lerna.json
  38. +0 −32,605 package-lock.json
  39. +29 −26 package.json
  40. +32 −10 packages/babel-plugin-add-jsx-attribute/CHANGELOG.md
  41. +13 −7 packages/babel-plugin-add-jsx-attribute/package.json
  42. +2 −2 packages/babel-plugin-add-jsx-attribute/src/index.test.ts
  43. +46 −0 packages/babel-plugin-remove-jsx-attribute/CHANGELOG.md
  44. +13 −7 packages/babel-plugin-remove-jsx-attribute/package.json
  45. +46 −0 packages/babel-plugin-remove-jsx-empty-expression/CHANGELOG.md
  46. +13 −7 packages/babel-plugin-remove-jsx-empty-expression/package.json
  47. +36 −10 packages/babel-plugin-replace-jsx-attribute-value/CHANGELOG.md
  48. +13 −7 packages/babel-plugin-replace-jsx-attribute-value/package.json
  49. +1 −1 packages/babel-plugin-replace-jsx-attribute-value/src/index.test.ts
  50. +33 −22 packages/babel-plugin-svg-dynamic-title/CHANGELOG.md
  51. +4 −0 packages/babel-plugin-svg-dynamic-title/README.md
  52. +13 −7 packages/babel-plugin-svg-dynamic-title/package.json
  53. +58 −5 packages/babel-plugin-svg-dynamic-title/src/index.test.ts
  54. +41 −26 packages/babel-plugin-svg-dynamic-title/src/index.ts
  55. +32 −10 packages/babel-plugin-svg-em-dimensions/CHANGELOG.md
  56. +3 −1 packages/babel-plugin-svg-em-dimensions/README.md
  57. +13 −7 packages/babel-plugin-svg-em-dimensions/package.json
  58. +19 −9 packages/babel-plugin-svg-em-dimensions/src/index.test.ts
  59. +29 −6 packages/babel-plugin-svg-em-dimensions/src/index.ts
  60. +44 −13 packages/babel-plugin-transform-react-native-svg/CHANGELOG.md
  61. +13 −7 packages/babel-plugin-transform-react-native-svg/package.json
  62. +28 −4 packages/babel-plugin-transform-react-native-svg/src/index.test.ts
  63. +8 −1 packages/babel-plugin-transform-react-native-svg/src/index.ts
  64. +49 −36 packages/babel-plugin-transform-svg-component/CHANGELOG.md
  65. +15 −6 packages/babel-plugin-transform-svg-component/package.json
  66. +227 −144 packages/babel-plugin-transform-svg-component/src/__snapshots__/index.test.ts.snap
  67. +93 −4 packages/babel-plugin-transform-svg-component/src/index.test.ts
  68. +2 −2 packages/babel-plugin-transform-svg-component/src/index.ts
  69. +4 −2 packages/babel-plugin-transform-svg-component/src/types.ts
  70. +77 −32 packages/babel-plugin-transform-svg-component/src/variables.ts
  71. +55 −48 packages/babel-preset/CHANGELOG.md
  72. +21 −15 packages/babel-preset/package.json
  73. +103 −24 packages/babel-preset/src/index.test.ts
  74. +30 −3 packages/babel-preset/src/index.ts
  75. +119 −117 packages/cli/CHANGELOG.md
  76. +2 −1 packages/cli/README.md
  77. +14 −13 packages/cli/package.json
  78. +200 −143 packages/cli/src/__snapshots__/index.test.ts.snap
  79. +7 −11 packages/cli/src/__snapshots__/util.test.ts.snap
  80. +37 −14 packages/cli/src/dirCommand.ts
  81. +33 −15 packages/cli/src/index.test.ts
  82. +16 −3 packages/cli/src/index.ts
  83. +2 −0 packages/cli/src/util.test.ts
  84. +5 −2 packages/cli/src/util.ts
  85. +127 −127 packages/core/CHANGELOG.md
  86. +3 −7 packages/core/README.md
  87. +17 −10 packages/core/package.json
  88. +28 −20 packages/core/src/__snapshots__/config.test.ts.snap
  89. +0 −641 packages/core/src/__snapshots__/convert.test.ts.snap
  90. +687 −0 packages/core/src/__snapshots__/transform.test.ts.snap
  91. +13 −5 packages/core/src/config.ts
  92. +1 −1 packages/core/src/index.ts
  93. +3 −3 packages/core/src/plugins.test.ts
  94. +1 −3 packages/core/src/plugins.ts
  95. +4 −0 packages/core/src/state.test.ts
  96. +1 −1 packages/core/src/state.ts
  97. +19 −5 packages/core/src/{convert.test.ts → transform.test.ts}
  98. +2 −4 packages/core/src/{convert.ts → transform.ts}
  99. +40 −41 packages/hast-util-to-babel-ast/CHANGELOG.md
  100. +1 −1 packages/hast-util-to-babel-ast/README.md
  101. +14 −8 packages/hast-util-to-babel-ast/package.json
  102. +2 −2 packages/hast-util-to-babel-ast/src/__snapshots__/index.test.ts.snap
  103. +26 −9 packages/hast-util-to-babel-ast/src/index.test.ts
  104. +9 −2 packages/hast-util-to-babel-ast/src/stringToObjectStyle.ts
  105. +66 −43 packages/plugin-jsx/CHANGELOG.md
  106. +24 −14 packages/plugin-jsx/package.json
  107. +7 −14 packages/plugin-jsx/src/index.test.ts
  108. +7 −0 packages/plugin-jsx/src/index.ts
  109. +45 −25 packages/plugin-prettier/CHANGELOG.md
  110. +19 −10 packages/plugin-prettier/package.json
  111. +67 −28 packages/plugin-svgo/CHANGELOG.md
  112. +20 −11 packages/plugin-svgo/package.json
  113. +8 −6 packages/plugin-svgo/src/__snapshots__/index.test.ts.snap
  114. +9 −4 packages/plugin-svgo/src/config.test.ts
  115. +18 −12 packages/plugin-svgo/src/config.ts
  116. +22 −5 packages/plugin-svgo/src/index.test.ts
  117. +9 −2 packages/plugin-svgo/src/index.ts
  118. +85 −103 packages/rollup/CHANGELOG.md
  119. +1 −1 packages/rollup/README.md
  120. +23 −16 packages/rollup/package.json
  121. +21 −27 packages/rollup/src/__snapshots__/index.test.ts.snap
  122. +7 −9 packages/rollup/src/index.ts
  123. +90 −106 packages/webpack/CHANGELOG.md
  124. +2 −2 packages/webpack/README.md
  125. +23 −19 packages/webpack/package.json
  126. +74 −88 packages/webpack/src/__snapshots__/index.test.ts.snap
  127. +10 −10 packages/webpack/src/index.test.ts
  128. +13 −4 packages/webpack/src/index.ts
  129. +11,350 −0 pnpm-lock.yaml
  130. +3 −0 pnpm-workspace.yaml
  131. +1 −0 website/.npmrc
  132. +1 −0 website/gatsby-config.js
  133. +4 −0 website/netlify.toml
  134. +32,215 −0 website/package-lock.json
  135. +18 −12 website/package.json
  136. +68 −62 website/pages/docs/cli.mdx
  137. +3 −2 website/pages/docs/configuration-files.mdx
  138. +61 −38 website/pages/docs/custom-templates.mdx
  139. +2 −1 website/pages/docs/custom-transformations.mdx
  140. +11 −4 website/pages/docs/ecosystem.mdx
  141. +12 −57 website/pages/docs/getting-started.mdx
  142. +9 −10 website/pages/docs/jest.mdx
  143. +126 −0 website/pages/docs/migrate.mdx
  144. +61 −0 website/pages/docs/mocha.mdx
  145. +0 −17 website/pages/docs/motivation.mdx
  146. +125 −0 website/pages/docs/next.mdx
  147. +107 −18 website/pages/docs/node-api.mdx
  148. +132 −77 website/pages/docs/options.mdx
  149. +5 −22 website/pages/docs/parcel.mdx
  150. +98 −0 website/pages/docs/remix.mdx
  151. +48 −21 website/pages/docs/rollup.mdx
  152. +0 −21 website/pages/docs/support.mdx
  153. +20 −0 website/pages/docs/supporting-svgr.mdx
  154. +0 −34 website/pages/docs/testing.mdx
  155. +105 −50 website/pages/docs/webpack.mdx
  156. +99 −0 website/pages/docs/what-is-svgr.mdx
  157. +40 −6 website/src/components/playground/Playground.js
  158. +40 −1 website/src/components/playground/config/settings.js
25 changes: 12 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -6,40 +6,39 @@ on:
pull_request:
branches: [main]

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x, 19.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
uses: actions/setup-node@v3

- name: Use latest npm
run: npm i -g npm@latest --registry=https://registry.npmjs.org
if: ${{ matrix.node-version == '12.x' || matrix.node-version == '14.x' }}
- name: Use latest pnpm
run: npm i -g pnpm@latest --registry=https://registry.npmjs.org

- name: Install dependencies
run: npm ci
run: pnpm install

- name: Build
run: npm run build
run: pnpm run build

- name: Lint
run: npm run lint
run: pnpm run lint

- name: Test
run: npm run test -- --ci --coverage
run: pnpm run test --ci --coverage

- name: Codecov
run: npx codecov
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -4,4 +4,4 @@ dist/
!svgr.now.sh/lib/
__fixtures_build__/
src/__fixtures__/dist/
coverage/
coverage/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -6,4 +6,6 @@ lerna.json
dist/
.next/
/website/.cache/
/website/public/
/website/public/
pnpm-workspace.yaml
pnpm-lock.yaml
Loading