diff --git a/.changeset/small-dots-poke.md b/.changeset/small-dots-poke.md new file mode 100644 index 0000000000..b77247857c --- /dev/null +++ b/.changeset/small-dots-poke.md @@ -0,0 +1,6 @@ +--- +"@latticexyz/common": patch +"@latticexyz/config": patch +--- + +Removed chalk usage from modules imported in client fix downstream client builds (vite in particular). diff --git a/packages/common/package.json b/packages/common/package.json index 39afa50904..97419abb1f 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -55,7 +55,6 @@ "dependencies": { "@latticexyz/schema-type": "workspace:*", "@solidity-parser/parser": "^0.16.0", - "chalk": "^5.2.0", "debug": "^4.3.4", "execa": "^7.0.0", "p-queue": "^7.4.1", diff --git a/packages/common/src/codegen/utils/format.ts b/packages/common/src/codegen/utils/format.ts index d987ebb71a..5e38d38eee 100644 --- a/packages/common/src/codegen/utils/format.ts +++ b/packages/common/src/codegen/utils/format.ts @@ -1,4 +1,3 @@ -import chalk from "chalk"; import prettier from "prettier"; import prettierPluginSolidity from "prettier-plugin-solidity"; @@ -27,7 +26,7 @@ export async function formatSolidity(content: string, prettierConfigPath?: strin } else { message = error; } - console.log(chalk.yellow(`Error during output formatting: ${message}`)); + console.log(`Error during output formatting: ${message}`); return content; } } diff --git a/packages/common/src/foundry/index.ts b/packages/common/src/foundry/index.ts index 2faffc9acd..8ff7d8b199 100644 --- a/packages/common/src/foundry/index.ts +++ b/packages/common/src/foundry/index.ts @@ -1,5 +1,4 @@ import { execa, Options } from "execa"; -import chalk from "chalk"; export interface ForgeConfig { // project @@ -127,13 +126,13 @@ export async function anvil(args: string[]): Promise { async function execLog(command: string, args: string[], options?: Options): Promise { const commandString = `${command} ${args.join(" ")}`; try { - console.log(chalk.gray(`running "${commandString}"`)); + console.log(`running "${commandString}"`); const { stdout } = await execa(command, args, { stdout: "pipe", stderr: "pipe", ...options }); return stdout; // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { let errorMessage = error?.stderr || error?.message || ""; - errorMessage += chalk.red(`\nError running "${commandString}"`); + errorMessage += `\nError running "${commandString}"`; throw new Error(errorMessage); } } diff --git a/packages/config/package.json b/packages/config/package.json index a335b9d39b..71c6a764c8 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -39,7 +39,6 @@ "dependencies": { "@latticexyz/common": "workspace:*", "@latticexyz/schema-type": "workspace:*", - "chalk": "^5.2.0", "esbuild": "^0.17.15", "ethers": "^5.7.2", "find-up": "^6.3.0", diff --git a/packages/config/src/library/errors.ts b/packages/config/src/library/errors.ts index 256673ad26..8adeda1da9 100644 --- a/packages/config/src/library/errors.ts +++ b/packages/config/src/library/errors.ts @@ -1,4 +1,3 @@ -import chalk from "chalk"; import { z, ZodError, ZodIssueCode } from "zod"; import { fromZodError } from "zod-validation-error"; @@ -15,7 +14,7 @@ export class MUDContextNotCreatedError extends Error { // Wrapper with preset styles, only requires a `prefix` export function fromZodErrorCustom(error: ZodError, prefix: string) { return fromZodError(error, { - prefix: chalk.red(prefix), + prefix: prefix, prefixSeparator: "\n- ", issueSeparator: "\n- ", }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8942de00f0..203cc1065b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -266,9 +266,6 @@ importers: '@solidity-parser/parser': specifier: ^0.16.0 version: 0.16.0 - chalk: - specifier: ^5.2.0 - version: 5.2.0 debug: specifier: ^4.3.4 version: 4.3.4(supports-color@8.1.1) @@ -312,9 +309,6 @@ importers: '@latticexyz/schema-type': specifier: workspace:* version: link:../schema-type - chalk: - specifier: ^5.2.0 - version: 5.2.0 esbuild: specifier: ^0.17.15 version: 0.17.15