Skip to content

Commit

Permalink
refactor!: bundle with rollup + typescript, remove UMD export (#410)
Browse files Browse the repository at this point in the history
* chore: configure changesets (#411)

* chore: bundle with rollup + typescript

* test: move tests out of src folder

* test: fix bundles snapshot test

* test: fix bundle tests

* test: fix bundle size tests

* chore: use @total-typescript/tsconfig

* test: fix test coverage

* test: use jest.config.ts

* xx

* test: migrate bundle unit test to vitest

* test: migrate snapshot tests to vitest

* fix: test coverage config

* test: fine tune coverage setup

* docs: update readme
  • Loading branch information
toomuchdesign authored Nov 20, 2024
1 parent 37aca01 commit 3bfb426
Show file tree
Hide file tree
Showing 35 changed files with 7,602 additions and 14,599 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-ears-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-minimal-pie-chart': major
---

UMD export removed
5 changes: 5 additions & 0 deletions .changeset/good-steaks-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-minimal-pie-chart': major
---

Package compiled in ES6. Consuming JS engines should be able to interpret features like arrow functions and const.
5 changes: 5 additions & 0 deletions .changeset/polite-moles-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-minimal-pie-chart': major
---

`svg-partial-circle` unbundled and imported via plain import
10 changes: 3 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ updates:
patterns:
- 'rollup*'
- '@rollup/*'
babel:
patterns:
- '@babel*'
storybook:
patterns:
- 'storybook'
Expand All @@ -25,11 +22,10 @@ updates:
- 'react-dom'
- '@types/react'
- '@types/react-dom'
jest:
vitest:
patterns:
- 'jest*'
- '@types/jest'
- 'babel-jest'
- 'vitest'
- '@vitest/*'
size-limit:
patterns:
- 'size-limit'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dist
types
coverage
storybook-static
*-temp.json

# Trailing dotted files
!.all-contributorsrc
Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions @types/jest/index.d.ts

This file was deleted.

8 changes: 8 additions & 0 deletions @types/schwingbat/relative-angle/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module '@schwingbat/relative-angle';

type Point = {
x: number;
y: number;
};

export function degrees(objectCoords: Point, targetCoords: Point): number;
10 changes: 10 additions & 0 deletions @types/vitest.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'vitest';

interface CustomMatchers<R = unknown> {
toEqualWithRoundingError: (expected: number) => R;
}

declare module 'vitest' {
interface Assertion<T = any> extends CustomMatchers<T> {}
interface AsymmetricMatchersContaining extends CustomMatchers {}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Because [Recharts][recharts-github] is awesome, but when you just need a simple

| | Size<br>by Bundlefobia | Benchmark Size \* | Loading time<br>on a slow 3g \* |
| :----------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :---------------: | :-----------------------------: |
| react-minimal-pie-chart (_v8.4.0_) | [![Bundle size: React minimal pie chart][bundlephobia-badge]][bundlephobia] | 1.93 KB | ~39 ms |
| react-minimal-pie-chart (_v9.0.0_) | [![Bundle size: React minimal pie chart][bundlephobia-badge]][bundlephobia] | 1.99 KB | ~40 ms |
| [rechart][recharts-github] (_v1.8.5_) | [![Bundle size: Recharts][recharts-bundlephobia-badge]][recharts-bundlephobia] | 96.9 KB | ~1900 ms |
| [victory-pie][victory-pie-github] (_v34.1.3_) | [![Bundle size: Victory pie][victory-pie-bundlephobia-badge]][victory-pie-bundlephobia] | 50.5 KB | ~1100 ms |
| [react-apexcharts][react-apexcharts-github] (_v1.3.7_) | [![Bundle size: React apec charts][react-apexcharts-bundlephobia-badge]][react-apexcharts-bundlephobia] | 114.6 KB | ~2300 ms |
Expand Down
30 changes: 0 additions & 30 deletions babel.config.js

This file was deleted.

Loading

0 comments on commit 3bfb426

Please sign in to comment.