@arkenv/vite-plugin 0.0.13 → 0.0.15
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/dist/index.cjs +6 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/package.json +10 -8
package/dist/index.cjs
CHANGED
|
@@ -27,11 +27,16 @@ let vite = require("vite");
|
|
|
27
27
|
vite = __toESM(vite);
|
|
28
28
|
|
|
29
29
|
//#region src/index.ts
|
|
30
|
+
/**
|
|
31
|
+
* TODO: If possible, find a better type than "const T extends Record<string, unknown>",
|
|
32
|
+
* and be as close as possible to the type accepted by ArkType's `type`.
|
|
33
|
+
*/
|
|
30
34
|
function arkenv$1(options) {
|
|
31
35
|
return {
|
|
32
36
|
name: "@arkenv/vite-plugin",
|
|
33
37
|
config(_config, { mode }) {
|
|
34
|
-
(0, arkenv.createEnv)(options, (0, vite.loadEnv)(mode, process.cwd(), ""));
|
|
38
|
+
const env = (0, arkenv.createEnv)(options, (0, vite.loadEnv)(mode, process.cwd(), ""));
|
|
39
|
+
return { define: Object.fromEntries(Object.entries(env).map(([key, value]) => [`import.meta.env.${key}`, JSON.stringify(value)])) };
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
42
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -2,5 +2,10 @@ import { EnvSchema } from "arkenv";
|
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TODO: If possible, find a better type than "const T extends Record<string, unknown>",
|
|
8
|
+
* and be as close as possible to the type accepted by ArkType's `type`.
|
|
9
|
+
*/
|
|
10
|
+
declare function arkenv<const T extends Record<string, unknown>>(options: EnvSchema<T>): Plugin;
|
|
6
11
|
export = arkenv;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { EnvSchema } from "arkenv";
|
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TODO: If possible, find a better type than "const T extends Record<string, unknown>",
|
|
8
|
+
* and be as close as possible to the type accepted by ArkType's `type`.
|
|
9
|
+
*/
|
|
10
|
+
declare function arkenv<const T extends Record<string, unknown>>(options: EnvSchema<T>): Plugin;
|
|
6
11
|
//#endregion
|
|
7
12
|
export { arkenv as default };
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,16 @@ import { createEnv } from "arkenv";
|
|
|
2
2
|
import { loadEnv } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/index.ts
|
|
5
|
+
/**
|
|
6
|
+
* TODO: If possible, find a better type than "const T extends Record<string, unknown>",
|
|
7
|
+
* and be as close as possible to the type accepted by ArkType's `type`.
|
|
8
|
+
*/
|
|
5
9
|
function arkenv(options) {
|
|
6
10
|
return {
|
|
7
11
|
name: "@arkenv/vite-plugin",
|
|
8
12
|
config(_config, { mode }) {
|
|
9
|
-
createEnv(options, loadEnv(mode, process.cwd(), ""));
|
|
13
|
+
const env = createEnv(options, loadEnv(mode, process.cwd(), ""));
|
|
14
|
+
return { define: Object.fromEntries(Object.entries(env).map(([key, value]) => [`import.meta.env.${key}`, JSON.stringify(value)])) };
|
|
10
15
|
}
|
|
11
16
|
};
|
|
12
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkenv/vite-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"author": "Yam Borodetsky <yam@yam.codes>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
"main": "./dist/index.cjs",
|
|
10
10
|
"module": "./dist/index.js",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"arkenv": "0.7.
|
|
12
|
+
"arkenv": "0.7.4"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"vite
|
|
19
|
-
"
|
|
15
|
+
"arktype": "2.1.25",
|
|
16
|
+
"tsdown": "0.15.12",
|
|
17
|
+
"typescript": "5.9.3",
|
|
18
|
+
"vite": "7.1.12",
|
|
19
|
+
"vite-tsconfig-paths": "5.1.4",
|
|
20
|
+
"vitest": "4.0.4"
|
|
20
21
|
},
|
|
21
22
|
"peerDependencies": {
|
|
22
23
|
"arktype": "^2.1.22",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"typecheck": "tsc --noEmit",
|
|
52
53
|
"clean": "rimraf dist node_modules",
|
|
53
54
|
"test": "vitest",
|
|
54
|
-
"fix": "pnpm -w run fix"
|
|
55
|
+
"fix": "pnpm -w run fix",
|
|
56
|
+
"changeset": "pnpm -w run changeset"
|
|
55
57
|
}
|
|
56
58
|
}
|