This repository is a yarn workspace made of 1 package reactus, which is already published to NPM as reactus. It supports both cjs and esm based projects by providing an cjs and esm folder made using a build script, then configuring the type (set to module), export map, import map, require map, and type maps in reactus/package.json.
The following folders and files are found in the root of the project.
docs- The official documentation of the project.examples- Various working examples project templatesreactus- The source code for the relative work involved.
Please ignore the following folders:
archivesreactus/.nyc_outputreactus/coverage
In this project we use yarn to execute scripts. Please do not use npm.
We use package.json to call scripts from packages like so.
yarn build- generates the esm and cjs versions of the reactus frameworkyarn test- runs the tests found inreactus/tests
Before running any scripts in terminal, make sure the session is using NodeJS 22 or above.
Before running yarn build, yarn test, or any other project script, make sure the shell is using Node.js 22 or newer.
Use the following lookup order:
- Check whether
nvmis installed. - If
nvmis installed, try to locate thenvmdirectory that contains the Node binaries and use a Node 22+ binary from there. - If the
nvmdirectory cannot be located, try to switch the shell directly withnvm use 22. - If
nvmis not available or cannot provide Node 22+, try common OS-specific Node install paths. - If Node is still not found, inspect environment variables such as
PATH,NVM_DIR,NODE_HOME, or similar variables that may point to the installation. - If after all of the above Node 22+ still cannot be found, stop the task and ask the user for the Node installation location.
Preferred process:
- First try to detect
nvmwith commands such ascommand -v nvmor by checkingNVM_DIR. - If
nvmexists, prefer Node binaries under thenvminstallation, commonly under:$NVM_DIR/versions/node/~/.nvm/versions/node/
- If a Node 22+ binary is found there, use that runtime for subsequent commands.
- If the folder cannot be resolved cleanly, fall back to
nvm use 22. - If
nvmis unavailable, check common Node locations based on the OS, such as:/usr/local/bin/node/opt/homebrew/bin/node/usr/bin/node- Windows
Program FilesNode.js install paths when relevant
- If needed, inspect environment variables and the active
PATHto find a usablenodebinary. - Do not proceed with project scripts unless Node 22+ has been confirmed.
Great usage examples can be found in the following folders in the examples folder.
examples/with-express/scriptsexamples/with-fastify/scriptsexamples/with-http/scriptsexamples/with-tailwind/scriptsexamples/with-unocss/scripts
When creating documentation please use the root docs folder. Do not add documentation in the reactus folder.