Comparing version 2.0.0 to 2.1.0
import { ZodType } from 'zod'; | ||
export { z } from 'zod'; | ||
@@ -4,0 +3,0 @@ type ConfigDefinitionElement<T = unknown> = { |
{ | ||
"name": "figue", | ||
"version": "2.0.0", | ||
"type": "module", | ||
"version": "2.1.0", | ||
"private": false, | ||
"description": "Platform agnostic configuration management library, with environmental variables and validation, like convict but cross-env and zod schemas", | ||
"author": "Corentin Th <corentin.thomasset74+npm@gmail.com> (https://github.com/CorentinTh)", | ||
"license": "MIT", | ||
"funding": "https://github.com/sponsors/CorentinTh", | ||
"author": "Corentin Th <corentin.thomasset74+npm@gmail.com> (https://github.com/CorentinTh)", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/CorentinTh/figue" | ||
}, | ||
"keywords": [ | ||
@@ -22,10 +29,3 @@ "configuration", | ||
], | ||
"private": false, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/CorentinTh/figue" | ||
}, | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"type": "module", | ||
"exports": { | ||
@@ -43,3 +43,12 @@ ".": { | ||
], | ||
"peerDependencies": { | ||
"zod": "^3.22.4" | ||
}, | ||
"dependencies": { | ||
"zod": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^3.5.0", | ||
"bumpp": "^9.5.2", | ||
"eslint": "^9.10.0", | ||
"standard-version": "^9.5.0", | ||
@@ -50,11 +59,8 @@ "typescript": "^5.4.5", | ||
}, | ||
"packageManager": "pnpm@9.0.6", | ||
"dependencies": { | ||
"zod": "^3.22.4" | ||
}, | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "vitest dev", | ||
"lint": "eslint --ext .ts,.js,.mjs,.cjs .", | ||
"release": "standard-version", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix .", | ||
"release": "bumpp && pnpm publish", | ||
"test": "pnpm run test:unit", | ||
@@ -61,0 +67,0 @@ "test:unit": "vitest run", |
@@ -13,9 +13,9 @@ # Figue | ||
# npm | ||
npm install figue | ||
npm install figue zod | ||
# yarn | ||
yarn install figue | ||
yarn install figue zod | ||
# pnpm | ||
pnpm install figue | ||
pnpm install figue zod | ||
``` | ||
@@ -27,6 +27,6 @@ | ||
// ESM | ||
import { defineConfig, z } from "figue"; | ||
import { defineConfig } from 'figue'; | ||
// CommonJS | ||
const { defineConfig, z } = require("figue"); | ||
const { defineConfig } = require('figue'); | ||
``` | ||
@@ -39,3 +39,4 @@ | ||
```typescript | ||
import { defineConfig, z } from "figue"; | ||
import { defineConfig } from 'figue'; | ||
import { z } from 'zod'; | ||
@@ -45,31 +46,31 @@ const { config } = defineConfig( | ||
env: { | ||
doc: "Application current environment", | ||
default: "development", | ||
schema: z.enum(["development", "production", "test"]), | ||
env: "NODE_ENV", | ||
doc: 'Application current environment', | ||
default: 'development', | ||
schema: z.enum(['development', 'production', 'test']), | ||
env: 'NODE_ENV', | ||
}, | ||
port: { | ||
doc: "Application port to listen", | ||
doc: 'Application port to listen', | ||
schema: z.coerce.number().int().positive(), | ||
default: 3000, | ||
env: "PORT", | ||
env: 'PORT', | ||
}, | ||
db: { | ||
host: { | ||
doc: "Database server url", | ||
doc: 'Database server url', | ||
schema: z.string().url(), | ||
default: "localhost", | ||
env: "APP_DB_HOST", | ||
default: 'localhost', | ||
env: 'APP_DB_HOST', | ||
}, | ||
username: { | ||
doc: "Database server username", | ||
doc: 'Database server username', | ||
schema: z.string(), | ||
default: "pg", | ||
env: "APP_DB_USERNAME", | ||
default: 'pg', | ||
env: 'APP_DB_USERNAME', | ||
}, | ||
password: { | ||
doc: "Database server password", | ||
doc: 'Database server password', | ||
schema: z.string(), | ||
default: "", | ||
env: "APP_DB_PASSWORD", | ||
default: '', | ||
env: 'APP_DB_PASSWORD', | ||
}, | ||
@@ -80,3 +81,3 @@ }, | ||
envSource: process.env, | ||
} | ||
}, | ||
); | ||
@@ -107,3 +108,3 @@ | ||
envSource: process.env, | ||
} | ||
}, | ||
); | ||
@@ -121,3 +122,3 @@ ``` | ||
envSource: import.meta.env, | ||
} | ||
}, | ||
); | ||
@@ -132,6 +133,6 @@ ``` | ||
env: { | ||
doc: "Application current environment", | ||
default: "development", | ||
schema: z.enum(["development", "production", "test"]), | ||
env: "NODE_ENV", | ||
doc: 'Application current environment', | ||
default: 'development', | ||
schema: z.enum(['development', 'production', 'test']), | ||
env: 'NODE_ENV', | ||
}, | ||
@@ -143,9 +144,9 @@ | ||
envSource: { | ||
NODE_ENV: "development", | ||
PORT: "3000", | ||
APP_DB_HOST: "localhost", | ||
APP_DB_USERNAME: "pg", | ||
APP_DB_PASSWORD: "", | ||
NODE_ENV: 'development', | ||
PORT: '3000', | ||
APP_DB_HOST: 'localhost', | ||
APP_DB_USERNAME: 'pg', | ||
APP_DB_PASSWORD: '', | ||
}, | ||
} | ||
}, | ||
); | ||
@@ -163,3 +164,3 @@ ``` | ||
envSource: [import.meta.env, myEnvs], | ||
} | ||
}, | ||
); | ||
@@ -166,0 +167,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15199
180
2
7
201