@arkenv/vite-plugin 0.0.11 → 0.0.13

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 CHANGED
@@ -63,6 +63,12 @@ VITE_DEBUG=true
63
63
  VITE_ALLOWED_ORIGINS=http://localhost:3000,https://example.com
64
64
  ```
65
65
 
66
+ ## FAQ
67
+
68
+ ### Why is this a Vite only plugin? (And not a Rollup plugin?)
69
+
70
+ This plugin uses [the Vite specific `config` hook](https://vite.dev/guide/api-plugin.html#config), which is not available in Rollup.
71
+
66
72
  ## Examples
67
73
 
68
74
  * [with-vite-react-ts](https://github.com/yamcodes/arkenv/tree/main/examples/with-vite-react-ts)
package/dist/index.cjs CHANGED
@@ -1,35 +1,40 @@
1
- "use strict";
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
8
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
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
17
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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);
19
28
 
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- default: () => arkenv
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
- var import_arkenv = require("arkenv");
27
- var import_vite = require("vite");
28
- function arkenv(options) {
29
- return {
30
- name: "@arkenv/vite-plugin",
31
- config(_config, { mode }) {
32
- (0, import_arkenv.createEnv)(options, (0, import_vite.loadEnv)(mode, process.cwd(), ""));
33
- }
34
- };
29
+ //#region src/index.ts
30
+ function arkenv$1(options) {
31
+ return {
32
+ name: "@arkenv/vite-plugin",
33
+ config(_config, { mode }) {
34
+ (0, arkenv.createEnv)(options, (0, vite.loadEnv)(mode, process.cwd(), ""));
35
+ }
36
+ };
35
37
  }
38
+
39
+ //#endregion
40
+ module.exports = arkenv$1;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { EnvSchema } from 'arkenv';
2
- import { Plugin } from 'vite';
1
+ import { EnvSchema } from "arkenv";
2
+ import { Plugin } from "vite";
3
3
 
4
+ //#region src/index.d.ts
4
5
  declare function arkenv<const T extends Record<string, string | undefined>>(options: EnvSchema<T>): Plugin;
5
-
6
- export { arkenv as default };
6
+ export = arkenv;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { EnvSchema } from 'arkenv';
2
- import { Plugin } from 'vite';
1
+ import { EnvSchema } from "arkenv";
2
+ import { Plugin } from "vite";
3
3
 
4
+ //#region src/index.d.ts
4
5
  declare function arkenv<const T extends Record<string, string | undefined>>(options: EnvSchema<T>): Plugin;
5
-
6
- export { arkenv as default };
6
+ //#endregion
7
+ export { arkenv as default };
package/dist/index.js CHANGED
@@ -1,14 +1,15 @@
1
- // src/index.ts
2
1
  import { createEnv } from "arkenv";
3
2
  import { loadEnv } from "vite";
3
+
4
+ //#region src/index.ts
4
5
  function arkenv(options) {
5
- return {
6
- name: "@arkenv/vite-plugin",
7
- config(_config, { mode }) {
8
- createEnv(options, loadEnv(mode, process.cwd(), ""));
9
- }
10
- };
6
+ return {
7
+ name: "@arkenv/vite-plugin",
8
+ config(_config, { mode }) {
9
+ createEnv(options, loadEnv(mode, process.cwd(), ""));
10
+ }
11
+ };
11
12
  }
12
- export {
13
- arkenv as default
14
- };
13
+
14
+ //#endregion
15
+ export { arkenv as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkenv/vite-plugin",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "author": "Yam Borodetsky <yam@yam.codes>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,22 +9,18 @@
9
9
  "main": "./dist/index.cjs",
10
10
  "module": "./dist/index.js",
11
11
  "dependencies": {
12
- "arkenv": "0.7.1"
12
+ "arkenv": "0.7.3"
13
13
  },
14
14
  "devDependencies": {
15
- "@types/react": "^19.1.12",
16
- "@types/react-dom": "^19.1.9",
17
- "@vitejs/plugin-react": "^5.0.2",
18
- "react": "^19.1.1",
19
- "react-dom": "^19.1.1",
20
- "tsup": "^8.5.0",
21
- "typescript": "^5.9.2",
22
- "vite": "^7.1.5",
15
+ "tsdown": "^0.15.6",
16
+ "typescript": "^5.9.3",
17
+ "vite": "7.1.9",
18
+ "vite-tsconfig-paths": "^5.1.4",
23
19
  "vitest": "^3.2.4"
24
20
  },
25
21
  "peerDependencies": {
26
22
  "arktype": "^2.1.22",
27
- "vite": "^6.0.0 || ^7.0.0"
23
+ "vite": "^2.9.18 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
28
24
  },
29
25
  "exports": {
30
26
  "types": "./dist/index.d.ts",
@@ -44,14 +40,17 @@
44
40
  "environment",
45
41
  "variables",
46
42
  "vite",
47
- "plugin"
43
+ "plugin",
44
+ "vite-plugin"
48
45
  ],
49
46
  "license": "MIT",
50
47
  "type": "module",
51
48
  "types": "./dist/index.d.ts",
52
49
  "scripts": {
53
- "build": "rimraf dist && tsup",
50
+ "build": "tsdown",
54
51
  "typecheck": "tsc --noEmit",
55
- "clean": "rimraf dist node_modules"
52
+ "clean": "rimraf dist node_modules",
53
+ "test": "vitest",
54
+ "fix": "pnpm -w run fix"
56
55
  }
57
56
  }