env-checklist 1.0.0 → 1.1.0

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/cli.cjs CHANGED
@@ -1,3 +1,9 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var p=Object.create;var t=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var u=(e,n,o,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of a(n))!v.call(e,s)&&s!==o&&t(e,s,{get:()=>n[s],enumerable:!(i=m(n,s))||i.enumerable});return e};var c=(e,n,o)=>(o=e!=null?p(h(e)):{},u(n||!e||!e.__esModule?t(o,"default",{value:e,enumerable:!0}):o,e));var r=c(require("fs"),1),f=c(require("path"),1);function l(e){let n=[],o={};for(let i of e){let s=process.env[i];s?o[i]=s:n.push(i)}return n.length>0&&(console.error(`
3
- \u2708\uFE0F [env-preflight] Missing variables: ${n.join(", ")}`),process.exit(1)),o}var g=f.default.join(process.cwd(),".env.example");r.default.existsSync(g)||(console.error("No .env.example file found in this directory."),process.exit(1));var x=r.default.readFileSync(g,"utf-8"),y=x.match(/^[^#\s=]+/gm)||[];console.log("\u2708\uFE0F Checking environment variables...");l(y);console.log("All systems go. Environment is flight-ready.");
2
+ "use strict";var p=Object.create;var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var y=(e,o,r,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of v(o))!u.call(e,s)&&s!==r&&c(e,s,{get:()=>o[s],enumerable:!(i=d(o,s))||i.enumerable});return e};var t=(e,o,r)=>(r=e!=null?p(h(e)):{},y(o||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e));var l=t(require("fs"),1),f=t(require("path"),1),n=t(require("chalk"),1);function a(e){let o=[],r={};for(let i of e){let s=process.env[i];s?r[i]=s:o.push(i)}return o.length>0&&(console.error(`
3
+ \u2708\uFE0F [env-preflight] Missing variables: ${o.join(", ")}`),process.exit(1)),r}var g=f.default.join(process.cwd(),".env.example"),b=e=>console.log(`${n.default.cyan.bold("[env-checklist]")} ${e}`);l.default.existsSync(g)||(console.error(n.default.red.bold(`
4
+ \u274C Error: No .env.example file found in this directory.`)),console.log(n.default.dim(`Make sure you have a .env.example file to define your required variables.
5
+ `)),process.exit(1));var x=l.default.readFileSync(g,"utf-8"),m=x.match(/^[^#\s=]+/gm)||[];m.length===0&&(b(n.default.yellow("No variables found in .env.example to validate.")),process.exit(0));console.log(n.default.blue.bold(`
6
+ \u2708\uFE0F Checking environment variables...`));try{a(m),console.log(n.default.green.bold(`\u2705 All systems go. Environment is flight-ready.
7
+ `))}catch(e){let o=e instanceof Error?e.message:String(e);console.error(n.default.red.bold(`
8
+ \u274C Preflight Failed!`)),console.error(n.default.yellow(`Missing variables: ${o}`)),console.log(n.default.dim(`Please update your .env file to match .env.example.
9
+ `)),process.exit(1)}
package/dist/cli.js CHANGED
@@ -1,2 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import{a as e}from"./chunk-FEPVSWMN.js";import o from"fs";import s from"path";var n=s.join(process.cwd(),".env.example");o.existsSync(n)||(console.error("No .env.example file found in this directory."),process.exit(1));var t=o.readFileSync(n,"utf-8"),i=t.match(/^[^#\s=]+/gm)||[];console.log("\u2708\uFE0F Checking environment variables...");e(i);console.log("All systems go. Environment is flight-ready.");
2
+ import{a as r}from"./chunk-FEPVSWMN.js";import n from"fs";import t from"path";import e from"chalk";var l=t.join(process.cwd(),".env.example"),a=o=>console.log(`${e.cyan.bold("[env-checklist]")} ${o}`);n.existsSync(l)||(console.error(e.red.bold(`
3
+ \u274C Error: No .env.example file found in this directory.`)),console.log(e.dim(`Make sure you have a .env.example file to define your required variables.
4
+ `)),process.exit(1));var c=n.readFileSync(l,"utf-8"),s=c.match(/^[^#\s=]+/gm)||[];s.length===0&&(a(e.yellow("No variables found in .env.example to validate.")),process.exit(0));console.log(e.blue.bold(`
5
+ \u2708\uFE0F Checking environment variables...`));try{r(s),console.log(e.green.bold(`\u2705 All systems go. Environment is flight-ready.
6
+ `))}catch(o){let i=o instanceof Error?o.message:String(o);console.error(e.red.bold(`
7
+ \u274C Preflight Failed!`)),console.error(e.yellow(`Missing variables: ${i}`)),console.log(e.dim(`Please update your .env file to match .env.example.
8
+ `)),process.exit(1)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "env-checklist",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Ensure your environment variables are flight-ready before takeoff.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -13,6 +13,7 @@
13
13
  "dist"
14
14
  ],
15
15
  "scripts": {
16
+ "start": "env-checklist && node dist/index.js",
16
17
  "build": "tsup src/index.ts src/cli.ts --format cjs,esm --dts --clean --minify",
17
18
  "dev": "tsup src/index.ts --watch",
18
19
  "test": "vitest run",
@@ -24,14 +25,18 @@
24
25
  "validation",
25
26
  "checker",
26
27
  "preflight",
28
+ "checklist",
27
29
  "cli"
28
30
  ],
29
- "author": "Your Name",
31
+ "author": "Rishi Joshi",
30
32
  "license": "MIT",
31
33
  "devDependencies": {
32
34
  "@types/node": "^20.19.37",
33
35
  "tsup": "^8.5.1",
34
36
  "typescript": "^5.9.3",
35
37
  "vitest": "^4.0.18"
38
+ },
39
+ "dependencies": {
40
+ "chalk": "^5.6.2"
36
41
  }
37
42
  }