@forgeailab/spark-schema 0.1.3 → 0.3.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/package.json +6 -1
- package/src/capabilities.ts +2 -2
- package/src/pack.ts +0 -13
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgeailab/spark-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared Zod schemas + TOML parsers for spark pack and template manifests.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/ForgeAILab/spark.git",
|
|
8
|
+
"directory": "packages/spark-schema"
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"publishConfig": {
|
|
7
12
|
"access": "public"
|
package/src/capabilities.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const PACK_CAPABILITY_VALUES = [
|
|
|
13
13
|
'ai-sdk',
|
|
14
14
|
'blob-storage',
|
|
15
15
|
'analytics',
|
|
16
|
-
'
|
|
16
|
+
'data-api',
|
|
17
17
|
] as const;
|
|
18
18
|
|
|
19
19
|
export const TEMPLATE_CAPABILITY_VALUES = ['static', 'server', 'react', 'native', 'vue', 'svelte', 'mdx-content', 'edge-runtime'] as const;
|
|
@@ -38,7 +38,7 @@ export const EXCLUSIVE_CAPABILITIES: ReadonlySet<PackCapability> = new Set<PackC
|
|
|
38
38
|
'auth',
|
|
39
39
|
'payments',
|
|
40
40
|
'ui-kit',
|
|
41
|
-
'
|
|
41
|
+
'data-api',
|
|
42
42
|
]);
|
|
43
43
|
|
|
44
44
|
export const NON_EXCLUSIVE_CAPABILITIES: ReadonlySet<PackCapability> = new Set<PackCapability>([
|
package/src/pack.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { z } from 'zod';
|
|
|
2
2
|
import { PackCapability, TemplateCapability } from './capabilities.ts';
|
|
3
3
|
|
|
4
4
|
const packNamePattern = /^[a-z][a-z0-9-]*$/;
|
|
5
|
-
const npmPackageNamePattern =
|
|
6
|
-
/^(?=.{1,214}$)(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
7
5
|
const semverPattern =
|
|
8
6
|
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
9
7
|
|
|
@@ -68,15 +66,6 @@ export const PackTasksSchema = z
|
|
|
68
66
|
})
|
|
69
67
|
.strict();
|
|
70
68
|
|
|
71
|
-
const RuntimePackageBlockSchema = z
|
|
72
|
-
.object({
|
|
73
|
-
package: z.string().regex(npmPackageNamePattern, {
|
|
74
|
-
message: 'Runtime package names must be valid npm package names',
|
|
75
|
-
}),
|
|
76
|
-
version: z.string().min(1),
|
|
77
|
-
})
|
|
78
|
-
.strict();
|
|
79
|
-
|
|
80
69
|
export const PackManifestSchema = z
|
|
81
70
|
.object({
|
|
82
71
|
name: PackName,
|
|
@@ -93,9 +82,7 @@ export const PackManifestSchema = z
|
|
|
93
82
|
files: z.array(PackFileOperationSchema).optional(),
|
|
94
83
|
skills: PackSkillsSchema.optional(),
|
|
95
84
|
tasks: PackTasksSchema.optional(),
|
|
96
|
-
runtime_package: RuntimePackageBlockSchema.optional(),
|
|
97
85
|
})
|
|
98
86
|
.strict();
|
|
99
87
|
|
|
100
|
-
export type RuntimePackageBlock = z.infer<typeof RuntimePackageBlockSchema>;
|
|
101
88
|
export type PackManifest = z.infer<typeof PackManifestSchema>;
|