Skip to content

Commit 4fc5f1c

Browse files
Add TS declarations (#167)
1 parent 82a96c8 commit 4fc5f1c

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

CHANGELOG.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 10.3.0
2+
3+
- Add TypeScript declarations #144
4+
15
## 10.2.0
26

37
- Add optional `emitOnChange` param to override method #166
@@ -14,20 +18,20 @@
1418
- Better representation of `readOnly` state
1519
- Smaller tooltip size
1620

17-
## 10.0.3
21+
## 10.0.3
1822

1923
- Small margin change to default bottom controller theme.
2024
- Add tooltip to eye dropper icon to match the rest of the interface
2125

22-
## 10.0.2
26+
## 10.0.2
2327

2428
- Add missing `colorSpace` value to onChange handler.
2529

26-
## 10.0.1
30+
## 10.0.1
2731

2832
- Fix `prepublish` build step to include `.ts,.tsx` extensions.
2933

30-
## 10.0.0
34+
## 10.0.0
3135

3236
v10 has been rewritten in TypeScript and has a new layout for better ergnomics and additional features!
3337

@@ -45,7 +49,7 @@ v10 has been rewritten in TypeScript and has a new layout for better ergnomics a
4549
- `channel` prop is no longer supported
4650
- `mode` has changed to `dial` or `values`
4751
- `colorSpace` replaces what was previously `mode`
48-
- `hexInput` is no longer passed on onChange.
52+
- `hexInput` is no longer passed on onChange.
4953
- The hex input no longer prints the shortend hex equivalent
5054
- A pasted hex input no longer retains a previously set alpha value
5155

@@ -64,6 +68,7 @@ v10 has been rewritten in TypeScript and has a new layout for better ergnomics a
6468
## 9.0.2
6569

6670
- [Enhancement] Allow ModeInput to have a disabled state based on a readOnly prop
71+
6772
## 9.0.1
6873

6974
- [Bug] Fix click to select color resulting in drag behavior [#153](https://github.com/mapbox/react-colorpickr/pull/153)

babel.config.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
module.exports = {
1+
/* global module */
2+
module.exports = ({ env }) => ({
23
presets: [
34
'@babel/preset-env',
45
'@babel/preset-react',
56
'@babel/preset-typescript'
6-
]
7-
};
7+
],
8+
ignore: env('test')
9+
? ['src/types']
10+
: ['src/types', '**/*.test.tsx', '**/*.test.ts']
11+
});

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mapbox/react-colorpickr",
3-
"version": "10.2.0",
3+
"version": "10.3.0",
44
"description": "A React colorpicker",
55
"main": "dist/colorpickr.js",
66
"scripts": {
@@ -9,7 +9,7 @@
99
"jest-watch": "jest --watch",
1010
"tsc": "tsc",
1111
"start": "budo example/index.js --dir example --serve=bundle.js --live -d -- -p [ tsify --noImplicitAny ] -t [ babelify --extensions '.ts','.tsx','.js' ]",
12-
"prepublishOnly": "rm -rf dist && babel src -d dist --extensions '.ts,.tsx,.js' && cp example/colorpickr.css dist/colorpickr.css",
12+
"prepublishOnly": "rm -rf dist && babel src -d dist --extensions '.ts,.tsx,.js' && tsc && cp example/colorpickr.css dist/colorpickr.css",
1313
"build": "browserify example/index.js -p [ tsify --noImplicitAny ] -t [ babelify --extensions '.ts','.tsx','.js' ] | uglifyjs -c -m > example/bundle.js",
1414
"prepare": "husky install"
1515
},

tsconfig.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
9-
"noEmit": true,
4+
"lib": ["dom", "dom.iterable", "esnext"],
105
"allowJs": true,
6+
"declaration": true,
7+
"emitDeclarationOnly": true,
118
"skipLibCheck": true,
129
"esModuleInterop": true,
1310
"allowSyntheticDefaultImports": true,
@@ -19,9 +16,10 @@
1916
"resolveJsonModule": true,
2017
"isolatedModules": true,
2118
"noImplicitAny": true,
22-
"jsx": "react-jsx"
19+
"jsx": "react-jsx",
20+
"rootDir": "src",
21+
"outDir": "dist"
2322
},
24-
"include": [
25-
"src"
26-
]
23+
"include": ["src"],
24+
"exclude": ["**/*.test.*"]
2725
}

0 commit comments

Comments
 (0)