Skip to content

Commit 40cfcd8

Browse files
authored
Merge pull request #10 from webscopeio/rewrite/monorepo
Rewrite/monorepo
2 parents 8b197cb + a52446a commit 40cfcd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+12628
-38031
lines changed

.babelrc

-10
This file was deleted.

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.editorconfig

-9
This file was deleted.

.eslintignore

-13
This file was deleted.

.eslintrc

-22
This file was deleted.

.flowconfig

-14
This file was deleted.

.gitignore

+26-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
1-
2-
# See https://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
32

43
# dependencies
54
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# testing
9+
coverage
610

7-
# builds
11+
# next.js
12+
.next/
13+
out/
814
build
915

10-
.rpt2_cache
16+
packages/**/dist
17+
packages/**/.turbo
1118

1219
# misc
1320
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
1429
.env
1530
.env.local
1631
.env.development.local
1732
.env.test.local
1833
.env.production.local
19-
.idea
2034

21-
npm-debug.log*
22-
yarn-debug.log*
23-
yarn-error.log*
35+
# turbo
36+
.turbo
37+
38+
# vercel
39+
.vercel
40+
41+
dist

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = true

.prettierrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 120,
6+
"tabWidth": 2
7+
}

.travis.yml

-4
This file was deleted.

README.md

+67-21
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,81 @@
1-
# react-firebase-messenger
1+
# Turborepo starter
22

3-
> Messenger tool based on firebase realtime database
3+
This is an official starter Turborepo.
44

5-
[![NPM](https://img.shields.io/npm/v/react-firebase-messenger.svg)](https://www.npmjs.com/package/react-firebase-messenger) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
5+
## Using this example
66

7-
## Install
7+
Run the following command:
88

9-
```bash
10-
npm install --save react-firebase-messenger
9+
```sh
10+
npx create-turbo@latest
1111
```
1212

13-
## Usage
13+
## What's inside?
1414

15-
```jsx
16-
import React, { Component } from 'react'
15+
This Turborepo includes the following packages/apps:
1716

18-
import MyComponent from 'react-firebase-messenger'
17+
### Apps and Packages
1918

20-
class Example extends Component {
21-
render () {
22-
return (
23-
<MyComponent />
24-
)
25-
}
26-
}
19+
- `docs`: a [Next.js](https://nextjs.org/) app
20+
- `web`: another [Next.js](https://nextjs.org/) app
21+
- `ui`: a stub React component library shared by both `web` and `docs` applications
22+
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
23+
- `tsconfig`: `tsconfig.json`s used throughout the monorepo
24+
25+
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
26+
27+
### Utilities
28+
29+
This Turborepo has some additional tools already setup for you:
30+
31+
- [TypeScript](https://www.typescriptlang.org/) for static type checking
32+
- [ESLint](https://eslint.org/) for code linting
33+
- [Prettier](https://prettier.io) for code formatting
34+
35+
### Build
36+
37+
To build all apps and packages, run the following command:
38+
39+
```
40+
cd my-turborepo
41+
pnpm build
2742
```
2843

29-
## Linking
30-
For debugging in linked packages use `wml` https://github.com/wix/wml and not npm link, you will save yourself a lot of issues
44+
### Develop
45+
46+
To develop all apps and packages, run the following command:
47+
48+
```
49+
cd my-turborepo
50+
pnpm dev
51+
```
52+
53+
### Remote Caching
54+
55+
Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
56+
57+
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:
58+
59+
```
60+
cd my-turborepo
61+
npx turbo login
62+
```
63+
64+
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
65+
66+
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
67+
68+
```
69+
npx turbo link
70+
```
3171

72+
## Useful Links
3273

33-
## License
74+
Learn more about the power of Turborepo:
3475

35-
MIT © [Webscope.io](https://github.com/Webscope.io)
76+
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
77+
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
78+
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
79+
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
80+
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
81+
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)

apps/docs/.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ["custom/next"],
3+
};

apps/docs/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

apps/docs/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Getting Started
2+
3+
First, run the development server:
4+
5+
```bash
6+
yarn dev
7+
```
8+
9+
Open [http://localhost:3001](http://localhost:3001) with your browser to see the result.
10+
11+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
12+
13+
To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, like `api/hello/route.ts` would map to [http://localhost:3001/api/hello](http://localhost:3001/api/hello).
14+
15+
## Learn More
16+
17+
To learn more about Next.js, take a look at the following resources:
18+
19+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
20+
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
21+
22+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
23+
24+
## Deploy on Vercel
25+
26+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
27+
28+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

apps/docs/app/layout.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default function RootLayout({
2+
children,
3+
}: {
4+
children: React.ReactNode;
5+
}): JSX.Element {
6+
return (
7+
<html lang="en">
8+
<body>{children}</body>
9+
</html>
10+
);
11+
}

apps/docs/app/page.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Page(): JSX.Element {
2+
return (
3+
<>
4+
Docs
5+
</>
6+
);
7+
}

apps/docs/next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

apps/docs/next.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
reactStrictMode: true,
3+
transpilePackages: ["ui"],
4+
};

apps/docs/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "docs",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev --port 3001",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"next": "^13.4.19",
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0"
15+
},
16+
"devDependencies": {
17+
"@next/eslint-plugin-next": "^13.4.19",
18+
"@types/node": "^17.0.12",
19+
"@types/react": "^18.0.22",
20+
"@types/react-dom": "^18.0.7",
21+
"eslint-config-custom": "workspace:*",
22+
"tsconfig": "workspace:*",
23+
"typescript": "^4.5.3"
24+
}
25+
}

apps/docs/tsconfig.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "tsconfig/nextjs.json",
3+
"compilerOptions": {
4+
"plugins": [{ "name": "next" }]
5+
},
6+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
7+
"exclude": ["node_modules"]
8+
}

0 commit comments

Comments
 (0)