This project is a monorepo for various NPM packages scoped under @fastnear/
.
Yarn is used in this repo, and it's likely not the yarn commonly installed. You must run:
yarn set version berry
yarn build
Will go through all the workspaces packages (see workspaces
key in package.json
) and build them for ECMAScript, CommonJS, and a Universal Module Definition. This is achieved using esbuild
.
Each workspace package (NPM module) has an esbuild.config.mjs
file that's used to take the TypeScript files in the src
directory and compile them to:
The modern JavaScript module system, primarily used for browser and server environments, and the default for most new packages.
The older module system for NodeJS, ensuring backwards compatibility.
A universal module format that works in browsers (with or without a bundler) and in NodeJS, bridging the gap between different environments.
Universal Module Definition (UMD) is a versatile module format that aims to provide compatibility across different environments, including both browsers and server-side applications. Unlike purely browser-centric solutions like AMD or server-specific formats like CommonJS, UMD offers a unified approach. It checks the environment and adapts accordingly, making it suitable for various scenarios without requiring major adjustments. source
All workspace packages publish a new version regardless of whether the package was modified.
Each package's dist
folder is revisioned, so make sure to run build. Not intending to focus much on CI.
In the project root, open package.json
and change the version that should be reflected in all packages.
yarn constraints
The file yarn.config.cjs
defines a Yarn constraint that takes the root manifest and updates all the workspace package versions based on that.
OTP is required and can be input into the command:
yarn workspaces foreach --all -ptv run publish --access public --tolerate-republish --otp
The rollup
solution is partway done. This allows us to expose helpful information to developers, including for static <script> imports. It's possible we don't need it if esbuild seems to be doing it? just realizing. gotta survey and decide, task-force style
This package seems close to building, but left out to get this repo up for others to see and work on.
Put attention there, could have unaddressed issues