Skip to content

Commit ce59bad

Browse files
authored
feat: switch project to monorepo (#451)
1 parent 5f7d0ad commit ce59bad

35 files changed

+386
-175
lines changed

.github/workflows/main.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,25 @@ jobs:
3535
run: yarn install --immutable
3636

3737
- name: Lint
38-
run: yarn lint
38+
run: yarn workspace react-responsive-modal lint
3939

4040
- name: Test
41-
run: yarn test --ci --coverage --maxWorkers=2
41+
run: yarn workspace react-responsive-modal test --ci --coverage --maxWorkers=2
4242

4343
- name: Report coverage
4444
uses: codecov/codecov-action@v1
4545

4646
- name: Build
47-
run: yarn build
47+
run: yarn workspace react-responsive-modal build
4848

4949
- name: Build docs
50-
run: yarn docz:build
50+
run: yarn workspace react-responsive-modal docz:build
5151

5252
- name: Cypress run
5353
uses: cypress-io/github-action@v2
5454
with:
5555
# Dependencies already installed before
5656
install: false
57-
start: yarn dlx serve -l 3000 .docz/dist
57+
# Use monorepo
58+
project: ./react-responsive-modal
59+
start: yarn dlx serve -l 3000 react-responsive-modal/.docz/dist

.github/workflows/release-please.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
run: yarn install --immutable
3131
if: ${{ steps.release.outputs.release_created }}
3232

33-
- name: Build
34-
run: yarn build
33+
- name: Build react-responsive-modal
34+
run: yarn workspace react-responsive-modal build
3535
if: ${{ steps.release.outputs.release_created }}
3636

37-
- name: Publish npm package
38-
run: yarn npm publish
37+
- name: Publish react-responsive-modal npm package
38+
run: yarn workspace react-responsive-modal npm publish
3939
env:
4040
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
4141
if: ${{ steps.release.outputs.release_created }}

.github/workflows/size.yml

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ jobs:
3030
- uses: andresz1/size-limit-action@v1
3131
with:
3232
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
directory: react-responsive-modal

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

+29
Large diffs are not rendered by default.

.yarnrc.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
nodeLinker: node-modules
22

3+
npmAuthToken: "${NPM_TOKEN-''}"
4+
35
plugins:
46
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
57
spec: "@yarnpkg/plugin-interactive-tools"
8+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
9+
spec: "@yarnpkg/plugin-workspace-tools"
610

711
yarnPath: .yarn/releases/yarn-2.3.3.cjs
8-
npmAuthToken: "${NPM_TOKEN-''}"

README.md

-71
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./react-responsive-modal/README.md

netlify.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[build]
3-
publish = ".docz/dist"
4-
command = "yarn docz:build"
3+
publish = "react-responsive-modal/.docz/dist"
4+
command = "yarn workspace react-responsive-modal docz:build"
55

66
[build.environment]
77
NODE_VERSION = "12"

package.json

+8-82
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,25 @@
11
{
2-
"name": "react-responsive-modal",
3-
"version": "5.2.6",
4-
"description": "A simple responsive and accessible react modal",
5-
"license": "MIT",
6-
"main": "dist/index.js",
7-
"module": "dist/react-responsive-modal.esm.js",
8-
"typings": "dist/index.d.ts",
2+
"private": true,
93
"scripts": {
10-
"start": "tsdx watch",
11-
"build": "tsdx build",
12-
"test": "tsdx test --passWithNoTests",
13-
"lint": "tsdx lint",
14-
"prepare": "tsdx build",
15-
"docz:dev": "docz dev",
16-
"docz:build": "docz build",
17-
"size": "size-limit",
184
"prettier": "prettier --write \"**/*.{js,ts,tsx,css,scss,json,md,mdx}\""
195
},
20-
"files": [
21-
"dist",
22-
"src",
23-
"styles.css"
6+
"workspaces": [
7+
"react-responsive-modal"
248
],
25-
"jest": {
26-
"setupFilesAfterEnv": [
27-
"./__tests__/setupTests.ts"
28-
],
29-
"modulePathIgnorePatterns": [
30-
"cypress"
31-
],
32-
"coveragePathIgnorePatterns": [
33-
"src/lib"
34-
]
35-
},
369
"prettier": {
3710
"singleQuote": true
3811
},
3912
"husky": {
4013
"hooks": {
41-
"pre-commit": "tsdx lint"
42-
}
43-
},
44-
"keywords": [
45-
"react",
46-
"responsive",
47-
"modal",
48-
"mobile",
49-
"flex"
50-
],
51-
"repository": "git+https://github.com/pradel/react-responsive-modal.git",
52-
"author": "Léo Pradel",
53-
"bugs": {
54-
"url": "https://github.com/pradel/react-responsive-modal/issues"
55-
},
56-
"homepage": "https://react-responsive-modal.leopradel.com/",
57-
"funding": "https://github.com/sponsors/pradel",
58-
"size-limit": [
59-
{
60-
"path": "dist/react-responsive-modal.cjs.production.min.js",
61-
"limit": "3.3 KB"
62-
},
63-
{
64-
"path": "dist/react-responsive-modal.esm.js",
65-
"limit": "3.3 KB"
14+
"pre-commit": "lint-staged"
6615
}
67-
],
68-
"dependencies": {
69-
"classnames": "^2.2.6",
70-
"no-scroll": "^2.1.1"
7116
},
72-
"peerDependencies": {
73-
"react": "^16.8.0 || ^17",
74-
"react-dom": "^16.8.0 || ^17"
17+
"lint-staged": {
18+
"*.{js,ts,tsx,css,scss,json,md,mdx}": "prettier --write"
7519
},
7620
"devDependencies": {
77-
"@size-limit/preset-small-lib": "4.7.0",
78-
"@testing-library/jest-dom": "5.11.5",
79-
"@testing-library/react": "11.1.1",
80-
"@types/classnames": "2.2.11",
81-
"@types/no-scroll": "2.1.0",
82-
"@types/node": "14.14.6",
83-
"@types/react": "16.9.56",
84-
"@types/react-dom": "16.9.9",
85-
"@types/react-transition-group": "4.4.0",
86-
"cypress": "5.5.0",
87-
"docz": "2.3.1",
88-
"gatsby": "2.23.11",
89-
"gatsby-theme-docz": "2.3.1",
9021
"husky": "4.3.0",
91-
"prettier": "2.1.2",
92-
"react": "16.14.0",
93-
"react-dom": "16.14.0",
94-
"size-limit": "4.7.0",
95-
"tsdx": "0.14.1",
96-
"tslib": "2.0.3",
97-
"typescript": "4.0.5"
22+
"lint-staged": "10.5.1",
23+
"prettier": "2.1.2"
9824
}
9925
}

react-responsive-modal/README.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# react-responsive-modal
2+
3+
[![npm version](https://img.shields.io/npm/v/react-responsive-modal.svg)](https://www.npmjs.com/package/react-responsive-modal)
4+
[![npm downloads per month](https://img.shields.io/npm/dm/react-responsive-modal.svg)](https://www.npmjs.com/package/react-responsive-modal)
5+
[![codecov](https://img.shields.io/codecov/c/github/pradel/react-responsive-modal/master.svg)](https://codecov.io/gh/pradel/react-responsive-modal)
6+
7+
A simple responsive and accessible react modal.
8+
9+
- Focus trap inside the modal.
10+
- Centered modals.
11+
- Scrolling modals.
12+
- Multiple modals.
13+
- Accessible modals.
14+
- Easily customizable via props.
15+
16+
## Documentation
17+
18+
- [Getting started](https://react-responsive-modal.leopradel.com/)
19+
- [Installation](https://react-responsive-modal.leopradel.com/#installation)
20+
- [Usage](https://react-responsive-modal.leopradel.com/#usage)
21+
- [Props](https://react-responsive-modal.leopradel.com/#props)
22+
- [Licence](https://react-responsive-modal.leopradel.com/#license)
23+
- [Examples](https://react-responsive-modal.leopradel.com/examples)
24+
- [Centered modal](https://react-responsive-modal.leopradel.com/examples#centered-modal)
25+
- [Multiple modal](https://react-responsive-modal.leopradel.com/examples#multiple-modal)
26+
- [Custom styling](https://react-responsive-modal.leopradel.com/examples#custom-styling)
27+
- [Custom animation](https://react-responsive-modal.leopradel.com/examples#custom-animation)
28+
- [Custom container](https://react-responsive-modal.leopradel.com/examples#custom-container)
29+
30+
## Installation
31+
32+
With npm: `npm install react-responsive-modal --save`
33+
34+
Or with yarn: `yarn add react-responsive-modal`
35+
36+
## Usage
37+
38+
[![Edit react-responsive-modal](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/9jxp669j2o)
39+
40+
```javascript
41+
import React, { useState } from 'react';
42+
import ReactDOM from 'react-dom';
43+
import 'react-responsive-modal/styles.css';
44+
import { Modal } from 'react-responsive-modal';
45+
46+
const App = () => {
47+
const [open, setOpen] = useState(false);
48+
49+
const onOpenModal = () => setOpen(true);
50+
const onCloseModal = () => setOpen(false);
51+
52+
return (
53+
<div>
54+
<button onClick={onOpenModal}>Open modal</button>
55+
<Modal open={open} onClose={onCloseModal} center>
56+
<h2>Simple centered modal</h2>
57+
</Modal>
58+
</div>
59+
);
60+
};
61+
62+
ReactDOM.render(<App />, document.getElementById('app'));
63+
```
64+
65+
## Props
66+
67+
Check the documentation: https://react-responsive-modal.leopradel.com/#props.
68+
69+
## License
70+
71+
MIT © [Léo Pradel](https://www.leopradel.com/)
File renamed without changes.
File renamed without changes.
File renamed without changes.

cypress/plugins/index.js react-responsive-modal/cypress/plugins/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
module.exports = (on, config) => {
1919
// `on` is used to hook into various events Cypress emits
2020
// `config` is the resolved Cypress config
21-
}
21+
};
File renamed without changes.

cypress/support/index.js react-responsive-modal/cypress/support/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// ***********************************************************
1515

1616
// Import commands.js using ES2015 syntax:
17-
import './commands'
17+
import './commands';
1818

1919
// Alternatively you can use CommonJS syntax:
2020
// require('./commands')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)