@squide/env-vars 1.4.19 → 1.4.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @squide/env-vars
2
2
 
3
+ ## 1.4.20
4
+
5
+ ### Patch Changes
6
+
7
+ - [#575](https://github.com/workleap/wl-squide/pull/575) [`9c91bd4`](https://github.com/workleap/wl-squide/commit/9c91bd47c5357a2b15b1fb0e984f81687a3b8b53) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bump dependencies
8
+
9
+ - Updated dependencies [[`9c91bd4`](https://github.com/workleap/wl-squide/commit/9c91bd47c5357a2b15b1fb0e984f81687a3b8b53)]:
10
+ - @squide/core@6.1.15
11
+
3
12
  ## 1.4.19
4
13
 
5
14
  ### Patch Changes
@@ -1,11 +1,8 @@
1
1
  import { Plugin } from "@squide/core";
2
2
  import { EnvironmentVariablesRegistry } from "./EnvironmentVariablesRegistry.js";
3
3
 
4
- ;// CONCATENATED MODULE: external "@squide/core"
5
4
 
6
- ;// CONCATENATED MODULE: external "./EnvironmentVariablesRegistry.js"
7
5
 
8
- ;// CONCATENATED MODULE: ./src/EnvironmentVariablesPlugin.ts
9
6
 
10
7
 
11
8
  const EnvironmentVariablesPluginName = "env-vars-plugin";
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariablesPlugin.js","sources":["../src/EnvironmentVariablesPlugin.ts"],"sourcesContent":["import { Plugin, type Runtime } from \"@squide/core\";\nimport { EnvironmentVariablesRegistry, type EnvironmentVariableKey, type EnvironmentVariables } from \"./EnvironmentVariablesRegistry.ts\";\n\nexport const EnvironmentVariablesPluginName = \"env-vars-plugin\";\n\nexport interface EnvironmentVariablesPluginOptions {\n variables?: Partial<EnvironmentVariables>;\n}\n\nexport class EnvironmentVariablesPlugin extends Plugin {\n readonly #environmentVariablesRegistry = new EnvironmentVariablesRegistry();\n\n constructor(runtime: Runtime, options: EnvironmentVariablesPluginOptions = {}) {\n super(EnvironmentVariablesPluginName, runtime);\n\n const {\n variables\n } = options;\n\n if (variables) {\n this.#environmentVariablesRegistry.addVariables(variables);\n }\n }\n\n registerVariable<T extends EnvironmentVariableKey>(key: T, value: EnvironmentVariables[T]) {\n this.#environmentVariablesRegistry.add(key, value);\n\n this._runtime.logger.debug(`[squide] An environment variable for key \"${key}\" has been registered with the value \"${value}\".`);\n }\n\n registerVariables(variables: Partial<EnvironmentVariables>) {\n this.#environmentVariablesRegistry.addVariables(variables);\n\n this._runtime.logger\n .withText(\"[squide] The following environment variables has been registered:\")\n .withObject(variables)\n .debug();\n }\n\n getVariable<T extends EnvironmentVariableKey>(key: T) {\n return this.#environmentVariablesRegistry.getVariable(key);\n }\n\n getVariables() {\n return this.#environmentVariablesRegistry.getVariables();\n }\n}\n\nexport function getEnvironmentVariablesPlugin(runtime: Runtime) {\n const plugin = runtime.getPlugin(EnvironmentVariablesPluginName, {\n throwOnNotFound: false\n }) as EnvironmentVariablesPlugin;\n\n if (!plugin) {\n throw new Error(\"[squide] The getEnvironmentVariablesPlugin function is called but no EnvironmentVariablesPlugin instance has been registered with the runtime. Did you provide a EnvironmentVariablesPlugin instance to the runtime instance?\");\n }\n\n return plugin;\n}\n"],"names":["Plugin","EnvironmentVariablesRegistry","EnvironmentVariablesPluginName","EnvironmentVariablesPlugin","runtime","options","variables","key","value","getEnvironmentVariablesPlugin","plugin","Error"],"mappings":";;;;;;;;AAAoD;AACqF;AAElI,MAAME,iCAAiC,kBAAkB;AAMzD,MAAMC,mCAAmCH,MAAMA;IACzC,6BAA6B,GAAG,IAAIC,4BAA4BA,GAAG;IAE5E,YAAYG,OAAgB,EAAEC,UAA6C,CAAC,CAAC,CAAE;QAC3E,KAAK,CAACH,gCAAgCE;QAEtC,MAAM,EACFE,SAAS,EACZ,GAAGD;QAEJ,IAAIC,WAAW;YACX,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAACA;QACpD;IACJ;IAEA,iBAAmDC,GAAM,EAAEC,KAA8B,EAAE;QACvF,IAAI,CAAC,6BAA6B,CAAC,GAAG,CAACD,KAAKC;QAE5C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,0CAA0C,EAAED,IAAI,sCAAsC,EAAEC,MAAM,EAAE,CAAC;IACjI;IAEA,kBAAkBF,SAAwC,EAAE;QACxD,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAACA;QAEhD,IAAI,CAAC,QAAQ,CAAC,MAAM,CACf,QAAQ,CAAC,qEACT,UAAU,CAACA,WACX,KAAK;IACd;IAEA,YAA8CC,GAAM,EAAE;QAClD,OAAO,IAAI,CAAC,6BAA6B,CAAC,WAAW,CAACA;IAC1D;IAEA,eAAe;QACX,OAAO,IAAI,CAAC,6BAA6B,CAAC,YAAY;IAC1D;AACJ;AAEO,SAASE,8BAA8BL,OAAgB;IAC1D,MAAMM,SAASN,QAAQ,SAAS,CAACF,gCAAgC;QAC7D,iBAAiB;IACrB;IAEA,IAAI,CAACQ,QAAQ;QACT,MAAM,IAAIC,MAAM;IACpB;IAEA,OAAOD;AACX"}
1
+ {"version":3,"file":"EnvironmentVariablesPlugin.js","sources":["../src/EnvironmentVariablesPlugin.ts"],"sourcesContent":["import { Plugin, type Runtime } from \"@squide/core\";\nimport { EnvironmentVariablesRegistry, type EnvironmentVariableKey, type EnvironmentVariables } from \"./EnvironmentVariablesRegistry.ts\";\n\nexport const EnvironmentVariablesPluginName = \"env-vars-plugin\";\n\nexport interface EnvironmentVariablesPluginOptions {\n variables?: Partial<EnvironmentVariables>;\n}\n\nexport class EnvironmentVariablesPlugin extends Plugin {\n readonly #environmentVariablesRegistry = new EnvironmentVariablesRegistry();\n\n constructor(runtime: Runtime, options: EnvironmentVariablesPluginOptions = {}) {\n super(EnvironmentVariablesPluginName, runtime);\n\n const {\n variables\n } = options;\n\n if (variables) {\n this.#environmentVariablesRegistry.addVariables(variables);\n }\n }\n\n registerVariable<T extends EnvironmentVariableKey>(key: T, value: EnvironmentVariables[T]) {\n this.#environmentVariablesRegistry.add(key, value);\n\n this._runtime.logger.debug(`[squide] An environment variable for key \"${key}\" has been registered with the value \"${value}\".`);\n }\n\n registerVariables(variables: Partial<EnvironmentVariables>) {\n this.#environmentVariablesRegistry.addVariables(variables);\n\n this._runtime.logger\n .withText(\"[squide] The following environment variables has been registered:\")\n .withObject(variables)\n .debug();\n }\n\n getVariable<T extends EnvironmentVariableKey>(key: T) {\n return this.#environmentVariablesRegistry.getVariable(key);\n }\n\n getVariables() {\n return this.#environmentVariablesRegistry.getVariables();\n }\n}\n\nexport function getEnvironmentVariablesPlugin(runtime: Runtime) {\n const plugin = runtime.getPlugin(EnvironmentVariablesPluginName, {\n throwOnNotFound: false\n }) as EnvironmentVariablesPlugin;\n\n if (!plugin) {\n throw new Error(\"[squide] The getEnvironmentVariablesPlugin function is called but no EnvironmentVariablesPlugin instance has been registered with the runtime. Did you provide a EnvironmentVariablesPlugin instance to the runtime instance?\");\n }\n\n return plugin;\n}\n"],"names":["Plugin","EnvironmentVariablesRegistry","EnvironmentVariablesPluginName","EnvironmentVariablesPlugin","runtime","options","variables","key","value","getEnvironmentVariablesPlugin","plugin","Error"],"mappings":";;;;;AAAoD;AACqF;AAElI,MAAME,8BAA8BA,GAAG,kBAAkB;AAMzD,MAAMC,0BAA0BA,SAASH,MAAMA;IACzC,6BAA6B,GAAG,IAAIC,4BAA4BA,GAAG;IAE5E,YAAYG,OAAgB,EAAEC,UAA6C,CAAC,CAAC,CAAE;QAC3E,KAAK,CAACH,8BAA8BA,EAAEE;QAEtC,MAAM,EACFE,SAAS,EACZ,GAAGD;QAEJ,IAAIC,WAAW;YACX,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAACA;QACpD;IACJ;IAEA,iBAAmDC,GAAM,EAAEC,KAA8B,EAAE;QACvF,IAAI,CAAC,6BAA6B,CAAC,GAAG,CAACD,KAAKC;QAE5C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,0CAA0C,EAAED,IAAI,sCAAsC,EAAEC,MAAM,EAAE,CAAC;IACjI;IAEA,kBAAkBF,SAAwC,EAAE;QACxD,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAACA;QAEhD,IAAI,CAAC,QAAQ,CAAC,MAAM,CACf,QAAQ,CAAC,qEACT,UAAU,CAACA,WACX,KAAK;IACd;IAEA,YAA8CC,GAAM,EAAE;QAClD,OAAO,IAAI,CAAC,6BAA6B,CAAC,WAAW,CAACA;IAC1D;IAEA,eAAe;QACX,OAAO,IAAI,CAAC,6BAA6B,CAAC,YAAY;IAC1D;AACJ;AAEO,SAASE,6BAA6BA,CAACL,OAAgB;IAC1D,MAAMM,SAASN,QAAQ,SAAS,CAACF,8BAA8BA,EAAE;QAC7D,iBAAiB;IACrB;IAEA,IAAI,CAACQ,QAAQ;QACT,MAAM,IAAIC,MAAM;IACpB;IAEA,OAAOD;AACX"}
@@ -1,8 +1,6 @@
1
1
  import memoize, { memoizeClear } from "memoize";
2
2
 
3
- ;// CONCATENATED MODULE: external "memoize"
4
3
 
5
- ;// CONCATENATED MODULE: ./src/EnvironmentVariablesRegistry.ts
6
4
 
7
5
  function typedEntries(obj) {
8
6
  return Object.entries(obj);
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariablesRegistry.js","sources":["../src/EnvironmentVariablesRegistry.ts"],"sourcesContent":["import memoize, { memoizeClear } from \"memoize\";\n\n// The \"EnvironmentVariables\" interface is expected to be extended by the consumer application.\n// This magic is called module augmentation: https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface EnvironmentVariables {}\n\nexport type EnvironmentVariableKey = keyof EnvironmentVariables;\n\nexport function typedEntries<T extends object>(obj: T) {\n return Object.entries(obj) as Array<[keyof T, T[keyof T]]>;\n}\n\nexport class EnvironmentVariablesRegistry {\n readonly #variables = new Map<EnvironmentVariableKey, unknown>();\n\n // Since the \"getVariables\" function is transforming the variables from a Map to an Object, the result of\n // the transformation is memoized to ensure the returned Object is immutable and can be use in React closures.\n readonly #memoizedGetVariables = memoize(() => Object.fromEntries(this.#variables) as unknown as EnvironmentVariables);\n\n add<T extends EnvironmentVariableKey>(key: T, value: EnvironmentVariables[T]) {\n if (this.#variables.has(key)) {\n const existingValue = this.#variables.get(key);\n\n if (existingValue !== value) {\n throw new Error(`[squide] An environment variable with the key \"${key}\" already exist and the new value differs from the existing one. Existing value: \"${existingValue}\" - New Value: \"${value}\"`);\n }\n } else {\n this.#variables.set(key, value);\n\n memoizeClear(this.#memoizedGetVariables);\n }\n }\n\n addVariables(variables: Partial<EnvironmentVariables>) {\n // Do not clear the \"getVariables\" memoize result if there are no variables.\n if (Object.keys(variables).length > 0) {\n for (const [key, value] of typedEntries(variables)) {\n if (value) {\n this.add(key, value);\n }\n }\n\n memoizeClear(this.#memoizedGetVariables);\n }\n }\n\n getVariable<T extends EnvironmentVariableKey>(key: T) {\n const value = this.#variables.get(key);\n\n if (!value) {\n throw new Error(`[squide] No environment variable has been registered for the key \"${key}\".`);\n }\n\n return value as EnvironmentVariables[T];\n }\n\n getVariables() {\n return this.#memoizedGetVariables();\n }\n}\n"],"names":["memoize","memoizeClear","typedEntries","obj","Object","EnvironmentVariablesRegistry","Map","key","value","existingValue","Error","variables"],"mappings":";;;;;AAAgD;AASzC,SAASE,aAA+BC,GAAM;IACjD,OAAOC,OAAO,OAAO,CAACD;AAC1B;AAEO,MAAME;IACA,UAAU,GAAG,IAAIC,MAAuC;IAEjE,yGAAyG;IACzG,8GAA8G;IACrG,qBAAqB,GAAGN,OAAOA,CAAC,IAAMI,OAAO,WAAW,CAAC,IAAI,CAAC,UAAU,GAAsC;IAEvH,IAAsCG,GAAM,EAAEC,KAA8B,EAAE;QAC1E,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAACD,MAAM;YAC1B,MAAME,gBAAgB,IAAI,CAAC,UAAU,CAAC,GAAG,CAACF;YAE1C,IAAIE,kBAAkBD,OAAO;gBACzB,MAAM,IAAIE,MAAM,CAAC,+CAA+C,EAAEH,IAAI,kFAAkF,EAAEE,cAAc,gBAAgB,EAAED,MAAM,CAAC,CAAC;YACtM;QACJ,OAAO;YACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAACD,KAAKC;YAEzBP,YAAYA,CAAC,IAAI,CAAC,qBAAqB;QAC3C;IACJ;IAEA,aAAaU,SAAwC,EAAE;QACnD,4EAA4E;QAC5E,IAAIP,OAAO,IAAI,CAACO,WAAW,MAAM,GAAG,GAAG;YACnC,KAAK,MAAM,CAACJ,KAAKC,MAAM,IAAIN,aAAaS,WAAY;gBAChD,IAAIH,OAAO;oBACP,IAAI,CAAC,GAAG,CAACD,KAAKC;gBAClB;YACJ;YAEAP,YAAYA,CAAC,IAAI,CAAC,qBAAqB;QAC3C;IACJ;IAEA,YAA8CM,GAAM,EAAE;QAClD,MAAMC,QAAQ,IAAI,CAAC,UAAU,CAAC,GAAG,CAACD;QAElC,IAAI,CAACC,OAAO;YACR,MAAM,IAAIE,MAAM,CAAC,kEAAkE,EAAEH,IAAI,EAAE,CAAC;QAChG;QAEA,OAAOC;IACX;IAEA,eAAe;QACX,OAAO,IAAI,CAAC,qBAAqB;IACrC;AACJ"}
1
+ {"version":3,"file":"EnvironmentVariablesRegistry.js","sources":["../src/EnvironmentVariablesRegistry.ts"],"sourcesContent":["import memoize, { memoizeClear } from \"memoize\";\n\n// The \"EnvironmentVariables\" interface is expected to be extended by the consumer application.\n// This magic is called module augmentation: https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface EnvironmentVariables {}\n\nexport type EnvironmentVariableKey = keyof EnvironmentVariables;\n\nexport function typedEntries<T extends object>(obj: T) {\n return Object.entries(obj) as Array<[keyof T, T[keyof T]]>;\n}\n\nexport class EnvironmentVariablesRegistry {\n readonly #variables = new Map<EnvironmentVariableKey, unknown>();\n\n // Since the \"getVariables\" function is transforming the variables from a Map to an Object, the result of\n // the transformation is memoized to ensure the returned Object is immutable and can be use in React closures.\n readonly #memoizedGetVariables = memoize(() => Object.fromEntries(this.#variables) as unknown as EnvironmentVariables);\n\n add<T extends EnvironmentVariableKey>(key: T, value: EnvironmentVariables[T]) {\n if (this.#variables.has(key)) {\n const existingValue = this.#variables.get(key);\n\n if (existingValue !== value) {\n throw new Error(`[squide] An environment variable with the key \"${key}\" already exist and the new value differs from the existing one. Existing value: \"${existingValue}\" - New Value: \"${value}\"`);\n }\n } else {\n this.#variables.set(key, value);\n\n memoizeClear(this.#memoizedGetVariables);\n }\n }\n\n addVariables(variables: Partial<EnvironmentVariables>) {\n // Do not clear the \"getVariables\" memoize result if there are no variables.\n if (Object.keys(variables).length > 0) {\n for (const [key, value] of typedEntries(variables)) {\n if (value) {\n this.add(key, value);\n }\n }\n\n memoizeClear(this.#memoizedGetVariables);\n }\n }\n\n getVariable<T extends EnvironmentVariableKey>(key: T) {\n const value = this.#variables.get(key);\n\n if (!value) {\n throw new Error(`[squide] No environment variable has been registered for the key \"${key}\".`);\n }\n\n return value as EnvironmentVariables[T];\n }\n\n getVariables() {\n return this.#memoizedGetVariables();\n }\n}\n"],"names":["memoize","memoizeClear","typedEntries","obj","Object","EnvironmentVariablesRegistry","Map","key","value","existingValue","Error","variables"],"mappings":";;;AAAgD;AASzC,SAASE,YAAYA,CAAmBC,GAAM;IACjD,OAAOC,OAAO,OAAO,CAACD;AAC1B;AAEO,MAAME,4BAA4BA;IAC5B,UAAU,GAAG,IAAIC,MAAuC;IAEjE,yGAAyG;IACzG,8GAA8G;IACrG,qBAAqB,GAAGN,OAAOA,CAAC,IAAMI,OAAO,WAAW,CAAC,IAAI,CAAC,UAAU,GAAsC;IAEvH,IAAsCG,GAAM,EAAEC,KAA8B,EAAE;QAC1E,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAACD,MAAM;YAC1B,MAAME,gBAAgB,IAAI,CAAC,UAAU,CAAC,GAAG,CAACF;YAE1C,IAAIE,kBAAkBD,OAAO;gBACzB,MAAM,IAAIE,MAAM,CAAC,+CAA+C,EAAEH,IAAI,kFAAkF,EAAEE,cAAc,gBAAgB,EAAED,MAAM,CAAC,CAAC;YACtM;QACJ,OAAO;YACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAACD,KAAKC;YAEzBP,YAAYA,CAAC,IAAI,CAAC,qBAAqB;QAC3C;IACJ;IAEA,aAAaU,SAAwC,EAAE;QACnD,4EAA4E;QAC5E,IAAIP,OAAO,IAAI,CAACO,WAAW,MAAM,GAAG,GAAG;YACnC,KAAK,MAAM,CAACJ,KAAKC,MAAM,IAAIN,YAAYA,CAACS,WAAY;gBAChD,IAAIH,OAAO;oBACP,IAAI,CAAC,GAAG,CAACD,KAAKC;gBAClB;YACJ;YAEAP,YAAYA,CAAC,IAAI,CAAC,qBAAqB;QAC3C;IACJ;IAEA,YAA8CM,GAAM,EAAE;QAClD,MAAMC,QAAQ,IAAI,CAAC,UAAU,CAAC,GAAG,CAACD;QAElC,IAAI,CAACC,OAAO;YACR,MAAM,IAAIE,MAAM,CAAC,kEAAkE,EAAEH,IAAI,EAAE,CAAC;QAChG;QAEA,OAAOC;IACX;IAEA,eAAe;QACX,OAAO,IAAI,CAAC,qBAAqB;IACrC;AACJ"}
package/dist/index.js CHANGED
@@ -1,14 +1,9 @@
1
- import { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin } from "./EnvironmentVariablesPlugin.js";
2
- import { useEnvironmentVariable, useEnvironmentVariables } from "./useEnvironmentVariable.js";
3
1
 
4
- ;// CONCATENATED MODULE: external "./EnvironmentVariablesPlugin.js"
5
2
 
6
- ;// CONCATENATED MODULE: external "./useEnvironmentVariable.js"
7
3
 
8
- ;// CONCATENATED MODULE: ./src/index.ts
9
4
 
10
5
 
11
-
12
- export { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin, useEnvironmentVariable, useEnvironmentVariables };
6
+ export { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin } from "./EnvironmentVariablesPlugin.js";
7
+ export { useEnvironmentVariable, useEnvironmentVariables } from "./useEnvironmentVariable.js";
13
8
 
14
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin, type EnvironmentVariablesPluginOptions } from \"./EnvironmentVariablesPlugin.ts\";\nexport type { EnvironmentVariableKey, EnvironmentVariables } from \"./EnvironmentVariablesRegistry.ts\";\nexport { useEnvironmentVariable, useEnvironmentVariables } from \"./useEnvironmentVariable.ts\";\n\n"],"names":["EnvironmentVariablesPlugin","EnvironmentVariablesPluginName","getEnvironmentVariablesPlugin","useEnvironmentVariable","useEnvironmentVariables"],"mappings":";;;;;;;;AAAoL;AAEtF"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin, type EnvironmentVariablesPluginOptions } from \"./EnvironmentVariablesPlugin.ts\";\nexport type { EnvironmentVariableKey, EnvironmentVariables } from \"./EnvironmentVariablesRegistry.ts\";\nexport { useEnvironmentVariable, useEnvironmentVariables } from \"./useEnvironmentVariable.ts\";\n\n"],"names":["EnvironmentVariablesPlugin","EnvironmentVariablesPluginName","getEnvironmentVariablesPlugin","useEnvironmentVariable","useEnvironmentVariables"],"mappings":";;AAAoL;AAEtF"}
@@ -1,11 +1,8 @@
1
1
  import { useRuntime } from "@squide/core";
2
2
  import { getEnvironmentVariablesPlugin } from "./EnvironmentVariablesPlugin.js";
3
3
 
4
- ;// CONCATENATED MODULE: external "@squide/core"
5
4
 
6
- ;// CONCATENATED MODULE: external "./EnvironmentVariablesPlugin.js"
7
5
 
8
- ;// CONCATENATED MODULE: ./src/useEnvironmentVariable.ts
9
6
 
10
7
 
11
8
  function useEnvironmentVariable(key) {
@@ -1 +1 @@
1
- {"version":3,"file":"useEnvironmentVariable.js","sources":["../src/useEnvironmentVariable.ts"],"sourcesContent":["import { useRuntime } from \"@squide/core\";\nimport { getEnvironmentVariablesPlugin } from \"./EnvironmentVariablesPlugin.ts\";\nimport type { EnvironmentVariableKey } from \"./EnvironmentVariablesRegistry.ts\";\n\nexport function useEnvironmentVariable<T extends EnvironmentVariableKey>(key: T) {\n const runtime = useRuntime();\n const plugin = getEnvironmentVariablesPlugin(runtime);\n\n return plugin.getVariable(key);\n}\n\nexport function useEnvironmentVariables() {\n const runtime = useRuntime();\n const plugin = getEnvironmentVariablesPlugin(runtime);\n\n return plugin.getVariables();\n}\n"],"names":["useRuntime","getEnvironmentVariablesPlugin","useEnvironmentVariable","key","runtime","plugin","useEnvironmentVariables"],"mappings":";;;;;;;;AAA0C;AACsC;AAGzE,SAASE,uBAAyDC,GAAM;IAC3E,MAAMC,UAAUJ,UAAUA;IAC1B,MAAMK,SAASJ,6BAA6BA,CAACG;IAE7C,OAAOC,OAAO,WAAW,CAACF;AAC9B;AAEO,SAASG;IACZ,MAAMF,UAAUJ,UAAUA;IAC1B,MAAMK,SAASJ,6BAA6BA,CAACG;IAE7C,OAAOC,OAAO,YAAY;AAC9B"}
1
+ {"version":3,"file":"useEnvironmentVariable.js","sources":["../src/useEnvironmentVariable.ts"],"sourcesContent":["import { useRuntime } from \"@squide/core\";\nimport { getEnvironmentVariablesPlugin } from \"./EnvironmentVariablesPlugin.ts\";\nimport type { EnvironmentVariableKey } from \"./EnvironmentVariablesRegistry.ts\";\n\nexport function useEnvironmentVariable<T extends EnvironmentVariableKey>(key: T) {\n const runtime = useRuntime();\n const plugin = getEnvironmentVariablesPlugin(runtime);\n\n return plugin.getVariable(key);\n}\n\nexport function useEnvironmentVariables() {\n const runtime = useRuntime();\n const plugin = getEnvironmentVariablesPlugin(runtime);\n\n return plugin.getVariables();\n}\n"],"names":["useRuntime","getEnvironmentVariablesPlugin","useEnvironmentVariable","key","runtime","plugin","useEnvironmentVariables"],"mappings":";;;;;AAA0C;AACsC;AAGzE,SAASE,sBAAsBA,CAAmCC,GAAM;IAC3E,MAAMC,UAAUJ,UAAUA;IAC1B,MAAMK,SAASJ,6BAA6BA,CAACG;IAE7C,OAAOC,OAAO,WAAW,CAACF;AAC9B;AAEO,SAASG,uBAAuBA;IACnC,MAAMF,UAAUJ,UAAUA;IAC1B,MAAMK,SAASJ,6BAA6BA,CAACG;IAE7C,OAAOC,OAAO,YAAY;AAC9B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@squide/env-vars",
3
3
  "author": "Workleap",
4
- "version": "1.4.19",
4
+ "version": "1.4.20",
5
5
  "description": "Add support for environment variables to @squide application shell.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -30,26 +30,27 @@
30
30
  "react": "^18.0.0 || ^19.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "@workleap/logging": "^1.3.6",
34
- "memoize": "^10.2.0",
35
- "@squide/core": "^6.1.14"
33
+ "@workleap/logging": "^1.3.7",
34
+ "memoize": "^11.0.0",
35
+ "@squide/core": "^6.1.15"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@eslint/js": "9.39.2",
39
- "@rsbuild/core": "1.7.3",
40
- "@rslib/core": "0.19.6",
39
+ "@rsbuild/core": "1.7.5",
40
+ "@rslib/core": "0.20.2",
41
+ "@types/node": "25.5.0",
41
42
  "@types/react": "19.2.14",
42
- "@typescript-eslint/parser": "8.56.1",
43
- "@typescript/native-preview": "7.0.0-dev.20260224.1",
44
- "@vitejs/plugin-react": "5.1.4",
45
- "@workleap/eslint-configs": "1.1.13",
46
- "@workleap/rslib-configs": "1.1.7",
47
- "@workleap/typescript-configs": "3.0.7",
43
+ "@typescript-eslint/parser": "8.58.0",
44
+ "@typescript/native-preview": "7.0.0-dev.20260331.1",
45
+ "@vitejs/plugin-react": "6.0.1",
46
+ "@workleap/eslint-configs": "2.0.1",
47
+ "@workleap/rslib-configs": "1.1.11",
48
+ "@workleap/typescript-configs": "4.0.0",
48
49
  "eslint": "9.39.2",
49
- "happy-dom": "20.7.0",
50
- "typescript": "5.9.3",
50
+ "happy-dom": "20.8.9",
51
+ "typescript": "6.0.2",
51
52
  "typescript-eslint": "8.54.0",
52
- "vitest": "4.0.18"
53
+ "vitest": "4.1.2"
53
54
  },
54
55
  "sideEffects": false,
55
56
  "scripts": {