-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: code cleanup and handlebars template
- Loading branch information
Showing
23 changed files
with
395 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 flakey5 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# dist-worker | ||
# release-cloudflare-worker | ||
|
||
New infra for serving Node.js downloads and documentation. | ||
|
||
For more information, check out [nodejs/build#3461](https://github.com/nodejs/build/issues/3461). | ||
|
||
## Dev Setup | ||
|
||
View [docs/dev-setup.md](./docs/dev-setup.md) | ||
|
||
## License | ||
|
||
This repo is licensed under the terms of the [MIT License](./LICENSE.md). It is based off of [Kotx's render worker](https://github.com/kotx/render), which is also licensed under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
# Deploy | ||
|
||
This worker is auto-deployed by Github Actions. The workflow is defined [here](../.github/workflows/deploy.yml). | ||
|
||
## Staging | ||
|
||
This worker is deployed to staging every time a pr is merged into the main branch. | ||
|
||
## Prod | ||
|
||
This worker is deployed into prod by a manual trigger. | ||
|
||
## Actions Setup | ||
|
||
How to setup the actions for automated deployments. | ||
|
||
* Create a Cloudflare API Token (https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) | ||
* Set Github secret `CF_API_TOKEN` on the repo to the token you generated | ||
* They should be working now | ||
- Create a Cloudflare API Token (https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) | ||
- Set Github secret `CF_API_TOKEN` on the repo to the token you generated | ||
- They should be working now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
# Dev Setup | ||
|
||
Guide to setting up this worker for development. | ||
|
||
## Have Node Installed | ||
|
||
Node needs to be installed for the thing that serves Node downloads (latest LTS/even numbered major recommended) | ||
|
||
## Install Dependencies | ||
|
||
Run `npm install` | ||
|
||
## Testing | ||
|
||
To run unit tests, `npm run test:unit`. To run e2e (end-to-end) tests, `npm run test:e2e`. | ||
|
||
See the [/test](../tests/) folder for more info on testing. | ||
|
||
## Running Locally | ||
|
||
Spin up a Workerd instance on your machine that serves this worker | ||
|
||
### Login to Cloudflare Dash From Wrangler CLI | ||
|
||
Run `wrangler login` | ||
|
||
### R2 Buckets | ||
|
||
Depending on the environment you're running in, you will need a different R2 bucket on your account. | ||
For dev (the default), it's `dist-dev`. For staging, `dist-staging`. For prod, `dist-prod`. | ||
These buckets will either need to have a copy of Node's dist folder in them or something mimicing the folder there. | ||
|
||
### Starting the Local Server | ||
Run `npm start`. This starts a Workerd instance in remote mode. | ||
|
||
Run `npm start`. This starts a Workerd instance in remote mode. |
Oops, something went wrong.