Skip to content

Commit 8dbf5f8

Browse files
committed
chore(deps): upgrade zod to v4
1 parent b317d64 commit 8dbf5f8

File tree

4 files changed

+14
-35
lines changed

4 files changed

+14
-35
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"prepare": "simple-git-hooks && pnpm run build",
88
"build": "pnpm run generate:schema && pnpm -r --filter=!website build",
99
"build:website": "pnpm --filter website build",
10-
"generate:schema": "tsx scripts/generate-schema.ts",
10+
"generate:schema": "tsx packages/skills-package-manager/scripts/generate-schema.ts",
1111
"bump": "bumpp -r --no-tag --no-push",
1212
"test": "rstest run",
1313
"lint": "biome lint",
@@ -30,7 +30,6 @@
3030
"nano-staged": "^0.9.0",
3131
"path-serializer": "^0.6.0",
3232
"simple-git-hooks": "^2.11.1",
33-
"tsx": "^4.21.0",
34-
"zod-to-json-schema": "^3.25.0"
33+
"tsx": "^4.21.0"
3534
}
3635
}

packages/skills-package-manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"semver": "^7.7.2",
3030
"tar": "^7.4.3",
3131
"yaml": "^2.8.1",
32-
"zod": "^3.25.0"
32+
"zod": "^4.3.6"
3333
},
3434
"devDependencies": {
3535
"@rslib/core": "^0.20.0",

scripts/generate-schema.ts renamed to packages/skills-package-manager/scripts/generate-schema.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
/**
22
* Script to generate JSON Schema from Zod schema
3-
* Run with: pnpm tsx scripts/generate-schema.ts
3+
* Run with: pnpm tsx packages/skills-package-manager/scripts/generate-schema.ts
44
*/
55
import { writeFile } from 'node:fs/promises'
6-
import { createRequire } from 'node:module'
76
import path from 'node:path'
87
import { fileURLToPath } from 'node:url'
9-
import { skillsManifestSchema } from '../packages/skills-package-manager/src/config/schema'
8+
import { z } from 'zod'
9+
import { skillsManifestSchema } from '../src/config/schema'
1010

1111
const __dirname = path.dirname(fileURLToPath(import.meta.url))
1212
const rootDir = path.join(__dirname, '..')
1313

14-
// Use createRequire to import from the workspace package
15-
const requireFromPackage = createRequire(
16-
new URL('../packages/skills-package-manager/package.json', import.meta.url),
17-
)
18-
const { zodToJsonSchema } = requireFromPackage('zod-to-json-schema') as {
19-
zodToJsonSchema: typeof import('zod-to-json-schema').zodToJsonSchema
20-
}
21-
2214
async function main() {
23-
const jsonSchema = zodToJsonSchema(skillsManifestSchema, {
15+
// Use Zod v4 native JSON Schema generation
16+
const jsonSchema = z.toJSONSchema(skillsManifestSchema, {
2417
name: 'skillsManifest',
25-
$refStrategy: 'none',
2618
})
2719

2820
// Add $schema field for JSON Schema draft
@@ -32,7 +24,7 @@ async function main() {
3224
}
3325

3426
// Generate in package directory (for npm publishing)
35-
const pkgOutputPath = path.join(rootDir, 'packages/skills-package-manager/skills.schema.json')
27+
const pkgOutputPath = path.join(rootDir, 'skills.schema.json')
3628
await writeFile(pkgOutputPath, JSON.stringify(output, null, 2) + '\n')
3729
console.log(`✅ Generated JSON Schema (package): ${pkgOutputPath}`)
3830
}

pnpm-lock.yaml

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)