Skip to content

Commit

Permalink
chore: Pretty print "use client" injection
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Oct 16, 2024
1 parent ef053f9 commit d123541
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/nuqs/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFile, writeFile } from 'node:fs/promises'
import { join } from 'node:path'
import { styleText } from 'node:util'
import { defineConfig, type Options } from 'tsup'

const commonConfig = {
Expand Down Expand Up @@ -41,7 +42,11 @@ export default defineConfig([
const withUseClientDirective = `'use client';\n\n${fileContents}`
await writeFile(filePath, withUseClientDirective)
console.info(
`Successfully prepended "use client" directive to ${entry}.`
[
styleText('green', 'USE'),
styleText('bold', filePath.padEnd(29)),
styleText('dim', 'prepended "use client"')
].join(' ')
)
})
)
Expand Down

0 comments on commit d123541

Please sign in to comment.