@buoy-gg/env 7.0.40 → 7.0.42

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.
Files changed (52) hide show
  1. package/README.md +11 -83
  2. package/lib/commonjs/env/components/EnvStatsOverview.js +1 -159
  3. package/lib/commonjs/env/components/EnvVarRow.js +1 -189
  4. package/lib/commonjs/env/components/EnvVarSection.js +1 -84
  5. package/lib/commonjs/env/components/EnvVarsModal.js +1 -322
  6. package/lib/commonjs/env/hooks/useDynamicEnv.js +1 -92
  7. package/lib/commonjs/env/types/index.js +1 -27
  8. package/lib/commonjs/env/types/types.js +1 -1
  9. package/lib/commonjs/env/types/userTypes.js +1 -1
  10. package/lib/commonjs/env/utils/envTypeDetector.js +1 -59
  11. package/lib/commonjs/env/utils/helpers.js +1 -119
  12. package/lib/commonjs/env/utils/index.js +1 -38
  13. package/lib/commonjs/env/utils/remoteEnv.js +1 -24
  14. package/lib/commonjs/env/utils/utils.js +1 -121
  15. package/lib/commonjs/index.js +1 -77
  16. package/lib/commonjs/preset.js +1 -76
  17. package/lib/commonjs/sync/envSyncAdapter.js +1 -38
  18. package/lib/module/env/components/EnvStatsOverview.js +1 -155
  19. package/lib/module/env/components/EnvVarRow.js +1 -185
  20. package/lib/module/env/components/EnvVarSection.js +1 -80
  21. package/lib/module/env/components/EnvVarsModal.js +1 -317
  22. package/lib/module/env/hooks/useDynamicEnv.js +1 -88
  23. package/lib/module/env/types/index.js +1 -4
  24. package/lib/module/env/types/types.js +1 -1
  25. package/lib/module/env/types/userTypes.js +1 -1
  26. package/lib/module/env/utils/envTypeDetector.js +1 -55
  27. package/lib/module/env/utils/helpers.js +1 -114
  28. package/lib/module/env/utils/index.js +1 -5
  29. package/lib/module/env/utils/remoteEnv.js +1 -19
  30. package/lib/module/env/utils/utils.js +1 -116
  31. package/lib/module/index.js +1 -21
  32. package/lib/module/preset.js +1 -73
  33. package/lib/module/sync/envSyncAdapter.js +1 -34
  34. package/lib/typescript/sync/envSyncAdapter.d.ts +5 -7
  35. package/lib/web/index.mjs +1 -0
  36. package/package.json +33 -11
  37. package/lib/typescript/env/components/EnvStatsOverview.d.ts.map +0 -1
  38. package/lib/typescript/env/components/EnvVarRow.d.ts.map +0 -1
  39. package/lib/typescript/env/components/EnvVarSection.d.ts.map +0 -1
  40. package/lib/typescript/env/components/EnvVarsModal.d.ts.map +0 -1
  41. package/lib/typescript/env/hooks/useDynamicEnv.d.ts.map +0 -1
  42. package/lib/typescript/env/types/index.d.ts.map +0 -1
  43. package/lib/typescript/env/types/types.d.ts.map +0 -1
  44. package/lib/typescript/env/types/userTypes.d.ts.map +0 -1
  45. package/lib/typescript/env/utils/envTypeDetector.d.ts.map +0 -1
  46. package/lib/typescript/env/utils/helpers.d.ts.map +0 -1
  47. package/lib/typescript/env/utils/index.d.ts.map +0 -1
  48. package/lib/typescript/env/utils/remoteEnv.d.ts.map +0 -1
  49. package/lib/typescript/env/utils/utils.d.ts.map +0 -1
  50. package/lib/typescript/index.d.ts.map +0 -1
  51. package/lib/typescript/preset.d.ts.map +0 -1
  52. package/lib/typescript/sync/envSyncAdapter.d.ts.map +0 -1
@@ -1,4 +1 @@
1
- "use strict";
2
-
3
- export * from "./types";
4
- export * from "./userTypes";
1
+ "use strict";export*from"./types";export*from"./userTypes";
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";
@@ -1,55 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Detects the type of an environment variable value
5
- * First checks if useDynamicEnv already parsed it to the correct type,
6
- * then analyzes string content to detect what type it represents
7
- *
8
- * @returns One of: "string", "number", "boolean", "array", "object"
9
- */
10
- export function getEnvVarType(value) {
11
- // Check the actual parsed value type from useDynamicEnv
12
- const type = typeof value;
13
- if (type === "boolean") return "boolean";
14
- if (type === "number") return "number";
15
- if (Array.isArray(value)) return "array";
16
- if (type === "object" && value !== null) return "object";
17
-
18
- // For strings, check if they look like other types
19
- if (type === "string") {
20
- const strValue = value;
21
-
22
- // Check if it looks like JSON
23
- if (strValue.startsWith("{") && strValue.endsWith("}") || strValue.startsWith("[") && strValue.endsWith("]")) {
24
- try {
25
- const parsed = JSON.parse(strValue);
26
- return Array.isArray(parsed) ? "array" : "object";
27
- } catch {
28
- return "string";
29
- }
30
- }
31
-
32
- // Check if it's a boolean string
33
- const lowerStr = strValue.toLowerCase();
34
- if (lowerStr === "true" || lowerStr === "false" || lowerStr === "enabled" || lowerStr === "disabled" || lowerStr === "yes" || lowerStr === "no" || lowerStr === "on" || lowerStr === "off") {
35
- return "boolean";
36
- }
37
-
38
- // Check if it's a number string (including 1 and 0 as numbers, not booleans)
39
- if (!isNaN(Number(strValue)) && strValue.trim() !== "") {
40
- return "number";
41
- }
42
-
43
- // Check if it's a URL
44
- if (strValue.startsWith("http://") || strValue.startsWith("https://")) {
45
- return "url";
46
- }
47
-
48
- // Check if it's a comma-separated array
49
- if (strValue.includes(",")) {
50
- return "array";
51
- }
52
- return "string";
53
- }
54
- return "unknown";
55
- }
1
+ "use strict";export function getEnvVarType(e){const n=typeof e;if(n==="boolean")return"boolean";if(n==="number")return"number";if(Array.isArray(e))return"array";if(n==="object"&&e!==null)return"object";if(n==="string"){const r=e;if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")){try{const s=JSON.parse(r);return Array.isArray(s)?"array":"object"}catch{return"string"}}const t=r.toLowerCase();if(t==="true"||t==="false"||t==="enabled"||t==="disabled"||t==="yes"||t==="no"||t==="on"||t==="off"){return"boolean"}if(!isNaN(Number(r))&&r.trim()!==""){return"number"}if(r.startsWith("http://")||r.startsWith("https://")){return"url"}if(r.includes(",")){return"array"}return"string"}return"unknown"}
@@ -1,114 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Helper to create a required env var configuration with type checking
5
- *
6
- * @example
7
- * const config = envVar("EXPO_PUBLIC_API_URL")
8
- * .withType("string")
9
- * .withDescription("Backend API endpoint")
10
- * .build();
11
- *
12
- * @example
13
- * const config = envVar("EXPO_PUBLIC_DEBUG_MODE")
14
- * .withDescription("Enable debug logging")
15
- * .withType("boolean")
16
- * .build();
17
- */
18
- class EnvVarBuilder {
19
- constructor(key) {
20
- this.key = key;
21
- }
22
- /** Just check if the variable exists */
23
- exists() {
24
- return this.key;
25
- }
26
-
27
- /** Check for a specific value */
28
- withValue(value) {
29
- this.expectedValue = value;
30
- delete this.expectedType; // Can't have both type and value
31
- return this;
32
- }
33
-
34
- /** Check for a specific type */
35
- withType(type) {
36
- this.expectedType = type;
37
- delete this.expectedValue; // Can't have both type and value
38
- return this;
39
- }
40
-
41
- /** Add a description for documentation */
42
- withDescription(desc) {
43
- this.description = desc;
44
- return this;
45
- }
46
-
47
- /** Build the final configuration */
48
- build() {
49
- if (this.expectedValue !== undefined) {
50
- return this.description ? {
51
- key: this.key,
52
- expectedValue: this.expectedValue,
53
- description: this.description
54
- } : {
55
- key: this.key,
56
- expectedValue: this.expectedValue
57
- };
58
- }
59
- if (this.expectedType !== undefined) {
60
- return this.description ? {
61
- key: this.key,
62
- expectedType: this.expectedType,
63
- description: this.description
64
- } : {
65
- key: this.key,
66
- expectedType: this.expectedType
67
- };
68
- }
69
-
70
- // If neither type nor value is specified, just check existence
71
- return this.key;
72
- }
73
- }
74
-
75
- /**
76
- * Fluent builder for defining expected environment variables. Helps teams author readable
77
- * `requiredEnvVars` arrays by chaining type/value/description requirements while keeping the
78
- * final shape compatible with `EnvVarsModal` and related helpers.
79
- *
80
- * @param key - Environment variable name to validate.
81
- * @returns Builder with convenience methods like `.withType()` and `.withValue()`.
82
- */
83
- export function envVar(key) {
84
- return new EnvVarBuilder(key);
85
- }
86
-
87
- /**
88
- * Normalizes `requiredEnvVars` definitions while documenting intent in code. The helper simply
89
- * returns the provided array, but allows teams to co-locate examples and benefit from IDE hovers.
90
- *
91
- * @param vars - Collection of required environment variable definitions created manually or via `envVar()`.
92
- * @returns The original array, unchanged, for ergonomic chaining and inference.
93
- *
94
- * @example
95
- * const requiredEnvVars = createEnvVarConfig([
96
- * // Simple existence check
97
- * "EXPO_PUBLIC_API_URL",
98
- *
99
- * // Type checking
100
- * { key: "EXPO_PUBLIC_DEBUG_MODE", expectedType: "boolean" },
101
- *
102
- * // Value checking
103
- * { key: "EXPO_PUBLIC_ENVIRONMENT", expectedValue: "development" },
104
- *
105
- * // With descriptions
106
- * envVar("EXPO_PUBLIC_MAX_RETRIES")
107
- * .withType("number")
108
- * .withDescription("Maximum number of API retry attempts")
109
- * .build(),
110
- * ]);
111
- */
112
- export function createEnvVarConfig(vars) {
113
- return vars;
114
- }
1
+ "use strict";class i{constructor(e){this.key=e}exists(){return this.key}withValue(e){this.expectedValue=e;delete this.expectedType;return this}withType(e){this.expectedType=e;delete this.expectedValue;return this}withDescription(e){this.description=e;return this}build(){if(this.expectedValue!==void 0){return this.description?{key:this.key,expectedValue:this.expectedValue,description:this.description}:{key:this.key,expectedValue:this.expectedValue}}if(this.expectedType!==void 0){return this.description?{key:this.key,expectedType:this.expectedType,description:this.description}:{key:this.key,expectedType:this.expectedType}}return this.key}}export function envVar(t){return new i(t)}export function createEnvVarConfig(t){return t}
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- export * from "./envTypeDetector";
4
- export * from "./helpers";
5
- export * from "./utils";
1
+ "use strict";export*from"./envTypeDetector";export*from"./helpers";export*from"./utils";
@@ -1,19 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Remote env override for remote mirror mode (desktop dashboard).
5
- *
6
- * The dashboard has no meaningful process.env of its own — the env values it
7
- * shows come from the synced device. When set, useDynamicEnv reads from this
8
- * map instead of process.env.
9
- */
10
-
11
- let remoteEnv = null;
12
-
13
- /** Override the env source. Pass null to restore process.env. */
14
- export function setRemoteEnv(env) {
15
- remoteEnv = env;
16
- }
17
- export function getRemoteEnv() {
18
- return remoteEnv;
19
- }
1
+ "use strict";let e=null;export function setRemoteEnv(t){e=t}export function getRemoteEnv(){return e}
@@ -1,116 +1 @@
1
- "use strict";
2
-
3
- import { getEnvVarType } from "./envTypeDetector";
4
-
5
- /**
6
- * Combines the auto-detected runtime environment values with the declared `requiredEnvVars`
7
- * configuration and produces categorized metadata for rendering in the UI.
8
- *
9
- * @param autoCollectedEnvVars - Values discovered via `useDynamicEnv` (key/value string map).
10
- * @param requiredEnvVars - Optional list of required variables describing expectations to validate.
11
- * @returns Required and optional variable collections annotated with validation status.
12
- */
13
- export const processEnvVars = (autoCollectedEnvVars, requiredEnvVars) => {
14
- const requiredVarInfos = [];
15
- const optionalVarInfos = [];
16
- const processedKeys = new Set();
17
-
18
- // Process required variables
19
- requiredEnvVars?.forEach(envVar => {
20
- const key = typeof envVar === "string" ? envVar : envVar.key;
21
- const expectedValue = typeof envVar === "object" && "expectedValue" in envVar ? envVar.expectedValue : undefined;
22
- const expectedType = typeof envVar === "object" && "expectedType" in envVar ? envVar.expectedType : undefined;
23
- const description = typeof envVar === "object" && "description" in envVar ? envVar.description : undefined;
24
- processedKeys.add(key);
25
- const actualValue = autoCollectedEnvVars[key];
26
- const isPresent = actualValue !== undefined;
27
- let status;
28
- if (!isPresent) {
29
- status = "required_missing";
30
- } else if (expectedValue) {
31
- // Handle different expectedValue patterns
32
- let valueMatches = false;
33
- if (expectedValue === "sk_*") {
34
- valueMatches = actualValue.startsWith("sk_");
35
- } else if (expectedValue === "production or development") {
36
- valueMatches = actualValue === "production" || actualValue === "development";
37
- } else {
38
- valueMatches = actualValue === expectedValue;
39
- }
40
- status = valueMatches ? "required_present" : "required_wrong_value";
41
- } else if (expectedType && getEnvVarType(actualValue).toLowerCase() !== expectedType.toLowerCase()) {
42
- status = "required_wrong_type";
43
- } else {
44
- status = "required_present";
45
- }
46
- requiredVarInfos.push({
47
- key,
48
- value: actualValue,
49
- expectedValue,
50
- expectedType,
51
- description,
52
- status,
53
- category: "required"
54
- });
55
- });
56
-
57
- // Process optional variables (those that exist but aren't required)
58
- Object.entries(autoCollectedEnvVars).forEach(([key, value]) => {
59
- if (!processedKeys.has(key)) {
60
- optionalVarInfos.push({
61
- key,
62
- value,
63
- status: "optional_present",
64
- category: "optional"
65
- });
66
- }
67
- });
68
-
69
- // Sort each category
70
- requiredVarInfos.sort((a, b) => {
71
- const statusOrder = {
72
- required_missing: 0,
73
- required_wrong_value: 1,
74
- required_wrong_type: 2,
75
- required_present: 3,
76
- optional_present: 4
77
- };
78
- if (statusOrder[a.status] !== statusOrder[b.status]) {
79
- return statusOrder[a.status] - statusOrder[b.status];
80
- }
81
- return a.key.localeCompare(b.key);
82
- });
83
- optionalVarInfos.sort((a, b) => a.key.localeCompare(b.key));
84
- return {
85
- requiredVars: requiredVarInfos,
86
- optionalVars: optionalVarInfos
87
- };
88
- };
89
-
90
- /**
91
- * Derives aggregate statistics from the processed environment variable lists for health badges
92
- * and summary chips in the modal UI.
93
- *
94
- * @param requiredVars - Processed required variables with validation state.
95
- * @param optionalVars - Processed optional variables discovered at runtime.
96
- * @param totalEnvVars - Raw key/value map of every detected environment variable.
97
- * @returns Counts related to overall env health for display purposes.
98
- */
99
- export const calculateStats = (requiredVars, optionalVars, totalEnvVars) => {
100
- const totalCount = Object.keys(totalEnvVars).length;
101
- const requiredCount = requiredVars.length;
102
- const missingCount = requiredVars.filter(v => v.status === "required_missing").length;
103
- const wrongValueCount = requiredVars.filter(v => v.status === "required_wrong_value").length;
104
- const wrongTypeCount = requiredVars.filter(v => v.status === "required_wrong_type").length;
105
- const presentRequiredCount = requiredVars.filter(v => v.status === "required_present").length;
106
- const optionalCount = optionalVars.length;
107
- return {
108
- totalCount,
109
- requiredCount,
110
- missingCount,
111
- wrongValueCount,
112
- wrongTypeCount,
113
- presentRequiredCount,
114
- optionalCount
115
- };
116
- };
1
+ "use strict";import{getEnvVarType as g}from"./envTypeDetector";export const processEnvVars=(n,d)=>{const r=[];const i=[];const p=new Set;d?.forEach(e=>{const s=typeof e==="string"?e:e.key;const o=typeof e==="object"&&"expectedValue"in e?e.expectedValue:void 0;const u=typeof e==="object"&&"expectedType"in e?e.expectedType:void 0;const a=typeof e==="object"&&"description"in e?e.description:void 0;p.add(s);const t=n[s];const f=t!==void 0;let c;if(!f){c="required_missing"}else if(o){let l=false;if(o==="sk_*"){l=t.startsWith("sk_")}else if(o==="production or development"){l=t==="production"||t==="development"}else{l=t===o}c=l?"required_present":"required_wrong_value"}else if(u&&g(t).toLowerCase()!==u.toLowerCase()){c="required_wrong_type"}else{c="required_present"}r.push({key:s,value:t,expectedValue:o,expectedType:u,description:a,status:c,category:"required"})});Object.entries(n).forEach(([e,s])=>{if(!p.has(e)){i.push({key:e,value:s,status:"optional_present",category:"optional"})}});r.sort((e,s)=>{const o={required_missing:0,required_wrong_value:1,required_wrong_type:2,required_present:3,optional_present:4};if(o[e.status]!==o[s.status]){return o[e.status]-o[s.status]}return e.key.localeCompare(s.key)});i.sort((e,s)=>e.key.localeCompare(s.key));return{requiredVars:r,optionalVars:i}};export const calculateStats=(n,d,r)=>{const i=Object.keys(r).length;const p=n.length;const e=n.filter(t=>t.status==="required_missing").length;const s=n.filter(t=>t.status==="required_wrong_value").length;const o=n.filter(t=>t.status==="required_wrong_type").length;const u=n.filter(t=>t.status==="required_present").length;const a=d.length;return{totalCount:i,requiredCount:p,missingCount:e,wrongValueCount:s,wrongTypeCount:o,presentRequiredCount:u,optionalCount:a}};
@@ -1,21 +1 @@
1
- "use strict";
2
-
3
- // Export preset configuration (easiest way to add to FloatingDevTools!)
4
- export { envToolPreset, createEnvTool } from "./preset";
5
-
6
- // Export main modal component
7
- // `EnvToolView` is the same tool rendered inline (header bar + body) instead
8
- // of inside a JsModal — for hosts that show tools in a panel.
9
- export { EnvVarsModal, EnvToolView } from "./env/components/EnvVarsModal";
10
-
11
- // External sync (adapter for @buoy-gg/external-sync's useExternalSync)
12
- export { createEnvSyncAdapter } from "./sync/envSyncAdapter";
13
-
14
- /** @internal - Remote mirror mode only (desktop dashboard). */
15
- export { setRemoteEnv } from "./env/utils/remoteEnv";
16
-
17
- // Export types (Environment, UserRole, RequiredEnvVar, etc.)
18
- export * from "./env/types";
19
-
20
- // Export utilities (createEnvVarConfig, envVar, etc.)
21
- export * from "./env/utils";
1
+ "use strict";export{envToolPreset,createEnvTool}from"./preset";export{EnvVarsModal,EnvToolView}from"./env/components/EnvVarsModal";export{createEnvSyncAdapter}from"./sync/envSyncAdapter";export{setRemoteEnv}from"./env/utils/remoteEnv";export*from"./env/types";export*from"./env/utils";
@@ -1,73 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Pre-configured environment variables tool for FloatingDevTools
5
- *
6
- * This preset provides a zero-config way to add env var inspection to your dev tools.
7
- * Just import and add it to your apps array!
8
- *
9
- * @example
10
- * ```tsx
11
- * import { envToolPreset } from '@buoy-gg/env';
12
- *
13
- * const installedApps = [
14
- * envToolPreset, // That's it!
15
- * // ...other tools
16
- * ];
17
- * ```
18
- */
19
-
20
- import { EnvIcon } from "@buoy-gg/floating-tools-core";
21
- import { EnvVarsModal } from "./env/components/EnvVarsModal";
22
- import { createToolFactory, defineToolPreset } from "@buoy-gg/shared-ui";
23
-
24
- /**
25
- * Pre-configured environment variables tool for FloatingDevTools.
26
- * Includes:
27
- * - Automatic env var discovery
28
- * - Required variable validation
29
- * - Search and filtering
30
- * - Copy functionality
31
- */
32
- import { jsx as _jsx } from "react/jsx-runtime";
33
- export const envToolPreset = defineToolPreset({
34
- id: "env",
35
- name: "ENV",
36
- description: "Environment variables debugger",
37
- slot: "both",
38
- icon: ({
39
- size
40
- }) => /*#__PURE__*/_jsx(EnvIcon, {
41
- size: size
42
- }),
43
- component: EnvVarsModal,
44
- props: {
45
- requiredEnvVars: [],
46
- enableSharedModalDimensions: true
47
- }
48
- });
49
-
50
- /**
51
- * Create a custom environment variables tool configuration.
52
- * Use this if you want to override default settings or provide required env vars.
53
- *
54
- * @example
55
- * ```tsx
56
- * import { createEnvTool, envVar, createEnvVarConfig } from '@buoy-gg/env';
57
- *
58
- * const requiredEnvVars = createEnvVarConfig([
59
- * envVar("EXPO_PUBLIC_API_URL").exists(),
60
- * envVar("EXPO_PUBLIC_DEBUG_MODE").withType("boolean").build(),
61
- * ]);
62
- *
63
- * const myEnvTool = createEnvTool({
64
- * requiredEnvVars,
65
- * colorPreset: "cyan",
66
- * enableSharedModalDimensions: true,
67
- * });
68
- * ```
69
- */
70
- export const createEnvTool = createToolFactory(envToolPreset, options => ({
71
- requiredEnvVars: options.requiredEnvVars || [],
72
- enableSharedModalDimensions: options.enableSharedModalDimensions ?? true
73
- }));
1
+ "use strict";import{EnvIcon as r}from"@buoy-gg/floating-tools-core";import{EnvVarsModal as o}from"./env/components/EnvVarsModal";import{setToolRequiredEnvVars as n}from"./sync/envSyncAdapter";import{createToolFactory as s,defineToolPreset as a}from"@buoy-gg/shared-ui";import{jsx as i}from"react/jsx-runtime";export const envToolPreset=a({id:"env",name:"ENV",description:"Environment variables debugger",slot:"both",icon:({size:e})=>i(r,{size:e}),component:o,props:{requiredEnvVars:[],enableSharedModalDimensions:true}});export const createEnvTool=s(envToolPreset,e=>{n(e.requiredEnvVars||[]);return{requiredEnvVars:e.requiredEnvVars||[],enableSharedModalDimensions:e.enableSharedModalDimensions??true}});
@@ -1,34 +1 @@
1
- "use strict";
2
-
3
- /** Collect the device's env vars (only EXPO_PUBLIC_-style vars exist in RN). */
4
- function collectEnv() {
5
- const env = {};
6
- // @ts-ignore process.env does exist
7
- for (const [key, value] of Object.entries(process.env)) {
8
- if (typeof value === "string") {
9
- env[key] = value;
10
- }
11
- }
12
- return env;
13
- }
14
-
15
- /**
16
- * Create a sync adapter for the env tool, consumed by @buoy-gg/external-sync's
17
- * `useExternalSync` (structurally matches its ToolSyncAdapter interface so
18
- * this package doesn't need a dependency on it).
19
- *
20
- * Env vars are baked into the bundle, so the snapshot is static — it's sent
21
- * once when a dashboard starts watching. Pass the same `requiredEnvVars`
22
- * config you give FloatingDevTools so the dashboard validates against it.
23
- */
24
- export function createEnvSyncAdapter(requiredEnvVars = []) {
25
- return {
26
- version: 1,
27
- getSnapshot: () => ({
28
- env: collectEnv(),
29
- requiredEnvVars
30
- }),
31
- // Env never changes at runtime — nothing to subscribe to
32
- subscribe: () => () => {}
33
- };
34
- }
1
+ "use strict";import{getRemoteEnv as r}from"../env/utils/remoteEnv";function s(){const e={};for(const[o,t]of Object.entries(r()??(typeof process==="undefined"?{}:process.env))){if(typeof t==="string"){e[o]=t}}return e}let n=[];export function setToolRequiredEnvVars(e){n=e}export function createEnvSyncAdapter(e=[]){return{version:1,getSnapshot:()=>({env:s(),requiredEnvVars:e.length>0?e:n}),subscribe:()=>()=>{}}}
@@ -1,13 +1,11 @@
1
1
  import type { RequiredEnvVar } from "../env/types/types";
2
2
  /**
3
- * Create a sync adapter for the env tool, consumed by @buoy-gg/external-sync's
4
- * `useExternalSync` (structurally matches its ToolSyncAdapter interface so
5
- * this package doesn't need a dependency on it).
6
- *
7
- * Env vars are baked into the bundle, so the snapshot is static — it's sent
8
- * once when a dashboard starts watching. Pass the same `requiredEnvVars`
9
- * config you give FloatingDevTools so the dashboard validates against it.
3
+ * Called by `createEnvTool`. An app that declares its variables on the tool
4
+ * (`apps={[createEnvTool({ requiredEnvVars })]}`) rather than on
5
+ * FloatingDevTools used to sync an empty list, so the desktop panel checked
6
+ * nothing and showed no required variables.
10
7
  */
8
+ export declare function setToolRequiredEnvVars(vars: RequiredEnvVar[]): void;
11
9
  export declare function createEnvSyncAdapter(requiredEnvVars?: RequiredEnvVar[]): {
12
10
  version: number;
13
11
  getSnapshot: () => {
@@ -0,0 +1 @@
1
+ "use client";var oe=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var ke=Object.prototype.hasOwnProperty;var Ie=(e,a)=>{for(var r in a)oe(e,r,{get:a[r],enumerable:true})},ie=(e,a,r,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of Ve(a))!ke.call(e,t)&&t!==r&&oe(e,t,{get:()=>a[t],enumerable:!(n=Te(a,t))||n.enumerable});return e},Ee=(e,a,r)=>(ie(e,a,"default"),r&&ie(r,a,"default"));typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{EnvIcon as Le}from"@buoy-gg/floating-tools-core/web";import{JsModal as Ae,devToolsStorageKeys as se,ModalHeader as M,HeaderSearchButton as qe,displayValue as De,buoyColors as j,night as K,windowDragProps as _e,ToolEmptyState as Re,resolveListEmptyState as Be,monoFont as le}from"@buoy-gg/shared-ui/web";import{useCallback as Me,useState as Y,useRef as je,useEffect as ce,useMemo as P}from"react";var de={};Ie(de,{AccessibilityInfo:()=>Fe,ActivityIndicator:()=>Mt,Alert:()=>Wt,Animated:()=>Oe,AppRegistry:()=>He,AppState:()=>$e,Appearance:()=>ze,BackHandler:()=>Ke,Button:()=>jt,CheckBox:()=>lt,Clipboard:()=>Ge,DeviceEventEmitter:()=>Tt,Dimensions:()=>Ue,Easing:()=>Je,FlatList:()=>ct,I18nManager:()=>Ye,Image:()=>dt,ImageBackground:()=>ut,InteractionManager:()=>Qe,Keyboard:()=>Xe,KeyboardAvoidingView:()=>pt,LayoutAnimation:()=>Ze,Linking:()=>et,LogBox:()=>St,Modal:()=>Rt,NativeEventEmitter:()=>tt,NativeModules:()=>Ne,PanResponder:()=>rt,Picker:()=>yt,PixelRatio:()=>at,Platform:()=>nt,Pressable:()=>_t,ProgressBar:()=>ht,RefreshControl:()=>bt,SafeAreaView:()=>gt,ScrollView:()=>ue,SectionList:()=>ft,Share:()=>ot,StatusBar:()=>mt,StyleSheet:()=>W,Switch:()=>Bt,Text:()=>y,TextInput:()=>At,Touchable:()=>vt,TouchableHighlight:()=>qt,TouchableNativeFeedback:()=>xt,TouchableOpacity:()=>G,TouchableWithoutFeedback:()=>Dt,UIManager:()=>it,Vibration:()=>st,View:()=>p,VirtualizedList:()=>Ct,YellowBox:()=>wt,findNodeHandle:()=>Pt,unstable_createElement:()=>We,useColorScheme:()=>Vt,useLocaleContext:()=>kt,useWindowDimensions:()=>It});Ee(de,Pe);import*as Pe from"react-native-web";import{unstable_createElement as We,NativeModules as Ne,AccessibilityInfo as Fe,Animated as Oe,Appearance as ze,AppRegistry as He,AppState as $e,BackHandler as Ke,Clipboard as Ge,Dimensions as Ue,Easing as Je,I18nManager as Ye,Keyboard as Xe,InteractionManager as Qe,LayoutAnimation as Ze,Linking as et,NativeEventEmitter as tt,PanResponder as rt,PixelRatio as at,Platform as nt,Share as ot,StyleSheet as W,UIManager as it,Vibration as st,CheckBox as lt,FlatList as ct,Image as dt,ImageBackground as ut,KeyboardAvoidingView as pt,Picker as yt,ProgressBar as ht,RefreshControl as bt,SafeAreaView as gt,SectionList as ft,StatusBar as mt,Touchable as vt,TouchableNativeFeedback as xt,VirtualizedList as Ct,YellowBox as wt,LogBox as St,DeviceEventEmitter as Tt,useColorScheme as Vt,useLocaleContext as kt,useWindowDimensions as It}from"react-native-web";import*as g from"react-native-web";import{createElement as Et,forwardRef as Lt}from"react";function x(e){let a=Lt((n,t)=>{let{accessibilityState:o,accessibilityValue:s,...i}=n;for(let d of["busy","checked","disabled","expanded","selected"])o?.[d]!==void 0&&i[`aria-${d}`]===void 0&&(i[`aria-${d}`]=o[d]);for(let[d,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[d]!==void 0&&i[`aria-${c}`]===void 0&&(i[`aria-${c}`]=s[d]);return Et(e,{...i,ref:t})}),r=e.State;return r&&Object.assign(a,{State:r}),a.displayName=e.displayName??e.name??"NativeWebView",a}var p=x(g.View),y=x(g.Text),At=x(g.TextInput),G=x(g.TouchableOpacity),qt=x(g.TouchableHighlight),Dt=x(g.TouchableWithoutFeedback),_t=x(g.Pressable),ue=x(g.ScrollView),Rt=x(g.Modal),Bt=x(g.Switch),Mt=x(g.ActivityIndicator),jt=x(g.Button),Pt=g.findNodeHandle,Wt={alert(e,a,r,n){if(typeof document>"u")return;let t=document.createElement("dialog");t.dataset.buoyRoot="",t.setAttribute("aria-label",e),t.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let o=document.createElement("h2");if(o.textContent=e,o.style.cssText="font-size:18px;margin:0 0 12px",t.appendChild(o),a){let c=document.createElement("p");c.textContent=a,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",t.appendChild(c)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let i=r?.length?r:[{text:"OK"}],d=()=>{t.close?.(),t.remove()};for(let c of i){let l=document.createElement("button");l.type="button",l.textContent=c.text??"OK",l.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,l.onclick=()=>{d(),c.onPress?.()},s.appendChild(l)}t.addEventListener("cancel",c=>{c.preventDefault(),n?.cancelable!==false&&(d(),n?.onDismiss?.())}),t.appendChild(s),document.body.appendChild(t),t.showModal?t.showModal():t.setAttribute("open","")}};import{CompactRow as Nt,night as T,monoFont as pe}from"@buoy-gg/shared-ui/web";import{jsx as V,jsxs as q}from"react/jsx-runtime";function Ft({stats:e,healthPercentage:a,healthStatus:r,healthColor:n,activeFilter:t="all",onFilterChange:o}){let s=e.wrongValueCount+e.wrongTypeCount;return q(p,{style:u.container,children:[V(Nt,{statusDotColor:n,statusLabel:"System",statusSublabel:r.toLowerCase(),primaryText:"Environment Configuration",secondaryText:`${a}% healthy`,testID:"buoy-env-health",statusSublabelTestID:"buoy-env-health-status",accessibilityLabel:`Environment configuration ${r.toLowerCase()}, ${a}% healthy`,customBadge:V(p,{style:[u.percentBadge,{borderColor:n+"40",backgroundColor:n+"10"}],children:q(y,{style:[u.percentText,{color:n}],testID:"buoy-env-health-percent",children:[a,"%"]})})}),q(p,{style:u.statsGrid,children:[q(G,{style:[u.statCard,t==="all"&&u.statCardActive],onPress:()=>o?.("all"),activeOpacity:.8,testID:"buoy-env-filter-all",accessibilityRole:"button",accessibilityLabel:"Show all variables",accessibilityState:{selected:t==="all"},children:[V(y,{style:[u.statValue,t==="all"&&u.statValueActive],testID:"buoy-env-filter-all-count",children:e.requiredCount+e.optionalCount}),V(y,{style:[u.statLabel,t==="all"&&u.statLabelActive],children:"ALL"})]}),q(G,{style:[u.statCard,t==="missing"&&u.statCardActive],onPress:()=>o?.("missing"),activeOpacity:.8,testID:"buoy-env-filter-missing",accessibilityRole:"button",accessibilityLabel:"Show missing variables",accessibilityState:{selected:t==="missing"},children:[V(y,{style:[u.statValue,t==="missing"&&u.statValueActive],testID:"buoy-env-filter-missing-count",children:e.missingCount}),V(y,{style:[u.statLabel,t==="missing"&&u.statLabelActive],children:"MISSING"})]}),q(G,{style:[u.statCard,t==="issues"&&u.statCardActive],onPress:()=>o?.("issues"),activeOpacity:.8,testID:"buoy-env-filter-issues",accessibilityRole:"button",accessibilityLabel:"Show variables with issues",accessibilityState:{selected:t==="issues"},children:[V(y,{style:[u.statValue,t==="issues"&&u.statValueActive],testID:"buoy-env-filter-issues-count",children:s}),V(y,{style:[u.statLabel,t==="issues"&&u.statLabelActive],children:"ISSUES"})]})]})]})}var u=W.create({container:{gap:8},statsGrid:{flexDirection:"row",gap:8,paddingHorizontal:4},statCard:{flex:1,backgroundColor:T.color.surface,borderRadius:10,borderWidth:1,borderColor:T.color.border,padding:12,alignItems:"center",justifyContent:"center",minHeight:64},statCardActive:{borderColor:T.color.accentBorderStrong,backgroundColor:T.color.accentSoft},statValue:{fontSize:22,fontWeight:"700",fontFamily:pe,lineHeight:26,color:T.color.text},statValueActive:{color:T.color.accent},statLabel:{fontSize:9,color:T.color.textTertiary,marginTop:4,textTransform:"uppercase",letterSpacing:.5,fontWeight:"600"},statLabelActive:{color:T.color.accent},percentBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:6,borderWidth:1},percentText:{fontSize:14,fontWeight:"700",fontFamily:pe}});import{useMemo as ye}from"react";var he=null;function Ot(e){he=e}function be(){return he}function zt({envFilter:e=()=>true}={}){let a=be()??(typeof process>"u"?{}:process.env),r=ye(()=>n=>{let t=a[n];if(t===void 0)return null;try{if(t.startsWith("{")||t.startsWith("["))return JSON.parse(t);if(t.toLowerCase()==="true")return true;if(t.toLowerCase()==="false")return false;if(/^\d+$/.test(t)){let o=parseInt(t,10);return isNaN(o)?t:o}if(/^\d*\.\d+$/.test(t)){let o=parseFloat(t);return isNaN(o)?t:o}return t}catch{return t}},[a]);return ye(()=>Object.keys(a).filter(n=>{let t=a[n];return e(n,t)}).map(n=>({key:n,data:r(n)})),[e,r,a])}function X(e){let a=typeof e;if(a==="boolean")return"boolean";if(a==="number")return"number";if(Array.isArray(e))return"array";if(a==="object"&&e!==null)return"object";if(a==="string"){let r=e;if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{let t=JSON.parse(r);return Array.isArray(t)?"array":"object"}catch{return"string"}let n=r.toLowerCase();return n==="true"||n==="false"||n==="enabled"||n==="disabled"||n==="yes"||n==="no"||n==="on"||n==="off"?"boolean":!isNaN(Number(r))&&r.trim()!==""?"number":r.startsWith("http://")||r.startsWith("https://")?"url":r.includes(",")?"array":"string"}return"unknown"}var Ht=class{constructor(e){this.key=e}exists(){return this.key}withValue(e){return this.expectedValue=e,delete this.expectedType,this}withType(e){return this.expectedType=e,delete this.expectedValue,this}withDescription(e){return this.description=e,this}build(){return this.expectedValue!==void 0?this.description?{key:this.key,expectedValue:this.expectedValue,description:this.description}:{key:this.key,expectedValue:this.expectedValue}:this.expectedType!==void 0?this.description?{key:this.key,expectedType:this.expectedType,description:this.description}:{key:this.key,expectedType:this.expectedType}:this.key}};function $t(e){return new Ht(e)}function Kt(e){return e}var ge=(e,a)=>{let r=[],n=[],t=new Set;return a?.forEach(o=>{let s=typeof o=="string"?o:o.key,i=typeof o=="object"&&"expectedValue"in o?o.expectedValue:void 0,d=typeof o=="object"&&"expectedType"in o?o.expectedType:void 0,c=typeof o=="object"&&"description"in o?o.description:void 0;t.add(s);let l=e[s],I=l!==void 0,w;if(!I)w="required_missing";else if(i){let E=false;i==="sk_*"?E=l.startsWith("sk_"):i==="production or development"?E=l==="production"||l==="development":E=l===i,w=E?"required_present":"required_wrong_value"}else d&&X(l).toLowerCase()!==d.toLowerCase()?w="required_wrong_type":w="required_present";r.push({key:s,value:l,expectedValue:i,expectedType:d,description:c,status:w,category:"required"})}),Object.entries(e).forEach(([o,s])=>{t.has(o)||n.push({key:o,value:s,status:"optional_present",category:"optional"})}),r.sort((o,s)=>{let i={required_missing:0,required_wrong_value:1,required_wrong_type:2,required_present:3,optional_present:4};return i[o.status]!==i[s.status]?i[o.status]-i[s.status]:o.key.localeCompare(s.key)}),n.sort((o,s)=>o.key.localeCompare(s.key)),{requiredVars:r,optionalVars:n}},fe=(e,a,r)=>{let n=Object.keys(r).length,t=e.length,o=e.filter(l=>l.status==="required_missing").length,s=e.filter(l=>l.status==="required_wrong_value").length,i=e.filter(l=>l.status==="required_wrong_type").length,d=e.filter(l=>l.status==="required_present").length,c=a.length;return{totalCount:n,requiredCount:t,missingCount:o,wrongValueCount:s,wrongTypeCount:i,presentRequiredCount:d,optionalCount:c}};import{useCallback as Gt,useState as Ut}from"react";import{CompactRow as Jt,TypeBadge as Q,buoyColors as D,night as Z,monoFont as ee}from"@buoy-gg/shared-ui/web";import{Fragment as Yt,jsx as C,jsxs as A}from"react/jsx-runtime";var Xt=(e,a)=>{switch(e){case"required_present":return{label:"Valid",color:D.success,sublabel:"Required"};case"required_missing":return{label:"Missing",color:D.error,sublabel:"Required"};case"required_wrong_value":return{label:"Wrong",color:D.warning,sublabel:"Invalid value"};case"required_wrong_type":return{label:"Type Error",color:D.info,sublabel:"Wrong type"};case"optional_present":return{label:"Set",color:D.textSecondary,sublabel:"Optional"}}};var Qt=e=>e==null?"undefined":typeof e=="string"?e:String(e);function Zt({envVar:e,isExpanded:a,onPress:r}){let n=Xt(e.status,e.expectedType),t=e.value!==void 0&&e.value!==null,o=e.key.split("_").map(d=>d.toLowerCase()).join(" \u203A "),s=`buoy-env-row-${e.key}`,i=A(p,{style:h.expandedContainer,children:[A(p,{style:h.expandedRow,children:[C(y,{style:h.expandedLabel,children:"Value:"}),C(y,{style:h.expandedValue,numberOfLines:3,testID:`${s}-value`,children:Qt(e.value)||"undefined"})]}),e.status==="required_wrong_type"&&e.expectedType&&A(Yt,{children:[A(p,{style:h.expandedRow,children:[C(y,{style:h.expandedLabel,children:"Type:"}),C(Q,{type:X(e.value),testID:`${s}-actual-type`})]}),A(p,{style:h.expandedRow,children:[C(y,{style:h.expandedLabel,children:"Expected:"}),C(Q,{type:e.expectedType,testID:`${s}-expected-type`})]})]}),e.status==="required_wrong_value"&&e.expectedValue&&A(p,{style:h.expandedRow,children:[C(y,{style:h.expandedLabel,children:"Expected:"}),C(y,{style:h.expandedExpected,testID:`${s}-expected-value`,children:String(e.expectedValue)})]}),e.description&&A(p,{style:h.expandedRow,children:[C(y,{style:h.expandedLabel,children:"Info:"}),C(y,{style:h.expandedDescription,testID:`${s}-description`,children:e.description})]})]});return C(Jt,{statusDotColor:n.color,statusLabel:n.label,statusSublabel:n.sublabel,primaryText:o,secondaryText:void 0,expandedContent:i,isExpanded:a,expandedGlowColor:n.color,customBadge:e.expectedType?C(Q,{type:e.expectedType,testID:`${s}-type-badge`}):void 0,showChevron:true,onPress:r?()=>r(e):void 0,testID:s,statusTestID:`${s}-status`,statusSublabelTestID:`${s}-category`,accessibilityLabel:`${e.key}, ${n.label}, ${n.sublabel}`})}var h=W.create({expandedContainer:{gap:6},expandedRow:{flexDirection:"row",alignItems:"center",gap:8},expandedLabel:{fontSize:10,color:Z.color.textTertiary,fontWeight:"600",minWidth:60,fontFamily:ee},expandedValue:{fontSize:11,color:Z.color.textSecondary,fontFamily:ee,flex:1},expandedExpected:{fontSize:11,color:D.warning,fontFamily:ee,flex:1},expandedDescription:{fontSize:11,color:Z.color.textSecondary,flex:1}});import{SectionHeader as _,night as N,monoFont as er}from"@buoy-gg/shared-ui/web";import{jsx as k,jsxs as U}from"react/jsx-runtime";function tr({title:e,count:a,vars:r,emptyMessage:n}){let[t,o]=Ut(null),s=Gt(i=>{o(d=>d===i.key?null:i.key)},[]);return r.length===0&&e==="Required Variables"?U(p,{style:F.sectionContainer,children:[U(_,{children:[k(_.Title,{children:e}),k(_.Badge,{count:0,color:N.color.accent})]}),k(p,{style:F.emptySection,children:k(y,{style:F.emptySectionText,children:n})})]}):r.length===0?null:U(p,{style:F.sectionContainer,children:[e!==""&&U(_,{children:[k(_.Title,{children:e}),k(_.Badge,{count:a,color:N.color.accent})]}),k(p,{style:F.sectionContent,children:r.map(i=>k(Zt,{envVar:i,isExpanded:t===i.key,onPress:s},i.key))})]})}var F=W.create({sectionContainer:{gap:8},sectionContent:{},emptySection:{padding:20,backgroundColor:N.color.accent+"08",borderRadius:8,borderWidth:1,borderColor:N.color.accent+"20",alignItems:"center"},emptySectionText:{color:N.color.accent,fontSize:11,textAlign:"center",fontFamily:er,opacity:.8,letterSpacing:.5}});import{jsx as b,jsxs as O}from"react/jsx-runtime";function te({visible:e,onClose:a,requiredEnvVars:r,onBack:n,onMinimize:t,enableSharedModalDimensions:o=false,inline:s=false}){let[i,d]=Y("all"),[c,l]=Y(false),[I,w]=Y(""),E=je(null),xe=Me(f=>{},[]);ce(()=>{c&&E.current&&E.current.focus()},[c]),ce(()=>{w(""),l(false)},[i]);let re=zt(),z=P(()=>{let f={};return re.forEach(({key:m,data:v})=>{v!=null&&(f[m]=typeof v=="string"?v:De(v))}),f},[re]),{requiredVars:H,optionalVars:R}=P(()=>ge(z,r),[z,r]),$=P(()=>r===void 0?{totalCount:0,requiredCount:0,optionalCount:0,presentRequiredCount:0,missingCount:0,wrongValueCount:0,wrongTypeCount:0}:fe(H,R,z),[r,H,R,z]),B=P(()=>[...H,...R].sort((f,m)=>{let v={required_missing:1,required_wrong_type:2,required_wrong_value:3,required_present:4,optional_present:5};return(v[f.status]||999)-(v[m.status]||999)}),[H,R]),J=P(()=>{let f=[];switch(i){case"all":f=B;break;case"missing":f=B.filter(m=>m.status==="required_missing");break;case"issues":f=B.filter(m=>m.status==="required_wrong_type"||m.status==="required_wrong_value");break}if(I){let m=I.toLowerCase();f=f.filter(v=>v.key.toLowerCase().includes(m)||v.description?.toLowerCase().includes(m)||typeof v.value=="string"&&v.value.toLowerCase().includes(m))}return f},[B,R,i,I]),L=$.requiredCount>0?Math.round($.presentRequiredCount/$.requiredCount*100):100,Ce=L===100?"HEALTHY":L>=75?"WARNING":L>=50?"ERROR":"CRITICAL",we=L===100?j.success:L>=75?j.warning:L>=50?j.error:j.error;if(!e)return null;let Se=o?se.modal.root():se.env.modal(),ae=O(M,{children:[n&&b(M.Navigation,{onBack:n}),b(M.Content,{title:c?"":"Environment Variables",noMargin:c,children:c&&b(M.Search,{value:I,onChangeText:w,onCancel:()=>{l(false),w("")},placeholder:"Search env keys...",accessibilityLabel:"Search env keys",testID:"buoy-env-search",containerTestID:"buoy-env-search-field",clearTestID:"buoy-env-search-clear"})}),b(M.Actions,{children:!c&&b(qe,{onPress:()=>l(true),testID:"buoy-env-search-open",accessibilityLabel:"Search env keys"})})]}),ne=O(ue,{style:S.scrollContainer,contentContainerStyle:S.contentContainer,showsVerticalScrollIndicator:false,testID:"buoy-env-scroll",children:[b(Ft,{stats:$,healthPercentage:L,healthStatus:Ce,healthColor:we,activeFilter:i,onFilterChange:d}),J.length>0?O(p,{style:S.varsSection,children:[O(p,{style:S.sectionHeader,children:[b(y,{style:S.sectionTitle,testID:"buoy-env-section-title",children:i==="all"?"ALL VARIABLES":i==="missing"?"MISSING VARIABLES":"ISSUES TO FIX"}),b(p,{style:S.countBadge,children:b(y,{style:S.countText,testID:"buoy-env-section-count",children:J.length})})]}),b(tr,{title:"",count:0,vars:J,emptyMessage:""})]}):b(Re,{testID:"buoy-env-empty",...Be({subject:"variables",verb:"declared",search:I,total:B.length,waiting:{otto:"keys",title:"No variables",message:`No ${i==="all"?"":i} variables found`}})})]});return s?O(p,{style:S.inlineRoot,children:[b(p,{style:S.inlineHeader,..._e,children:ae}),ne]}):b(Ae,{visible:e,onClose:a,onMinimize:t,persistenceKey:Se,header:{customContent:ae,showToggleButton:true},onModeChange:xe,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},children:ne})}function rr({requiredEnvVars:e}){return b(te,{inline:true,visible:true,requiredEnvVars:e,onClose:()=>{}})}var S=W.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:j.border,backgroundColor:"transparent"},scrollContainer:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},varsSection:{marginTop:16},sectionHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8,paddingHorizontal:8},sectionTitle:{fontSize:10,fontWeight:"700",color:K.color.textTertiary,letterSpacing:1.2,fontFamily:le},countBadge:{backgroundColor:K.color.accent+"15",paddingHorizontal:8,paddingVertical:2,borderRadius:9999,borderWidth:1,borderColor:K.color.accent+"40"},countText:{fontSize:10,fontWeight:"500",color:K.color.accent,fontFamily:le}});function ar(){let e={};for(let[a,r]of Object.entries(be()??(typeof process>"u"?{}:process.env)))typeof r=="string"&&(e[a]=r);return e}var me=[];function nr(e){me=e}function or(e=[]){return{version:1,getSnapshot:()=>({env:ar(),requiredEnvVars:e.length>0?e:me}),subscribe:()=>()=>{}}}import{createToolFactory as ir,defineToolPreset as sr}from"@buoy-gg/shared-ui/web";import{jsx as lr}from"react/jsx-runtime";var ve=sr({id:"env",name:"ENV",description:"Environment variables debugger",slot:"both",icon:({size:e})=>lr(Le,{size:e}),component:te,props:{requiredEnvVars:[],enableSharedModalDimensions:true}}),cr=ir(ve,e=>(nr(e.requiredEnvVars||[]),{requiredEnvVars:e.requiredEnvVars||[],enableSharedModalDimensions:e.enableSharedModalDimensions??true}));export{rr as EnvToolView,te as EnvVarsModal,fe as calculateStats,or as createEnvSyncAdapter,cr as createEnvTool,Kt as createEnvVarConfig,ve as envToolPreset,$t as envVar,X as getEnvVarType,ge as processEnvVars,Ot as setRemoteEnv};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/env",
3
- "version": "7.0.40",
3
+ "version": "7.0.42",
4
4
  "description": "Environment variable inspector for React Native with runtime-visible values, required-variable checks, and type validation.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -10,28 +10,38 @@
10
10
  "exports": {
11
11
  ".": {
12
12
  "react-native": "./lib/module/index.js",
13
+ "browser": {
14
+ "types": "./lib/typescript/index.d.ts",
15
+ "default": "./lib/web/index.mjs"
16
+ },
13
17
  "import": {
14
- "default": "./lib/module/index.js",
15
- "types": "./lib/typescript/index.d.ts"
18
+ "types": "./lib/typescript/index.d.ts",
19
+ "default": "./lib/module/index.js"
16
20
  },
17
21
  "require": {
18
- "default": "./lib/commonjs/index.js",
19
- "types": "./lib/typescript/index.d.ts"
22
+ "types": "./lib/typescript/index.d.ts",
23
+ "default": "./lib/commonjs/index.js"
20
24
  }
21
25
  },
22
- "./package.json": "./package.json"
26
+ "./package.json": "./package.json",
27
+ "./web": {
28
+ "types": "./lib/typescript/index.d.ts",
29
+ "default": "./lib/web/index.mjs"
30
+ }
23
31
  },
24
32
  "files": [
25
33
  "lib"
26
34
  ],
27
35
  "sideEffects": false,
28
36
  "dependencies": {
29
- "@buoy-gg/floating-tools-core": "^7.0.40",
30
- "@buoy-gg/shared-ui": "^7.0.40"
37
+ "@buoy-gg/floating-tools-core": "^7.0.42",
38
+ "@buoy-gg/shared-ui": "^7.0.42"
31
39
  },
32
40
  "peerDependencies": {
33
41
  "react": "*",
34
- "react-native": "*"
42
+ "react-native": "*",
43
+ "react-native-web": "^0.21.0",
44
+ "react-dom": ">=18"
35
45
  },
36
46
  "react-native-builder-bob": {
37
47
  "source": "src",
@@ -86,10 +96,22 @@
86
96
  "config",
87
97
  "app-env"
88
98
  ],
99
+ "peerDependenciesMeta": {
100
+ "react-native": {
101
+ "optional": true
102
+ },
103
+ "react-native-web": {
104
+ "optional": true
105
+ },
106
+ "react-dom": {
107
+ "optional": true
108
+ }
109
+ },
89
110
  "scripts": {
90
- "build": "bob build",
111
+ "build": "bob build && pnpm run build:web",
91
112
  "typecheck": "tsc --noEmit",
92
113
  "clean": "rimraf lib",
93
- "test": "pnpm run typecheck"
114
+ "test": "pnpm run typecheck",
115
+ "build:web": "node ../../scripts/build-web.mjs env"
94
116
  }
95
117
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnvStatsOverview.d.ts","sourceRoot":"","sources":["../../../../src/env/components/EnvStatsOverview.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzD,UAAU,qBAAqB;IAC7B,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;QACtB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;QACxB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAoB,EACpB,cAAc,GACf,EAAE,qBAAqB,+BAoIvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnvVarRow.d.ts","sourceRoot":"","sources":["../../../../src/env/components/EnvVarRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,UAAU,cAAc;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAkDD,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,cAAc,+BAmGxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnvVarSection.d.ts","sourceRoot":"","sources":["../../../../src/env/components/EnvVarSection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,IAAI,EACJ,YAAY,GACb,EAAE,kBAAkB,sCA2CpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnvVarsModal.d.ts","sourceRoot":"","sources":["../../../../src/env/components/EnvVarsModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAc,MAAM,UAAU,CAAC;AAUtD,UAAU,iBAAiB;IACzB,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,qDAAqD;IACrD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qFAAqF;IACrF,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,OAAO,EACP,eAAe,EACf,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,MAAc,GACf,EAAE,iBAAiB,sCAyQnB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,eAAe,GAChB,EAAE;IACD,eAAe,EAAE,cAAc,EAAE,CAAC;CACnC,+BASA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDynamicEnv.d.ts","sourceRoot":"","sources":["../../../../src/env/hooks/useDynamicEnv.ts"],"names":[],"mappings":"AAGA,UAAU,oBAAoB;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;CACjE;AAED,UAAU,SAAS;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAsB,GACvB,GAAE,oBAAyB,GAAG,SAAS,EAAE,CA6DzC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/env/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}