tidewave 0.6.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 +12 -0
- package/README.md +36 -158
- package/dist/cli/index.js +13980 -14351
- package/dist/core.d.ts +17 -3
- package/dist/http/handlers/config.d.ts +12 -2
- 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 +6 -14
- package/dist/http/magic-bytes.d.ts +2 -0
- package/dist/http/security.d.ts +4 -4
- package/dist/http/types.d.ts +11 -0
- package/dist/resolution/formatters.d.ts +2 -2
- package/dist/resolution/index.d.ts +1 -2
- package/dist/resolution/symbol-finder.d.ts +2 -2
- package/dist/resolution/utils.d.ts +1 -0
- package/dist/tanstack.js +22 -16
- package/dist/toolbar.d.ts +4 -0
- package/dist/vite-plugin.js +22187 -23328
- package/package.json +4 -22
- 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 -11
- package/dist/next-js/handler.js +0 -34857
- package/dist/next-js/instrumentation.d.ts +0 -2
- package/dist/next-js/instrumentation.js +0 -256
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
|
|
9
|
+
## [0.7.0] - 2026-06-14
|
|
10
|
+
|
|
11
|
+
* Support namespaces/files in `get_docs` tool and make it return a list of exports
|
|
12
|
+
* Support re-exports in `get_docs` lookups
|
|
13
|
+
* Improve out-of-the-box experience for remote access (which remains opt-in)
|
|
14
|
+
|
|
3
15
|
## [0.6.0] - 2025-12-31
|
|
4
16
|
|
|
5
17
|
* Tanstack support
|
package/README.md
CHANGED
|
@@ -7,9 +7,8 @@ more information.
|
|
|
7
7
|
|
|
8
8
|
This project supports:
|
|
9
9
|
|
|
10
|
-
- Next.js 15/16
|
|
11
10
|
- TanStack Start with React
|
|
12
|
-
- Vite with React/Vue
|
|
11
|
+
- Vite with React/Vue (which includes Astro, VitePress, etc)
|
|
13
12
|
|
|
14
13
|
If you are using React/Vue with Django, FastAPI, Flask, Phoenix, or Rails,
|
|
15
14
|
[follow the steps here instead](http://hexdocs.pm/tidewave/frontend.html).
|
|
@@ -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 abovees 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,13 +106,39 @@ features.
|
|
|
255
106
|
|
|
256
107
|
### Configuration
|
|
257
108
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
109
|
+
Vite's `tidewave` accepts the configuration options below:
|
|
110
|
+
|
|
111
|
+
- `allowRemoteAccess`: Tidewave only allows requests from localhost by default,
|
|
112
|
+
even if your server listens on other interfaces, for security purposes. Read
|
|
113
|
+
[our security guidelines for more information and when to allow remote access](https://hexdocs.pm/tidewave/security.html)
|
|
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`
|
|
264
124
|
- `team`: enable Tidewave Web for teams
|
|
125
|
+
- `toolbar`: controls whether the Tidewave toolbar is injected into your HTML
|
|
126
|
+
pages. Defaults to `true`
|
|
127
|
+
|
|
128
|
+
## Available tools
|
|
129
|
+
|
|
130
|
+
- `get_docs` - get the documentation for a given module/namespace or a
|
|
131
|
+
class/interface/enum/type in that namespace. It consults the exact versions
|
|
132
|
+
used by the project, ensuring you always get correct information
|
|
133
|
+
|
|
134
|
+
- `get_source_location` - get the source location for a given module/namespace
|
|
135
|
+
or a class/interface/enum/type in that namespace, so an agent can directly
|
|
136
|
+
read the source skipping search
|
|
137
|
+
|
|
138
|
+
- `get_logs` - reads console log written by the server
|
|
139
|
+
|
|
140
|
+
- `project_eval` - evaluates code within the runtime itself, giving the agent
|
|
141
|
+
access to dependencies, server code, and all in-memory data
|
|
265
142
|
|
|
266
143
|
## CLI
|
|
267
144
|
|
|
@@ -302,6 +179,7 @@ Here are some examples:
|
|
|
302
179
|
|
|
303
180
|
```bash
|
|
304
181
|
# Local TypeScript/JavaScript files
|
|
182
|
+
npx tidewave docs ./src/utils
|
|
305
183
|
npx tidewave docs ./src/utils:formatDate
|
|
306
184
|
npx tidewave docs ./components:Button#onClick
|
|
307
185
|
|
|
@@ -330,8 +208,8 @@ bun run clean # Clean dist directory
|
|
|
330
208
|
|
|
331
209
|
## Acknowledgements
|
|
332
210
|
|
|
333
|
-
A thank you to [Zoey](https://github.com/zoedsoupe/) for implementing
|
|
334
|
-
|
|
211
|
+
A thank you to [Zoey](https://github.com/zoedsoupe/) for implementing the Vite
|
|
212
|
+
integration as well as the CLI interface.
|
|
335
213
|
|
|
336
214
|
## License
|
|
337
215
|
|