dsriseah / ursys

an opinionated javascript library for prototyping realtime web apps
1 stars 2 forks source link

Repo Folder Structure for Exported Libraries #5

Closed dsriseah closed 2 months ago

dsriseah commented 4 months ago

The Challenge

Currently it's unclear how to import an URSYS library without cloning the entire repo as a framework. Ideally we'd want to just be able to do:

npm install git://github.com//dsriseah/ursys

or something like that.

Background

The URSYS repo is intended to be both a build framework and importable npm package.

Another wrinkle is that the core and addons packages have several target platforms with different build systems. At minimum, there are:

Thus, there are multiple kinds of module to handle through the "mailfiles" fields of package.json, and figuring out how to allow each environment to handle const UR = require '@ursys/core' and import * as UR from '@ursys/core' from both nodejs source files (cjs, cts, mjs,mts), common source (js, ts), or browser-compatible (also js, ts) with the right globals is tricky.