Skip to content

Commit e5f050d

Browse files
thibmeugithub-actions[bot]
authored andcommitted
[worker] Add FormData conversion into JsValue (#634)
This allows FormData to be constructed and passed as JsValue later on. For instance, `RequestInit::new().with_body(Some(formdata.into()))`
0 parents  commit e5f050d

File tree

241 files changed

+31874
-0
lines changed

Some content is hidden

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

241 files changed

+31874
-0
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "cloudflare/workers-rs" }
6+
],
7+
"commit": false,
8+
"fixed": [],
9+
"linked": [],
10+
"access": "restricted",
11+
"baseBranch": "main",
12+
"updateInternalDependencies": "patch",
13+
"ignore": []
14+
}

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 🐞 Bug Report
2+
description: File a bug/issue
3+
title: "[BUG] <title>"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
## Bug Report Form
9+
Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.
10+
- type: checkboxes
11+
attributes:
12+
label: Is there an existing issue for this?
13+
description: Please search to see if an issue already exists for the bug you encountered.
14+
options:
15+
- label: I have searched the existing issues
16+
required: true
17+
- type: input
18+
attributes:
19+
label: What version of `workers-rs` are you using?
20+
placeholder: 0.0.0
21+
validations:
22+
required: true
23+
- type: input
24+
attributes:
25+
label: What version of `wrangler` are you using?
26+
placeholder: 0.0.0
27+
validations:
28+
required: true
29+
- type: textarea
30+
attributes:
31+
label: Describe the bug
32+
description: A concise description of what you're experiencing and the expected behavior.
33+
validations:
34+
required: true
35+
- type: textarea
36+
attributes:
37+
label: Steps To Reproduce
38+
description: Steps to reproduce the behavior.
39+
placeholder: |
40+
1. In this environment...
41+
2. With this config...
42+
3. Run '...'
43+
4. See error...
44+
validations:
45+
required: false
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: ⭐ Feature Request
2+
description: Submit a feature request
3+
title: "[Feature] <title>"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
## Feature Request Form
9+
Thanks for submitting a feature request! Please fill out this form as completely as possible.
10+
- type: checkboxes
11+
attributes:
12+
label: Is there an existing issue for this?
13+
description: Please search to see if an issue already exists for the bug you encountered.
14+
options:
15+
- label: I have searched the existing issues
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: Description
20+
description: A concise description of the feature requested.
21+
validations:
22+
required: true

.github/changeset-version.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { execSync } = require("node:child_process");
2+
3+
// This script is used by the `release.yml` workflow to update the version of the packages being released.
4+
// The standard step is only to run `changeset version` but this does not update the package-lock.json file.
5+
// So we also run `npm install`, which does this update.
6+
// This is a workaround until this is handled automatically by `changeset version`.
7+
// See https://github.com/changesets/changesets/issues/421.
8+
execSync("npx changeset version");
9+
execSync("npm install");

.github/logo.png

49.2 KB
Loading
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Open a release PR
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
level:
6+
description: Version bump level
7+
required: true
8+
type: choice
9+
options:
10+
- patch
11+
- minor
12+
jobs:
13+
make-release-pr:
14+
permissions:
15+
id-token: write # Enable OIDC
16+
pull-requests: write
17+
contents: write
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: chainguard-dev/actions/setup-gitsign@main
22+
- name: Install cargo-release
23+
uses: taiki-e/install-action@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tool: cargo-release
28+
- name: Update versions
29+
id: update_versions
30+
run: |
31+
OLD_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -rc '.packages[] | select(.name=="worker") | .version')
32+
cargo release version ${{ inputs.level }} --execute --no-confirm
33+
cargo update
34+
NEW_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -rc '.packages[] | select(.name=="worker") | .version')
35+
find templates | grep Cargo.toml | while read f; do sed -i -e "s/$OLD_VERSION/$NEW_VERSION/g" $f; done
36+
git commit --amend --no-edit
37+
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
38+
- name: Check semver
39+
uses: obi1kenobi/cargo-semver-checks-action@v2
40+
continue-on-error: true
41+
with:
42+
package: worker
43+
verbose: true
44+
feature-group: default-features
45+
- name: Check semver (http)
46+
uses: obi1kenobi/cargo-semver-checks-action@v2
47+
continue-on-error: true
48+
with:
49+
package: worker
50+
verbose: true
51+
- name: Build workspace
52+
run: cargo build --workspace
53+
- name: Build workspace (http)
54+
run: cargo build --package worker-sandbox --all-features
55+
- name: Create Pull Request
56+
uses: peter-evans/create-pull-request@v6
57+
with:
58+
commit-message: "chore: bump versions"
59+
branch: releases/v${{ steps.update_versions.outputs.version }}
60+
base: main
61+
title: Release v${{ steps.update_versions.outputs.version }}
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/create-release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
pull_request:
3+
types:
4+
- closed
5+
branches:
6+
- main
7+
8+
name: Create Release
9+
10+
jobs:
11+
github-release:
12+
name: Github Release
13+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'releases/') && github.event.pull_request.head.repo.full_name == 'cloudflare/workers-rs'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
- name: Extract version
19+
id: extract_version
20+
run: |
21+
BRANCH="${{ github.event.pull_request.head.ref }}"
22+
VERSION=${BRANCH:10}
23+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
24+
- name: Create Release
25+
id: create_release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: v${{ steps.extract_version.outputs.version }}
31+
release_name: Release v${{ steps.extract_version.outputs.version }}
32+
draft: true
33+
prerelease: false
34+
generate_release_notes: true
35+
commitish: ${{ github.event.pull_request.head.sha }}

.github/workflows/pullrequest.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Pull Request
2+
3+
on:
4+
- pull_request
5+
- workflow_dispatch
6+
7+
jobs:
8+
rustfmt:
9+
name: Formatter
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Install stable toolchain
15+
uses: actions-rs/toolchain@v1
16+
with:
17+
toolchain: stable
18+
target: wasm32-unknown-unknown
19+
override: true
20+
21+
- name: Check Formatting
22+
run: cargo fmt --all -- --check
23+
24+
- name: Check for idiomatic code
25+
run: cargo clippy --features d1,queue --all-targets --workspace -- -D warnings
26+
27+
- name: Check for idiomatic code (http)
28+
run: cargo clippy --all-features --package worker-sandbox --all-targets -- -D warnings
29+
test:
30+
name: Test
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout sources
35+
uses: actions/checkout@v2
36+
37+
- name: Install stable toolchain
38+
uses: actions-rs/toolchain@v1
39+
with:
40+
toolchain: stable
41+
target: wasm32-unknown-unknown
42+
override: true
43+
44+
- name: Check for errors
45+
uses: actions-rs/cargo@v1
46+
with:
47+
command: check
48+
49+
- name: Run builder tests
50+
uses: actions-rs/cargo@v1
51+
with:
52+
command: test
53+
args: --manifest-path worker-build/Cargo.toml
54+
55+
- name: Setup node
56+
uses: actions/setup-node@v3
57+
with:
58+
node-version: v18.12.1
59+
60+
- name: Install packages
61+
run: |
62+
sudo apt update
63+
sudo apt clean
64+
sudo apt install -y build-essential libssl-dev netcat libc++-dev
65+
- name: Install wasmpack
66+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
67+
68+
- name: Build local worker-build
69+
uses: actions-rs/cargo@v1
70+
with:
71+
command: install
72+
args: --path ./worker-build --force --debug
73+
74+
- name: Install npm dependencies
75+
shell: bash
76+
run: npm ci
77+
78+
- name: Run tests
79+
shell: bash
80+
run: npm run test
81+
82+
- name: Run tests (http)
83+
shell: bash
84+
run: npm run test-http

0 commit comments

Comments
 (0)