Skip to content

Commit

Permalink
refactor: remove cli generated header (#2958)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm authored Aug 31, 2023
1 parent b23ba51 commit b31f36d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-mayflies-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/cli": patch
---

Removed generated file header
3 changes: 1 addition & 2 deletions packages/cli/src/commands/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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') ?? ''}
Expand Down
8 changes: 0 additions & 8 deletions packages/cli/test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
})

1 comment on commit b31f36d

@vercel
Copy link

@vercel vercel bot commented on b31f36d Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.