Skip to content

Commit

Permalink
read migrate version from package.json and fix cli path
Browse files Browse the repository at this point in the history
  • Loading branch information
mkusaka committed Sep 25, 2023
1 parent 2fdf934 commit f3bcd1f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/connect-migrate/bin/connect-migrate
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require("../dist/cjs/cli.js");
require("../dist/cjs/src/cli.js");
3 changes: 2 additions & 1 deletion packages/connect-migrate/src/migrations/v0.13.1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from "./v0.13.1";
import { PackageJson } from "../lib/package-json";
import { MigrateOptions } from "../migration";
import packageJson from "../../package.json";

describe("dependencyReplacements", function () {
dependencyReplacements.forEach((r, index) => {
Expand Down Expand Up @@ -178,7 +179,7 @@ describe("migration", function () {
expect(packageJsonWritten.length).toBe(1);
expect(packageJsonWritten[0].pkg).toEqual({
dependencies: {
"@connectrpc/connect": "^1.0.0-rc1",
"@connectrpc/connect": "^" + packageJson.version,
},
});
expect(lockFilesUpdated.length).toBe(1);
Expand Down
3 changes: 2 additions & 1 deletion packages/connect-migrate/src/migrations/v0.13.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import { updateSourceFile } from "../lib/update-source-file";
import { migrateSourceFiles } from "../lib/migrate-source-files";
import { migratePackages } from "../lib/migrate-packages";
import { migrateLockFiles } from "../lib/migrate-lock-files";
import packageJson from "../../package.json";

export const targetVersionConnectEs = "1.0.0";
export const targetVersionConnectEs = packageJson.version;
export const targetVersionConnectQuery = "0.4.4";

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/connect-migrate/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"include": ["src/**/*.ts"],
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"esModuleInterop": true // required for jscodeshift
"esModuleInterop": true, // required for jscodeshift
"resolveJsonModule": true // required for read package.json
}
}

0 comments on commit f3bcd1f

Please sign in to comment.