schemashift-cli 0.9.0 → 0.10.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/dist/cli.js +37 -6
- package/dist/index.cjs +12 -2
- package/dist/index.js +12 -2
- package/package.json +14 -8
package/dist/cli.js
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
TransformEngine,
|
|
29
29
|
TypeDedupDetector
|
|
30
30
|
} from "@schemashift/core";
|
|
31
|
+
import { createIoTsToEffectHandler } from "@schemashift/io-ts-effect";
|
|
31
32
|
import { createIoTsToZodHandler } from "@schemashift/io-ts-zod";
|
|
32
33
|
import { createJoiToZodHandler } from "@schemashift/joi-zod";
|
|
33
34
|
|
|
@@ -35888,7 +35889,12 @@ var TIER_FEATURES = {
|
|
|
35888
35889
|
"zod->valibot",
|
|
35889
35890
|
"any->valibot",
|
|
35890
35891
|
"zod->yup",
|
|
35891
|
-
"valibot->zod"
|
|
35892
|
+
"valibot->zod",
|
|
35893
|
+
"zod->arktype",
|
|
35894
|
+
"arktype->zod",
|
|
35895
|
+
"zod->superstruct",
|
|
35896
|
+
"superstruct->zod",
|
|
35897
|
+
"io-ts->effect"
|
|
35892
35898
|
],
|
|
35893
35899
|
devices: 4,
|
|
35894
35900
|
ciSupport: true,
|
|
@@ -35930,7 +35936,12 @@ var TIER_FEATURES = {
|
|
|
35930
35936
|
"any->valibot",
|
|
35931
35937
|
"zod->valibot",
|
|
35932
35938
|
"zod->yup",
|
|
35933
|
-
"valibot->zod"
|
|
35939
|
+
"valibot->zod",
|
|
35940
|
+
"zod->arktype",
|
|
35941
|
+
"arktype->zod",
|
|
35942
|
+
"zod->superstruct",
|
|
35943
|
+
"superstruct->zod",
|
|
35944
|
+
"io-ts->effect"
|
|
35934
35945
|
],
|
|
35935
35946
|
devices: Infinity,
|
|
35936
35947
|
ciSupport: true,
|
|
@@ -36235,6 +36246,11 @@ var LicenseManager = class {
|
|
|
36235
36246
|
|
|
36236
36247
|
// src/cli.ts
|
|
36237
36248
|
import { createYupToZodHandler, createZodToYupHandler } from "@schemashift/yup-zod";
|
|
36249
|
+
import { createArktypeToZodHandler, createZodToArktypeHandler } from "@schemashift/zod-arktype";
|
|
36250
|
+
import {
|
|
36251
|
+
createSuperstructToZodHandler,
|
|
36252
|
+
createZodToSuperstructHandler
|
|
36253
|
+
} from "@schemashift/zod-superstruct";
|
|
36238
36254
|
import { createZodV3ToV4Handler } from "@schemashift/zod-v3-v4";
|
|
36239
36255
|
import { createValibotToZodHandler, createZodToValibotHandler } from "@schemashift/zod-valibot";
|
|
36240
36256
|
import { Command } from "commander";
|
|
@@ -37024,6 +37040,11 @@ engine.registerHandler("zod-v3", "v4", createZodV3ToV4Handler());
|
|
|
37024
37040
|
engine.registerHandler("zod", "valibot", createZodToValibotHandler());
|
|
37025
37041
|
engine.registerHandler("zod", "yup", createZodToYupHandler());
|
|
37026
37042
|
engine.registerHandler("valibot", "zod", createValibotToZodHandler());
|
|
37043
|
+
engine.registerHandler("zod", "arktype", createZodToArktypeHandler());
|
|
37044
|
+
engine.registerHandler("arktype", "zod", createArktypeToZodHandler());
|
|
37045
|
+
engine.registerHandler("zod", "superstruct", createZodToSuperstructHandler());
|
|
37046
|
+
engine.registerHandler("superstruct", "zod", createSuperstructToZodHandler());
|
|
37047
|
+
engine.registerHandler("io-ts", "effect", createIoTsToEffectHandler());
|
|
37027
37048
|
var POLAR_URL = "https://schemashift.qwady.app";
|
|
37028
37049
|
program.name("schemashift").version(pkg.version).description("TypeScript schema migration CLI");
|
|
37029
37050
|
program.command("init").description("Create .schemashiftrc.json config file").option("-f, --force", "Overwrite existing config").action((options) => {
|
|
@@ -37366,12 +37387,18 @@ Migration Readiness: ${from} -> ${to}
|
|
|
37366
37387
|
}
|
|
37367
37388
|
}
|
|
37368
37389
|
});
|
|
37369
|
-
program.command("migrate <path>").description("Migrate schemas from one library to another").
|
|
37390
|
+
program.command("migrate <path>").description("Migrate schemas from one library to another").option("-f, --from <library>", "Source library (yup, joi, io-ts, zod-v3, zod)").option("-t, --to <library>", "Target library (zod, v4, valibot, yup, arktype, superstruct)").option("-d, --dry-run", "Preview changes without writing files").option("-v, --verbose", "Show detailed transformation info").option("-c, --config <path>", "Path to config file").option("--report <format>", "Generate report (json, html, csv)").option("--report-output <path>", "Report output path").option("--git-branch", "Create git branch for changes").option("--git-commit", "Auto-commit changes").option("--no-backup", "Skip backup creation").option("--yes", "Skip confirmation prompt").option("--ci", "CI mode (non-interactive, exit code on failure)").option("--cross-file", "Resolve cross-file schema dependencies (Pro+)").option("--chain <path>", "Chain migrations, e.g. yup->zod->valibot (Pro+)").option("--compat-check", "Run compatibility check before migration (Pro+)").option("--fail-on-warnings", "Exit 1 if any warnings (Team+)").option(
|
|
37370
37391
|
"--max-risk-score <score>",
|
|
37371
37392
|
"Exit 1 if any file exceeds risk score (Team+)",
|
|
37372
37393
|
Number.parseInt
|
|
37373
37394
|
).option("--incremental", "Enable incremental migration (file-by-file with progress tracking)").option("--resume", "Resume a previously started incremental migration").option("--incremental-status", "Show incremental migration progress").option("--scaffold-tests", "Generate validation tests after migration (Pro+)").option("--audit", "Enable migration audit logging (Team+)").action(async (targetPath, options) => {
|
|
37374
37395
|
const startTime = Date.now();
|
|
37396
|
+
if (!options.chain && (!options.from || !options.to)) {
|
|
37397
|
+
console.error(pc4.red("Either --from and --to, or --chain must be specified."));
|
|
37398
|
+
console.error(pc4.dim(" Single-step: schemashift migrate <path> -f yup -t zod"));
|
|
37399
|
+
console.error(pc4.dim(" Chain: schemashift migrate <path> --chain yup->zod->valibot"));
|
|
37400
|
+
process.exit(1);
|
|
37401
|
+
}
|
|
37375
37402
|
if (options.maxRiskScore !== void 0 && Number.isNaN(options.maxRiskScore)) {
|
|
37376
37403
|
console.error(pc4.red("--max-risk-score must be a valid number."));
|
|
37377
37404
|
process.exit(1);
|
|
@@ -37495,10 +37522,14 @@ Compatibility score: ${pc4.cyan(compatResult.overallScore.toString())}%`);
|
|
|
37495
37522
|
if (options.chain) {
|
|
37496
37523
|
const migrationChain = new MigrationChain();
|
|
37497
37524
|
chainSteps = migrationChain.parseChain(options.chain);
|
|
37498
|
-
|
|
37499
|
-
|
|
37525
|
+
if (chainSteps.length > 0) {
|
|
37526
|
+
if (!options.from) options.from = chainSteps[0]?.from;
|
|
37527
|
+
if (!options.to) options.to = chainSteps[chainSteps.length - 1]?.to;
|
|
37528
|
+
}
|
|
37529
|
+
const chainValidation = migrationChain.validateChain(chainSteps, engine);
|
|
37530
|
+
if (!chainValidation.valid) {
|
|
37500
37531
|
console.error(pc4.red("Chain migration validation failed:"));
|
|
37501
|
-
for (const err of
|
|
37532
|
+
for (const err of chainValidation.errors) {
|
|
37502
37533
|
console.error(` ${pc4.red(err)}`);
|
|
37503
37534
|
}
|
|
37504
37535
|
process.exit(1);
|
package/dist/index.cjs
CHANGED
|
@@ -33845,7 +33845,12 @@ var TIER_FEATURES = {
|
|
|
33845
33845
|
"zod->valibot",
|
|
33846
33846
|
"any->valibot",
|
|
33847
33847
|
"zod->yup",
|
|
33848
|
-
"valibot->zod"
|
|
33848
|
+
"valibot->zod",
|
|
33849
|
+
"zod->arktype",
|
|
33850
|
+
"arktype->zod",
|
|
33851
|
+
"zod->superstruct",
|
|
33852
|
+
"superstruct->zod",
|
|
33853
|
+
"io-ts->effect"
|
|
33849
33854
|
],
|
|
33850
33855
|
devices: 4,
|
|
33851
33856
|
ciSupport: true,
|
|
@@ -33887,7 +33892,12 @@ var TIER_FEATURES = {
|
|
|
33887
33892
|
"any->valibot",
|
|
33888
33893
|
"zod->valibot",
|
|
33889
33894
|
"zod->yup",
|
|
33890
|
-
"valibot->zod"
|
|
33895
|
+
"valibot->zod",
|
|
33896
|
+
"zod->arktype",
|
|
33897
|
+
"arktype->zod",
|
|
33898
|
+
"zod->superstruct",
|
|
33899
|
+
"superstruct->zod",
|
|
33900
|
+
"io-ts->effect"
|
|
33891
33901
|
],
|
|
33892
33902
|
devices: Infinity,
|
|
33893
33903
|
ciSupport: true,
|
package/dist/index.js
CHANGED
|
@@ -33804,7 +33804,12 @@ var TIER_FEATURES = {
|
|
|
33804
33804
|
"zod->valibot",
|
|
33805
33805
|
"any->valibot",
|
|
33806
33806
|
"zod->yup",
|
|
33807
|
-
"valibot->zod"
|
|
33807
|
+
"valibot->zod",
|
|
33808
|
+
"zod->arktype",
|
|
33809
|
+
"arktype->zod",
|
|
33810
|
+
"zod->superstruct",
|
|
33811
|
+
"superstruct->zod",
|
|
33812
|
+
"io-ts->effect"
|
|
33808
33813
|
],
|
|
33809
33814
|
devices: 4,
|
|
33810
33815
|
ciSupport: true,
|
|
@@ -33846,7 +33851,12 @@ var TIER_FEATURES = {
|
|
|
33846
33851
|
"any->valibot",
|
|
33847
33852
|
"zod->valibot",
|
|
33848
33853
|
"zod->yup",
|
|
33849
|
-
"valibot->zod"
|
|
33854
|
+
"valibot->zod",
|
|
33855
|
+
"zod->arktype",
|
|
33856
|
+
"arktype->zod",
|
|
33857
|
+
"zod->superstruct",
|
|
33858
|
+
"superstruct->zod",
|
|
33859
|
+
"io-ts->effect"
|
|
33850
33860
|
],
|
|
33851
33861
|
devices: Infinity,
|
|
33852
33862
|
ciSupport: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "schemashift-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "TypeScript schema migration CLI - migrate between Zod, Yup, Joi, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -48,13 +48,19 @@
|
|
|
48
48
|
},
|
|
49
49
|
"author": "Joseph May",
|
|
50
50
|
"license": "MIT",
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22.0.0"
|
|
53
|
+
},
|
|
51
54
|
"dependencies": {
|
|
52
|
-
"@schemashift/core": "0.
|
|
53
|
-
"@schemashift/io-ts-
|
|
54
|
-
"@schemashift/
|
|
55
|
-
"@schemashift/
|
|
56
|
-
"@schemashift/zod
|
|
57
|
-
"@schemashift/zod-
|
|
55
|
+
"@schemashift/core": "0.10.0",
|
|
56
|
+
"@schemashift/io-ts-effect": "0.10.0",
|
|
57
|
+
"@schemashift/io-ts-zod": "0.10.0",
|
|
58
|
+
"@schemashift/joi-zod": "0.10.0",
|
|
59
|
+
"@schemashift/yup-zod": "0.10.0",
|
|
60
|
+
"@schemashift/zod-arktype": "0.10.0",
|
|
61
|
+
"@schemashift/zod-superstruct": "0.10.0",
|
|
62
|
+
"@schemashift/zod-valibot": "0.10.0",
|
|
63
|
+
"@schemashift/zod-v3-v4": "0.10.0",
|
|
58
64
|
"commander": "14.0.2",
|
|
59
65
|
"cosmiconfig": "9.0.0",
|
|
60
66
|
"glob": "13.0.0",
|
|
@@ -63,7 +69,7 @@
|
|
|
63
69
|
"picocolors": "1.1.1"
|
|
64
70
|
},
|
|
65
71
|
"devDependencies": {
|
|
66
|
-
"@schemashift/license": "0.
|
|
72
|
+
"@schemashift/license": "0.10.0"
|
|
67
73
|
},
|
|
68
74
|
"publishConfig": {
|
|
69
75
|
"access": "public"
|