gosling.js icon indicating copy to clipboard operation
gosling.js copied to clipboard

chore: update generic-filehandle to v3

Open manzt opened this issue 1 year ago • 2 comments

Updates generic-filehandle to latest version with https://github.com/GMOD/generic-filehandle/pull/103

Checklist

  • [x] Ensure the PR works with all demos on the online editor
  • [ ] Unit tests added or updated
  • [ ] Examples added or updated
  • [ ] Documentation updated (e.g., added API functions)
  • [ ] Screenshots for visual changes (e.g., new encoding support or UI change on Editor)

manzt avatar Aug 23 '22 14:08 manzt

I'm not getting the same error. yarn build? I think this could be due to @gmod/bbi-js using a default import from generic-filehandle.

manzt avatar Aug 31 '22 20:08 manzt

Yes, I get an error when I run yarn and then yarn build:

Full Error Message
yarn build
yarn run v1.22.19
$ run-s build-clear build-types build-lib
$ rm -rf ./dist
$ tsc --emitDeclarationOnly -p tsconfig.build.json
$ vite build --mode lib && node scripts/build-umd && node scripts/build-embed
vite v2.9.5 building for lib...
✓ 1891 modules transformed.
✓ 2012 modules transformed.
✓ 536 modules transformed.
rendering chunks (1)...Sourcemap is likely to be incorrect: a plugin (at position 12) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
Sourcemap is likely to be incorrect: a plugin (at position 12) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
dist/assets/vcf-worker.7d6e5fc7.js.map   848.86 KiB
dist/assets/bam-worker.89a607cc.js.map   1488.45 KiB
dist/gosling.es.js                       3196.71 KiB / gzip: 585.64 KiB
dist/gosling.es.js.map                   2936.59 KiB
 > dist/gosling.es.js:18:7: error: No matching export in "node_modules/generic-filehandle/esm/index.js" for import "default"
    18 │ import require$$7, { RemoteFile as RemoteFile$1 } from "generic-filehandle";
       ╵        ~~~~~~~~~~

/Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:1475
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
dist/gosling.es.js:18:7: error: No matching export in "node_modules/generic-filehandle/esm/index.js" for import "default"
    at failureErrorWithLog (/Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:1475:15)
    at /Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:1133:28
    at runOnEndCallbacks (/Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:1051:65)
    at buildResponseToResult (/Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:1131:7)
    at /Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:1240:14
    at /Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:611:9
    at handleIncomingPacket (/Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:708:9)
    at Socket.readFromStdout (/Users/sehilyi/Documents/gosling/gosling.js/node_modules/esbuild/lib/main.js:578:7)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12) {
  errors: [
    {
      detail: undefined,
      location: {
        column: 7,
        file: 'dist/gosling.es.js',
        length: 10,
        line: 18,
        lineText: 'import require$$7, { RemoteFile as RemoteFile$1 } from "generic-filehandle";',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'No matching export in "node_modules/generic-filehandle/esm/index.js" for import "default"'
    }
  ],
  warnings: []
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build-lib" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Ah, I think you are right. In dist/gosling.es.js, require$$7 is used only for bbi:

import require$$7, { RemoteFile as RemoteFile$1 } from "generic-filehandle";
   //  ^^^^^^^^^^ No matching export in "node_modules/generic-filehandle/esm/index.js" for import "default

// ...

var _genericFilehandle = require$$7;

// ...

    if (filehandle) {
      this.bbi = filehandle;
    } else if (url) {
      this.bbi = new _genericFilehandle.RemoteFile(url);
    } else if (path) {
      this.bbi = new _genericFilehandle.LocalFile(path);
    } else {
      throw new Error("no file given");
    }

sehilyi avatar Aug 31 '22 20:08 sehilyi

Would be great to revisit this PR and many others related to updating dependencies...

manzt avatar Mar 12 '23 20:03 manzt

Maybe we just need to upgrade @gmod/bbi-js as well. Its version pinned in our package.json is ^1.0.30 which is way behind the current version (v3.0.0).

sehilyi avatar Mar 16 '23 00:03 sehilyi