Skip to content

Commit

Permalink
Introduce TypeScript and convert two components (#161)
Browse files Browse the repository at this point in the history
* Drop a lot of stuff for now and add TypeScript
* Add first radix-ui piece to icon component
* Move utils to TypeScript
* Tests
* Revert on a bunch of work

This reverts commit 0b6dc34.
  • Loading branch information
tristen authored Jun 30, 2022
1 parent af7e44d commit cd2dca1
Show file tree
Hide file tree
Showing 71 changed files with 10,346 additions and 31,960 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Changelog
Changelog
---

## HEAD

- [breaking] Rewrites `src/components/icon` as a functional component and uses [`accessible-icon` from Radix](https://www.radix-ui.com/docs/primitives/utilities/accessible-icon) as an internal primitive.
- [breaking] Rewrites `src/components/control-wrapper` as a functional component.
- [feature] Introduces TypeScript to the source code and converts:
- `src/docs/*`
- `src/components/utils/*`
- `src/components/icon/*`
- `src/components/control-wrapper/*`
- [feature] Adds React Testing Library to newly ported components

## 2.0.0-beta.2

Expand Down
20 changes: 16 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
'use strict';

module.exports = {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ['@babel/plugin-proposal-class-properties']
presets: ['@mapbox/babel-preset-mapbox'],
overrides: [
{
test: /\.tsx$/,
presets: [
'@mapbox/babel-preset-mapbox',
[
'@babel/typescript',
{
allExtensions: true,
isTSX: true
}
]
]
}
]
};
9 changes: 7 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
module.exports = {
coverageReporters: ['text', 'html'],
clearMocks: true,
testMatch: ['**/__tests__/*.test.js'],
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
'^.+\\.(js|jsx)$': 'babel-jest'
},
testRegex: '.*\\.test\\.(ts|tsx|js)$',
setupFiles: ['./src/test-utils/jest-setup.js'],
setupFilesAfterEnv: ['./src/test-utils/jest-setup-framework.js']
setupFilesAfterEnv: ['./src/test-utils/jest-framework-setup.js'],
testEnvironment: 'jest-environment-jsdom'
};
Loading

0 comments on commit cd2dca1

Please sign in to comment.