tidewave 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +16 -156
- package/dist/cli/index.js +13929 -14492
- package/dist/core.d.ts +5 -0
- package/dist/http/handlers/config.d.ts +12 -3
- package/dist/http/handlers/html.d.ts +3 -2
- package/dist/http/handlers/mcp.d.ts +2 -2
- package/dist/http/handlers/upload.d.ts +3 -0
- package/dist/http/headers.d.ts +4 -0
- package/dist/http/index.d.ts +2 -14
- package/dist/http/magic-bytes.d.ts +2 -0
- package/dist/http/security.d.ts +10 -2
- package/dist/http/types.d.ts +11 -0
- package/dist/tanstack.js +2 -14
- package/dist/toolbar.d.ts +4 -0
- package/dist/vite-plugin.js +22164 -23397
- package/package.json +3 -21
- package/dist/cli/install.d.ts +0 -7
- package/dist/logger/tidewave-log-record-processor.d.ts +0 -17
- package/dist/logger/tidewave-span-processor.d.ts +0 -26
- package/dist/next-js/handler.d.ts +0 -12
- package/dist/next-js/handler.js +0 -34967
- package/dist/next-js/instrumentation.d.ts +0 -2
- package/dist/next-js/instrumentation.js +0 -274
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v0.8.0] - 2026-07-22
|
|
4
|
+
|
|
5
|
+
* Add the Tidewave Toolbar
|
|
6
|
+
* Align minor version across Tidewave packages
|
|
7
|
+
* Drop Next.JS support
|
|
8
|
+
|
|
3
9
|
## [0.7.0] - 2026-06-14
|
|
4
10
|
|
|
5
11
|
* Support namespaces/files in `get_docs` tool and make it return a list of exports
|
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@ more information.
|
|
|
7
7
|
|
|
8
8
|
This project supports:
|
|
9
9
|
|
|
10
|
-
- Next.js 15/16
|
|
11
10
|
- TanStack Start with React
|
|
12
11
|
- Vite with React/Vue (which includes Astro, VitePress, etc)
|
|
13
12
|
|
|
@@ -19,154 +18,6 @@ This project can also be used through the CLI or as
|
|
|
19
18
|
|
|
20
19
|
## Installation
|
|
21
20
|
|
|
22
|
-
### Next.js
|
|
23
|
-
|
|
24
|
-
If you are using Next.js, install Tidewave with:
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
$ npx tidewave install
|
|
28
|
-
# or
|
|
29
|
-
$ yarn dlx tidewave install
|
|
30
|
-
# or
|
|
31
|
-
$ pnpm dlx tidewave install
|
|
32
|
-
# or
|
|
33
|
-
$ bunx tidewave install
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
And you are almost there! Now make sure
|
|
37
|
-
[Tidewave is installed](https://hexdocs.pm/tidewave/installation.html) and you
|
|
38
|
-
are ready to connect Tidewave to your app.
|
|
39
|
-
|
|
40
|
-
In case the command above do not work, you can toggle the manual installation
|
|
41
|
-
instructions below
|
|
42
|
-
|
|
43
|
-
<details>
|
|
44
|
-
<summary>Show manual installation steps</summary><br />
|
|
45
|
-
|
|
46
|
-
**1. Add Tidewave as a dependency**
|
|
47
|
-
|
|
48
|
-
```sh
|
|
49
|
-
$ npm install -D tidewave
|
|
50
|
-
# or
|
|
51
|
-
$ yarn add -D tidewave
|
|
52
|
-
# or
|
|
53
|
-
$ pnpm add --save-dev tidewave
|
|
54
|
-
# or
|
|
55
|
-
$ bun add --dev tidewave
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**2. Create `pages/api/tidewave.ts`**
|
|
59
|
-
|
|
60
|
-
Then create `pages/api/tidewave.ts` with:
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
64
|
-
|
|
65
|
-
export default async function handler(
|
|
66
|
-
req: NextApiRequest,
|
|
67
|
-
res: NextApiResponse,
|
|
68
|
-
) {
|
|
69
|
-
if (process.env.NODE_ENV === 'development') {
|
|
70
|
-
const { tidewaveHandler } = await import('tidewave/next-js/handler');
|
|
71
|
-
const handler = await tidewaveHandler();
|
|
72
|
-
return handler(req, res);
|
|
73
|
-
} else {
|
|
74
|
-
res.status(404).end();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const config = {
|
|
79
|
-
runtime: 'nodejs',
|
|
80
|
-
api: {
|
|
81
|
-
bodyParser: false, // Tidewave already parses the body internally
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**3. Create the proxy.ts or middleware.ts**
|
|
87
|
-
|
|
88
|
-
If you are using Next.js 16+, then create (or modify) `proxy.ts` with:
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
92
|
-
|
|
93
|
-
export function proxy(req: NextRequest): NextResponse {
|
|
94
|
-
if (req.nextUrl.pathname.startsWith('/tidewave')) {
|
|
95
|
-
return NextResponse.rewrite(new URL('/api/tidewave', req.url));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Here you could add your own logic or different middlewares.
|
|
99
|
-
return NextResponse.next();
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
For Next.js 15+ and earlier, create (or modify) `middleware.ts` with:
|
|
104
|
-
|
|
105
|
-
```typescript
|
|
106
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
107
|
-
|
|
108
|
-
export function middleware(req: NextRequest): NextResponse {
|
|
109
|
-
if (req.nextUrl.pathname.startsWith('/tidewave')) {
|
|
110
|
-
return NextResponse.rewrite(new URL('/api/tidewave', req.url));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Here you could add your own logic or different middlewares.
|
|
114
|
-
return NextResponse.next();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export const config = {
|
|
118
|
-
matcher: ['/tidewave/:path*'],
|
|
119
|
-
};
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
**4. Create instrumentation.ts**
|
|
123
|
-
|
|
124
|
-
Finally, we expose your application's spans, events, and logs to Tidewave MCP.
|
|
125
|
-
First install the NodeSDK:
|
|
126
|
-
|
|
127
|
-
```sh
|
|
128
|
-
npm install @opentelemetry/sdk-node
|
|
129
|
-
npm install -D @opentelemetry/sdk-trace-base @opentelemetry/sdk-logs
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
And then create (or modify) a custom `instrumentation.ts` file in the root
|
|
133
|
-
directory of the project (or inside `src` folder if using one):
|
|
134
|
-
|
|
135
|
-
```typescript
|
|
136
|
-
// instrumentation.ts
|
|
137
|
-
import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
138
|
-
import type { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
139
|
-
|
|
140
|
-
export async function register() {
|
|
141
|
-
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
142
|
-
const { NodeSDK } = await import('@opentelemetry/sdk-node');
|
|
143
|
-
|
|
144
|
-
// Add your app own processes here existing configuration
|
|
145
|
-
const sdkConfig: {
|
|
146
|
-
spanProcessors: SpanProcessor[];
|
|
147
|
-
logRecordProcessors: LogRecordProcessor[];
|
|
148
|
-
} = {
|
|
149
|
-
spanProcessors: [],
|
|
150
|
-
logRecordProcessors: [],
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// Conditionally add Tidewave processors in development
|
|
154
|
-
if (process.env.NODE_ENV === 'development') {
|
|
155
|
-
const { TidewaveSpanProcessor, TidewaveLogRecordProcessor } =
|
|
156
|
-
await import('tidewave/next-js/instrumentation');
|
|
157
|
-
|
|
158
|
-
sdkConfig.spanProcessors.push(new TidewaveSpanProcessor());
|
|
159
|
-
sdkConfig.logRecordProcessors.push(new TidewaveLogRecordProcessor());
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const sdk = new NodeSDK(sdkConfig);
|
|
163
|
-
sdk.start();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
</details>
|
|
169
|
-
|
|
170
21
|
### TanStack Start
|
|
171
22
|
|
|
172
23
|
If you are using TanStack Start with React, install Tidewave with:
|
|
@@ -255,15 +106,24 @@ features.
|
|
|
255
106
|
|
|
256
107
|
### Configuration
|
|
257
108
|
|
|
258
|
-
|
|
259
|
-
options below:
|
|
109
|
+
Vite's `tidewave` accepts the configuration options below:
|
|
260
110
|
|
|
261
|
-
- `
|
|
262
|
-
|
|
263
|
-
purposes. Read
|
|
111
|
+
- `allowRemoteAccess`: Tidewave only allows requests from localhost by default,
|
|
112
|
+
even if your server listens on other interfaces, for security purposes. Read
|
|
264
113
|
[our security guidelines for more information and when to allow remote access](https://hexdocs.pm/tidewave/security.html)
|
|
265
114
|
(if you know what you are doing)
|
|
115
|
+
- `allowedOrigins`: a list of values matched against the `Origin` header to
|
|
116
|
+
prevent cross origin and DNS rebinding attacks. Each value must be a string of
|
|
117
|
+
shape `[scheme:]//host[:port]`, where both scheme and port are optional. The
|
|
118
|
+
host may also start with `*`. Example: `["//localhost:8000", "//*.test"]`. By
|
|
119
|
+
default, Tidewave allows Vite's configured server host and port, using
|
|
120
|
+
`localhost` when Vite uses its implicit host
|
|
121
|
+
- `tmpDir`: temporary directory Tidewave uses for screenshots and recordings.
|
|
122
|
+
Defaults to `tmp`, storing files under `tmp/tidewave/screenshots` and
|
|
123
|
+
`tmp/tidewave/recordings`
|
|
266
124
|
- `team`: enable Tidewave Web for teams
|
|
125
|
+
- `toolbar`: controls whether the Tidewave toolbar is injected into your HTML
|
|
126
|
+
pages. Defaults to `true`
|
|
267
127
|
|
|
268
128
|
## Available tools
|
|
269
129
|
|
|
@@ -348,8 +208,8 @@ bun run clean # Clean dist directory
|
|
|
348
208
|
|
|
349
209
|
## Acknowledgements
|
|
350
210
|
|
|
351
|
-
A thank you to [Zoey](https://github.com/zoedsoupe/) for implementing
|
|
352
|
-
|
|
211
|
+
A thank you to [Zoey](https://github.com/zoedsoupe/) for implementing the Vite
|
|
212
|
+
integration as well as the CLI interface.
|
|
353
213
|
|
|
354
214
|
## License
|
|
355
215
|
|