privatenumber / pkgroll

📦 Zero-config package bundler for Node.js + TypeScript
MIT License
1.01k stars 23 forks source link

Possible bug related to --dist #15

Closed ayuhito closed 1 month ago

ayuhito commented 2 years ago

While writing some tests for #11, I was a little confused about this test for the --dist flag.

Is it intended for the command to be used as pkgroll --dist ./nested or as written in the test pkgroll --dist .? I'm not sure if I agree with the test in this case as being intended behaviour.

I was originally intending to use distPath for #11, but that wouldn't work with the current --dist flag setup since we'd be cleaning the . dir instead of ./nested.

Switching it pkgroll --dist ./nested in the test results in the following error:

/home/lotus/pkgroll/node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/error.js:59
                error = new Error(message);
                        ^

Error: Command failed with exit code 1: /home/lotus/.cache/nve/12.22.9/x64/bin/node /home/lotus/pkgroll/dist/cli.js --dist ./nested
Error: Could not find mathing source file for export path "./nested/index.d.ts"
    at tD (/home/lotus/pkgroll/dist/cli-0d8a4c1f.js:21:5041)
    at async /home/lotus/pkgroll/dist/cli-0d8a4c1f.js:37:19127
    at async Promise.all (index 2)
    at async /home/lotus/pkgroll/dist/cli-0d8a4c1f.js:37:19086
    at null.makeError (/home/lotus/pkgroll/node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/error.js:59:11)
    at null.handlePromise (/home/lotus/pkgroll/node_modules/.pnpm/execa@6.1.0/node_modules/execa/index.js:119:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at null.pkgroll (/home/lotus/pkgroll/tests/utils/pkgroll.ts:18:6)
    at null.<anonymous> (/home/lotus/pkgroll/tests/specs/builds/src-dist.ts:88:27)
    at null.<anonymous> (/home/lotus/pkgroll/node_modules/.pnpm/manten@0.0.3/node_modules/manten/dist/index.js:36:9) {
  shortMessage: 'Command failed with exit code 1: /home/lotus/.cache/nve/12.22.9/x64/bin/node /home/lotus/pkgroll/dist/cli.js --dist ./nested',
  command: '/home/lotus/.cache/nve/12.22.9/x64/bin/node /home/lotus/pkgroll/dist/cli.js --dist ./nested',
  escapedCommand: '"/home/lotus/.cache/nve/12.22.9/x64/bin/node" "/home/lotus/pkgroll/dist/cli.js" --dist "./nested"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'Error: Could not find mathing source file for export path "./nested/index.d.ts"\n' +
    '    at tD (/home/lotus/pkgroll/dist/cli-0d8a4c1f.js:21:5041)\n' +
    '    at async /home/lotus/pkgroll/dist/cli-0d8a4c1f.js:37:19127\n' +
    '    at async Promise.all (index 2)\n' +
    '    at async /home/lotus/pkgroll/dist/cli-0d8a4c1f.js:37:19086',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Possibly related to the dts plugin not taking in the dist arg properly? I could dig around a little if you have any clues which file may be related.

privatenumber commented 1 month ago

Closing as this seems stale. Feel free to file a new issue if it comes up again