Skip to content

Commit c560245

Browse files
hogekaiclaude
andcommitted
feat: separate web plugins into @trawl/ortb3-web, rename core to @trawl/ortb3
Move browser plugins (consent, sync, topics) to a dedicated @trawl/ortb3-web package with @trawl/ortb3 as a peer dependency, keeping the core package environment-agnostic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c73f147 commit c560245

41 files changed

Lines changed: 159 additions & 35 deletions

Some content is hidden

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

README.md

Lines changed: 2 additions & 1 deletion

packages/ortb3-web/README.md

Lines changed: 46 additions & 0 deletions

packages/ortb3-web/package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "@trawl/ortb3-web",
3+
"version": "0.1.0",
4+
"type": "module",
5+
"description": "Browser plugins for @trawl/ortb3",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/hogekai/trawl.git",
10+
"directory": "packages/ortb3-web"
11+
},
12+
"keywords": ["openrtb", "programmatic", "advertising", "consent", "tcf", "topics"],
13+
"engines": {
14+
"node": ">=18"
15+
},
16+
"exports": {
17+
".": {
18+
"import": "./dist/index.js",
19+
"types": "./dist/index.d.ts"
20+
}
21+
},
22+
"files": ["dist"],
23+
"scripts": {
24+
"build": "tsup",
25+
"test": "vitest run",
26+
"typecheck": "tsc --noEmit"
27+
},
28+
"peerDependencies": {
29+
"@trawl/ortb3": "^0.1.0"
30+
},
31+
"dependencies": {
32+
"iab-openrtb": "^2.1.0"
33+
},
34+
"devDependencies": {
35+
"@trawl/ortb3": "workspace:*",
36+
"iab-adcom": "^2.0.1",
37+
"typescript": "^5.7.0",
38+
"tsup": "^8.0.0",
39+
"vitest": "^3.0.0"
40+
}
41+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Request } from "iab-openrtb/v30"
2-
import type { Plugin } from "../types.js"
2+
import type { Plugin } from "@trawl/ortb3"
33
import { raceSignal } from "./race-signal.js"
44

55
export interface TCData {
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Bid } from "iab-openrtb/v30"
2-
import type { DemandPlugin } from "../types.js"
2+
import type { DemandPlugin } from "@trawl/ortb3"
33

44
export function sync(
55
type: "image" | "iframe",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Request } from "iab-openrtb/v30"
2-
import type { Plugin } from "../types.js"
2+
import type { Plugin } from "@trawl/ortb3"
33
import { raceSignal } from "./race-signal.js"
44

55
export function topics(): Plugin {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
declare global {
2+
interface AbortSignal {
3+
readonly aborted: boolean
4+
readonly reason: unknown
5+
addEventListener(type: "abort", listener: () => void): void
6+
removeEventListener(type: "abort", listener: () => void): void
7+
}
8+
9+
class AbortController {
10+
readonly signal: AbortSignal
11+
abort(reason?: unknown): void
12+
}
13+
214
class Image {
315
src: string
416
}

packages/ortb3-trawl/tests/web/consent.test.ts renamed to packages/ortb3-web/tests/consent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Request } from "iab-openrtb/v30"
22
import { describe, expect, it, vi } from "vitest"
3-
import { consent } from "../../src/web/consent.js"
3+
import { consent } from "../src/consent.js"
44

55
function makeReq(id = "req-1"): Request {
66
return { id, item: [] }

0 commit comments

Comments
 (0)