A lightweight monorepo template intended for use in developing javascript packages. Assemble Package leverages:
After creating your new repo from the github template, name your package(s) and modify the contents of the packages
directory to reflect that. Use the example in the packages directory as a reference. You can simply rename both the directory and name in the package.json
file and work off of that.
pnpm install
pnpm run dev
packages
directory.pnpm init
to create a fresh package.json file.pnpm preconstruct init
from the root directory: this will add the necessary config for development and publishing.pnpm add [package-name]
.--save-peer
flag.Note: in order to leverage the monorepo approach in a npm publishing workflow you need to have a paid NPM account - this unlocks private packages (sadly a mandatory in this context).
There is an example Next.js app configured with turbo to work as a testing sandbox for your package development (or you can simply use it as a starting point for your dapp). You will need to modify your imports to reflect the new package name.
In the example app's package.json
you will need to import your development package like so:
"dependencies": {
"[package-name-here]": "workspace:*"
}
Additionally, in next.config.ts
, update the following field with the name of your package:
const nextConfig = {
...
transpilePackages: ['your-package-name-here'],
}
Both examples have been configured to support web3 technologies out of the box with the below dependencies:
Note that this is the most recent version of React and Next.js which introduces more stringent methodolgies around server and client side rendering. This is a good test environment to illustrate optimal package usage especially when content is not hydrated.