@skyvexsoftware/stratos-sdk 0.5.8 → 0.6.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Skyvex Software
3
+ Copyright (c) 2026 Skyvex Software Pty Ltd
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -95,6 +95,8 @@ export type RecoverableFlight = {
95
95
  elapsedMs: number;
96
96
  status: string;
97
97
  phase: string | null;
98
+ /** Last known fuel in lbs (canonical). Null if no fuel data was captured. */
99
+ lastFuel: number | null;
98
100
  };
99
101
  /** Socket.io payload for flight:manager events */
100
102
  export type FlightManagerPayload = {
@@ -0,0 +1,6 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ export declare const createRoot: any;
4
+ export declare const hydrateRoot: any;
5
+ export declare const version: any;
6
+ //# sourceMappingURL=react-dom-client.d.ts.map
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/gen-react-shims.mjs — do not edit by hand.
2
+ // Proxies "react-dom/client" imports to window.__stratos_modules__["react-dom/client"]
3
+ // so every copy of React in the plugin graph (source, lucide-react,
4
+ // radix, etc.) resolves to the shell's single instance.
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const __m = globalThis.__stratos_modules__?.["react-dom/client"];
7
+ if (!__m)
8
+ throw new Error("Stratos: window.__stratos_modules__[\"react-dom/client\"] is not available. The shell must initialize it before plugin modules evaluate.");
9
+ export default __m.default ?? __m;
10
+ export const createRoot = __m.createRoot;
11
+ export const hydrateRoot = __m.hydrateRoot;
12
+ export const version = __m.version;
@@ -0,0 +1,17 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ export declare const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: any;
4
+ export declare const createPortal: any;
5
+ export declare const flushSync: any;
6
+ export declare const preconnect: any;
7
+ export declare const prefetchDNS: any;
8
+ export declare const preinit: any;
9
+ export declare const preinitModule: any;
10
+ export declare const preload: any;
11
+ export declare const preloadModule: any;
12
+ export declare const requestFormReset: any;
13
+ export declare const unstable_batchedUpdates: any;
14
+ export declare const useFormState: any;
15
+ export declare const useFormStatus: any;
16
+ export declare const version: any;
17
+ //# sourceMappingURL=react-dom.d.ts.map
@@ -0,0 +1,23 @@
1
+ // GENERATED by scripts/gen-react-shims.mjs — do not edit by hand.
2
+ // Proxies "react-dom" imports to window.__stratos_modules__["react-dom"]
3
+ // so every copy of React in the plugin graph (source, lucide-react,
4
+ // radix, etc.) resolves to the shell's single instance.
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const __m = globalThis.__stratos_modules__?.["react-dom"];
7
+ if (!__m)
8
+ throw new Error("Stratos: window.__stratos_modules__[\"react-dom\"] is not available. The shell must initialize it before plugin modules evaluate.");
9
+ export default __m.default ?? __m;
10
+ export const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = __m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
11
+ export const createPortal = __m.createPortal;
12
+ export const flushSync = __m.flushSync;
13
+ export const preconnect = __m.preconnect;
14
+ export const prefetchDNS = __m.prefetchDNS;
15
+ export const preinit = __m.preinit;
16
+ export const preinitModule = __m.preinitModule;
17
+ export const preload = __m.preload;
18
+ export const preloadModule = __m.preloadModule;
19
+ export const requestFormReset = __m.requestFormReset;
20
+ export const unstable_batchedUpdates = __m.unstable_batchedUpdates;
21
+ export const useFormState = __m.useFormState;
22
+ export const useFormStatus = __m.useFormStatus;
23
+ export const version = __m.version;
@@ -0,0 +1,5 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ export declare const Fragment: any;
4
+ export declare const jsxDEV: any;
5
+ //# sourceMappingURL=react-jsx-dev-runtime.d.ts.map
@@ -0,0 +1,11 @@
1
+ // GENERATED by scripts/gen-react-shims.mjs — do not edit by hand.
2
+ // Proxies "react/jsx-dev-runtime" imports to window.__stratos_modules__["react/jsx-dev-runtime"]
3
+ // so every copy of React in the plugin graph (source, lucide-react,
4
+ // radix, etc.) resolves to the shell's single instance.
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const __m = globalThis.__stratos_modules__?.["react/jsx-dev-runtime"];
7
+ if (!__m)
8
+ throw new Error("Stratos: window.__stratos_modules__[\"react/jsx-dev-runtime\"] is not available. The shell must initialize it before plugin modules evaluate.");
9
+ export default __m.default ?? __m;
10
+ export const Fragment = __m.Fragment;
11
+ export const jsxDEV = __m.jsxDEV;
@@ -0,0 +1,6 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ export declare const Fragment: any;
4
+ export declare const jsx: any;
5
+ export declare const jsxs: any;
6
+ //# sourceMappingURL=react-jsx-runtime.d.ts.map
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/gen-react-shims.mjs — do not edit by hand.
2
+ // Proxies "react/jsx-runtime" imports to window.__stratos_modules__["react/jsx-runtime"]
3
+ // so every copy of React in the plugin graph (source, lucide-react,
4
+ // radix, etc.) resolves to the shell's single instance.
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const __m = globalThis.__stratos_modules__?.["react/jsx-runtime"];
7
+ if (!__m)
8
+ throw new Error("Stratos: window.__stratos_modules__[\"react/jsx-runtime\"] is not available. The shell must initialize it before plugin modules evaluate.");
9
+ export default __m.default ?? __m;
10
+ export const Fragment = __m.Fragment;
11
+ export const jsx = __m.jsx;
12
+ export const jsxs = __m.jsxs;
@@ -0,0 +1,44 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ export declare const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: any;
4
+ export declare const __COMPILER_RUNTIME: any;
5
+ export declare const act: any;
6
+ export declare const cache: any;
7
+ export declare const captureOwnerStack: any;
8
+ export declare const Children: any;
9
+ export declare const cloneElement: any;
10
+ export declare const Component: any;
11
+ export declare const createContext: any;
12
+ export declare const createElement: any;
13
+ export declare const createRef: any;
14
+ export declare const forwardRef: any;
15
+ export declare const Fragment: any;
16
+ export declare const isValidElement: any;
17
+ export declare const lazy: any;
18
+ export declare const memo: any;
19
+ export declare const Profiler: any;
20
+ export declare const PureComponent: any;
21
+ export declare const startTransition: any;
22
+ export declare const StrictMode: any;
23
+ export declare const Suspense: any;
24
+ export declare const unstable_useCacheRefresh: any;
25
+ export declare const use: any;
26
+ export declare const useActionState: any;
27
+ export declare const useCallback: any;
28
+ export declare const useContext: any;
29
+ export declare const useDebugValue: any;
30
+ export declare const useDeferredValue: any;
31
+ export declare const useEffect: any;
32
+ export declare const useId: any;
33
+ export declare const useImperativeHandle: any;
34
+ export declare const useInsertionEffect: any;
35
+ export declare const useLayoutEffect: any;
36
+ export declare const useMemo: any;
37
+ export declare const useOptimistic: any;
38
+ export declare const useReducer: any;
39
+ export declare const useRef: any;
40
+ export declare const useState: any;
41
+ export declare const useSyncExternalStore: any;
42
+ export declare const useTransition: any;
43
+ export declare const version: any;
44
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1,50 @@
1
+ // GENERATED by scripts/gen-react-shims.mjs — do not edit by hand.
2
+ // Proxies "react" imports to window.__stratos_modules__["react"]
3
+ // so every copy of React in the plugin graph (source, lucide-react,
4
+ // radix, etc.) resolves to the shell's single instance.
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const __m = globalThis.__stratos_modules__?.["react"];
7
+ if (!__m)
8
+ throw new Error("Stratos: window.__stratos_modules__[\"react\"] is not available. The shell must initialize it before plugin modules evaluate.");
9
+ export default __m.default ?? __m;
10
+ export const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = __m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
11
+ export const __COMPILER_RUNTIME = __m.__COMPILER_RUNTIME;
12
+ export const act = __m.act;
13
+ export const cache = __m.cache;
14
+ export const captureOwnerStack = __m.captureOwnerStack;
15
+ export const Children = __m.Children;
16
+ export const cloneElement = __m.cloneElement;
17
+ export const Component = __m.Component;
18
+ export const createContext = __m.createContext;
19
+ export const createElement = __m.createElement;
20
+ export const createRef = __m.createRef;
21
+ export const forwardRef = __m.forwardRef;
22
+ export const Fragment = __m.Fragment;
23
+ export const isValidElement = __m.isValidElement;
24
+ export const lazy = __m.lazy;
25
+ export const memo = __m.memo;
26
+ export const Profiler = __m.Profiler;
27
+ export const PureComponent = __m.PureComponent;
28
+ export const startTransition = __m.startTransition;
29
+ export const StrictMode = __m.StrictMode;
30
+ export const Suspense = __m.Suspense;
31
+ export const unstable_useCacheRefresh = __m.unstable_useCacheRefresh;
32
+ export const use = __m.use;
33
+ export const useActionState = __m.useActionState;
34
+ export const useCallback = __m.useCallback;
35
+ export const useContext = __m.useContext;
36
+ export const useDebugValue = __m.useDebugValue;
37
+ export const useDeferredValue = __m.useDeferredValue;
38
+ export const useEffect = __m.useEffect;
39
+ export const useId = __m.useId;
40
+ export const useImperativeHandle = __m.useImperativeHandle;
41
+ export const useInsertionEffect = __m.useInsertionEffect;
42
+ export const useLayoutEffect = __m.useLayoutEffect;
43
+ export const useMemo = __m.useMemo;
44
+ export const useOptimistic = __m.useOptimistic;
45
+ export const useReducer = __m.useReducer;
46
+ export const useRef = __m.useRef;
47
+ export const useState = __m.useState;
48
+ export const useSyncExternalStore = __m.useSyncExternalStore;
49
+ export const useTransition = __m.useTransition;
50
+ export const version = __m.version;
@@ -23,6 +23,7 @@ import { serveExternals } from "./serve-externals.js";
23
23
  import { stratosDevServer } from "./stratos-dev-server.js";
24
24
  import { cssInject } from "./css-inject.js";
25
25
  import { hmrBaseRewrite } from "./hmr-base-rewrite.js";
26
+ import { reactShimAliases } from "./react-shim.js";
26
27
  /** Modules external in background builds (available in Electron main process) */
27
28
  const BG_EXTERNALS = ["electron", "socket.io-client"];
28
29
  /** Node.js built-in modules to externalize in background builds */
@@ -219,12 +220,19 @@ function createUIConfig(pluginDir, entry, extraConfig) {
219
220
  host: "localhost",
220
221
  },
221
222
  },
223
+ resolve: {
224
+ // Redirect React (and friends) to shim modules that proxy to
225
+ // window.__stratos_modules__. Applies during source transforms AND
226
+ // esbuild pre-bundling, so any third-party dep that imports React
227
+ // (lucide-react, radix, etc.) resolves to the shell's single instance —
228
+ // avoiding the two-React "Cannot read properties of null (reading
229
+ // 'useContext')" crash.
230
+ alias: reactShimAliases(),
231
+ },
222
232
  optimizeDeps: {
223
- // Exclude non-React externals from pre-bundling (they come from the shell).
224
- // React packages are NOT excluded they need to be pre-bundled so that
225
- // @vitejs/plugin-react can resolve react-refresh for Fast Refresh.
226
- // serveExternals() still rewrites all source-level React imports to
227
- // window.__stratos_modules__, so the pre-bundled React is never loaded.
233
+ // Exclude non-React externals from pre-bundling (they come from the
234
+ // shell). React subpaths are handled by the alias above their imports
235
+ // are rewritten to shim files, which esbuild can bundle normally.
228
236
  exclude: UI_EXTERNALS.filter((id) => !id.startsWith("react") && id !== "react-dom"),
229
237
  },
230
238
  build: {
@@ -0,0 +1,3 @@
1
+ import type { Alias } from "vite";
2
+ export declare function reactShimAliases(): Alias[];
3
+ //# sourceMappingURL=react-shim.d.ts.map
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Resolve React (and friends) to shim modules that proxy to
3
+ * `window.__stratos_modules__`.
4
+ *
5
+ * Without aliasing, any dep that imports React — `lucide-react`, `@radix-ui/*`,
6
+ * anything with React as a peer — gets pre-bundled by Vite with its own copy
7
+ * of React. The plugin's source code has its React imports rewritten to the
8
+ * shell's `window.__stratos_modules__.react` (by serve-externals /
9
+ * stratos-externals), so the plugin ends up with two separate React instances
10
+ * — breaking hooks ("Cannot read properties of null (reading 'useContext')"),
11
+ * context, and refs.
12
+ *
13
+ * The alias redirects React imports (source AND inside pre-bundled deps) to
14
+ * physical shim files shipped with the SDK. Each shim reads from
15
+ * `window.__stratos_modules__[...]` and re-exports the enumerated names
16
+ * statically. Every React import in the entire graph resolves to the SAME
17
+ * instance the shell provides. Third-party UI libraries just work.
18
+ *
19
+ * The trade-off: ES modules require static named exports, so each shim
20
+ * enumerates the exports it covers. Lists target React 19 — update the shim
21
+ * files when upgrading React.
22
+ */
23
+ import { fileURLToPath } from "url";
24
+ import * as path from "path";
25
+ // Resolve shim paths relative to this file. At consume time (compiled SDK in
26
+ // node_modules), this file lives in dist/vite/ and shims live in dist/shims/.
27
+ const here = path.dirname(fileURLToPath(import.meta.url));
28
+ const shimDir = path.resolve(here, "..", "shims");
29
+ export function reactShimAliases() {
30
+ return [
31
+ { find: /^react$/, replacement: path.join(shimDir, "react.js") },
32
+ { find: /^react-dom$/, replacement: path.join(shimDir, "react-dom.js") },
33
+ {
34
+ find: /^react-dom\/client$/,
35
+ replacement: path.join(shimDir, "react-dom-client.js"),
36
+ },
37
+ {
38
+ find: /^react\/jsx-runtime$/,
39
+ replacement: path.join(shimDir, "react-jsx-runtime.js"),
40
+ },
41
+ {
42
+ find: /^react\/jsx-dev-runtime$/,
43
+ replacement: path.join(shimDir, "react-jsx-dev-runtime.js"),
44
+ },
45
+ ];
46
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@skyvexsoftware/stratos-sdk",
3
- "version": "0.5.8",
3
+ "version": "0.6.0",
4
4
  "description": "Plugin SDK for Stratos — types, hooks, and UI components",
5
5
  "author": {
6
- "name": "Skyvex Software",
6
+ "name": "Skyvex Software Pty Ltd",
7
7
  "email": "jordan@skyvexsoftware.com"
8
8
  },
9
9
  "license": "MIT",
@@ -75,7 +75,8 @@
75
75
  "access": "public"
76
76
  },
77
77
  "scripts": {
78
- "build": "tsc -b",
78
+ "gen:shims": "node scripts/gen-react-shims.mjs",
79
+ "build": "node scripts/gen-react-shims.mjs && tsc -b",
79
80
  "lint": "eslint src --ext .ts,.tsx",
80
81
  "tsc": "tsc --noEmit",
81
82
  "typecheck": "tsc --noEmit",
@@ -109,17 +110,19 @@
109
110
  "devDependencies": {
110
111
  "@radix-ui/react-alert-dialog": "^1.1.15",
111
112
  "@radix-ui/react-dialog": "^1.1.15",
112
- "@radix-ui/react-label": "^2.1.7",
113
+ "@radix-ui/react-label": "^2.1.8",
113
114
  "@radix-ui/react-radio-group": "^1.3.8",
114
115
  "@radix-ui/react-select": "^2.1.8",
115
116
  "@radix-ui/react-separator": "^1.1.4",
116
117
  "@radix-ui/react-slider": "^1.3.6",
117
- "@radix-ui/react-slot": "^1.2.0",
118
+ "@radix-ui/react-slot": "^1.2.4",
118
119
  "@radix-ui/react-switch": "^1.2.6",
119
120
  "@radix-ui/react-tabs": "^1.1.8",
120
121
  "@radix-ui/react-tooltip": "^1.1.12",
121
122
  "@types/react": "^19.1.2",
123
+ "@types/react-dom": "^19.1.2",
122
124
  "@vitejs/plugin-react": "^5.1.4",
125
+ "react-dom": "^19.0.0",
123
126
  "class-variance-authority": "^0.7.1",
124
127
  "lucide-react": "^0.577.0",
125
128
  "socket.io-client": "^4.8.3",