Closed jookshub closed 1 year ago
Hi @jookshub , Thank you for your feedback!
I think that change like below,
.option('useDirective', {
describe: 'add directive as first line into created index.ts files. eg. \'use client\' ',
type: 'string',
})
I think that useDirective
option is useful for many people as well as next.js user
Hi @jookshub,
I add useDirective
option in v1.8.0
, You can use this option like that,
ctix single -p tsconfig.json -useDirective "'use client'"
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
ctix@1.6.0
for the project I'm working on.In order to circumvent this issue with NextJS https://github.com/vercel/next.js/issues/41940 I had to include the 'use client' directive into multiple index files, so I've leveraged your project to do that via CLI.
Along the way I've also fixed the duplicated output of comment/timestamp in the
indexFileWrite
function. ThefirstLine
is included inprettierApplied
so there is no need to redo that whenprettierApplied
gets used.I did not check against other configurations and consider this a quick working draft that helps me moving forward to other more pressing issues 🙂 I might be able to improve this solution at another time.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.