mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +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
|
||||
[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
|
||||
|
||||
- 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
|
||||
> this case it is safe to delete and recreate using `rm yarn.lock && yarn`.
|
||||
Then, to deploy an individual worker
|
||||
|
||||
- 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
|
||||
deploying, it also allows us to stream logs from running workers by using
|
||||
`yarn wrangler tail`.
|
||||
deploying, it also allows us to stream logs from running workers by using `yarn
|
||||
workspace <worker-name> wrangler tail`.
|
||||
|
||||
## Creating a new worker
|
||||
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "cast-albums",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "files",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "github-discord-notifier",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "health-check",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
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",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "files",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"name": "sentry-reporter",
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "tail",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "thumbnails",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
{
|
||||
"name": "uploader",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240614.0",
|
||||
"typescript": "^5",
|
||||
"wrangler": "^3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22"
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user