SynBioDex / sboljs3

A library for the Synthetic Biology Open Language (SBOL) written in TypeScript, for JavaScript/TypeScript applications in the browser or node.js
6 stars 1 forks source link

Node package #21

Open bbartley opened 1 year ago

bbartley commented 1 year ago

Would it be possible to deploy a node package?

I attempted to configure and build my own webpack, but so far have not been successful in transpiling a bundle (using ts-loader).

jamesamcl commented 1 year ago

Hi Bryan, it should be in npm as sboljs with major version 3:

https://www.npmjs.com/package/sboljs

so npm install sboljs should get it

bbartley commented 1 year ago

@udp I am having trouble integrating this package into my own projects. Can you provide any guidance for how to configure a node project to use sboljs?

When I attempt to import sboljs into a local node package, or when I attempt to require it into a simple js script, I get the following:

/Users/bbartley/Dev/git/idt/node_modules/rdfoo/dist/rdfoo/node.js:4
const rdf_ext_1 = require("rdf-ext");
                  ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/bbartley/Dev/git/idt/node_modules/rdfoo/node_modules/rdf-ext/index.js from /Users/bbartley/Dev/git/idt/node_modules/rdfoo/dist/rdfoo/node.js not supported.
Instead change the require of index.js in /Users/bbartley/Dev/git/idt/node_modules/rdfoo/dist/rdfoo/node.js to a dynamic import() which is available in all CommonJS modules.

I am not sure if the issue is just because I am a noob at js development, or if there is actually some incompatibility of modules in the dependency tree.