Skip to content

Commit d135a1d

Browse files
authored
Add rollup (#13)
1 parent 7774dab commit d135a1d

File tree

5 files changed

+95
-17
lines changed

5 files changed

+95
-17
lines changed

docs/Changelog.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
## [Unreleased]
1212

13+
## [1.0.3] - 2020-06-30
14+
- esm bundle
15+
1316
## [1.0.2] - 2020-06-25
1417
- change react peer dependency format
1518

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"name": "react-type-check",
3-
"version": "1.0.3-rc.2",
3+
"version": "1.0.3",
44
"description": "Type checking utilities for React elements.",
5-
"main": "dist/index.js",
5+
"main": "./dist/index.js",
6+
"types": "./dist/index.d.ts",
7+
"module": "./dist/react-type-check.esm.js",
68
"files": [
79
"dist"
810
],
@@ -12,7 +14,7 @@
1214
"scripts": {
1315
"prebuild": "rimraf dist",
1416
"prepublishOnly": "concurrently \"yarn run build\" \"yarn run validate\"",
15-
"build": "tsc",
17+
"build": "rollup -c",
1618
"check-types": "tsc --noEmit",
1719
"test-types": "yarn run check-types --project ./testing/tsconfig.test.json",
1820
"test": "jest -c ./testing/jest.config.js",
@@ -43,6 +45,8 @@
4345
"prettier": "^2.0.5",
4446
"react": "^16.13.1",
4547
"rimraf": "^3.0.2",
48+
"rollup": "^2.18.1",
49+
"rollup-plugin-typescript2": "^0.27.1",
4650
"ts-jest": "^26.1.0",
4751
"typescript": "^3.9.3"
4852
},

rollup.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pkg from './package.json';
2+
import typescript from 'rollup-plugin-typescript2';
3+
export default {
4+
input: 'src/index.ts',
5+
output: [
6+
{
7+
file: pkg.main,
8+
format: 'cjs',
9+
},
10+
{ file: pkg.module, format: 'es' },
11+
],
12+
plugins: [typescript()],
13+
};

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* Basic Options */
66
// "incremental": true, /* Enable incremental compilation */
77
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
8-
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
8+
"module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
99
// "lib": [], /* Specify library files to be included in the compilation. */
1010
// "allowJs": true, /* Allow javascript files to be compiled. */
1111
// "checkJs": true, /* Report errors in .js files. */
@@ -14,7 +14,7 @@
1414
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
1515
// "sourceMap": true, /* Generates corresponding '.map' file. */
1616
// "outFile": "./", /* Concatenate and emit output to single file. */
17-
"outDir": "./dist" /* Redirect output structure to the directory. */,
17+
// "outDir": "./dist" /* Redirect output structure to the directory. */,
1818
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
1919
// "composite": true, /* Enable project compilation */
2020
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */

yarn.lock

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,6 +1857,15 @@
18571857
dependencies:
18581858
tslib "^1.11.2"
18591859

1860+
"@rollup/pluginutils@^3.0.8":
1861+
version "3.1.0"
1862+
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
1863+
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
1864+
dependencies:
1865+
"@types/estree" "0.0.39"
1866+
estree-walker "^1.0.1"
1867+
picomatch "^2.2.2"
1868+
18601869
"@samverschueren/stream-to-observable@^0.3.0":
18611870
version "0.3.0"
18621871
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"
@@ -2121,6 +2130,11 @@
21212130
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
21222131
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
21232132

2133+
"@types/estree@0.0.39":
2134+
version "0.0.39"
2135+
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
2136+
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
2137+
21242138
"@types/events@*":
21252139
version "3.0.0"
21262140
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
@@ -6366,6 +6380,11 @@ estraverse@^5.1.0:
63666380
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642"
63676381
integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==
63686382

6383+
estree-walker@^1.0.1:
6384+
version "1.0.1"
6385+
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
6386+
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
6387+
63696388
esutils@^2.0.2:
63706389
version "2.0.3"
63716390
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
@@ -6894,6 +6913,15 @@ find-cache-dir@^2.0.0, find-cache-dir@^2.1.0:
68946913
make-dir "^2.0.0"
68956914
pkg-dir "^3.0.0"
68966915

6916+
find-cache-dir@^3.3.1:
6917+
version "3.3.1"
6918+
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880"
6919+
integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==
6920+
dependencies:
6921+
commondir "^1.0.1"
6922+
make-dir "^3.0.2"
6923+
pkg-dir "^4.1.0"
6924+
68976925
find-root@^1.1.0:
68986926
version "1.1.0"
68996927
resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4"
@@ -7066,6 +7094,15 @@ fs-exists-cached@1.0.0, fs-exists-cached@^1.0.0:
70667094
resolved "https://registry.yarnpkg.com/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz#cf25554ca050dc49ae6656b41de42258989dcbce"
70677095
integrity sha1-zyVVTKBQ3EmuZla0HeQiWJidy84=
70687096

7097+
fs-extra@8.1.0, fs-extra@^8.1.0:
7098+
version "8.1.0"
7099+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
7100+
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
7101+
dependencies:
7102+
graceful-fs "^4.2.0"
7103+
jsonfile "^4.0.0"
7104+
universalify "^0.1.0"
7105+
70697106
fs-extra@9.0.1:
70707107
version "9.0.1"
70717108
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
@@ -7076,15 +7113,6 @@ fs-extra@9.0.1:
70767113
jsonfile "^6.0.1"
70777114
universalify "^1.0.0"
70787115

7079-
fs-extra@^8.1.0:
7080-
version "8.1.0"
7081-
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
7082-
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
7083-
dependencies:
7084-
graceful-fs "^4.2.0"
7085-
jsonfile "^4.0.0"
7086-
universalify "^0.1.0"
7087-
70887116
fs-readdir-recursive@^1.1.0:
70897117
version "1.1.0"
70907118
resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27"
@@ -10578,7 +10606,7 @@ make-dir@^2.0.0, make-dir@^2.1.0:
1057810606
pify "^4.0.1"
1057910607
semver "^5.6.0"
1058010608

10581-
make-dir@^3.0.0:
10609+
make-dir@^3.0.0, make-dir@^3.0.2:
1058210610
version "3.1.0"
1058310611
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
1058410612
integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
@@ -12059,7 +12087,7 @@ physical-cpu-count@^2.0.0:
1205912087
resolved "https://registry.yarnpkg.com/physical-cpu-count/-/physical-cpu-count-2.0.0.tgz#18de2f97e4bf7a9551ad7511942b5496f7aba660"
1206012088
integrity sha1-GN4vl+S/epVRrXURlCtUlverpmA=
1206112089

12062-
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1:
12090+
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2:
1206312091
version "2.2.2"
1206412092
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
1206512093
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
@@ -12127,7 +12155,7 @@ pkg-dir@^3.0.0:
1212712155
dependencies:
1212812156
find-up "^3.0.0"
1212912157

12130-
pkg-dir@^4.2.0:
12158+
pkg-dir@^4.1.0, pkg-dir@^4.2.0:
1213112159
version "4.2.0"
1213212160
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
1213312161
integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==
@@ -13834,6 +13862,13 @@ resolve-url@^0.2.1:
1383413862
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
1383513863
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
1383613864

13865+
resolve@1.15.1:
13866+
version "1.15.1"
13867+
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8"
13868+
integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==
13869+
dependencies:
13870+
path-parse "^1.0.6"
13871+
1383713872
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.8.1:
1383813873
version "1.17.0"
1383913874
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
@@ -13926,6 +13961,24 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
1392613961
hash-base "^3.0.0"
1392713962
inherits "^2.0.1"
1392813963

13964+
rollup-plugin-typescript2@^0.27.1:
13965+
version "0.27.1"
13966+
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.1.tgz#4f27193408a8f040139eed3e3db7b0c7f3668200"
13967+
integrity sha512-RJl77Bbj1EunAQDC3dK/O2HWuSUX3oJbRGzyLoS5o9W4Hs1Nix3Gavqj1Lzs5Y6Ff4H2xXfmZ1WWUQCYocSbzQ==
13968+
dependencies:
13969+
"@rollup/pluginutils" "^3.0.8"
13970+
find-cache-dir "^3.3.1"
13971+
fs-extra "8.1.0"
13972+
resolve "1.15.1"
13973+
tslib "1.11.2"
13974+
13975+
rollup@^2.18.1:
13976+
version "2.18.1"
13977+
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.18.1.tgz#1662c679da5dfc89ec6fda75951a2bcca1a4f77d"
13978+
integrity sha512-w4X77ADA+WTGlapC8Z6yggdJtODw3SBl6R2LSkA7ZW5MtdkgcB7sfaSD1UWyx8diXbMcGIb0eI9gCx/dyqOgNQ==
13979+
optionalDependencies:
13980+
fsevents "~2.1.2"
13981+
1392913982
rsvp@^4.8.4:
1393013983
version "4.8.5"
1393113984
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
@@ -15554,6 +15607,11 @@ tsconfig-paths@^3.9.0:
1555415607
minimist "^1.2.0"
1555515608
strip-bom "^3.0.0"
1555615609

15610+
tslib@1.11.2:
15611+
version "1.11.2"
15612+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.2.tgz#9c79d83272c9a7aaf166f73915c9667ecdde3cc9"
15613+
integrity sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==
15614+
1555715615
tslib@^1.0.0, tslib@^1.10.0, tslib@^1.11.1, tslib@^1.11.2, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
1555815616
version "1.13.0"
1555915617
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"

0 commit comments

Comments
 (0)