Hyperdrive is an open source, Creator-focused, Layer 2 centric NFT marketplace built and maintained by the community that uses it. It is a project consisting of a Rush monorepo, NextJS micro-frontends, and a shared component library.
Before continuing further, check out Rush's Prerequisites and Caveats in their documentation
Install Rush CLI with npm install -g @microsoft/rush
Install all dependencies with rush install
from repository root directory
Generally speaking, you should not need to run these commands often, because adding npm packages should generally be a process that is carefully considered and done sparingly. But if you need to add a package, please try to make that its own separate commit with its own separate Pull Request. However in the beginning of this project we plan to try a lot of stuff out and it might be needed to add a package and implement it in the same Pull Request.
Remember to run rush update whenever a package.json file has changed. In other words:
- After pulling new changes from git (e.g. git pull)
- After manually editing any project's package.json file in any way
- After editing any common/config files that affect versions (e.g. pnpmfile.js, common-versions.json, etc.)
The rush update operation may change some files under common/config. If so, you should commit those changes to Git and include them in your PR. When in doubt, run rush update -- if everything is already up to date, it won't take any time!
What rush update does:
- Rush checks/applies various policies that sometimes update files under common/config.
- Rush compares all of your project package.json files against the repository's common shrinkwrap file to see if it's valid.
- If it's outdated, the package manager updates the shrinkwrap file.
- Either way, the package manager installs all dependencies into the common/temp/node_modules folder.
- Finally, Rush constructs a local node_modules folder for each project, by making symlinks into common/temp/node_modules. (This is the same operation as rush link.)
Once you've pulled the latest changes, it's time to compile everything. rush rebuild
does a full, clean build of every project in the repository.
If your toolchain supports incremental builds, you can also use rush build
to build only the projects that have changed.
Each folder inside of /projects/ is its own separate buildable project with its own build commands, but we just so happen to be using NextJS for all our apps, so you can just run npm run dev
and it will start that project's local build at http://localhost:3000
Another easy way is use make command
Management commands for Hyperdrive:
Usage:
make Prepares and setup up project with default settings
make help Show this menu
make dev-aggregate Start development aggregate site
make dev-creators Start development creators site
make dev-marketing Start development marketing site
🏢 Org Hyperdrive (github.com/Hyperdrive-go/hd)
├── projects (nextjs)
│ ├── aggregate
│ ├── creators
│ └── marketing-site
├── libs
│ ├── i18n (locales for multi-language support)
│ └── ui (webpack, share stub components)
└── common (rush config)
- What is Rush Stack? - learn about the mission behind these projects
- API reference - browse API documentation for NPM packages
- Zulip chat room - chat with the Rush Stack developers
- Rush - a build orchestrator for large scale TypeScript monorepos
- API Extractor - create .d.ts rollups and track your TypeScript API signatures
- API Documenter - use TSDoc comments to publish an API documentation website
- i18Next - use to translate NextJs app
These GitHub repositories provide supplementary resources for Rush Stack:
- rushstack-samples - a monoprepo with sample projects that illustrate various project setups, including how to use Heft with other popular JavaScript frameworks
- rush-example - a minimal Rush repo that demonstrates the fundamentals of Rush without relying on any other Rush Stack tooling
- rushstack-legacy - older projects that are still maintained but no longer actively developed