Skip to content

Commit 64071b3

Browse files
authored
feat: convert to monorepo (#339)
1 parent 210efab commit 64071b3

File tree

21 files changed

+2919
-839
lines changed

21 files changed

+2919
-839
lines changed

.codesandbox/ci.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"buildCommand": "compile",
2+
"buildCommand": "build",
3+
"sandboxes": ["/packages/example"],
34
"node": "16"
45
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
dist
3+
build
34
.cache
45
.parcel-cache

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install dependencies
2020
run: yarn install --frozen-lockfile
2121
- name: Build example
22-
run: yarn example:build
22+
run: yarn build --filter=react-youtube-example...
2323
- name: Deploy to GitHub pages
2424
if: success()
2525
uses: crazy-max/ghaction-github-pages@v2

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- name: Install dependencies
2121
run: yarn install --frozen-lockfile
2222
- name: Run tests
23-
run: yarn test
23+
run: yarn test --filter=react-youtube
2424
- name: Build
25-
run: yarn compile
25+
run: yarn build --filter=react-youtube
2626
- name: Semantic Release
27-
uses: cycjimmy/semantic-release-action@v3
27+
run: yarn release
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Install dependencies
2121
run: yarn install
2222
- name: Run tests
23-
run: yarn test:ci
23+
run: yarn test --filter=react-youtube

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
node_modules
22
npm-debug.log
3-
dist
4-
es
5-
.vscode/*
6-
.cache/*
7-
.parcel-cache/*
8-
build/*
3+
dist/
4+
.vscode/
5+
.cache/
6+
.parcel-cache/
7+
build/
8+
.turbo

browserslist

Lines changed: 0 additions & 4 deletions
This file was deleted.

example/example.jsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

package.json

Lines changed: 17 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,32 @@
11
{
2-
"name": "react-youtube",
3-
"version": "1.0.0-semantic-release",
4-
"description": "React.js powered YouTube player component",
5-
"main": "dist/YouTube.js",
6-
"module": "dist/YouTube.mjs",
7-
"types": "dist/YouTube.d.ts",
8-
"targets": {
9-
"main": false,
10-
"module": false,
11-
"types": false
12-
},
13-
"sideEffects": false,
14-
"files": [
15-
"dist/**"
16-
],
17-
"repository": {
18-
"type": "git",
19-
"url": "[email protected]:tjallingt/react-youtube.git"
20-
},
21-
"keywords": [
22-
"react",
23-
"youtube",
24-
"player",
25-
"react-component"
26-
],
27-
"author": "Tjalling Tolle <[email protected]>",
28-
"license": "MIT",
29-
"bugs": {
30-
"url": "https://github.com/tjallingt/react-youtube/issues"
31-
},
32-
"homepage": "https://github.com/tjallingt/react-youtube",
33-
"dependencies": {
34-
"fast-deep-equal": "3.1.3",
35-
"prop-types": "15.8.1",
36-
"youtube-player": "5.5.2"
2+
"private": true,
3+
"scripts": {
4+
"dev": "turbo run dev --parallel",
5+
"build": "turbo run build",
6+
"test": "turbo run test",
7+
"clean": "turbo run clean && rm -rf node_modules",
8+
"release": "turbo run release --concurrency=1",
9+
"lint": "eslint packages --ext .ts,.tsx,.js,.jsx",
10+
"commit": "git-cz",
11+
"prepare": "husky install"
3712
},
3813
"devDependencies": {
3914
"@commitlint/cli": "16.2.3",
4015
"@commitlint/config-conventional": "16.2.1",
41-
"@testing-library/jest-dom": "5.16.4",
42-
"@testing-library/react": "12.1.4",
43-
"@types/jest": "27.4.1",
44-
"@types/youtube-player": "5.5.6",
16+
"@typescript-eslint/eslint-plugin": "5.19.0",
17+
"@typescript-eslint/parser": "5.19.0",
4518
"commitizen": "4.2.4",
46-
"cross-env": "7.0.3",
4719
"cz-conventional-changelog": "3.3.0",
4820
"eslint": "8.13.0",
4921
"eslint-config-prettier": "8.5.0",
50-
"eslint-config-react-app": "7.0.0",
22+
"eslint-config-react-app": "7.0.1",
5123
"eslint-plugin-prettier": "4.0.0",
5224
"husky": "7.0.4",
53-
"jest": "27.5.1",
5425
"lint-staged": "12.3.7",
55-
"parcel": "2.4.1",
5626
"prettier": "2.6.2",
57-
"process": "0.11.10",
58-
"react": "17.0.2",
59-
"react-dom": "17.0.2",
60-
"ts-jest": "27.1.4",
61-
"tsup": "5.12.4",
27+
"turbo": "1.2.2",
6228
"typescript": "4.6.3"
6329
},
64-
"peerDependencies": {
65-
"react": ">=0.14.1"
66-
},
67-
"engines": {
68-
"node": ">= 14.x"
69-
},
70-
"scripts": {
71-
"test": "jest",
72-
"test:ci": "jest --ci --runInBand",
73-
"compile": "tsup src/YouTube.tsx --format esm,cjs --dts --external react",
74-
"prepublishOnly": "npm run compile",
75-
"lint": "eslint src example --ext .ts,.tsx,.js,.jsx",
76-
"example": "parcel example/index.html --public-url /react-youtube/ --open",
77-
"example:build": "parcel build example/index.html --public-url /react-youtube/ --dist-dir build",
78-
"commit": "git-cz",
79-
"prepare": "husky install"
80-
},
8130
"lint-staged": {
8231
"*.js": "eslint --ext .ts,.tsx,.js,.jsx --fix",
8332
"*.{html,json}": "prettier --write"
@@ -87,8 +36,7 @@
8736
"path": "cz-conventional-changelog"
8837
}
8938
},
90-
"jest": {
91-
"testEnvironment": "jsdom",
92-
"preset": "ts-jest"
93-
}
39+
"workspaces": [
40+
"packages/*"
41+
]
9442
}

example/README.md renamed to packages/example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
Run with NPM:
44

55
```bash
6-
$ npm run example
6+
npm run dev
77
```
88

99
or with Yarn:
1010

1111
```bash
12-
$ yarn example
12+
yarn dev
1313
```

0 commit comments

Comments
 (0)