- We recommend using a different browser or a different profile of your browser to avoid mixing up the real Sporran and the play coins Sporran
- Have git, Node.js, and yarn installed
git clone https://github.com/KILTprotocol/sporran-extension.git
cd sporran-extension
yarn install && yarn dev
- Start Chrome and navigate to chrome://extensions (or in Firefox about:debugging#/runtime/this-firefox)
- Enable Developer Mode by clicking the toggle switch next to Developer mode (Chrome only)
- Click the Load unpacked button and select the
sporran-extension/dist
directory (or in Firefox click Load Temporary Add-on... and selectsporran-extension/dist/manifest.json
) - Now you have the internal version of Sporran installed. DO NOT USE IT for real KILT identities/addresses/coins! Click the Sporran icon in the browser toolbar and follow the flow to create an Identity. Click the Receive link and copy the Identity address on the next screen.
- Visit the Faucet, paste the Identity address there, accept the Terms, and click Request Tokens to get some play KILT coins
- Go to actions page for "Packages the internal version".
- Click on the build you want to test.
- Download the extension file from the Artifacts section at the bottom.
- Unpack the downloaded .zip file and unpack the sporran-???.zip from it as well.
- Go to actions page for "Packages the public version".
- Click the buttons "Run workflow" -> "Run workflow" to prepare the public version and wait for the workflow to finish.
- Click the link for the just finished workflow and download the extension file from the Artifacts section at the bottom.
- Unpack the downloaded .zip file and unpack the sporran-???.zip from it as well.
Testing in Chrome
- Navigate to chrome://extensions.
- Enable Developer Mode by clicking the toggle switch next to Developer mode.
- Click the Load unpacked button and select the directory you have unpacked the extension into.
Testing in Firefox
- Navigate to about:debugging#/runtime/this-firefox.
- Click the Load Temporary Add-on... button.
- Select the manifest.json from the directory you have unpacked the extension into.
Run the following commands to install dependencies and start developing
yarn install
yarn dev
Update the version in src/static/manifest.json
and src/configuration/configuration.ts
.
Run the following commands:
yarn install
yarn build
yarn package
This will generate a file dist/web-ext-artifacts/sporran-???.zip
ready to be uploaded to stores.
yarn dev
- runwebpack
inwatch
modeyarn storybook
- runs the Storybook serveryarn build
- builds the production-ready unpacked extensionyarn package
- packages the built code for uploadyarn test -u
- runs Jest + updates test snapshotsyarn lint
- runs Stylelint and ESLintyarn prettify
- runs Prettieryarn open-firefox
- opens Sporran in Firefoxyarn open-chrome
- opens Sporran in Chrome
- Includes a custom mock for the webextension-polyfill-ts package in
src/__mocks__
. This allows you to mock any browser APIs used by your extension so you can develop your components inside Storybook.