From b31f36d522a634f53d44349d6a9ea47f59d84d7a Mon Sep 17 00:00:00 2001 From: awkweb Date: Thu, 31 Aug 2023 16:43:23 -0400 Subject: [PATCH] refactor: remove cli generated header (#2958) --- .changeset/fast-mayflies-sleep.md | 5 +++++ packages/cli/src/commands/generate.test.ts | 3 +-- packages/cli/src/commands/generate.ts | 2 -- packages/cli/test/setup.ts | 8 -------- 4 files changed, 6 insertions(+), 12 deletions(-) create mode 100644 .changeset/fast-mayflies-sleep.md diff --git a/.changeset/fast-mayflies-sleep.md b/.changeset/fast-mayflies-sleep.md new file mode 100644 index 0000000000..c8d5c2d13d --- /dev/null +++ b/.changeset/fast-mayflies-sleep.md @@ -0,0 +1,5 @@ +--- +"@wagmi/cli": patch +--- + +Removed generated file header diff --git a/packages/cli/src/commands/generate.test.ts b/packages/cli/src/commands/generate.test.ts index a65343aef4..c7d90709b3 100644 --- a/packages/cli/src/commands/generate.test.ts +++ b/packages/cli/src/commands/generate.test.ts @@ -138,8 +138,7 @@ describe('generate', () => { await expect( readFile(resolve(dir, 'generated.ts'), 'utf8'), ).resolves.toMatchInlineSnapshot(` - "// Generated by @wagmi/cli@x.y.z on 1/30/2023 at 12:00:00 PM - /* imports test */ + "/* imports test */ /* prepend test */ diff --git a/packages/cli/src/commands/generate.ts b/packages/cli/src/commands/generate.ts index 49e606c273..5555dd28b0 100644 --- a/packages/cli/src/commands/generate.ts +++ b/packages/cli/src/commands/generate.ts @@ -11,7 +11,6 @@ import pc from 'picocolors' import { type Address, getAddress } from 'viem' import { z } from 'zod' -import { version as packageVersion } from '../../package.json' import type { Contract, ContractConfig, Plugin, Watch } from '../config' import { fromZodError } from '../errors' import * as logger from '../logger' @@ -374,7 +373,6 @@ async function writeContracts({ }) { // Assemble code let code = dedent` - // Generated by @wagmi/cli@${packageVersion} on ${new Date().toLocaleDateString()} at ${new Date().toLocaleTimeString()} ${imports.join('\n\n') ?? ''} ${prepend.join('\n\n') ?? ''} diff --git a/packages/cli/test/setup.ts b/packages/cli/test/setup.ts index 9817d32ddd..f97ba76ab5 100644 --- a/packages/cli/test/setup.ts +++ b/packages/cli/test/setup.ts @@ -67,11 +67,3 @@ vi.mock('picocolors', async () => { }, } }) - -vi.mock('../package.json', async () => { - const packageJson = vi.importActual('../package.json') - return { - ...packageJson, - version: 'x.y.z', - } -})