snap-tama1
v0.1.22
Published
**This will be updated in the AM namespace for development purposes until it is ready to be viewed on the new Pixelmon-minigames organization repo**
Downloads
3
Readme
snap-tama
This will be updated in the AM namespace for development purposes until it is ready to be viewed on the new Pixelmon-minigames organization repo
This snap runs the core logic of Pixelmon's tamagotchi-like minigame.
This snap was based off of the standard metamask snap template. The snap runs within the Metamask browser environment, and will prompt the user to install it from the specified NPM package where it is published (TBC).
Run locally
yarn start
- runs the app on the default port :8080 which the frontend interface will read from when run locally.
Known Errors
On the browser console, you might get this error after adjusting snap.manifest.json:
RPC Error: Failed to fetch Snap "local:http://localhost:8080": Invalid Snap manifest: manifest shasum does not match computed shasum.
Run yarn fix-shasum
to reload the shasum.
Publishing NPM package
Run yarn npm-release
. It will execute the following steps:
- Update version number in both package.json and snap.manifest.json
- Run
yarn fix-shasum
- Run
npm publish
You will need to give execution permissions to the shell script with chmod +x ./increment_versions.sh
and run brew install jq
in the terminal.
Unpublishing
Run npm unpublish <package_name>@<version>
Testing
The snap comes with some basic tests, to demonstrate how to write tests for
snaps. To test the snap, run yarn test
in this directory. This will use
@metamask/snaps-jest
to run the tests in src/index.test.ts
.
Notes
- Babel is used for transpiling TypeScript to JavaScript, so when building with
the CLI,
transpilationMode
must be set tolocalOnly
(default) orlocalAndDeps
.