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/dist/core.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface InternalResolvedModule {
|
|
|
19
19
|
}
|
|
20
20
|
export interface ExtractionRequest {
|
|
21
21
|
readonly module: string;
|
|
22
|
-
readonly symbol
|
|
22
|
+
readonly symbol?: string;
|
|
23
23
|
readonly member?: string;
|
|
24
24
|
readonly isStatic?: boolean;
|
|
25
25
|
}
|
|
@@ -32,6 +32,18 @@ export interface SymbolInfo {
|
|
|
32
32
|
readonly location: string;
|
|
33
33
|
readonly jsDoc?: string;
|
|
34
34
|
}
|
|
35
|
+
export interface ExportSummary {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly kind: string;
|
|
38
|
+
readonly line: number;
|
|
39
|
+
readonly documentation?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface FileInfo {
|
|
42
|
+
readonly path: string;
|
|
43
|
+
readonly overview?: string;
|
|
44
|
+
readonly exportCount: number;
|
|
45
|
+
readonly exports: ExportSummary[];
|
|
46
|
+
}
|
|
35
47
|
export interface ExtractorOptions {
|
|
36
48
|
readonly prefix?: string;
|
|
37
49
|
}
|
|
@@ -62,21 +74,23 @@ export interface EvaluatedModuleResult {
|
|
|
62
74
|
stderr: string;
|
|
63
75
|
}
|
|
64
76
|
export type ResolveResult = ResolvedModule | ResolveError;
|
|
65
|
-
export type ExtractResult = SymbolInfo | ExtractError;
|
|
77
|
+
export type ExtractResult = SymbolInfo | FileInfo | ExtractError;
|
|
66
78
|
export type InternalResolveResult = InternalResolvedModule | ResolveError;
|
|
67
|
-
export declare function isError(result: ResolveResult | ExtractResult): boolean;
|
|
68
79
|
export declare function isResolveError(result: ResolveResult | InternalResolveResult): result is ResolveError;
|
|
69
80
|
export declare function isExtractError(result: ExtractResult): result is ExtractError;
|
|
81
|
+
export declare function isFileInfo(result: ExtractResult): result is FileInfo;
|
|
70
82
|
export declare function resolveError(specifier: ModuleRequest['specifier'], source: ModuleRequest['source']): ResolveError;
|
|
71
83
|
export declare function createExtractError(code: ExtractError['error']['code'], message: string, details?: unknown): ExtractError;
|
|
72
84
|
export interface TidewaveConfig {
|
|
73
85
|
port?: number;
|
|
74
86
|
host?: string;
|
|
75
87
|
clientUrl?: string;
|
|
88
|
+
toolbar?: boolean;
|
|
76
89
|
allowRemoteAccess?: boolean;
|
|
77
90
|
allowedOrigins?: string[];
|
|
78
91
|
projectName?: string;
|
|
79
92
|
framework?: string;
|
|
93
|
+
tmpDir?: string;
|
|
80
94
|
team?: {
|
|
81
95
|
id?: string;
|
|
82
96
|
token?: string;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
import type { Handler } from '../index';
|
|
2
1
|
import type { TidewaveConfig } from '../../core';
|
|
3
|
-
|
|
2
|
+
import type { TidewaveHandler } from '../types';
|
|
3
|
+
export type LocalPortGetter = () => number | undefined;
|
|
4
|
+
export interface TidewaveConfigPayload {
|
|
5
|
+
project_name: string;
|
|
6
|
+
framework_type: string;
|
|
7
|
+
tidewave_version: string;
|
|
8
|
+
team: NonNullable<TidewaveConfig['team']> | Record<string, never>;
|
|
9
|
+
local_port: number | undefined;
|
|
10
|
+
tmp_dir: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function tidewaveConfig(config: TidewaveConfig, getLocalPort?: LocalPortGetter): TidewaveConfigPayload;
|
|
13
|
+
export declare function createHandleConfig(config: TidewaveConfig, getLocalPort?: LocalPortGetter): TidewaveHandler;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { Handler } from '../index';
|
|
2
1
|
import type { TidewaveConfig } from '../../core';
|
|
3
|
-
|
|
2
|
+
import type { TidewaveHandler } from '../types';
|
|
3
|
+
export declare function createHandleHtml(config: TidewaveConfig): TidewaveHandler;
|
|
4
|
+
export declare function createHandleAppHtml(config: TidewaveConfig): TidewaveHandler;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function handleMcp(req:
|
|
1
|
+
import type { TidewaveNext, TidewaveRequest, TidewaveResponse } from '../types';
|
|
2
|
+
export declare function handleMcp(req: TidewaveRequest, res: TidewaveResponse, next: TidewaveNext): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TidewaveConfig } from '../core';
|
|
2
|
+
import type { LocalPortGetter } from './handlers/config';
|
|
3
|
+
import type { TidewaveHandler } from './types';
|
|
4
|
+
export declare function createHandleResponseHeaders(config: TidewaveConfig, getLocalPort?: LocalPortGetter): TidewaveHandler;
|
package/dist/http/index.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { IncomingMessage, NextFunction, Server } from 'connect';
|
|
1
|
+
import { type LocalPortGetter } from './handlers/config';
|
|
3
2
|
import type { TidewaveConfig } from '../core';
|
|
4
|
-
|
|
5
|
-
body?: Record<string, unknown>;
|
|
6
|
-
}
|
|
7
|
-
export type Response = ServerResponse<IncomingMessage>;
|
|
8
|
-
export type NextFn = NextFunction;
|
|
3
|
+
import type { TidewaveMiddlewareServer } from './types';
|
|
9
4
|
export declare const ENDPOINT: "/tidewave";
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function checkSecurity(config: TidewaveConfig): (req: Request, res: Response, next: NextFn) => void;
|
|
15
|
-
export declare function methodNotAllowed(res: Response): void;
|
|
16
|
-
export { getHandlers };
|
|
5
|
+
export interface HandlerOptions {
|
|
6
|
+
getLocalPort?: LocalPortGetter;
|
|
7
|
+
}
|
|
8
|
+
export declare function configureServer(server: TidewaveMiddlewareServer, config?: TidewaveConfig, options?: HandlerOptions): TidewaveMiddlewareServer;
|
package/dist/http/security.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { TidewaveConfig } from '../core';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function checkRemoteIp(req:
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function checkOrigin(req: Request, res: Response, config: TidewaveConfig): boolean;
|
|
2
|
+
import type { TidewaveRequest, TidewaveResponse } from './types';
|
|
3
|
+
export declare function checkRemoteIp(req: TidewaveRequest, res: TidewaveResponse, config: TidewaveConfig): boolean;
|
|
4
|
+
export declare function checkOrigin(req: TidewaveRequest, res: TidewaveResponse, config: TidewaveConfig): boolean;
|
|
6
5
|
export declare function getDefaultAllowedOrigins(config: TidewaveConfig): string[];
|
|
7
6
|
export declare function parseUrl(url: string): {
|
|
8
7
|
scheme?: string;
|
|
@@ -10,3 +9,4 @@ export declare function parseUrl(url: string): {
|
|
|
10
9
|
port?: number;
|
|
11
10
|
} | null;
|
|
12
11
|
export declare function isOriginAllowed(origin: ReturnType<typeof parseUrl>, allowed: ReturnType<typeof parseUrl>): boolean;
|
|
12
|
+
export declare function isLocalIp(ip?: string): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
export interface TidewaveRequest extends IncomingMessage {
|
|
3
|
+
body?: Record<string, unknown>;
|
|
4
|
+
}
|
|
5
|
+
export type TidewaveResponse = ServerResponse<IncomingMessage>;
|
|
6
|
+
export type TidewaveNext = (err?: unknown) => void;
|
|
7
|
+
export type TidewaveHandler = (req: TidewaveRequest, res: TidewaveResponse, next: TidewaveNext) => Promise<void>;
|
|
8
|
+
export interface TidewaveMiddlewareServer {
|
|
9
|
+
use(handler: unknown): void;
|
|
10
|
+
use(route: string, handler: unknown): void;
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import type { SymbolInfo } from '../core';
|
|
2
|
+
import type { SymbolInfo, FileInfo } from '../core';
|
|
3
3
|
export declare function getSignature(checker: ts.TypeChecker, symbol: ts.Symbol, type: ts.Type): string;
|
|
4
4
|
export declare function getTypeString(checker: ts.TypeChecker, symbol: ts.Symbol, type: ts.Type): string;
|
|
5
|
-
export declare function formatOutput(info: SymbolInfo): string;
|
|
5
|
+
export declare function formatOutput(info: SymbolInfo | FileInfo): string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractionRequest, ExtractResult, ExtractorOptions, ResolveResult } from '../core';
|
|
2
|
-
import { formatOutput } from './formatters';
|
|
3
2
|
export declare function extractDocs(modulePath: string): Promise<ExtractResult>;
|
|
4
3
|
export declare function getSourceLocation(reference: string): Promise<ResolveResult>;
|
|
5
4
|
export declare function extractSymbol(request: ExtractionRequest, options?: ExtractorOptions): Promise<ExtractResult>;
|
|
6
|
-
export { formatOutput };
|
|
5
|
+
export { formatOutput } from './formatters';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SymbolInfo, ExtractError } from '../core';
|
|
3
3
|
export declare function findSymbolInJavaScriptFile(sourceFile: ts.SourceFile, checker: ts.TypeChecker, symbolName: string): ts.Symbol | undefined;
|
|
4
|
-
export declare function getSymbolInfo(checker: ts.TypeChecker, symbol: ts.Symbol, member?: string, isStatic?: boolean):
|
|
4
|
+
export declare function getSymbolInfo(checker: ts.TypeChecker, symbol: ts.Symbol, member?: string, isStatic?: boolean): SymbolInfo | ExtractError;
|
|
@@ -3,3 +3,4 @@ export declare function getLocation(symbol: ts.Symbol): string;
|
|
|
3
3
|
export declare function getDocumentation(checker: ts.TypeChecker, symbol: ts.Symbol): string;
|
|
4
4
|
export declare function getJSDoc(checker: ts.TypeChecker, symbol: ts.Symbol): string;
|
|
5
5
|
export declare function getSymbolKind(symbol: ts.Symbol): string;
|
|
6
|
+
export declare function getFileOverview(sourceFile: ts.SourceFile): string | undefined;
|
package/dist/tanstack.js
CHANGED
|
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
7
12
|
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
8
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
22
|
for (let key of __getOwnPropNames(mod))
|
|
11
23
|
if (!__hasOwnProp.call(to, key))
|
|
12
24
|
__defProp(to, key, {
|
|
13
|
-
get: (
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
14
26
|
enumerable: true
|
|
15
27
|
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
16
30
|
return to;
|
|
17
31
|
};
|
|
18
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
+
var __returnValue = (v) => v;
|
|
34
|
+
function __exportSetter(name, newValue) {
|
|
35
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
+
}
|
|
19
37
|
var __export = (target, all) => {
|
|
20
38
|
for (var name in all)
|
|
21
39
|
__defProp(target, name, {
|
|
22
40
|
get: all[name],
|
|
23
41
|
enumerable: true,
|
|
24
42
|
configurable: true,
|
|
25
|
-
set: (
|
|
43
|
+
set: __exportSetter.bind(all, name)
|
|
26
44
|
});
|
|
27
45
|
};
|
|
28
46
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -87,16 +105,10 @@ class TidewaveLogger {
|
|
|
87
105
|
}
|
|
88
106
|
}
|
|
89
107
|
}
|
|
90
|
-
var tidewaveLogger;
|
|
91
|
-
var init_tidewave_logger = __esm(() => {
|
|
92
|
-
tidewaveLogger = new TidewaveLogger;
|
|
93
|
-
});
|
|
108
|
+
var tidewaveLogger = new TidewaveLogger;
|
|
94
109
|
|
|
95
110
|
// src/logger/console-patch.ts
|
|
96
|
-
var
|
|
97
|
-
__export(exports_console_patch, {
|
|
98
|
-
patchConsole: () => patchConsole
|
|
99
|
-
});
|
|
111
|
+
var ANSI_REGEX = /\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g;
|
|
100
112
|
function stripAnsiCodes(text) {
|
|
101
113
|
return text.replace(ANSI_REGEX, "");
|
|
102
114
|
}
|
|
@@ -152,12 +164,6 @@ function patchConsole() {
|
|
|
152
164
|
});
|
|
153
165
|
globalThis.__TIDEWAVE_CONSOLE_PATCHED__ = true;
|
|
154
166
|
}
|
|
155
|
-
var ANSI_REGEX;
|
|
156
|
-
var init_console_patch = __esm(() => {
|
|
157
|
-
init_tidewave_logger();
|
|
158
|
-
ANSI_REGEX = /\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g;
|
|
159
|
-
});
|
|
160
167
|
|
|
161
168
|
// src/tanstack.ts
|
|
162
|
-
init_console_patch();
|
|
163
169
|
patchConsole();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TidewaveConfig } from './core';
|
|
2
|
+
import { type LocalPortGetter } from './http/handlers/config';
|
|
3
|
+
export declare function injectToolbarHtml(html: string, config: TidewaveConfig, getLocalPort?: LocalPortGetter): string;
|
|
4
|
+
export declare function toolbarAlreadyInjected(html: string): boolean;
|