Skip to content

Commit 1a1e690

Browse files
authored
Merge pull request #13 from DenysVuika/develop
v2.0.0
2 parents 6ba28d4 + cfc5236 commit 1a1e690

File tree

8 files changed

+1827
-1969
lines changed

8 files changed

+1827
-1969
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"settings": {
2121
"react": {
22-
"version": "16"
22+
"version": "17"
2323
}
2424
},
2525
"rules": {

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8-
target-branch: master
8+
target-branch: develop

.gitignore

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,5 @@ typings/
7575
# parcel-bundler cache (https://parceljs.org/)
7676
.cache
7777

78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
78+
.idea
79+
dist/

.size-limit.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"path": "dist/react-lib.esm.js",
4+
"limit": "1 KB",
5+
"webpack": false
6+
},
7+
{
8+
"path": "dist/react-lib.umd.js",
9+
"limit": "1 KB",
10+
"webpack": false
11+
}
12+
]

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.0.0] - Unreleased
9+
10+
### Added
11+
12+
- CHANGELOG file
13+
14+
### Changed
15+
16+
- Upgraded all dependencies to latest versions
17+
- Moved `size-limit` config from the `package.json` to its own file
18+
- Enable sourcemaps by default
19+
- Remove CommonJS build output
20+
21+
### Fixed
22+
23+
## [1.0.0] - 2020-01-06
24+
25+
### Added
26+
27+
- Typescript support
28+
- CSS Modules
29+
- ESLint (with React and Prettier)
30+
- Unit tests (Jest and Testing Library)
31+
- Minified output (Terser)
32+
- Bundle size validation
33+
- Flexible builds (Rollup)

package.json

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "react-lib",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Project template for a React library",
5-
"main": "react-lib.cjs.js",
5+
"main": "react-lib.umd.js",
66
"module": "react-lib.esm.js",
7-
"browser": "react-lib.umd.js",
87
"private": "true",
8+
"typings": "index.d.ts",
99
"scripts": {
1010
"build": "rollup -c",
1111
"lint": "eslint './{src,app}/**/*.{ts,tsx}'",
@@ -34,56 +34,40 @@
3434
"devDependencies": {
3535
"@size-limit/preset-small-lib": "^4.5.0",
3636
"@testing-library/jest-dom": "^5.10.1",
37-
"@testing-library/react": "^10.2.1",
37+
"@testing-library/react": "^11.2.2",
3838
"@types/jest": "^26.0.0",
39-
"@types/react": "^16.9.36",
40-
"@types/react-dom": "^16.9.8",
41-
"@typescript-eslint/eslint-plugin": "^3.2.0",
42-
"@typescript-eslint/parser": "^3.2.0",
39+
"@types/react": "^17.0.0",
40+
"@types/react-dom": "^17.0.0",
41+
"@typescript-eslint/eslint-plugin": "^4.12.0",
42+
"@typescript-eslint/parser": "^4.12.0",
4343
"eslint": "^7.2.0",
44-
"eslint-config-prettier": "^6.11.0",
44+
"eslint-config-prettier": "^7.1.0",
4545
"eslint-plugin-prettier": "^3.1.4",
4646
"eslint-plugin-react": "^7.20.0",
4747
"identity-obj-proxy": "^3.0.0",
4848
"jest": "^26.0.1",
49+
"postcss": "^8.2.2",
4950
"prettier": "^2.0.5",
50-
"react": "^16.13.1",
51-
"react-dom": "^16.13.1",
51+
"react": "^17.0.1",
52+
"react-dom": "^17.0.1",
5253
"rollup": "^2.16.1",
5354
"rollup-plugin-copy": "^3.3.0",
5455
"rollup-plugin-delete": "^2.0.0",
5556
"rollup-plugin-generate-package-json": "^3.2.0",
56-
"rollup-plugin-postcss": "^3.1.2",
57-
"rollup-plugin-terser": "^6.1.0",
58-
"rollup-plugin-typescript2": "^0.27.1",
57+
"rollup-plugin-postcss": "^4.0.0",
58+
"rollup-plugin-terser": "^7.0.2",
59+
"rollup-plugin-typescript2": "^0.29.0",
5960
"size-limit": "^4.5.0",
6061
"ts-jest": "^26.1.0",
61-
"typescript": "^3.9.5"
62+
"typescript": "^4.1.3"
6263
},
6364
"config": {
6465
"lib": {
6566
"peerDependencies": {
66-
"react": "^16.13.1",
67-
"react-dom": "^16.13.1",
68-
"typescript": "^3.9.5"
67+
"react": "^17.0.1",
68+
"react-dom": "^17.0.1",
69+
"typescript": "^4.1.3"
6970
}
7071
}
71-
},
72-
"size-limit": [
73-
{
74-
"path": "dist/react-lib.cjs.js",
75-
"limit": "1 KB",
76-
"webpack": false
77-
},
78-
{
79-
"path": "dist/react-lib.esm.js",
80-
"limit": "1 KB",
81-
"webpack": false
82-
},
83-
{
84-
"path": "dist/react-lib.umd.js",
85-
"limit": "1 KB",
86-
"webpack": false
87-
}
88-
]
72+
}
8973
}

rollup.config.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import postcss from 'rollup-plugin-postcss';
55
import del from 'rollup-plugin-delete';
66
import generatePackageJson from 'rollup-plugin-generate-package-json';
77
import pkg from './package.json';
8-
import * as path from 'path';
8+
import { resolve } from 'path';
99

1010
const peerDependencies = pkg.config.lib.peerDependencies;
1111

@@ -19,39 +19,41 @@ export default [
1919
typescript: require('typescript'),
2020
}),
2121
postcss({
22-
extract: true,
2322
modules: true,
2423
plugins: [],
25-
extract: path.resolve(`dist/${pkg.name}.css`),
24+
extract: resolve(`dist/${pkg.name}.css`),
2625
}),
2726
copy({
28-
targets: [{ src: 'README.md', dest: 'dist' }],
27+
targets: [
28+
{ src: 'README.md', dest: 'dist' },
29+
{ src: 'CHANGELOG.md', dest: 'dist' },
30+
],
2931
}),
3032
generatePackageJson({
3133
baseContents: (pkg) => ({
3234
...pkg,
3335
name: pkg.name,
34-
scripts: {},
36+
scripts: undefined,
3537
dependencies: {},
3638
devDependencies: {},
3739
peerDependencies,
3840
private: true,
39-
config: {},
41+
config: undefined,
4042
}),
4143
}),
4244
terser(),
4345
],
4446
output: [
4547
{
4648
name: pkg.name,
47-
file: `dist/${pkg.browser}`,
49+
file: `dist/${pkg.main}`,
4850
format: 'umd',
4951
globals: {
5052
react: 'react',
5153
},
54+
sourcemap: true,
5255
},
53-
{ file: `dist/${pkg.main}`, format: 'cjs' },
54-
{ file: `dist/${pkg.module}`, format: 'es' },
56+
{ file: `dist/${pkg.module}`, format: 'es', sourcemap: true },
5557
],
5658
},
5759
];

0 commit comments

Comments
 (0)