mirror of
https://github.com/ente-io/ente.git
synced 2025-08-09 07:48:52 +00:00
[workers] Use yarn workspaces
The duplicate disk usage of individual node_modules is starting to get prohibitive.
This commit is contained in:
parent
08ceb0d5f2
commit
14e0afd867
@ -3,24 +3,25 @@
|
|||||||
Source code for our
|
Source code for our
|
||||||
[Cloudflare Workers](https://developers.cloudflare.com/workers/).
|
[Cloudflare Workers](https://developers.cloudflare.com/workers/).
|
||||||
|
|
||||||
Each worker is a self contained directory with its each `package.json`.
|
Workers are organized as Yarn workspaces sharing a common `package.json` and
|
||||||
|
base `tsconfig`. They can however be deployed individually.
|
||||||
|
|
||||||
## Deploying
|
## Deploying
|
||||||
|
|
||||||
- Switch to a worker directory, e.g. `cd github-discord-notifier`.
|
Install dependencies with `yarn`.
|
||||||
|
|
||||||
- Install dependencies (if needed) with `yarn`
|
> If you have previously deployed, then you will have an old `yarn.lock`. In
|
||||||
|
> this case it is safe to delete and recreate using `rm yarn.lock && yarn`.
|
||||||
|
|
||||||
> If you have previously deployed, then you will have an old `yarn.lock`. In
|
Then, to deploy an individual worker
|
||||||
> this case it is safe to delete and recreate using `rm yarn.lock && yarn`.
|
|
||||||
|
|
||||||
- Login into wrangler (if needed) using `yarn wrangler login`
|
- Login into wrangler (if needed) using `yarn workspace health-check wrangler login`
|
||||||
|
|
||||||
- Deploy! `yarn wrangler deploy`
|
- Deploy! `yarn workspace health-check wrangler deploy`
|
||||||
|
|
||||||
Wrangler is the CLI provided by Cloudflare to manage workers. Apart from
|
Wrangler is the CLI provided by Cloudflare to manage workers. Apart from
|
||||||
deploying, it also allows us to stream logs from running workers by using
|
deploying, it also allows us to stream logs from running workers by using `yarn
|
||||||
`yarn wrangler tail`.
|
workspace <worker-name> wrangler tail`.
|
||||||
|
|
||||||
## Creating a new worker
|
## Creating a new worker
|
||||||
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "cast-albums",
|
"name": "cast-albums",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "files",
|
"name": "files",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "github-discord-notifier",
|
"name": "github-discord-notifier",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "health-check",
|
"name": "health-check",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
13
infra/workers/package.json
Normal file
13
infra/workers/package.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "workers",
|
||||||
|
"private": true,
|
||||||
|
"devDependencies": {
|
||||||
|
"@cloudflare/workers-types": "^4.20240614.0",
|
||||||
|
"typescript": "^5",
|
||||||
|
"wrangler": "^3"
|
||||||
|
},
|
||||||
|
"workspaces": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"packageManager": "yarn@1.22.22"
|
||||||
|
}
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "public-albums",
|
"name": "public-albums",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "files",
|
"name": "sentry-reporter",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "tail",
|
"name": "tail",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "thumbnails",
|
"name": "thumbnails",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "uploader",
|
"name": "uploader",
|
||||||
"private": true,
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"private": true
|
||||||
"@cloudflare/workers-types": "^4.20240614.0",
|
|
||||||
"typescript": "^5",
|
|
||||||
"wrangler": "^3"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user