vite-plugin-envka 1.0.0 → 1.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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # vite-plugin-envka
2
2
 
3
- <!-- [![npm version](https://img.shields.io/npm/v/vite-plugin-envka.svg)](https://www.npmjs.com/package/vite-plugin-envka) -->
3
+ [![npm version](https://img.shields.io/npm/v/vite-plugin-envka.svg)](https://www.npmjs.com/package/vite-plugin-envka) [![Vite](https://img.shields.io/badge/vite-compatible-blue.svg)](https://vitejs.dev/)
4
4
 
5
- [![Vite](https://img.shields.io/badge/vite-compatible-blue.svg)](https://vitejs.dev/)
5
+ ![Logo](./logo.png)
6
6
 
7
7
  ## Overview
8
8
 
@@ -65,9 +65,9 @@ npx env example --schema /path/to/schema/file --output /optional/output
65
65
  ```ts
66
66
  import envka, { envkaValidator } from "vite-plugin-envka";
67
67
 
68
- /** Example using Envka Validator */
69
- export const builtinSchema = envkaValidator({
70
- FOO: { type: "string", default: "bar" },
68
+ /** Env schema object should always be default export */
69
+ export default envkaValidator({
70
+ FOO: { type: "string" },
71
71
  BAR: {
72
72
  type: "number",
73
73
  description: "A comment on your .env.example",
@@ -33,11 +33,13 @@ program
33
33
  log(`Failed to import schema from ${absSchemaPath}`, "error");
34
34
  process.exit(1);
35
35
  }
36
- // Use imported schema for .env.example generation
37
- const schema = imported.default || imported.schema || imported;
36
+ if (!imported.default) {
37
+ log("schema object should be a default export", "error");
38
+ process.exit(1);
39
+ }
38
40
  let exampleContent;
39
41
  try {
40
- exampleContent = printEnvExample(schema);
42
+ exampleContent = printEnvExample(imported.default);
41
43
  }
42
44
  catch (e) {
43
45
  log("Failed to generate .env.example", "error");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-envka",
3
3
  "description": "Envka is a vite plugin designed to enhance environment variable management in Vite projects.",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "author": {
6
6
  "name": "Ireneo C. Cobar Jr"
7
7
  },
@@ -47,7 +47,8 @@
47
47
  "types": "dist/src/index.d.ts",
48
48
  "scripts": {
49
49
  "build": "tsc",
50
- "test": "vitest"
50
+ "test": "vitest",
51
+ "prepublishOnly": "tsc"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@types/node": "^24.8.0",