-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): remove backup/restore/force options from set-version (#1687)
- Loading branch information
Showing
7 changed files
with
75 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@latticexyz/cli": major | ||
--- | ||
|
||
Removes `.mudbackup` file handling and `--backup`, `--restore`, and `--force` options from `mud set-version` command. | ||
|
||
To revert to a previous MUD version, use `git diff` to find the version that you changed from and want to revert to and run `pnpm mud set-version <prior-version>` again. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type MudPackages = Record<string, { localPath: string }>; |
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,24 @@ | ||
import { ZodError, z } from "zod"; | ||
import { MudPackages } from "./common"; | ||
|
||
const envSchema = z.object({ | ||
MUD_PACKAGES: z.string().transform((value) => JSON.parse(value) as MudPackages), | ||
}); | ||
|
||
function parseEnv(): z.infer<typeof envSchema> { | ||
try { | ||
return envSchema.parse({ | ||
// tsup replaces the env vars with their values at compile time | ||
MUD_PACKAGES: process.env.MUD_PACKAGES, | ||
}); | ||
} catch (error) { | ||
if (error instanceof ZodError) { | ||
const { _errors, ...invalidEnvVars } = error.format(); | ||
console.error(`\nMissing or invalid environment variables:\n\n ${Object.keys(invalidEnvVars).join("\n ")}\n`); | ||
process.exit(1); | ||
} | ||
throw error; | ||
} | ||
} | ||
|
||
export const mudPackages = parseEnv().MUD_PACKAGES; |
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
3d0b3ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mud-docs – ./
mud-docs.vercel.app
mud-docs-latticexyz.vercel.app
v2.mud.dev
mud-docs-git-main-latticexyz.vercel.app
www.mud.dev
mud.dev