Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timscodebase/api-fun
A monorepo full of fun API examples. Built with Sveltekit
https://github.com/timscodebase/api-fun
Last synced: about 1 month ago
JSON representation
A monorepo full of fun API examples. Built with Sveltekit
- Host: GitHub
- URL: https://github.com/timscodebase/api-fun
- Owner: timscodebase
- Created: 2022-10-06T15:18:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-08T18:55:33.000Z (about 2 years ago)
- Last Synced: 2024-12-01T00:49:05.997Z (about 1 month ago)
- Language: Svelte
- Size: 4.78 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Simple Monorepo Starter
This is a simple monorepo starter for a project that has multiple packages. It uses [PnPm](https://pnpm.io/) for efficiency and speed
The code came mainly from Scott Tolinski's [Monorepos with Pnpm](https://leveluptutorials.com/tutorials/monorepos-with-pnpm) tutorial.
---
## How to use
1) Click the green "Use this template" button above to create a new repo from this template
2) Name your new monorepo
3) Enjoy!The `packages` folder is where you'll put your packages, duh. A package can be anything from a frontend framework to a backend framework to a library to a CLI tool. It's up to you!
### Scripts
```json
"scripts": {
"start:main": "pnpm -F @project-name/main start",
"start:second": "pnpm -F @project-name/second start",
"start": "pnpm -r start",
"update:all": "pnpm -r update -i -L",
"clean": "find ./ -name node_modules -type d -exec rm -rf {} +"
},
```- `start:main` - starts the main package
- `start:second` - starts the second package
- `start` - starts both/all packages
- `update:all` - recursively updates all dependencies for all packages
- `clean` - removes all `node_modules` folders### How to add new dependencies
```bash
# Add a new package
pnpm -F @project-name/second add [email protected]# Add a new dependency to the main package (the root package) - rarely needed
pnpm add -w just-kebab-case
```### How to add a new package
Simply create a new folder in the `packages` folder and add run `pnpm init` in that folder.
1) Create a new folder in the `packages` folder
2) Run `pnpm init` in that folder
3) Optionally, duplicate `start:second` in the root `package.json` and change the name to the new package