Le mercredi 29 octobre 2025, 10:24:49 heure normale d’Europe centrale Bastien Roucaries a écrit :
> Le mercredi 29 octobre 2025, 01:02:58 heure normale d’Europe centrale Jérémy Lal a écrit :
> > Le mer. 29 oct. 2025 à 00:59, Bastien Roucaries <rouca@debian.org> a écrit :
> >
> > > Le mercredi 29 octobre 2025, 00:48:44 heure normale d’Europe centrale
> > > Jérémy Lal a écrit :
> > > > Le mar. 28 oct. 2025 à 23:23, Bastien Roucaries <rouca@debian.org> a
> > > écrit :
> > > >
> > > > > Hi,
> > > > >
> > > > > I have improved https://salsa.debian.org/js-team/node-glob
> > > > >
> > > > > But I am not happy with result
> > > > > https://salsa.debian.org/js-team/node-glob/-/pipelines/964670
> > > > >
> > > > > Do you have ideas how to fix ?
> > > >
> > > >
> > > > The glob API has changed a lot - the major version bumps reflect the
> > > > reality.
> > > > - update packages to versions that support glob >= 10
> > > > - sometimes it's not going to be easy and a patch is easier (e.g.
> > > > node-glob-stream ? not even sure, as glob.stream() exists now, but
> > > upstream
> > > > node-glob-stream rejects this and made their own version of it).
> > > >
> > > > Example:
> > > > const glob = promisify(require('glob'))
> > > > becomes
> > > > const { glob } = require('glob')
> > > > because the API switched to Promises, so promisify makes no sense now.
> > > > Which is good in general, but bad for a smooth transition of glob.
> > >
> > > I need a @types/glob stub in order to ease transition
> > >
> > > a @types/ modules that redirect to glob that include glob/index.d.ts
> > >
> > > I do something like this for another package and it will help at least two
> > > package to compiles
> > >
> > > Did you remember where I have done the stub @types ?
> > >
> >
> > I don't, and am not sure I understand.
> > Searching for @types/glob gives this list of packages:
> > https://codesearch.debian.net/results/3d44cd4d99045a3a/packages.txt
>
> Hi,
>
> This kind of stuff should be put somewhere on wiki
> https://salsa.debian.org/rouca/node-glob/-/blob/b216bff760596e9746a571d0ab19716e387dc785/debian/patches/0003-Add-compatibility-types.patch
But I believe I commited a mistake because
https://salsa.debian.org/rouca/node-glob/-/jobs/8519296#L2026
The idea is here but forget how to implement
A bettter way is to generate the *.d.ts during build, and install them.
Which is already the case in node-glob, it installs /usr/share/nodejs/glob/dist/mjs/index.d.ts
which is declared in node-glob's package.json.
When a package builds its own typescript definitions (*.d.ts files), dh-nodejs will install them, as long as they are declared in package.json. They won't go to /usr/share/nodejs/@types/thatmodule/, and instead are kept inside /usr/share/nodejs/thatmodule/, and that's perfectly fine.