@teardown/react-native 1.2.9 → 1.2.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teardown/react-native",
3
- "version": "1.2.9",
3
+ "version": "1.2.15",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -14,11 +14,13 @@
14
14
  "dist/**/*"
15
15
  ],
16
16
  "dependencies": {
17
- "@teardown/logger": "1.2.9",
18
- "@teardown/util": "1.2.9",
19
- "@teardown/websocket": "1.2.9"
17
+ "@teardown/logger": "1.2.15",
18
+ "@teardown/util": "1.2.15",
19
+ "@teardown/websocket": "1.2.15"
20
20
  },
21
21
  "devDependencies": {
22
+ "@teardown/config": "1.2.15",
23
+ "@teardown/react-native-ui": "1.2.15",
22
24
  "@types/react": "^18.3.1",
23
25
  "@types/react-native": "^0.73.0",
24
26
  "metro-config": "^0.81.0",
@@ -32,6 +34,7 @@
32
34
  "react": "^18",
33
35
  "react-native": "^0.75",
34
36
  "react-native-device-info": "^14",
35
- "react-native-gesture-handler": "^2"
37
+ "react-native-gesture-handler": "^2",
38
+ "@teardown/react-native-ui": "^1"
36
39
  }
37
40
  }
@@ -1,7 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- export type DebuggerUiPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center-left' | 'center-right';
3
- export type DebuggerUiOptions = {
4
- enabled?: boolean;
5
- position?: DebuggerUiPosition;
6
- };
7
- export declare const DebuggerUi: FunctionComponent<DebuggerUiOptions>;
@@ -1 +0,0 @@
1
- export * from './debugger-ui';
@@ -1,4 +0,0 @@
1
- import type { FunctionComponent } from "react";
2
- import { type SvgProps } from "react-native-svg";
3
- export type TeardownLogoProps = SvgProps;
4
- export declare const TeardownLogo: FunctionComponent<TeardownLogoProps>;
@@ -1 +0,0 @@
1
- export * from './teardown.container';
@@ -1,11 +0,0 @@
1
- import type { FunctionComponent, PropsWithChildren } from "react";
2
- import type { PluginTuple, TeardownClient } from "../teardown.client";
3
- import type { DebuggerUiOptions } from "../components";
4
- export type TeardownContainerOptions = {
5
- debugger: DebuggerUiOptions;
6
- };
7
- export type TeardownContainerProps<T extends readonly PluginTuple[]> = PropsWithChildren<{
8
- client: TeardownClient<T>;
9
- options?: TeardownContainerOptions;
10
- }>;
11
- export declare const TeardownContainer: FunctionComponent<TeardownContainerProps<any>>;
@@ -1,13 +0,0 @@
1
- import { type ClientWebsocketEvents, type ConnectionEstablishedWebsocketEvent, WebsocketClient, type WebsocketClientOptions, type WebsocketConnectionStatus } from "@teardown/websocket";
2
- export type DebuggerStatus = WebsocketConnectionStatus;
3
- export type DebuggerOptions = WebsocketClientOptions & {
4
- deviceName?: string;
5
- };
6
- export declare class Debugger extends WebsocketClient<ClientWebsocketEvents> {
7
- private readonly customDeviceName?;
8
- constructor(options?: DebuggerOptions);
9
- private getDeviceName;
10
- onConnectionEstablished(event: ConnectionEstablishedWebsocketEvent): Promise<void>;
11
- getHostFromUrl(url: string): string;
12
- getHost(): string;
13
- }
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./containers";
2
- export * from "./teardown.client";
3
- export * from "./plugins";
@@ -1,2 +0,0 @@
1
- import type { MetroConfig } from "metro-config";
2
- export declare const getConfig: (configPath: string) => Promise<MetroConfig>;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfig = void 0;
4
- const getConfig = async (configPath) => { };
5
- exports.getConfig = getConfig;
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_path_1 = __importDefault(require("node:path"));
7
- const chokidar_1 = __importDefault(require("chokidar"));
8
- function getConfig() {
9
- const screensDir = node_path_1.default.join(__dirname, "screens");
10
- const outputFile = node_path_1.default.join(__dirname, "screens.gen.tsx");
11
- return {
12
- server: {
13
- enhanceMiddleware: (middleware) => {
14
- return (req, res, next) => {
15
- console.log("Request URL:", req.url);
16
- // Handle requests as usual
17
- return middleware;
18
- };
19
- },
20
- },
21
- };
22
- }
23
- // Function to generate the output file
24
- function generateOutputFile() {
25
- // Your code to generate the output file based on the files in the ./screens folder
26
- const outputContent = "/* Generated file */";
27
- console.log("Generating output file...");
28
- // fs.writeFileSync(outputFile, outputContent);
29
- }
30
- // Initialize the watcher
31
- const watcher = chokidar_1.default.watch(screensDir, {
32
- ignored: /(^|[\/\\])\../, // Ignore dotfiles
33
- persistent: true,
34
- });
35
- // Watch for changes in the ./screens folder
36
- watcher
37
- .on("add", generateOutputFile)
38
- .on("change", generateOutputFile)
39
- .on("unlink", generateOutputFile)
40
- .on("ready", generateOutputFile) // Generate the initial output file
41
- .on("error", (error) => console.error(`Watcher error: ${error}`));
42
- console.log(`Watching ${screensDir} for changes...`);
43
- module.exports = {
44
- server: {},
45
- };
@@ -1,23 +0,0 @@
1
- import type { TeardownClient } from "../teardown.client";
2
- import { type DefaultPluginOptions, Plugin } from "../teardown.client";
3
- export type HTTPPluginOptions = DefaultPluginOptions<{
4
- ignoreURLs?: RegExp[];
5
- }>;
6
- export declare class HTTPPlugin extends Plugin {
7
- private client;
8
- private requests;
9
- private ignoreURLs;
10
- constructor(options?: HTTPPluginOptions);
11
- install(client: TeardownClient<any>): void;
12
- enableXHRInterceptor(): void;
13
- disableInterception(): void;
14
- private shouldIgnoreURL;
15
- private xhrOpenCallback;
16
- private xhrRequestHeaderCallback;
17
- private xhrSendCallback;
18
- private serializeRequestBody;
19
- private xhrResponseCallback;
20
- private parseResponseHeaders;
21
- private parseResponseBody;
22
- private sendHTTPEvent;
23
- }
@@ -1,2 +0,0 @@
1
- export * from './http.plugin';
2
- export * from './logging.plugin';
@@ -1,9 +0,0 @@
1
- import type { IPlugin, TeardownClient } from "../teardown.client";
2
- export declare class LoggingPlugin implements IPlugin {
3
- private client;
4
- private originalConsoleMethods;
5
- private createConsoleProxy;
6
- constructor();
7
- install(client: TeardownClient<any>): void;
8
- uninstall(): void;
9
- }
@@ -1,17 +0,0 @@
1
- import type { IPlugin, TeardownClient } from "../teardown.client";
2
- export declare class WebSocketPlugin implements IPlugin {
3
- private logger;
4
- private client;
5
- private sockets;
6
- constructor();
7
- install(client: TeardownClient<any>): void;
8
- private setupWebSocketInterceptor;
9
- private wsConnectCallback;
10
- private wsSendCallback;
11
- private wsOnMessageCallback;
12
- private wsOnCloseCallback;
13
- private sendOpenEvent;
14
- private sendMessageEvent;
15
- private sendCloseEvent;
16
- disableInterception(): void;
17
- }
@@ -1 +0,0 @@
1
- export * from './teardown.service';
@@ -1,10 +0,0 @@
1
- import type { PluginTuple, TeardownClient } from "../teardown.client";
2
- export type TeardownServiceContextType<T extends readonly PluginTuple[]> = {
3
- client: TeardownClient<T>;
4
- };
5
- export declare const TeardownService: {
6
- Context: import("react").Context<TeardownServiceContextType<any> | null>;
7
- Provider: import("react").Provider<TeardownServiceContextType<any> | null>;
8
- useState<T extends readonly PluginTuple[]>(): TeardownServiceContextType<T>;
9
- useProvidedState<T extends readonly PluginTuple[]>(client: TeardownClient<T>): TeardownServiceContextType<T>;
10
- };
@@ -1,44 +0,0 @@
1
- import { Logger } from "@teardown/logger";
2
- import { Debugger, type DebuggerOptions } from "./debugger";
3
- export interface IPlugin {
4
- install?(client: TeardownClient<any>): void;
5
- uninstall?(): void;
6
- }
7
- export type DefaultPluginOptions<T> = {
8
- debug?: boolean;
9
- } & T;
10
- export type PluginOptions<T> = DefaultPluginOptions<{
11
- key: string;
12
- }> & T;
13
- export declare abstract class Plugin<T = any> {
14
- protected logger: Logger;
15
- protected constructor(options: PluginOptions<T>);
16
- install?(client: TeardownClient<any>): void;
17
- uninstall?(): void;
18
- }
19
- export type PluginTuple = readonly [string, IPlugin];
20
- type InferPluginFromTuple<T extends PluginTuple> = {
21
- [K in T[0]]: Omit<T[1], "install" | "uninstall">;
22
- };
23
- type InferPluginsFromArray<T extends readonly PluginTuple[]> = UnionToIntersection<InferPluginFromTuple<T[number]>>;
24
- type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
25
- export type TeardownClientOptions<T extends readonly PluginTuple[]> = {
26
- plugins?: T;
27
- debuggerEnabled?: boolean;
28
- loggingEnabled?: boolean;
29
- } & DebuggerOptions;
30
- export declare class TeardownClient<T extends readonly PluginTuple[]> {
31
- readonly options?: TeardownClientOptions<T> | undefined;
32
- logger: Logger;
33
- debugger: Debugger | null;
34
- private readonly plugins;
35
- api: InferPluginsFromArray<T>;
36
- constructor(options?: TeardownClientOptions<T> | undefined);
37
- private installPlugin;
38
- private uninstallPlugin;
39
- private uninstallAllPlugins;
40
- private reinstallPlugins;
41
- shutdown(): void;
42
- }
43
- export declare const createTeardownClient: <Plugins extends readonly PluginTuple[]>(plugins: Plugins) => TeardownClient<Plugins>;
44
- export {};