@arkenv/vite-plugin 0.0.1 → 0.0.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yam Borodetsky <https://yam.codes/>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,26 +1,3 @@
1
- # bun starter
1
+ # `@arkenv/vite-plugin`
2
2
 
3
- ## Getting Started
4
-
5
- Click the [Use this template](https://github.com/wobsoriano/bun-lib-starter/generate) button to create a new repository with the contents starter.
6
-
7
- OR
8
-
9
- Run `bun create wobsoriano/bun-lib-starter ./my-lib`.
10
-
11
- ## Setup
12
-
13
- ```bash
14
- # install dependencies
15
- bun install
16
-
17
- # test the app
18
- bun test
19
-
20
- # build the app, available under dist
21
- bun run build
22
- ```
23
-
24
- ## License
25
-
26
- MIT
3
+ A Vite plugin for using `ark.env` to validate environment variables in **build time**.
package/dist/index.cjs CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
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
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,19 +17,27 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/index.ts
21
31
  var index_exports = {};
22
32
  __export(index_exports, {
23
- one: () => one,
24
- two: () => two
33
+ default: () => index_default
25
34
  });
26
35
  module.exports = __toCommonJS(index_exports);
27
- var one = 1;
28
- var two = 2;
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- one,
32
- two
36
+ var import_ark = __toESM(require("ark.env"), 1);
37
+ var import_vite = require("vite");
38
+ var index_default = (options) => ({
39
+ name: "@arkenv/vite-plugin",
40
+ config(_config, { mode }) {
41
+ import_ark.default.env(options, (0, import_vite.loadEnv)(mode, process.cwd(), ""));
42
+ }
33
43
  });
package/dist/index.d.cts CHANGED
@@ -1,4 +1,7 @@
1
- declare const one = 1;
2
- declare const two = 2;
1
+ import { type } from 'arktype';
2
+ import { Plugin } from 'vite';
3
3
 
4
- export { one, two };
4
+ type EnvSchema<T extends Record<string, string | undefined> = Record<string, string | undefined>> = type.validate<T>;
5
+ declare const _default: <T extends EnvSchema>(options: EnvSchema<T>) => Plugin;
6
+
7
+ export { _default as default };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- declare const one = 1;
2
- declare const two = 2;
1
+ import { type } from 'arktype';
2
+ import { Plugin } from 'vite';
3
3
 
4
- export { one, two };
4
+ type EnvSchema<T extends Record<string, string | undefined> = Record<string, string | undefined>> = type.validate<T>;
5
+ declare const _default: <T extends EnvSchema>(options: EnvSchema<T>) => Plugin;
6
+
7
+ export { _default as default };
package/dist/index.js CHANGED
@@ -1,7 +1,12 @@
1
1
  // src/index.ts
2
- var one = 1;
3
- var two = 2;
2
+ import ark from "ark.env";
3
+ import { loadEnv } from "vite";
4
+ var index_default = (options) => ({
5
+ name: "@arkenv/vite-plugin",
6
+ config(_config, { mode }) {
7
+ ark.env(options, loadEnv(mode, process.cwd(), ""));
8
+ }
9
+ });
4
10
  export {
5
- one,
6
- two
11
+ index_default as default
7
12
  };
package/package.json CHANGED
@@ -1,39 +1,50 @@
1
1
  {
2
- "name": "@arkenv/vite-plugin",
3
- "type": "module",
4
- "version": "0.0.1",
5
- "main": "./dist/index.cjs",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "description": "Vite plugin for ark.env",
9
- "exports": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
13
- },
14
- "scripts": {
15
- "build": "rimraf dist && tsup",
16
- "prepack": "bun run build",
17
- "typecheck": "tsc --noEmit",
18
- "clean": "rimraf dist node_modules"
19
- },
20
- "files": [
21
- "dist"
22
- ],
23
- "keywords": [
24
- "bun"
25
- ],
26
- "license": "MIT",
27
- "homepage": "https://github.com/wobsoriano/pkg-name#readme",
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/wobsoriano/pkg-name.git"
31
- },
32
- "bugs": "https://github.com/wobsoriano/pkg-name/issues",
33
- "author": "Robert Soriano <sorianorobertc@gmail.com>",
34
- "devDependencies": {
35
- "@types/bun": "^1.1.10",
36
- "bun-plugin-dts": "^0.3.0",
37
- "tsup": "^8.3.6"
38
- }
39
- }
2
+ "name": "@arkenv/vite-plugin",
3
+ "version": "0.0.2",
4
+ "author": "Yam Borodetsky <yam@yam.codes>",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/yamcodes/ark.env.git"
8
+ },
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.js",
11
+ "dependencies": {
12
+ "ark.env": "0.1.4"
13
+ },
14
+ "devDependencies": {
15
+ "tsup": "^8.3.6",
16
+ "typescript": "^5.7.3"
17
+ },
18
+ "peerDependencies": {
19
+ "arktype": "^2.0.0",
20
+ "vite": "^6.0.0"
21
+ },
22
+ "exports": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js",
25
+ "require": "./dist/index.cjs"
26
+ },
27
+ "bugs": "https://github.com/yamcodes/ark.env/labels/%40arkenv%2Fvite-plugin",
28
+ "description": "Vite plugin for ark.env",
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "homepage": "https://yam.codes/ark.env",
33
+ "keywords": [
34
+ "arktype",
35
+ "arkenv",
36
+ "ark.env",
37
+ "environment",
38
+ "variables",
39
+ "vite",
40
+ "plugin"
41
+ ],
42
+ "license": "MIT",
43
+ "type": "module",
44
+ "types": "./dist/index.d.ts",
45
+ "scripts": {
46
+ "build": "rimraf dist && tsup",
47
+ "typecheck": "tsc --noEmit",
48
+ "clean": "rimraf dist node_modules"
49
+ }
50
+ }