Conversation
25b5861 to
5b08411
Compare
|
|
||
| const load = require('@commitlint/load'); | ||
| // fix: commitlint load is ported to typescript, until this one is ported we need to unpack it | ||
| const {default: load} = require('@commitlint/load'); |
There was a problem hiding this comment.
This amounts to a breaking change for CommonJS consumers. Can we emit the module to contain the module.exports = ... stanza instead? If i remember correctly there was a tsc settings for this...
There was a problem hiding this comment.
Doesn't fix the breakage for external CommonJS consumers but we can use the default import interop babel provides.
There was a problem hiding this comment.
Maybe we should create a building library that works like bob. With such a tool we can build commonjs, module and just typescript definition files. I think that might be best to keep support for all platforms, right? Internally, we can just use the latest default module system.
marionebl
left a comment
There was a problem hiding this comment.
Looks good at first glance! I'll fiddle around a bit with the any types and check if we can avoid the CommonJS breakage
|
Yeah, I agree with the |
Good job on switching to jest mocking! Thinking about it we might speed up Regarding the TS setting to emit CommonJS |
|
No idea why the pluginloader test acts up now... |
|
I'll take a look tomorrow! I bet it's still repairable 😬 |
|
@marionebl I may need some help finishing this one 😄 The types you added are great, but they also overlap with types from I also implemented the |
Yes, let's export and use the |
Co-authored-by: Armano <[email protected]>
| '**/@commitlint/travis-cli/src/*.test.js?(x)', | ||
| '**/@commitlint/cli/src/*.test.js?(x)', | ||
| '**/@commitlint/prompt-cli/*.test.js?(x)' | ||
| '**/@commitlint/{lint,read,travis-cli,cli,prompt-cli,load}/src/*.test.js?(x)' |
There was a problem hiding this comment.
this is not correct as prompt-cli has no src folder
Description
Part of #659
Motivation and Context
It's kind of an old attempt from me, with some new mocking mechanisms. Instead of using proxyquire, it uses jest. With jest, we can actually import typescript, with proxyquire we cant... I also "made it work" in the CLI, by unpacking from default. Think there might be some things in here that we should change, like the
anycastings. Let me know what you think! 😁Usage examplesHow Has This Been Tested?Types of changesChecklist: