Skip to content

Commit e117e77

Browse files
committed
Merge branch 'main' into release
2 parents afeb6dd + cc09e99 commit e117e77

Some content is hidden

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

64 files changed

+1738
-1461
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
#region Summary
122122
- name: Create Job summary
123123
if: always()
124-
uses: actions/github-script@v7
124+
uses: actions/github-script@v8
125125
id: summary
126126
with:
127127
script: |
@@ -166,7 +166,7 @@ jobs:
166166
- name: Create deploy comment
167167
if: github.event_name == 'pull_request'
168168
continue-on-error: true
169-
uses: edumserrano/find-create-or-update-comment@v2
169+
uses: edumserrano/find-create-or-update-comment@v3
170170
with:
171171
issue-number: ${{ github.event.pull_request.number }}
172172
body-includes: '<!-- worker-deploy-summary -->'

.github/workflows/pr-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: Typecheck
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v5
2222
- uses: ./.github/workflows/setup
2323
- run: pnpm typecheck
2424

@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout code
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
3131
- name: Environment setup
3232
uses: ./.github/workflows/setup
3333
- name: Check lint
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
steps:
4040
- name: Checkout code
41-
uses: actions/checkout@v4
41+
uses: actions/checkout@v5
4242
- name: Environment setup
4343
uses: ./.github/workflows/setup
4444
- name: Check format

.github/workflows/pr-title-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
name: Check PR Title
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: amannn/action-semantic-pull-request@v5
16+
- uses: amannn/action-semantic-pull-request@v6
1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ dist
4646
!cdn/dist/.gitkeep
4747
build
4848
.cache
49+
50+
# macOS
51+
.DS_Store

api/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Publisher Tools - API
2+
3+
This package contains the Hono-based API server that powers the Publisher Tools. It runs on Cloudflare Workers and is responsible for fetching tool configurations, handling Open Payments, and managing probabilistic revenue sharing.
4+
5+
## Endpoints
6+
7+
The API exposes endpoints related to the following functionalities:
8+
9+
- **Tool Configuration:** Handles fetching the configuration for the monetization tools (see `src/routes/get-config.ts`).
10+
- **Payments:** Manages the Open Payments flow (see `src/routes/payment.ts`).
11+
- **Probabilistic Revshare:** Handles logic related to probabilistic revenue sharing (see `src/routes/probabilistic-revshare.ts`).
12+
13+
## Development
14+
15+
To run the API server for local development, you can use the `dev` script from the project root:
16+
17+
```sh
18+
pnpm -C api dev
19+
```
20+
21+
This will start the Cloudflare Wrangler development server, which automatically reloads on file changes.

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"@hono/zod-validator": "^0.7.3",
1818
"@interledger/open-payments": "^7.1.3",
19-
"@noble/ed25519": "^2.3.0",
19+
"@noble/ed25519": "^3.0.0",
2020
"@paralleldrive/cuid2": "^2.2.2",
2121
"@shared/config-storage-service": "workspace:^",
2222
"@shared/probabilistic-revenue-share": "workspace:^",

api/src/utils/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { signMessage } from 'http-message-signatures/lib/httpbis'
22
import { createContentDigestHeader } from 'httpbis-digest-headers'
33
import type { Request } from 'http-message-signatures'
4-
import * as ed from '@noble/ed25519'
4+
import { signAsync } from '@noble/ed25519'
55
import type { ContentfulStatusCode } from 'hono/utils/http-status'
66
import { HTTPException } from 'hono/http-exception'
77

@@ -104,7 +104,7 @@ function createSigner(key: Uint8Array, keyId: string) {
104104
id: keyId,
105105
alg: 'ed25519',
106106
async sign(data: Uint8Array) {
107-
return Buffer.from(await ed.signAsync(data, key))
107+
return Buffer.from(await signAsync(data, key))
108108
}
109109
}
110110
}

api/wrangler.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,5 @@ main = "src/index.ts"
33
compatibility_date = "2024-09-23"
44
compatibility_flags = ["nodejs_compat"]
55

6-
[vars]
7-
FRONTEND_URL = "https://webmonetization.org/tools/"
8-
AWS_PREFIX = "20250717"
9-
106
[dev]
117
port = 8787

cdn/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Publisher Tools - CDN
2+
3+
This package is responsible for building and delivering the final, browser-ready JavaScript assets (the banner and widget scripts) that publishers embed on their websites.
4+
5+
It takes the raw source code from the `@tools/components` package, bundles it using `esbuild`, and prepares it for delivery via the Cloudflare CDN.
6+
7+
## Build Process
8+
9+
The core of this package is the custom build script located at `build.js`. This script uses `esbuild` to compile the TypeScript source from `src/` and the components from the `components` package into distributable files.
10+
11+
The main entry points for the build are:
12+
13+
- `src/banner.ts`
14+
- `src/widget.ts`
15+
16+
The output is placed in the `dist/` directory.
17+
18+
## Assets
19+
20+
This package also manages static assets required by the components, such as fonts. The build process ensures that these assets are correctly referenced and made available through the CDN. Fonts are located in the `src/assets/fonts` directory.
21+
22+
## Development
23+
24+
To build the assets and run a local development server that simulates the CDN, use the `dev` script from the project root. This will watch for file changes in both the `cdn` and `components` packages and automatically rebuild.
25+
26+
```sh
27+
pnpm -C cdn dev
28+
```

components/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Publisher Tools - Components
2+
3+
This package contains the core, embeddable web components for the Publisher Tools, built using the [Lit](https://lit.dev/) library. These components are intended to be placed on publishers' websites.
4+
5+
## Core Components
6+
7+
- **Banner:** A notification banner that can be displayed on a publisher's site. The source is located in `src/banner.ts`.
8+
- **Widget:** The interactive monetization widget. Its source code is in the `src/widget/` directory.
9+
10+
## Build Process
11+
12+
This package contains the raw source code for the web components but does not have its own build process.
13+
14+
The components are imported and bundled by the **`cdn`** package, which is responsible for compiling them into a browser-ready format. They are also used by the **`frontend`** package for demonstration purposes.
15+
16+
Please see the `cdn` package for more details on the build and delivery process.
17+
18+
## Development
19+
20+
The only available script is for type checking, which can be run from the project root:
21+
22+
```sh
23+
pnpm -C components typecheck
24+
```

0 commit comments

Comments
 (0)