@arkenv/vite-plugin 0.0.14 → 0.0.16
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 +1 -45
- package/dist/index.d.cts +2 -1
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -20
- package/dist/index.js.map +1 -0
- package/package.json +19 -8
package/dist/index.cjs
CHANGED
|
@@ -1,45 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
let arkenv = require("arkenv");
|
|
25
|
-
arkenv = __toESM(arkenv);
|
|
26
|
-
let vite = require("vite");
|
|
27
|
-
vite = __toESM(vite);
|
|
28
|
-
|
|
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
|
-
*/
|
|
34
|
-
function arkenv$1(options) {
|
|
35
|
-
return {
|
|
36
|
-
name: "@arkenv/vite-plugin",
|
|
37
|
-
config(_config, { mode }) {
|
|
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)])) };
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
module.exports = arkenv$1;
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`arkenv`);c=s(c);let l=require(`vite`);l=s(l);function u(e){return{name:`@arkenv/vite-plugin`,config(t,{mode:n}){let r=(0,c.createEnv)(e,(0,l.loadEnv)(n,process.cwd(),``));return{define:Object.fromEntries(Object.entries(r).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)]))}}}}module.exports=u;
|
package/dist/index.d.cts
CHANGED
|
@@ -8,4 +8,5 @@ import { Plugin } from "vite";
|
|
|
8
8
|
* and be as close as possible to the type accepted by ArkType's `type`.
|
|
9
9
|
*/
|
|
10
10
|
declare function arkenv<const T extends Record<string, unknown>>(options: EnvSchema<T>): Plugin;
|
|
11
|
-
export = arkenv;
|
|
11
|
+
export = arkenv;
|
|
12
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAE4C;;AAQxB,iBADI,MACJ,CAAA,gBAD2B,MAC3B,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,CAAA,OAAA,EAAV,SAAU,CAAA,CAAA,CAAA,CAAA,EACjB,MADiB;AAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAE4C;;AAQxB,iBADI,MACJ,CAAA,gBAD2B,MAC3B,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,CAAA,OAAA,EAAV,SAAU,CAAA,CAAA,CAAA,CAAA,EACjB,MADiB"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
*/
|
|
9
|
-
function arkenv(options) {
|
|
10
|
-
return {
|
|
11
|
-
name: "@arkenv/vite-plugin",
|
|
12
|
-
config(_config, { mode }) {
|
|
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)])) };
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { arkenv as default };
|
|
1
|
+
import{createEnv as e}from"arkenv";import{loadEnv as t}from"vite";function n(n){return{name:`@arkenv/vite-plugin`,config(r,{mode:i}){let a=e(n,t(i,process.cwd(),``));return{define:Object.fromEntries(Object.entries(a).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)]))}}}}export{n as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { EnvSchema } from \"arkenv\";\nimport { createEnv } from \"arkenv\";\nimport { loadEnv, type Plugin } from \"vite\";\n\n/**\n * TODO: If possible, find a better type than \"const T extends Record<string, unknown>\",\n * and be as close as possible to the type accepted by ArkType's `type`.\n */\n\nexport default function arkenv<const T extends Record<string, unknown>>(\n\toptions: EnvSchema<T>,\n): Plugin {\n\treturn {\n\t\tname: \"@arkenv/vite-plugin\",\n\t\tconfig(_config, { mode }) {\n\t\t\tconst env = createEnv(options, loadEnv(mode, process.cwd(), \"\"));\n\n\t\t\t// Expose transformed environment variables through Vite's define option\n\t\t\tconst define = Object.fromEntries(\n\t\t\t\tObject.entries(<Record<string, unknown>>env).map(([key, value]) => [\n\t\t\t\t\t`import.meta.env.${key}`,\n\t\t\t\t\tJSON.stringify(value),\n\t\t\t\t]),\n\t\t\t);\n\n\t\t\treturn { define };\n\t\t},\n\t};\n}\n"],"mappings":"kEASA,SAAwB,EACvB,EACS,CACT,MAAO,CACN,KAAM,sBACN,OAAO,EAAS,CAAE,QAAQ,CACzB,IAAM,EAAM,EAAU,EAAS,EAAQ,EAAM,QAAQ,KAAK,CAAE,GAAG,CAAC,CAUhE,MAAO,CAAE,OAPM,OAAO,YACrB,OAAO,QAAiC,EAAI,CAAC,KAAK,CAAC,EAAK,KAAW,CAClE,mBAAmB,IACnB,KAAK,UAAU,EAAM,CACrB,CAAC,CACF,CAEgB,EAElB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkenv/vite-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"author": "Yam Borodetsky <yam@yam.codes>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
"main": "./dist/index.cjs",
|
|
10
10
|
"module": "./dist/index.js",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"arkenv": "0.7.
|
|
12
|
+
"arkenv": "0.7.5"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
15
|
+
"@size-limit/preset-small-lib": "11.2.0",
|
|
16
|
+
"arktype": "2.1.25",
|
|
17
|
+
"size-limit": "11.2.0",
|
|
18
|
+
"tsdown": "0.15.12",
|
|
19
|
+
"typescript": "5.9.3",
|
|
20
|
+
"vite": "7.1.12",
|
|
21
|
+
"vite-tsconfig-paths": "5.1.4",
|
|
22
|
+
"vitest": "4.0.8"
|
|
20
23
|
},
|
|
21
24
|
"peerDependencies": {
|
|
22
25
|
"arktype": "^2.1.22",
|
|
@@ -46,12 +49,20 @@
|
|
|
46
49
|
"license": "MIT",
|
|
47
50
|
"type": "module",
|
|
48
51
|
"types": "./dist/index.d.ts",
|
|
52
|
+
"size-limit": [
|
|
53
|
+
{
|
|
54
|
+
"path": "dist/index.js",
|
|
55
|
+
"limit": "2 kB",
|
|
56
|
+
"import": "*"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
49
59
|
"scripts": {
|
|
50
60
|
"build": "tsdown",
|
|
51
61
|
"typecheck": "tsc --noEmit",
|
|
52
62
|
"clean": "rimraf dist node_modules",
|
|
53
63
|
"test": "vitest",
|
|
54
64
|
"fix": "pnpm -w run fix",
|
|
55
|
-
"changeset": "pnpm -w run changeset"
|
|
65
|
+
"changeset": "pnpm -w run changeset",
|
|
66
|
+
"size": "size-limit"
|
|
56
67
|
}
|
|
57
68
|
}
|