@aixyz/config 0.1.2 → 0.2.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/index.ts +15 -16
- package/package.json +2 -3
package/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { resolve } from "path";
|
|
2
|
-
import { loadEnvConfig } from "@next/env";
|
|
3
2
|
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
|
|
@@ -25,7 +24,7 @@ export type AixyzConfig = {
|
|
|
25
24
|
*/
|
|
26
25
|
network: string;
|
|
27
26
|
};
|
|
28
|
-
skills
|
|
27
|
+
skills?: GetAixyzConfig["skills"];
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
const NetworkSchema = z.custom<Network>((val) => {
|
|
@@ -58,18 +57,20 @@ const AixyzConfigSchema = z.object({
|
|
|
58
57
|
payTo: z.string(),
|
|
59
58
|
network: NetworkSchema,
|
|
60
59
|
}),
|
|
61
|
-
skills: z
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
skills: z
|
|
61
|
+
.array(
|
|
62
|
+
z.object({
|
|
63
|
+
id: z.string().nonempty(),
|
|
64
|
+
name: z.string().nonempty(),
|
|
65
|
+
description: z.string().nonempty(),
|
|
66
|
+
tags: z.array(z.string()),
|
|
67
|
+
examples: z.array(z.string()).optional(),
|
|
68
|
+
inputModes: z.array(z.string()).optional(),
|
|
69
|
+
outputModes: z.array(z.string()).optional(),
|
|
70
|
+
security: z.array(z.record(z.string(), z.array(z.string()))).optional(),
|
|
71
|
+
}),
|
|
72
|
+
)
|
|
73
|
+
.default([]),
|
|
73
74
|
});
|
|
74
75
|
|
|
75
76
|
/**
|
|
@@ -95,8 +96,6 @@ export type GetAixyzConfig = z.infer<typeof AixyzConfigSchema>;
|
|
|
95
96
|
*/
|
|
96
97
|
export function getAixyzConfig(): GetAixyzConfig {
|
|
97
98
|
const cwd = process.cwd();
|
|
98
|
-
loadEnvConfig(cwd);
|
|
99
|
-
|
|
100
99
|
const configPath = resolve(cwd, "aixyz.config.ts");
|
|
101
100
|
const mod = require(configPath);
|
|
102
101
|
const config = mod.default;
|
package/package.json
CHANGED