sindresorhus / meow

🐈 CLI app helper
MIT License
3.53k stars 150 forks source link

Rewrite in TypeScript #252

Open tommy-mitchell opened 7 months ago

tommy-mitchell commented 7 months ago

Per #233.

tommy-mitchell commented 7 months ago

May have missed some comments, but that's the bulk of where I'm needing clarification. The other TODOs I have are reminders to fix type issues.

sindresorhus commented 6 months ago

FYI: https://github.com/sindresorhus/meow/commit/e9a55cdd748d3f451c761c46eba1cfb7ca862dbe

tommy-mitchell commented 6 months ago

Do we support a shorthand for setting flags?

const cli = meow({
    importMeta: import.meta
    flags: {
        rainbow: 'boolean',
        unicorn: 'string',
    },
});
sindresorhus commented 6 months ago

Do we support a shorthand for setting flags?

No. That's not something I want to support either.

tommy-mitchell commented 6 months ago

Got it. I think this test case (and maybe another?) had confused me before and I was remembering something about it:

https://github.com/sindresorhus/meow/blob/c97c03161753f611798996978e8274323c004382/test/errors.js#L38-L40

sindresorhus commented 6 months ago

That test case is incorrect.

tommy-mitchell commented 5 months ago

Updated to reflect changes from other PRs. Type tests are failing due to tsd not seeing minimist-options.d.ts.

tommy-mitchell commented 5 months ago

CI is failing due to https://github.com/sindresorhus/type-fest/pull/824

tommy-mitchell commented 5 months ago

I'm not sure how to fix the timeout issue, I get it sometimes locally when running npm test but never with npx ava.

sindresorhus commented 5 months ago

Maybe try downgrading to ava@5 for now.

tommy-mitchell commented 5 months ago

Didn't work, guess it's something on our end. Now it doesn't even say which test timed out.

sindresorhus commented 5 months ago

Works for me now: https://github.com/sindresorhus/meow/pull/252/commits/64f0915b8aa0ed42b9a04fc4bc7b814e125b57d3

sindresorhus commented 5 months ago

Hmm, or maybe not. Maybe the problem here is tsimp. I never had any problems with tsx. Maybe worth trying that.