tidewave 0.4.0 → 0.5.1

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 CHANGED
@@ -1,55 +1,9 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
3
+ ## [0.5.1] - 2025-11-11
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+ * Add `npx tidewave install` and trim down dependency list.
7
6
 
8
- ## [0.1.0] - 2024-08-29
7
+ ## [0.5.0] - 2025-11-10
9
8
 
10
- ### Added
11
-
12
- #### Core Features
13
- - **MCP Server Support**: STDIO-based Model Context Protocol server for integration with AI coding assistants
14
- - **Documentation Extraction**: Extract TypeScript/JavaScript documentation and type information for symbols, classes, functions, and methods
15
- - **Source Location Resolution**: Get source file paths for modules, symbols, and members
16
- - **Multi-format Support**: Support for local files, npm dependencies, and Node.js builtin modules
17
-
18
- #### Module Reference Formats
19
- - `module:symbol` - Extract documentation for top-level symbols
20
- - `module:Class#method` - Extract documentation for instance methods
21
- - `module:Class.method` - Extract documentation for static methods
22
- - `node:Class#method` - Extract documentation for Node.js builtin instance methods
23
- - `node:Class.method` - Extract documentation for Node.js builtin static methods
24
-
25
- #### CLI Commands
26
- - `tidewave mcp` - Start the MCP server via STDIO
27
- - `tidewave docs <module-path>` - Extract documentation for a symbol
28
- - `tidewave source <module>` - Get the source file path for a module
29
-
30
- #### Runtime Support
31
- - Full support for Node.js with npm/npx
32
- - Native support for Bun with bunx
33
- - Support for Deno via npm: protocol
34
-
35
- ### Fixed
36
- - Handle source location of symbols and members correctly (#7)
37
- - Handle prefix option only on CLI layer, not in core extraction (#6)
38
- - Correctly extract JavaScript/TypeScript symbols, instances, and methods
39
- - Show interface types correctly
40
- - Handle falsy values and improve error handling (#1)
41
-
42
- ### Changed
43
- - Refactored codebase into modular structure for better maintainability
44
- - Simplified module resolution and extraction logic
45
- - Improved TypeScript and Node.js module resolution
46
- - Changed config flag for project path handling (#3)
47
-
48
- ### Technical Details
49
- - Built with TypeScript for type safety
50
- - Uses TypeScript Compiler API for accurate code analysis
51
- - Supports ESM modules
52
- - Includes comprehensive error handling and user-friendly error messages
53
- - Optimized for use with AI coding assistants through MCP protocol
54
-
55
- [0.1.0]: https://github.com/dashbit/tidewave_javascript/releases/tag/v0.1.0
9
+ * Initial release.
package/README.md CHANGED
@@ -1,23 +1,28 @@
1
1
  # Tidewave
2
2
 
3
- > Tidewave Web for Next.js is currently in alpha testing!
3
+ Tidewave is the coding agent for full-stack web app development. Integrate
4
+ Claude Code, OpenAI Codex, and other agents with your web app and web framework
5
+ at every layer, from UI to database. [See our website](https://tidewave.ai) for
6
+ more information.
4
7
 
5
- Tidewave is the coding agent for full-stack web app development.
6
- [See our website](https://tidewave.ai) for more information.
8
+ This project supports:
7
9
 
8
- This package is recommended for JavaScript-powered backends as well as
9
- JavaScript libraries/applications using a backend as a service (such as
10
- Supabase). If you are using React with Phoenix, Rails, Django, or another
11
- server-side framework, [follow the steps here instead](http://hexdocs.pm/tidewave/react.html).
10
+ - Next.js 15/16
12
11
 
13
- This project can also be used as a standalone Model Context Protocol (MCP)
14
- server for your editors.
12
+ - React + Vite frontends, with either a backend as a service (such as Supabase)
13
+ or a third-party framework
14
+
15
+ If you are using React with Django, FastAPI, Flask, Phoenix, or Rails,
16
+ [follow the steps here instead](http://hexdocs.pm/tidewave/react.html).
17
+
18
+ This project can also be used through the CLI or as a standalone Model Context
19
+ Protocol (MCP) server for your editors.
15
20
 
16
21
  ## Installation
17
22
 
18
23
  ### Next.js
19
24
 
20
- Install it with:
25
+ If you are using Next.js, install Tidewave with:
21
26
 
22
27
  ```sh
23
28
  $ npm install -D tidewave
@@ -39,7 +44,7 @@ export default async function handler(
39
44
  res: NextApiResponse,
40
45
  ) {
41
46
  if (process.env.NODE_ENV === 'development') {
42
- const { tidewaveHandler } = await import('tidewave/next-js');
47
+ const { tidewaveHandler } = await import('tidewave/next-js/handler');
43
48
  const handler = await tidewaveHandler();
44
49
  return handler(req, res);
45
50
  } else {
@@ -58,14 +63,29 @@ export const config = {
58
63
  _Note: this uses the **Pages Router**, however it works regardless of the router
59
64
  type you use in your application._
60
65
 
61
- Then create (or modify) `middleware.ts` with:
66
+ If you are using Next.js 16+, then create (or modify) `proxy.ts` with:
67
+
68
+ ```typescript
69
+ import { NextRequest, NextResponse } from 'next/server';
70
+
71
+ export function proxy(req: NextRequest): NextResponse {
72
+ if (req.nextUrl.pathname.startsWith('/tidewave')) {
73
+ return NextResponse.rewrite(new URL('/api/tidewave', req.url));
74
+ }
75
+
76
+ // Here you could add your own logic or different middlewares.
77
+ return NextResponse.next();
78
+ }
79
+ ```
80
+
81
+ For Next.js 15+ and earlier, create (or modify) `middleware.ts` with:
62
82
 
63
83
  ```typescript
64
84
  import { NextRequest, NextResponse } from 'next/server';
65
85
 
66
86
  export function middleware(req: NextRequest): NextResponse {
67
87
  if (req.nextUrl.pathname.startsWith('/tidewave')) {
68
- return NextResponse.rewrite(new URL(`/api/tidewave`, req.url));
88
+ return NextResponse.rewrite(new URL('/api/tidewave', req.url));
69
89
  }
70
90
 
71
91
  // Here you could add your own logic or different middlewares.
@@ -77,20 +97,31 @@ export const config = {
77
97
  };
78
98
  ```
79
99
 
80
- Finally, we recommend creating the `instrumentation.ts` file below,
81
- to expose your application's spans, events, and logs to Tidewave/MCP:
100
+ Finally, we expose your application's spans, events, and logs to Tidewave MCP.
101
+ First install the NodeSDK:
102
+
103
+ ```sh
104
+ npm install @opentelemetry/sdk-node
105
+ ```
106
+
107
+ And then create (or modify) a custom `instrumentation.ts` file in the root
108
+ directory of the project (or inside `src` folder if using one):
82
109
 
83
110
  ```typescript
84
111
  // instrumentation.ts
85
112
  import { NodeSDK } from '@opentelemetry/sdk-node';
86
- import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-node';
113
+ import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
114
+ import type { LogRecordProcessor } from '@opentelemetry/sdk-logs';
87
115
 
88
116
  export async function register() {
89
117
  const runtime = process.env.NEXT_RUNTIME;
90
118
  const env = process.env.NODE_ENV;
91
119
 
92
120
  // Add your app own processes here existing configuration
93
- const sdkConfig = {
121
+ const sdkConfig: {
122
+ spanProcessors: SpanProcessor[];
123
+ logRecordProcessors: LogRecordProcessor[];
124
+ } = {
94
125
  spanProcessors: [],
95
126
  logRecordProcessors: [],
96
127
  };
@@ -110,8 +141,16 @@ export async function register() {
110
141
  }
111
142
  ```
112
143
 
144
+ Now make sure
145
+ [Tidewave is installed](https://hexdocs.pm/tidewave/installation.html) and you
146
+ are ready to connect Tidewave to your app.
147
+
113
148
  ### React + Vite
114
149
 
150
+ If you are building a front-end application, using a backend as a service, such
151
+ as Supabase, or a non-officially supported web framework, we recommend using our
152
+ React + Vite integration.
153
+
115
154
  Install it with:
116
155
 
117
156
  ```sh
@@ -135,19 +174,32 @@ export default defineConfig({
135
174
  });
136
175
  ```
137
176
 
177
+ Now make sure
178
+ [Tidewave is installed](https://hexdocs.pm/tidewave/installation.html) and you
179
+ are ready to connect Tidewave to your app.
180
+
181
+ If you are using Supabase or similar, you can prompt Tidewave to use the
182
+ `supabase` CLI so it has complete access to your database. For non-officially
183
+ supported web frameworks, our React + Vite integration allows Tidewave Web to
184
+ perform changes on the front-end, and the agent will be able to modify your
185
+ backend code as usual, but some functionality (such as accessing logs, doing
186
+ database calls, etc) won't be available.
187
+
138
188
  ### Configuration
139
189
 
140
- Next.js' `tidewaveHandler` and Vite's `tidewave` accept the configuration options below:
190
+ Next.js' `tidewaveHandler` and Vite's `tidewave` accept the configuration
191
+ options below:
141
192
 
142
- - `allow_remote_access:` allow remote connections when true (default false)
143
- - `allowed_origins:` defaults to the current host/port
193
+ - `allow_remote_access:` allow remote connections when true (default false).
194
+ Enable this only if you trust your network and you want Tidewave MCP to be
195
+ accessed from another trusted machine
144
196
  - `team`: enable Tidewave Web for teams
145
197
 
146
198
  ## CLI
147
199
 
148
- Tidewave.js also comes with a CLI for developers who want to use it
149
- as a standalone MCP or query its functionality directly. Note this
150
- functionality is separate from Tidewave Web.
200
+ Tidewave.js also comes with a CLI for developers who want to use it as a
201
+ standalone MCP or query its functionality directly. Note this functionality is
202
+ separate from Tidewave Web.
151
203
 
152
204
  ### STDIO MCP
153
205