Skip to content

Commit

Permalink
Add Typescript SDK docker name for IR migrations (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachkirsch authored Dec 10, 2022
1 parent 4af1163 commit ceb94ed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("migrateIntermediateRepresentation", () => {

it("runs migration if generator is equal to migration version", () => {
const migrated = migrateIntermediateRepresentation({
generatorName: "fernapi/fern-typescript",
generatorName: "fernapi/fern-typescript-sdk",
generatorVersion: "0.0.245",
intermediateRepresentation: MOCK_IR_V2 as unknown as IntermediateRepresentation,
});
Expand All @@ -72,7 +72,7 @@ describe("migrateIntermediateRepresentation", () => {

it("runs migration if generator is less than migration version", () => {
const migrated = migrateIntermediateRepresentation({
generatorName: "fernapi/fern-typescript",
generatorName: "fernapi/fern-typescript-sdk",
generatorVersion: "0.0.244",
intermediateRepresentation: MOCK_IR_V2 as unknown as IntermediateRepresentation,
});
Expand All @@ -89,7 +89,7 @@ describe("migrateIntermediateRepresentation", () => {

it("does not run migration if generator is great to migration version", () => {
const migrated = migrateIntermediateRepresentation({
generatorName: "fernapi/fern-typescript",
generatorName: "fernapi/fern-typescript-sdk",
generatorVersion: "0.0.246",
intermediateRepresentation: MOCK_IR_V2 as unknown as IntermediateRepresentation,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { AlwaysRunMigration, IrMigration } from "../../types/IrMigration";

export const V2_TO_V1_MIGRATION: IrMigration<V2.ir.IntermediateRepresentation, V1.ir.IntermediateRepresentation> = {
requiredForGeneratorVersions: {
"fernapi/fern-typescript": "0.0.245",
"fernapi/fern-typescript": AlwaysRunMigration,
"fernapi/fern-typescript-sdk": "0.0.245",
"fernapi/fern-python": AlwaysRunMigration,
"fernapi/fern-java": AlwaysRunMigration,
"fernapi/fern-openapi": AlwaysRunMigration,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const GeneratorName = {
TYPESCRIPT: "fernapi/fern-typescript",
TYPESCRIPT_SDK: "fernapi/fern-typescript-sdk",
JAVA: "fernapi/fern-java",
PYTHON: "fernapi/fern-python",
OPENAPI: "fernapi/fern-openapi",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export interface IrMigration<NextVersion, PreviousVersion> {
* if the targeted generator's version is less than or equal to its value in
* requiredForGeneratorVersions, then this migration is needed.
*
* if the targeted generator's version is greater than its value in this map,
* or the targeted generator's name is not in this map, then this migration
* is needed.
* if the targeted generator's version is greater than its value in this
* map, or the value in this map is `undefined`, then this migration is
* needed.
*
* if the targeted generator's version is AlwaysRunMigration, then this
* migration is needed
Expand Down

0 comments on commit ceb94ed

Please sign in to comment.