@stacksjs/validation 0.51.0 → 0.52.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/README.md CHANGED
@@ -32,7 +32,7 @@ pnpm test
32
32
 
33
33
  Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
34
34
 
35
- ## 💪🏼 Contributing
35
+ ## 🚜 Contributing
36
36
 
37
37
  Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
38
38
 
package/dist/index.d.ts CHANGED
@@ -1,2 +1,51 @@
1
1
  import { z as validate, z } from 'zod';
2
+ export declare const envVariables: validate.ZodObject<{
3
+ APP_NAME: validate.ZodOptional<validate.ZodDefault<validate.ZodString>>;
4
+ APP_ENV: validate.ZodOptional<validate.ZodDefault<validate.ZodString>>;
5
+ APP_KEY: validate.ZodString;
6
+ APP_URL: validate.ZodDefault<validate.ZodString>;
7
+ APP_DEBUG: validate.ZodDefault<validate.ZodBoolean>;
8
+ DB_CONNECTION: validate.ZodOptional<validate.ZodDefault<validate.ZodString>>;
9
+ DB_DATABASE: validate.ZodOptional<validate.ZodDefault<validate.ZodString>>;
10
+ DB_USERNAME: validate.ZodOptional<validate.ZodDefault<validate.ZodString>>;
11
+ DB_PASSWORD: validate.ZodOptional<validate.ZodString>;
12
+ SEARCH_ENGINE_DRIVER: validate.ZodOptional<validate.ZodString>;
13
+ MEILISEARCH_HOST: validate.ZodDefault<validate.ZodOptional<validate.ZodString>>;
14
+ MEILISEARCH_KEY: validate.ZodOptional<validate.ZodString>;
15
+ }, "strip", validate.ZodTypeAny, {
16
+ APP_KEY: string;
17
+ APP_URL: string;
18
+ APP_DEBUG: boolean;
19
+ MEILISEARCH_HOST: string;
20
+ APP_NAME?: string | undefined;
21
+ APP_ENV?: string | undefined;
22
+ DB_CONNECTION?: string | undefined;
23
+ DB_DATABASE?: string | undefined;
24
+ DB_USERNAME?: string | undefined;
25
+ DB_PASSWORD?: string | undefined;
26
+ SEARCH_ENGINE_DRIVER?: string | undefined;
27
+ MEILISEARCH_KEY?: string | undefined;
28
+ }, {
29
+ APP_KEY: string;
30
+ APP_NAME?: string | undefined;
31
+ APP_ENV?: string | undefined;
32
+ APP_URL?: string | undefined;
33
+ APP_DEBUG?: boolean | undefined;
34
+ DB_CONNECTION?: string | undefined;
35
+ DB_DATABASE?: string | undefined;
36
+ DB_USERNAME?: string | undefined;
37
+ DB_PASSWORD?: string | undefined;
38
+ SEARCH_ENGINE_DRIVER?: string | undefined;
39
+ MEILISEARCH_HOST?: string | undefined;
40
+ MEILISEARCH_KEY?: string | undefined;
41
+ }>;
42
+ export type StacksEnv = validate.infer<typeof envVariables>;
43
+ export declare enum Type {
44
+ String = "String",
45
+ Number = "Number",
46
+ Boolean = "Boolean",
47
+ Date = "Date",
48
+ Object = "Object",
49
+ Array = "Array"
50
+ }
2
51
  export { validate, z };
package/dist/index.mjs CHANGED
@@ -1,2 +1,25 @@
1
1
  import { z as validate, z } from "zod";
2
+ export const envVariables = validate.object({
3
+ APP_NAME: validate.string().default("Stacks").optional(),
4
+ APP_ENV: validate.string().default("local").optional(),
5
+ APP_KEY: validate.string(),
6
+ APP_URL: validate.string().url().default("http://localhost:3333"),
7
+ APP_DEBUG: validate.boolean().default(true),
8
+ DB_CONNECTION: validate.string().default("mysql").optional(),
9
+ DB_DATABASE: validate.string().default("stacks").optional(),
10
+ DB_USERNAME: validate.string().default("root").optional(),
11
+ DB_PASSWORD: validate.string().optional(),
12
+ SEARCH_ENGINE_DRIVER: validate.string().optional(),
13
+ MEILISEARCH_HOST: validate.string().optional().default("http://127.0.0.1:7700"),
14
+ MEILISEARCH_KEY: validate.string().optional()
15
+ });
16
+ export var Type = /* @__PURE__ */ ((Type2) => {
17
+ Type2["String"] = "String";
18
+ Type2["Number"] = "Number";
19
+ Type2["Boolean"] = "Boolean";
20
+ Type2["Date"] = "Date";
21
+ Type2["Object"] = "Object";
22
+ Type2["Array"] = "Array";
23
+ return Type2;
24
+ })(Type || {});
2
25
  export { validate, z };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/validation",
3
3
  "type": "module",
4
- "version": "0.51.0",
5
- "packageManager": "pnpm@7.26.3",
4
+ "version": "0.52.0",
5
+ "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks Validation methods.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -23,7 +23,12 @@
23
23
  "functions",
24
24
  "stacks"
25
25
  ],
26
- "main": "dist/index.mjs",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.mjs"
30
+ }
31
+ },
27
32
  "module": "dist/index.mjs",
28
33
  "types": "dist/index.d.ts",
29
34
  "contributors": [
@@ -33,22 +38,16 @@
33
38
  "dist",
34
39
  "README.md"
35
40
  ],
36
- "engines": {
37
- "node": ">=v18.14.0",
38
- "pnpm": ">=7.26.3"
39
- },
40
41
  "peerDependencies": {
41
- "zod": "^3.20.2"
42
+ "zod": "^3.21.4"
42
43
  },
43
44
  "devDependencies": {
44
- "mkdist": "^1.1.0",
45
- "typescript": "^4.9.5",
46
- "@stacksjs/path": "0.51.0",
47
- "@stacksjs/testing": "0.51.0"
45
+ "@stacksjs/development": "0.52.0",
46
+ "@stacksjs/path": "0.52.0"
48
47
  },
49
48
  "scripts": {
50
- "build": "mkdist -d",
51
- "dev": "mkdist -d",
49
+ "build": "unbuild",
50
+ "dev": "unbuild --stub",
52
51
  "typecheck": "tsc --noEmit"
53
52
  }
54
53
  }