@granite-js/plugin-core 0.1.23-next.10 → 0.1.23-next.11
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 +8 -0
- package/dist/index.d.cts +31 -5
- package/dist/index.d.ts +31 -5
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -3,9 +3,9 @@ import * as esbuild$1 from "esbuild";
|
|
|
3
3
|
import * as esbuild from "esbuild";
|
|
4
4
|
import { HandleFunction } from "connect";
|
|
5
5
|
import { FastifyPluginAsync, FastifyPluginCallback } from "fastify";
|
|
6
|
+
import * as ws from "ws";
|
|
6
7
|
import * as babel from "@babel/core";
|
|
7
8
|
import * as z from "zod";
|
|
8
|
-
import { BuildFailureResult as BuildFailureResult$1, BuildResult as BuildResult$1, BuildSuccessResult as BuildSuccessResult$1 } from "@granite-js/plugin-core";
|
|
9
9
|
|
|
10
10
|
//#region src/types/BuildConfig.d.ts
|
|
11
11
|
interface BuildConfig {
|
|
@@ -232,11 +232,35 @@ interface BundleData {
|
|
|
232
232
|
//#region src/types/DevServerConfig.d.ts
|
|
233
233
|
type Middleware = FastifyPluginAsync | FastifyPluginCallback;
|
|
234
234
|
type MetroMiddleware = HandleFunction;
|
|
235
|
+
interface InspectorProxyConfig {
|
|
236
|
+
delegate?: {
|
|
237
|
+
/**
|
|
238
|
+
* @param message CDP message from the connected device
|
|
239
|
+
* @param socket `WebSocket` instance that connected to the device
|
|
240
|
+
* @returns `true` if the message is handled, `false` otherwise
|
|
241
|
+
*/
|
|
242
|
+
onDeviceMessage?: <DeviceMessage extends {
|
|
243
|
+
method: string;
|
|
244
|
+
params: Record<string, any>;
|
|
245
|
+
}>(message: DeviceMessage, socket: ws.WebSocket) => boolean;
|
|
246
|
+
/**
|
|
247
|
+
* @param message CDP message from debugger
|
|
248
|
+
* @param socket `WebSocket` instance that connected to debugger
|
|
249
|
+
* @returns `true` if the message is handled, `false` otherwise
|
|
250
|
+
*/
|
|
251
|
+
onDebuggerMessage?: <DebuggerMessage extends {
|
|
252
|
+
method: string;
|
|
253
|
+
params: Record<string, any>;
|
|
254
|
+
}>(message: DebuggerMessage, socket: ws.WebSocket) => boolean;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
235
257
|
interface DevServerConfig {
|
|
236
258
|
middlewares?: Middleware[];
|
|
259
|
+
inspectorProxy?: InspectorProxyConfig;
|
|
237
260
|
}
|
|
238
261
|
interface MetroDevServerConfig {
|
|
239
262
|
middlewares?: MetroMiddleware[];
|
|
263
|
+
inspectorProxy?: InspectorProxyConfig;
|
|
240
264
|
}
|
|
241
265
|
|
|
242
266
|
//#endregion
|
|
@@ -446,7 +470,9 @@ interface MetroConfig {
|
|
|
446
470
|
readonly reporter?: {
|
|
447
471
|
update: (event: ReportableEvent) => void;
|
|
448
472
|
};
|
|
449
|
-
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
//#endregion
|
|
450
476
|
//#region src/types/MetroConfig.d.ts
|
|
451
477
|
interface AdditionalMetroConfig extends MetroConfig {
|
|
452
478
|
/**
|
|
@@ -619,8 +645,8 @@ declare function createPluginContext(): PluginContext;
|
|
|
619
645
|
|
|
620
646
|
//#endregion
|
|
621
647
|
//#region src/utils/buildResult.d.ts
|
|
622
|
-
declare function isBuildSuccess(result: BuildResult
|
|
623
|
-
declare function isBuildFailure(result: BuildResult
|
|
648
|
+
declare function isBuildSuccess(result: BuildResult): result is BuildSuccessResult;
|
|
649
|
+
declare function isBuildFailure(result: BuildResult): result is BuildFailureResult;
|
|
624
650
|
|
|
625
651
|
//#endregion
|
|
626
652
|
//#region src/utils/resolveConfig.d.ts
|
|
@@ -701,4 +727,4 @@ interface LoadConfigOptions {
|
|
|
701
727
|
declare const loadConfig: (options?: LoadConfigOptions) => Promise<CompleteGraniteConfig>;
|
|
702
728
|
|
|
703
729
|
//#endregion
|
|
704
|
-
export { AdditionalMetroConfig, AliasConfig, AliasResolver, BabelConfig, BuildConfig, BuildFailureResult, BuildResult, BuildSuccessResult, BundleData, CompleteGraniteConfig, DevServerConfig, DynamicPluginConfig, EsbuildConfig, GraniteConfig, GranitePlugin, GranitePluginBuildPostHandler, GranitePluginBuildPreHandler, GranitePluginConfig, GranitePluginCore, GranitePluginDevHandlerArgs, GranitePluginDevPostHandler, GranitePluginDevPreHandler, GranitePluginHooks, GranitePluginPostHandlerArgs, GranitePluginPreHandlerArgs, MetroDevServerConfig, MetroMiddleware, Middleware, ParsedGraniteConfig, PluginBuildConfig, PluginConfig, PluginContext, PluginInput, PluginMetroConfig, PluginResolvable, ProtocolConfig, ResolveResult, ResolveResultWithOptions, ResolvedMetroConfig, ResolvedPluginConfig, ResolverConfig, StaticPluginConfig, SwcConfig, TransformAsync, TransformSync, TransformerConfig, createContext, createPluginContext, createPluginHooksDriver, defineConfig, flattenPlugins, isBuildFailure, isBuildSuccess, loadConfig, mergeBuildConfigs, mergeConfig, pluginConfigSchema, resolveConfig, resolvePlugins };
|
|
730
|
+
export { AdditionalMetroConfig, AliasConfig, AliasResolver, BabelConfig, BuildConfig, BuildFailureResult, BuildResult, BuildSuccessResult, BundleData, CompleteGraniteConfig, DevServerConfig, DynamicPluginConfig, EsbuildConfig, GraniteConfig, GranitePlugin, GranitePluginBuildPostHandler, GranitePluginBuildPreHandler, GranitePluginConfig, GranitePluginCore, GranitePluginDevHandlerArgs, GranitePluginDevPostHandler, GranitePluginDevPreHandler, GranitePluginHooks, GranitePluginPostHandlerArgs, GranitePluginPreHandlerArgs, InspectorProxyConfig, MetroDevServerConfig, MetroMiddleware, Middleware, ParsedGraniteConfig, PluginBuildConfig, PluginConfig, PluginContext, PluginInput, PluginMetroConfig, PluginResolvable, ProtocolConfig, ResolveResult, ResolveResultWithOptions, ResolvedMetroConfig, ResolvedPluginConfig, ResolverConfig, StaticPluginConfig, SwcConfig, TransformAsync, TransformSync, TransformerConfig, createContext, createPluginContext, createPluginHooksDriver, defineConfig, flattenPlugins, isBuildFailure, isBuildSuccess, loadConfig, mergeBuildConfigs, mergeConfig, pluginConfigSchema, resolveConfig, resolvePlugins };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import * as esbuild$1 from "esbuild";
|
|
|
4
4
|
import * as esbuild from "esbuild";
|
|
5
5
|
import { HandleFunction } from "connect";
|
|
6
6
|
import { FastifyPluginAsync, FastifyPluginCallback } from "fastify";
|
|
7
|
+
import * as ws from "ws";
|
|
7
8
|
import * as babel from "@babel/core";
|
|
8
|
-
import { BuildFailureResult as BuildFailureResult$1, BuildResult as BuildResult$1, BuildSuccessResult as BuildSuccessResult$1 } from "@granite-js/plugin-core";
|
|
9
9
|
|
|
10
10
|
//#region src/types/BuildConfig.d.ts
|
|
11
11
|
interface BuildConfig {
|
|
@@ -232,11 +232,35 @@ interface BundleData {
|
|
|
232
232
|
//#region src/types/DevServerConfig.d.ts
|
|
233
233
|
type Middleware = FastifyPluginAsync | FastifyPluginCallback;
|
|
234
234
|
type MetroMiddleware = HandleFunction;
|
|
235
|
+
interface InspectorProxyConfig {
|
|
236
|
+
delegate?: {
|
|
237
|
+
/**
|
|
238
|
+
* @param message CDP message from the connected device
|
|
239
|
+
* @param socket `WebSocket` instance that connected to the device
|
|
240
|
+
* @returns `true` if the message is handled, `false` otherwise
|
|
241
|
+
*/
|
|
242
|
+
onDeviceMessage?: <DeviceMessage extends {
|
|
243
|
+
method: string;
|
|
244
|
+
params: Record<string, any>;
|
|
245
|
+
}>(message: DeviceMessage, socket: ws.WebSocket) => boolean;
|
|
246
|
+
/**
|
|
247
|
+
* @param message CDP message from debugger
|
|
248
|
+
* @param socket `WebSocket` instance that connected to debugger
|
|
249
|
+
* @returns `true` if the message is handled, `false` otherwise
|
|
250
|
+
*/
|
|
251
|
+
onDebuggerMessage?: <DebuggerMessage extends {
|
|
252
|
+
method: string;
|
|
253
|
+
params: Record<string, any>;
|
|
254
|
+
}>(message: DebuggerMessage, socket: ws.WebSocket) => boolean;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
235
257
|
interface DevServerConfig {
|
|
236
258
|
middlewares?: Middleware[];
|
|
259
|
+
inspectorProxy?: InspectorProxyConfig;
|
|
237
260
|
}
|
|
238
261
|
interface MetroDevServerConfig {
|
|
239
262
|
middlewares?: MetroMiddleware[];
|
|
263
|
+
inspectorProxy?: InspectorProxyConfig;
|
|
240
264
|
}
|
|
241
265
|
|
|
242
266
|
//#endregion
|
|
@@ -446,7 +470,9 @@ interface MetroConfig {
|
|
|
446
470
|
readonly reporter?: {
|
|
447
471
|
update: (event: ReportableEvent) => void;
|
|
448
472
|
};
|
|
449
|
-
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
//#endregion
|
|
450
476
|
//#region src/types/MetroConfig.d.ts
|
|
451
477
|
interface AdditionalMetroConfig extends MetroConfig {
|
|
452
478
|
/**
|
|
@@ -619,8 +645,8 @@ declare function createPluginContext(): PluginContext;
|
|
|
619
645
|
|
|
620
646
|
//#endregion
|
|
621
647
|
//#region src/utils/buildResult.d.ts
|
|
622
|
-
declare function isBuildSuccess(result: BuildResult
|
|
623
|
-
declare function isBuildFailure(result: BuildResult
|
|
648
|
+
declare function isBuildSuccess(result: BuildResult): result is BuildSuccessResult;
|
|
649
|
+
declare function isBuildFailure(result: BuildResult): result is BuildFailureResult;
|
|
624
650
|
|
|
625
651
|
//#endregion
|
|
626
652
|
//#region src/utils/resolveConfig.d.ts
|
|
@@ -701,4 +727,4 @@ interface LoadConfigOptions {
|
|
|
701
727
|
declare const loadConfig: (options?: LoadConfigOptions) => Promise<CompleteGraniteConfig>;
|
|
702
728
|
|
|
703
729
|
//#endregion
|
|
704
|
-
export { AdditionalMetroConfig, AliasConfig, AliasResolver, BabelConfig, BuildConfig, BuildFailureResult, BuildResult, BuildSuccessResult, BundleData, CompleteGraniteConfig, DevServerConfig, DynamicPluginConfig, EsbuildConfig, GraniteConfig, GranitePlugin, GranitePluginBuildPostHandler, GranitePluginBuildPreHandler, GranitePluginConfig, GranitePluginCore, GranitePluginDevHandlerArgs, GranitePluginDevPostHandler, GranitePluginDevPreHandler, GranitePluginHooks, GranitePluginPostHandlerArgs, GranitePluginPreHandlerArgs, MetroDevServerConfig, MetroMiddleware, Middleware, ParsedGraniteConfig, PluginBuildConfig, PluginConfig, PluginContext, PluginInput, PluginMetroConfig, PluginResolvable, ProtocolConfig, ResolveResult, ResolveResultWithOptions, ResolvedMetroConfig, ResolvedPluginConfig, ResolverConfig, StaticPluginConfig, SwcConfig, TransformAsync, TransformSync, TransformerConfig, createContext, createPluginContext, createPluginHooksDriver, defineConfig, flattenPlugins, isBuildFailure, isBuildSuccess, loadConfig, mergeBuildConfigs, mergeConfig, pluginConfigSchema, resolveConfig, resolvePlugins };
|
|
730
|
+
export { AdditionalMetroConfig, AliasConfig, AliasResolver, BabelConfig, BuildConfig, BuildFailureResult, BuildResult, BuildSuccessResult, BundleData, CompleteGraniteConfig, DevServerConfig, DynamicPluginConfig, EsbuildConfig, GraniteConfig, GranitePlugin, GranitePluginBuildPostHandler, GranitePluginBuildPreHandler, GranitePluginConfig, GranitePluginCore, GranitePluginDevHandlerArgs, GranitePluginDevPostHandler, GranitePluginDevPreHandler, GranitePluginHooks, GranitePluginPostHandlerArgs, GranitePluginPreHandlerArgs, InspectorProxyConfig, MetroDevServerConfig, MetroMiddleware, Middleware, ParsedGraniteConfig, PluginBuildConfig, PluginConfig, PluginContext, PluginInput, PluginMetroConfig, PluginResolvable, ProtocolConfig, ResolveResult, ResolveResultWithOptions, ResolvedMetroConfig, ResolvedPluginConfig, ResolverConfig, StaticPluginConfig, SwcConfig, TransformAsync, TransformSync, TransformerConfig, createContext, createPluginContext, createPluginHooksDriver, defineConfig, flattenPlugins, isBuildFailure, isBuildSuccess, loadConfig, mergeBuildConfigs, mergeConfig, pluginConfigSchema, resolveConfig, resolvePlugins };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/plugin-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.23-next.
|
|
4
|
+
"version": "0.1.23-next.11",
|
|
5
5
|
"description": "The core plugin module for Granite",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
"vitest": "^3.0.9"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@granite-js/utils": "0.1.23-next.
|
|
38
|
+
"@granite-js/utils": "0.1.23-next.11",
|
|
39
39
|
"@swc/core": "npm:1.5.24",
|
|
40
40
|
"@types/babel__core": "^7",
|
|
41
41
|
"@types/connect": "^3",
|
|
42
|
+
"@types/ws": "^8.18.0",
|
|
42
43
|
"cosmiconfig": "^9.0.0",
|
|
43
44
|
"cosmiconfig-typescript-loader": "^5.1.0",
|
|
44
45
|
"es-toolkit": "^1.39.8",
|