@leancodepl/config 9.6.3 → 9.6.6
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 +7 -3
- package/package.json +31 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @leancodepl/config - Utility for creating configuration getters that access Vite-injected values in development and environment variables in production.
|
|
2
2
|
|
|
3
|
-
Provides a function to create getters for accessing configuration values prefixed with '
|
|
3
|
+
Provides a function to create getters for accessing configuration values prefixed with 'VITE\_' from `import.meta.env`
|
|
4
|
+
during development. In production, it retrieves values directly from environment variables, with support for tools like
|
|
5
|
+
nginx-base from "leancodepl/tools" for parsing.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
@@ -18,9 +20,11 @@ yarn add @leancodepl/config
|
|
|
18
20
|
|
|
19
21
|
### `mkGetInjectedConfig()`
|
|
20
22
|
|
|
21
|
-
Creates a getter function for accessing Vite-injected configuration values from environment variables on development, on
|
|
23
|
+
Creates a getter function for accessing Vite-injected configuration values from environment variables on development, on
|
|
24
|
+
production it will return the value from the environment variables. You can check "@leancodepl/tools" repository for
|
|
25
|
+
more information. There's nginx-base defined which parses it out.
|
|
22
26
|
|
|
23
|
-
The keys are automatically prefixed with '
|
|
27
|
+
The keys are automatically prefixed with 'VITE\_' when accessing import.meta.env.
|
|
24
28
|
|
|
25
29
|
**Returns:** An object containing the `getInjectedConfig` method.
|
|
26
30
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/config",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public",
|
|
7
|
+
"registry": "https://registry.npmjs.org/"
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=18.0.0"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/leancodepl/js_corelibrary.git",
|
|
15
|
+
"directory": "packages/config"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/leancodepl/js_corelibrary",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/leancodepl/js_corelibrary/issues"
|
|
20
|
+
},
|
|
21
|
+
"description": "Utility for creating configuration getters that access Vite-injected values in development and environment variables in production",
|
|
22
|
+
"keywords": [
|
|
23
|
+
"config",
|
|
24
|
+
"configuration",
|
|
25
|
+
"vite",
|
|
26
|
+
"environment-variables",
|
|
27
|
+
"env",
|
|
28
|
+
"typescript",
|
|
29
|
+
"leancode"
|
|
30
|
+
],
|
|
31
|
+
"author": {
|
|
32
|
+
"name": "LeanCode",
|
|
33
|
+
"url": "https://leancode.co"
|
|
34
|
+
},
|
|
5
35
|
"exports": {
|
|
6
36
|
"./package.json": "./package.json",
|
|
7
37
|
".": {
|