@archie/devtools 0.0.4 → 0.0.6

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": "@archie/devtools",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "DevTools for Archie generated applications - Route synchronization and editor communication",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -12,14 +12,26 @@
12
12
  "require": "./dist/index.js"
13
13
  },
14
14
  "./client": {
15
- "types": "./dist/client.d.ts",
16
- "import": "./dist/client.mjs",
17
- "require": "./dist/client.js"
15
+ "types": "./dist/client/client.d.ts",
16
+ "import": "./dist/client/client.mjs",
17
+ "require": "./dist/client/client.js"
18
+ },
19
+ "./client/inject-inspector/auto": {
20
+ "types": "./dist/client/inject-inspector/auto.d.ts",
21
+ "import": "./dist/client/inject-inspector/auto.mjs",
22
+ "require": "./dist/client/inject-inspector/auto.js"
23
+ },
24
+ "./constants": {
25
+ "types": "./dist/constants/archieOrigins.d.ts",
26
+ "import": "./dist/constants/archieOrigins.mjs",
27
+ "require": "./dist/constants/archieOrigins.js"
18
28
  }
19
29
  },
20
30
  "scripts": {
21
- "build": "tsup src/index.ts src/client.ts --format cjs,esm --dts",
22
- "dev": "tsup src/index.ts src/client.ts --format cjs,esm --dts --watch",
31
+ "test": "vitest run",
32
+ "test:watch": "vitest",
33
+ "build": "tsup src/index.ts src/client/client.ts src/client/inject-inspector/injectInspector.ts src/client/inject-inspector/auto.ts src/client/route-listener/routeListener.ts src/constants/archieOrigins.ts --format cjs,esm --dts",
34
+ "dev": "tsup src/index.ts src/client/client.ts src/client/inject-inspector/injectInspector.ts src/client/inject-inspector/auto.ts src/client/route-listener/routeListener.ts src/constants/archieOrigins.ts --format cjs,esm --dts --watch",
23
35
  "typecheck": "tsc --noEmit",
24
36
  "release": "node publish.js"
25
37
  },
@@ -39,12 +51,14 @@
39
51
  "@remix-run/router": "^1.0.0",
40
52
  "@types/react": "^19.0.0",
41
53
  "@types/react-dom": "^19.0.0",
54
+ "happy-dom": "^20.5.0",
42
55
  "react": "^19.0.0",
43
56
  "react-dom": "^19.0.0",
44
57
  "react-router-dom": "^7.0.0",
45
58
  "tsup": "^8.0.0",
46
59
  "typescript": "^5.0.0",
47
- "vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
60
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
61
+ "vitest": "^2.1.9"
48
62
  },
49
63
  "peerDependencies": {
50
64
  "react": ">=18.0.0",
@@ -1,24 +1,5 @@
1
1
  import { Router } from '@remix-run/router';
2
2
 
3
- /**
4
- * Archie Route Listener Setup
5
- *
6
- * Subscribes to the React Router instance to detect route changes
7
- * and broadcast them to the host editor (iframe parent or popup opener).
8
- *
9
- * @param router - The React Router instance (from createBrowserRouter)
10
- * @returns Unsubscribe function to stop listening
11
- *
12
- * @example
13
- * ```typescript
14
- * import { setupArchieRouteListener } from '@archie/devtools/client';
15
- * import { router } from './App';
16
- *
17
- * const unsubscribe = setupArchieRouteListener(router);
18
- * // Later: unsubscribe();
19
- * ```
20
- */
21
- declare function setupArchieRouteListener(router: Router): () => void;
22
3
  /**
23
4
  * Route information for the sitemap
24
5
  */
@@ -45,5 +26,24 @@ interface ArchieRouteUpdateMessage {
45
26
  timestamp: number;
46
27
  };
47
28
  }
29
+ /**
30
+ * Archie Route Listener Setup
31
+ *
32
+ * Subscribes to the React Router instance to detect route changes
33
+ * and broadcast them to the host editor (iframe parent or popup opener).
34
+ *
35
+ * @param router - The React Router instance (from createBrowserRouter)
36
+ * @returns Unsubscribe function to stop listening
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * import { setupArchieRouteListener } from '@archie/devtools/client';
41
+ * import { router } from './App';
42
+ *
43
+ * const unsubscribe = setupArchieRouteListener(router);
44
+ * // Later: unsubscribe();
45
+ * ```
46
+ */
47
+ declare function setupArchieRouteListener(router: Router): () => void;
48
48
 
49
49
  export { type ArchieRouteUpdateMessage, type RouteInfo, setupArchieRouteListener };
@@ -1,24 +1,5 @@
1
1
  import { Router } from '@remix-run/router';
2
2
 
3
- /**
4
- * Archie Route Listener Setup
5
- *
6
- * Subscribes to the React Router instance to detect route changes
7
- * and broadcast them to the host editor (iframe parent or popup opener).
8
- *
9
- * @param router - The React Router instance (from createBrowserRouter)
10
- * @returns Unsubscribe function to stop listening
11
- *
12
- * @example
13
- * ```typescript
14
- * import { setupArchieRouteListener } from '@archie/devtools/client';
15
- * import { router } from './App';
16
- *
17
- * const unsubscribe = setupArchieRouteListener(router);
18
- * // Later: unsubscribe();
19
- * ```
20
- */
21
- declare function setupArchieRouteListener(router: Router): () => void;
22
3
  /**
23
4
  * Route information for the sitemap
24
5
  */
@@ -45,5 +26,24 @@ interface ArchieRouteUpdateMessage {
45
26
  timestamp: number;
46
27
  };
47
28
  }
29
+ /**
30
+ * Archie Route Listener Setup
31
+ *
32
+ * Subscribes to the React Router instance to detect route changes
33
+ * and broadcast them to the host editor (iframe parent or popup opener).
34
+ *
35
+ * @param router - The React Router instance (from createBrowserRouter)
36
+ * @returns Unsubscribe function to stop listening
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * import { setupArchieRouteListener } from '@archie/devtools/client';
41
+ * import { router } from './App';
42
+ *
43
+ * const unsubscribe = setupArchieRouteListener(router);
44
+ * // Later: unsubscribe();
45
+ * ```
46
+ */
47
+ declare function setupArchieRouteListener(router: Router): () => void;
48
48
 
49
49
  export { type ArchieRouteUpdateMessage, type RouteInfo, setupArchieRouteListener };