[Pkg-javascript-devel] RFS: node-ts-loader

Yadd yadd at debian.org
Mon Nov 21 08:18:14 GMT 2022


Le Dimanche, Novembre 20, 2022 22:38 CET, Israel Galadima <izzygaladima at gmail.com> a écrit: 
> Hello Yadd,
> 
> I've dropped the chalk component.
> 
> However, I noticed that when I ran node -p require('chalk') in the package
> folder without the chalk component I got this chalk object
> 
> [Function: chalk] createChalk { level: 2 }
> 
> And when I ran node -p require('chalk') in the package folder with the
> chalk component I got this chalk object
> 
> [Function (anonymous)] Chalk {
>     constructor: [Function (anonymous)],
>     Instance: [class ChalkClass],
>     supportsColor: { level: 2, hasBasic: true, has256: true, has16m: false
> },
>     stderr: [Function (anonymous)] Chalk {
>         constructor: [Function(anonymous)],
>         Instance: [class ChalkClass],
>         supportsColor: { level: 2, hasBasic: true, has256: true, has16m:
> false }
>     }
> }
> 
> Both requires don't return the same chalk object.
> 
> And there are files in the package that use properties from the chalk
> object returned with the chalk component. An example is in src/instances.ts
> 
> const colors = new chalk.Instance({ level });
> 
> Instance is only a property in the chalk object when we use the chalk
> component. It will be unavailable if we choose to exclude the chalk
> component.

Yes, Debian has chalk 5 while this package requires chalk 4 and API are different. However, this works in many cases (Debian package builds a commonjs file using rollup because chalk 5 is ES only)

I pushed your package to NEW queue. Thanks for your work !

Cheers,
Yadd




More information about the Pkg-javascript-devel mailing list