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.
as a build framework, I clone the repo and then create an app-* folder in it that is gitignored for version control separately from ursys-repo
as an importable npm package, the project in my app-* folder's package.json uses "@ursys/addons": "file:./_ur_addons", "@ursys/core": "file:./_ur" to import through the file system, so I can tweak and add to the core without having to update another repo
Another wrinkle is that the core and addons packages have several target platforms with different build systems. At minimum, there are:
environments: nodejs, web browser
source types: mjs, mts, cts, cjs, js, ts
package formats: commonjs, esm, umd
source maps
typescript type definitions
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.
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:
or something like that.
Background
The URSYS repo is intended to be both a build framework and importable npm package.
app-*
folder in it that is gitignored for version control separately from ursys-repoapp-*
folder'spackage.json
uses"@ursys/addons": "file:./_ur_addons", "@ursys/core": "file:./_ur"
to import through the file system, so I can tweak and add to the core without having to update another repoAnother wrinkle is that the
core
andaddons
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 handleconst UR = require '@ursys/core'
andimport * 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.