@skyvexsoftware/stratos-sdk 0.21.1 → 0.22.1

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/README.md CHANGED
@@ -97,7 +97,7 @@ The `vite` option accepts any Vite config to merge in (plugins, resolve, css, et
97
97
  - `available_settings`: Optional array of setting definitions (boolean, text, number, list, etc.)
98
98
  - `min_core_version`: Optional oldest Stratos Core the plugin runs on (e.g. `"2.49.0"`)
99
99
 
100
- plugin.json keys are snake_case. Uploads using the old camelCase names (`availableSettings`, `minCoreVersion`, `includeSourceMaps`, `attachesFilesToPirep`) are refused.
100
+ plugin.json keys are snake_case.
101
101
 
102
102
  ## API Reference
103
103
 
@@ -203,9 +203,7 @@ import { Plane, Map, Settings, Helicopter } from "lucide-react";
203
203
 
204
204
  The SDK's Vite config shims `react`, `react-dom`, and their jsx subpaths so every copy of React in your plugin graph (including lucide-react's internals) resolves to the shell's single instance.
205
205
 
206
- If you need dynamic lookup (e.g. icons chosen by name from a remote config), `import { icons } from "lucide-react"` gives you the full map — at the cost of bundling the whole set into your plugin. Prefer a curated static map when possible.
207
-
208
- Earlier SDK versions exposed `STRATOS_ICONS` and `STRATOS_ICON_NAMES` as convenience re-exports of lucide's `icons` object. Those exports are still available but **deprecated** — prefer the patterns above in new code.
206
+ For icons chosen by name at runtime (e.g. from an airline setting), use `DynamicIcon` from `@skyvexsoftware/stratos-sdk/icons`. Stratos loads each icon on demand (core 2.49.0+), so your plugin bundles none of the set.
209
207
 
210
208
  ### Types
211
209
 
package/dist/icons.d.ts CHANGED
@@ -1,21 +1,2 @@
1
- /**
2
- * Re-exports of lucide-react's icon registry.
3
- *
4
- * @deprecated Since SDK 0.7.2. Import from `lucide-react` directly — static
5
- * imports tree-shake, and the SDK's Vite config shims `react` so lucide's
6
- * internals resolve to the shell's React instance (no bundle duplication,
7
- * no two-React crashes). For genuinely dynamic name→component lookup, use
8
- * `import { icons } from "lucide-react"` which costs ~60 KB gzipped in your
9
- * plugin bundle — prefer a curated static map where you can.
10
- *
11
- * Retained as a thin re-export so existing plugin bundles that were built
12
- * against SDK 0.6.x and earlier keep working when core upgrades the SDK.
13
- * Safe to remove in a future major release once no shipped plugin references
14
- * these exports.
15
- */
16
- import { icons } from "lucide-react";
17
- /** @deprecated Import from `lucide-react` directly. See file docstring. */
18
- export declare const STRATOS_ICONS: typeof icons;
19
- /** @deprecated Import from `lucide-react` directly. See file docstring. */
20
- export declare const STRATOS_ICON_NAMES: string[];
1
+ export {};
21
2
  //# sourceMappingURL=icons.d.ts.map
package/dist/icons.js CHANGED
@@ -1,20 +1,12 @@
1
1
  /**
2
- * Re-exports of lucide-react's icon registry.
3
- *
4
- * @deprecated Since SDK 0.7.2. Import from `lucide-react` directly — static
5
- * imports tree-shake, and the SDK's Vite config shims `react` so lucide's
6
- * internals resolve to the shell's React instance (no bundle duplication,
7
- * no two-React crashes). For genuinely dynamic name→component lookup, use
8
- * `import { icons } from "lucide-react"` which costs ~60 KB gzipped in your
9
- * plugin bundle — prefer a curated static map where you can.
10
- *
11
- * Retained as a thin re-export so existing plugin bundles that were built
12
- * against SDK 0.6.x and earlier keep working when core upgrades the SDK.
13
- * Safe to remove in a future major release once no shipped plugin references
14
- * these exports.
2
+ * Re-exports of lucide-react's icon registry, kept at runtime for plugin
3
+ * bundles built against SDK 0.6.x and earlier. Left out of the published
4
+ * types (`@internal`): plugins import icons from `lucide-react` or use
5
+ * `DynamicIcon`. Safe to remove in a future major release once no shipped
6
+ * plugin references these exports.
15
7
  */
16
8
  import { icons } from "lucide-react";
17
- /** @deprecated Import from `lucide-react` directly. See file docstring. */
9
+ /** @internal See file docstring. */
18
10
  export const STRATOS_ICONS = icons;
19
- /** @deprecated Import from `lucide-react` directly. See file docstring. */
11
+ /** @internal See file docstring. */
20
12
  export const STRATOS_ICON_NAMES = Object.keys(icons).sort();
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type { PluginAuthor, PluginManifest } from "./types/manifest";
2
- export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginVaApiClient, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginServerRegistrar, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginPirepSubmissionContext, PluginPirepAttachment, PluginPirepAttachHandler, PluginFileAttachment, PluginNotifier, PluginToastInput, BuiltInSound, PluginAlertSound, PluginDialogApi, PluginPromptApi, PluginDialogAlertInput, PluginDialogConfirmInput, PluginPromptTextInput, PluginPromptNumberInput, PluginPromptSelectInput, PluginIndicatorType, PluginIndicatorInput, PluginSelfApi, } from "./types/context";
2
+ export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginVaApiClient, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginServerRegistrar, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginPirepSubmissionContext, PluginPirepAttachment, PluginPirepAttachHandler, PluginFileAttachment, PluginNotifier, PluginToastInput, BuiltInSound, PluginDialogApi, PluginPromptApi, PluginDialogAlertInput, PluginDialogConfirmInput, PluginPromptTextInput, PluginPromptNumberInput, PluginPromptSelectInput, PluginIndicatorType, PluginIndicatorInput, PluginSelfApi, } from "./types/context";
3
3
  export type { PluginNavigationHelper, PluginPilotUser, PluginToastAPI, PluginUIContext, } from "./types/context-ui";
4
4
  export type { PluginSettingType, PluginSettingOption, PluginSettingDefinition, PluginAvailableSettings, BooleanSettingDef, TextSettingDef, LongtextSettingDef, NumberSettingDef, RangeSettingDef, ListSettingDef, RadioSettingDef, DateSettingDef, JsonSettingDef, } from "./types/settings";
5
5
  export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./types/module";
@@ -39,6 +39,5 @@ export type { AutoStartConfirmPayload, ConnectionState, LogEntryPayload, Notific
39
39
  export type { PluginDialogKind, PluginDialogSelectOption, PluginDialogSpec, PluginDialogResult, PluginDialogClosePayload, } from "./shared-types/plugin-dialogs";
40
40
  export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
41
41
  export type { BadgeProps, ButtonProps, ComboboxOption, ComboboxProps, } from "./ui";
42
- export { STRATOS_ICONS, STRATOS_ICON_NAMES } from "./icons";
43
42
  export { cn } from "./utils/cn";
44
43
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -28,10 +28,10 @@ export { useSocket, useSimulatorData, useProtocolUrl, useNotifications, useSyste
28
28
  export { SOCKET_EVENTS } from "./shared-types/socket-events";
29
29
  // ── UI Primitives ──────────────────────────────────────────────────────
30
30
  export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
31
- // ── Icons (deprecated) ────────────────────────────────────────────────
32
- // Kept as a thin re-export of lucide-react's icons registry so plugin
33
- // bundles built against earlier SDK versions keep working when core
34
- // upgrades. New code should import from lucide-react directly.
31
+ // ── Icons (internal) ──────────────────────────────────────────────────
32
+ // Kept at runtime for plugin bundles that still read them; out of the
33
+ // published types. Plugins import from lucide-react or use DynamicIcon.
34
+ /** @internal */
35
35
  export { STRATOS_ICONS, STRATOS_ICON_NAMES } from "./icons";
36
36
  // ── Utilities ──────────────────────────────────────────────────────────
37
37
  export { cn } from "./utils/cn";
@@ -274,11 +274,6 @@ export type PluginNotifier = {
274
274
  * ogg, m4a, aac.
275
275
  */
276
276
  playCustomSound(assetPath: string): Promise<void>;
277
- /**
278
- * @deprecated Use {@link PluginNotifier.playSound}. Retained for back-compat;
279
- * legacy names (`alert`/`warning`/`chime`) now map onto a real bundled file.
280
- */
281
- sound(name: PluginAlertSound): Promise<void>;
282
277
  };
283
278
  /** Input for `ctx.notify.toast`. */
284
279
  export type PluginToastInput = {
@@ -290,8 +285,6 @@ export type PluginToastInput = {
290
285
  };
291
286
  /** Built-in shell sound catalogue. Semantic names mapped to bundled files by the shell. */
292
287
  export type BuiltInSound = "attention" | "error" | "success";
293
- /** @deprecated Use {@link BuiltInSound} with `playSound`. */
294
- export type PluginAlertSound = "alert" | "warning" | "error" | "success" | "chime";
295
288
  /** Visual style of a plugin's sidebar indicator. */
296
289
  export type PluginIndicatorType = "notification" | "warning";
297
290
  /** Input for `ctx.plugin.setIndicator`. */
@@ -1,5 +1,5 @@
1
1
  export type { PluginAuthor, PluginManifest } from "./manifest";
2
- export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginServerRegistrar, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginPirepSubmissionContext, PluginPirepAttachment, PluginPirepAttachHandler, PluginFileAttachment, PluginNotifier, PluginToastInput, BuiltInSound, PluginAlertSound, } from "./context";
2
+ export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginServerRegistrar, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginPirepSubmissionContext, PluginPirepAttachment, PluginPirepAttachHandler, PluginFileAttachment, PluginNotifier, PluginToastInput, BuiltInSound, } from "./context";
3
3
  export type { PluginNavigationHelper, PluginToastAPI, PluginUIContext, } from "./context-ui";
4
4
  export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./module";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -153,6 +153,10 @@ function createUIConfig(pluginDir, entry, extraConfig) {
153
153
  },
154
154
  rollupOptions: {
155
155
  external: [...UI_EXTERNALS],
156
+ // One file only. If the direct file:// import fails, or after a hot
157
+ // plugin update, Stratos loads ui/index.js from a blob: URL, where a
158
+ // relative import of another chunk can't resolve.
159
+ output: { inlineDynamicImports: true },
156
160
  },
157
161
  sourcemap: true,
158
162
  minify: isProduction ? "esbuild" : false,
@@ -170,6 +174,7 @@ function createUIConfig(pluginDir, entry, extraConfig) {
170
174
  alias: mergedAlias,
171
175
  },
172
176
  plugins: [
177
+ processEnvDefine(),
173
178
  serveExternals(),
174
179
  hmrBaseRewrite(),
175
180
  stratosDevServer({ pluginDir }),
@@ -180,6 +185,26 @@ function createUIConfig(pluginDir, entry, extraConfig) {
180
185
  ],
181
186
  };
182
187
  }
188
+ /**
189
+ * The renderer has no Node `process`, and library mode leaves
190
+ * `process.env.NODE_ENV` in the bundle, so libraries that read it (MapLibre,
191
+ * deck.gl, React builds) throw "process is not defined" at load. Replace it
192
+ * with the build's mode, and any other `process.env.X` with undefined.
193
+ */
194
+ function processEnvDefine() {
195
+ return {
196
+ name: "stratos-process-env-define",
197
+ config(_config, { mode }) {
198
+ const nodeEnv = mode === "production" ? "production" : "development";
199
+ return {
200
+ define: {
201
+ "process.env.NODE_ENV": JSON.stringify(nodeEnv),
202
+ "process.env": JSON.stringify({ NODE_ENV: nodeEnv }),
203
+ },
204
+ };
205
+ },
206
+ };
207
+ }
183
208
  /**
184
209
  * Shared background build configuration — used both for the production
185
210
  * build (createBackgroundConfig below) and the dev hot-rebuilder in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyvexsoftware/stratos-sdk",
3
- "version": "0.21.1",
3
+ "version": "0.22.1",
4
4
  "description": "Plugin SDK for Stratos — types, hooks, and UI components",
5
5
  "author": {
6
6
  "name": "Skyvex Software Pty Ltd",