@coreframe/vite 0.2.8 → 0.2.10

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/client.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="vite-plugin-hashed-favicons/virtual" />
2
2
 
3
3
  interface ImportMetaEnv {
4
+ readonly COREFRAME_MANAGED_DEV?: boolean
4
5
  readonly PLATFORM: import("@coreframe/lib/shell").ShellPlatform
5
6
  }
6
7
 
@@ -0,0 +1,10 @@
1
+ //#region browser/flutter-devtools.d.ts
2
+ type FlutterDevToolsHotContext = {
3
+ off(event: string, listener: (data: unknown) => void): void;
4
+ on<T>(event: string, listener: (data: T) => void): void;
5
+ send(event: string, data?: unknown): void;
6
+ };
7
+ /** Connects the shared state-launcher registry to the debug-only Flutter host. */
8
+ declare function installFlutterDevTools(hot?: FlutterDevToolsHotContext | undefined): () => void;
9
+ //#endregion
10
+ export { installFlutterDevTools };
@@ -0,0 +1 @@
1
+ import{codexTaskEvents as e}from"@coreframe/dev-contracts/codex-task";import{developmentControlsEvents as t}from"@coreframe/dev-contracts/development-controls";import{managedDevEvents as n}from"@coreframe/dev-contracts/managed-dev";import{createFlutterDevToolsClient as r}from"@coreframe/flutter-js/devtools";import{clearActiveState as i,getStateLauncherSnapshot as a,launchStateLauncherCommand as o,subscribeStateLauncher as s}from"state-launcher/headless";function c(i=d()){let o=import.meta.env.COREFRAME_MANAGED_DEV?[`state-launcher`,`managed-dev`]:[`state-launcher`],c,f=()=>c.publishStateLauncherSnapshot(a());c=r({features:o,onManagedDevRequest:e=>u(e,i),onReady:e=>{i&&e.includes(`managed-dev`)&&i.send(n.statusRequest)},onStateLauncherRequest:l}),f(),i&&(i.on(n.status,m),i.on(n.actionResult,h),i.on(n.codex,g),i.on(t.actionResult,_),i.on(e.result,v));let p=s(f);return()=>{p(),i&&(i.off(n.status,m),i.off(n.actionResult,h),i.off(n.codex,g),i.off(t.actionResult,_),i.off(e.result,v)),c.dispose()};function m(e){c.publishManagedDevStatus(e.status)}function h(e){c.publishManagedDevActionResult(e)}function g(e){c.publishManagedDevCodex(e)}function _(e){c.publishDevelopmentControlResult(e)}function v(e){c.publishCodexTaskResult(e)}}async function l(e){if(e.action===`clear`){await i();return}await o(e.id)}function u(r,i){if(i)switch(r.type){case`managed-dev-status-request`:i.send(n.statusRequest);return;case`managed-dev-action`:i.send(n.action,{action:r.action,requestId:r.requestId});return;case`development-controls-action`:i.send(t.action,{action:r.action,requestId:r.requestId});return;case`codex-task-start`:i.send(e.start,{openInBackground:r.openInBackground,prompt:r.prompt,requestId:r.requestId});return}}function d(){return import.meta.hot}export{c as installFlutterDevTools};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/vite",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "Vite plugins and build integrations for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,6 +40,10 @@
40
40
  "types": "./dist/plugins/native.d.ts",
41
41
  "default": "./dist/plugins/native.js"
42
42
  },
43
+ "./flutter-devtools": {
44
+ "types": "./dist/browser/flutter-devtools.d.ts",
45
+ "default": "./dist/browser/flutter-devtools.js"
46
+ },
43
47
  "./*": {
44
48
  "types": "./dist/plugins/*.d.ts",
45
49
  "default": "./dist/plugins/*.js"
@@ -57,14 +61,14 @@
57
61
  "obug": "^2.1.3",
58
62
  "unplugin": "^2.3.11",
59
63
  "vite-plugin-hashed-favicons": "^2.1.1",
60
- "@coreframe/assets": "^0.1.5",
61
- "@coreframe/dashboard": "^0.3.2",
62
- "@coreframe/config": "^0.1.2",
64
+ "@coreframe/assets": "^0.1.6",
65
+ "@coreframe/config": "^0.1.3",
66
+ "@coreframe/dashboard": "^0.3.3",
67
+ "@coreframe/dev": "^0.1.5",
63
68
  "@coreframe/dev-contracts": "^0.1.2",
64
- "@coreframe/flutter-js": "^0.1.5",
65
- "@coreframe/dev": "^0.1.4",
66
- "@coreframe/flutter-tools": "^0.1.6",
67
- "@coreframe/lib": "^0.2.2"
69
+ "@coreframe/flutter-js": "^0.1.7",
70
+ "@coreframe/flutter-tools": "^0.1.7",
71
+ "@coreframe/lib": "^0.2.3"
68
72
  },
69
73
  "devDependencies": {
70
74
  "@tsdown/css": "0.22.3",
@@ -74,6 +78,7 @@
74
78
  "isolet-js": "0.0.7",
75
79
  "react": "^19.2.7",
76
80
  "react-dom": "^19.2.7",
81
+ "state-launcher": "^0.3.0",
77
82
  "tsdown": "0.22.3",
78
83
  "typescript": "6.0.3",
79
84
  "unplugin-icons": "^23.0.1",
@@ -83,8 +88,14 @@
83
88
  "peerDependencies": {
84
89
  "react": ">=18",
85
90
  "react-dom": ">=18",
91
+ "state-launcher": "^0.3.0",
86
92
  "vite": "^8.0.0"
87
93
  },
94
+ "peerDependenciesMeta": {
95
+ "state-launcher": {
96
+ "optional": true
97
+ }
98
+ },
88
99
  "scripts": {
89
100
  "build": "tsdown",
90
101
  "test": "vitest run --reporter=minimal",