<div dir="ltr">Hi Julian,<div><br></div><div>For the first set of errors, you need to exclude all test files from rollup.</div><div>Then for the second, you need to change globby to a named export.</div><div><br></div><div>I've added the relevant commits to my fork on Salsa <a href="https://salsa.debian.org/izzygala/node-webfont">here</a>.<br><br></div><div>Regards.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 22 Dec 2022 at 20:21, Julian Gilbey <<a href="mailto:jdg@debian.org">jdg@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm wondering if anyone has an idea about this.  I've been working on<br>
packaging node-webfont (my current work is on salsa:<br>
<a href="https://salsa.debian.org/js-team/node-webfont" rel="noreferrer" target="_blank">https://salsa.debian.org/js-team/node-webfont</a>).  It now builds, but<br>
there is some really weird behaviour during the build.<br>
<br>
It builds the components that need building, then comes to the main<br>
module and calls rollup:<br>
<br>
---<br>
Found debian/nodejs/./build<br>
        cd ./. && sh -ex debian/nodejs/./build<br>
+ rollup -c<br>
---<br>
<br>
but immediately runs into trouble:<br>
<br>
---<br>
src/cli/index.ts → dist/cli.js...<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module 'tsd' or its corresponding type declarations.<br>
is-svg/index.test-d.ts: (1:26)<br>
<br>
1 import {expectType} from 'tsd';<br>
                           ~~~~~<br>
---<br>
<br>
I don't know why it's looking at is-svg (one of the components); it<br>
shouldn't be touching it.  And even if rollup has to look at it, why<br>
is it looking at one of the test files?  It then hits another is-svg<br>
error, followed by lots of webfont errors, starting with:<br>
<br>
---<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2304: Cannot find name 'jest'.<br>
src/cli/index.test.ts: (8:1)<br>
<br>
8 jest.mock("./meow");<br>
  ~~~~<br>
<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.<br>
src/cli/index.test.ts: (15:1)<br>
<br>
15 describe("cli", () => {<br>
   ~~~~~~~~<br>
<br>
[...]<br>
<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2304: Cannot find name 'beforeAll'.<br>
src/cli/index.test.ts: (17:3)<br>
<br>
17   beforeAll(() => new Promise((resolve, reject) => {<br>
     ~~~~~~~~~<br>
<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2304: Cannot find name 'beforeEach'.<br>
src/cli/index.test.ts: (34:3)<br>
<br>
34   beforeEach(() => new Promise((resolve, reject) => {<br>
     ~~~~~~~~~~<br>
<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.<br>
src/cli/index.test.ts: (60:3)<br>
<br>
60   it("exits with code 2 and displays --help if no argument parameters are passed", async () => {<br>
     ~~<br>
<br>
[...]<br>
<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2304: Cannot find name 'expect'.<br>
src/cli/index.test.ts: (64:5)<br>
<br>
64     expect(output.code).toBe(2);<br>
       ~~~~~~<br>
---<br>
<br>
Installing the jest package made no difference to this error, and<br>
again, I don't understand why it is looking at test files.<br>
<br>
<br>
There was then another, apparently unrelated, error:<br>
<br>
---<br>
(!) Plugin typescript: @rollup/plugin-typescript TS2349: This expression is not callable.<br>
  Type 'typeof import("/usr/share/nodejs/globby/index")' has no call signatures.<br>
src/standalone/index.ts: (121:28)<br>
<br>
121   const foundFiles = await globby([].concat(options.files));<br>
                               ~~~~~~<br>
---<br>
<br>
Any hints or suggestions would be very welcome here!<br>
<br>
(There is also an unrelated issue: one of the included components is<br>
wawoff2, and that is not in source format.  Figuring out how to fix<br>
that looks like a reasonably big job :( )<br>
<br>
Best wishes,<br>
<br>
   Julian<br>
<br>
-- <br>
Pkg-javascript-devel mailing list<br>
<a href="mailto:Pkg-javascript-devel@alioth-lists.debian.net" target="_blank">Pkg-javascript-devel@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel</a><br>
</blockquote></div>