Skip to content

Commit ed8e9f4

Browse files
committed
Update changelog and bump version to 0.1.1 for Zod to Valibot codemod
1 parent 712b966 commit ed8e9f4

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

codemod/zod-to-valibot/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the library will be documented in this file.
44

5+
## v0.1.1 (December 06, 2025)
6+
7+
- Fix CLI `jscodeshift` resolution when installed via `npx`
8+
59
## v0.1.0 (December 06, 2025)
610

711
- Initial release

codemod/zod-to-valibot/cli.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env node
22

33
import { execSync } from 'child_process';
4+
import { createRequire } from 'module';
45
import path from 'path';
56
import { fileURLToPath } from 'url';
67

78
const __dirname = path.dirname(fileURLToPath(import.meta.url));
89
const transformPath = path.join(__dirname, 'dist', 'index.mjs');
9-
const jscodeshift = path.join(__dirname, 'node_modules', '.bin', 'jscodeshift');
10+
const require = createRequire(import.meta.url);
11+
const jscodeshiftBin = require.resolve('jscodeshift/bin/jscodeshift.js');
1012

1113
const args = process.argv.slice(2);
1214
const hasParserArg = args.some(
@@ -37,15 +39,15 @@ Common jscodeshift options:
3739
--dry Run without making changes
3840
--print Print output
3941
--verbose=2 Increase verbosity
40-
--parser=ts Specify parser (default: babel)
42+
--parser=ts Specify parser (default: ts)
4143
4244
For all options, see: jscodeshift --help
4345
`);
4446
process.exit(0);
4547
}
4648

4749
try {
48-
const command = `"${jscodeshift}" -t "${transformPath}" ${finalArgs.join(' ')}`;
50+
const command = `"${process.execPath}" "${jscodeshiftBin}" -t "${transformPath}" ${finalArgs.join(' ')}`;
4951
execSync(command, { stdio: 'inherit' });
5052
} catch (error) {
5153
process.exit(1);

codemod/zod-to-valibot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@valibot/zod-to-valibot",
33
"description": "Official codemod for converting Zod schemas to Valibot",
4-
"version": "0.1.0",
4+
"version": "0.1.1",
55
"license": "MIT",
66
"author": "Elton Lobo",
77
"homepage": "https://valibot.dev",

0 commit comments

Comments
 (0)