0.0.12 • Published 3 years ago
@lightningrodlabs/create-we-applet v0.0.12
@lightningrodlabs/create-we-applet
Easily scaffold a We Applet UI package.
Usage
Run this in the project subfolder where you want to create the applet:
npx @lightningrodlabs/create-we-applet [APPLET NAME]For example:
npx @lightningrodlabs/create-we-applet notebooksThis will create a we-applet folder, with the necessary setup to create a We Applet. This would usually be a small NPM workspace inside a bigger repository.
If your project was scaffolded using npm init @holochain, here are your next steps:
- In your root
package.json:- Include the newly scaffolded package in the
workspacesfield.
- Include the newly scaffolded package in the
- In the
we-appletpackage, add the dependency to your local package where your elements and store live, and runnpm installfrom the root folder of the repository. In the
we-applet/src/[APPLET NAME]-applet.tsfile:- Instantiate your store in the
firstUpdatedfunction. - Add your elements to the
static get scopedElements()getter. - Add your elements to the HTML for them to render appropriately.
- Instantiate your store in the
In the
workdir/dna.yamlfile for the generated applet, change the location of the zome.- In the
package.jsonfile for the generated applect, change theCARGO_TARGET_DIRdirectory to which you will be compiling. - Change the
icon.pngto the icon you would like this applet to have.