-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli/migrate): separate transform-related exports from the tr…
…ansform because jscodeshift does not have full typescript support for transforms
- Loading branch information
Showing
5 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/remix-dev/cli/migrate/migrations/replace-remix-imports/transform/adapter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const adapters = [ | ||
"architect", | ||
"cloudflare-pages", | ||
"cloudflare-workers", | ||
"express", | ||
"netlify", | ||
"vercel", | ||
] as const; | ||
export type Adapter = typeof adapters[number]; | ||
export const isAdapter = (maybe: string): maybe is Adapter => { | ||
return (adapters as readonly string[]).includes(maybe); | ||
}; |
7 changes: 7 additions & 0 deletions
7
packages/remix-dev/cli/migrate/migrations/replace-remix-imports/transform/options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { Adapter } from "./adapter"; | ||
import type { Runtime } from "./runtime"; | ||
|
||
export interface Options { | ||
runtime: Runtime; | ||
adapter?: Adapter; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/remix-dev/cli/migrate/migrations/replace-remix-imports/transform/runtime.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const runtimes = ["cloudflare", "node"] as const; | ||
export type Runtime = typeof runtimes[number]; | ||
export const isRuntime = (maybe: string): maybe is Runtime => { | ||
return (runtimes as readonly string[]).includes(maybe); | ||
}; |