Skip to content

Latest commit

 

History

History
126 lines (90 loc) · 5.16 KB

internal.md

File metadata and controls

126 lines (90 loc) · 5.16 KB

Develop, test and deploy

NOTE: This section is intended for internal team members. If you are an external developer, please check this documentation.

Getting Started

Run the following commands to install dependencies and start developing

yarn install
yarn dev

Scripts

  • yarn dev - run webpack in watch mode using the "internal" variant
  • yarn dev-public - run webpack in watch mode using the "public" variant
  • yarn storybook - runs the Storybook server
  • yarn build - builds the production-ready unpacked extension
  • yarn package - packages the built code for upload
  • yarn test -u - runs Jest + updates test snapshots
  • yarn lint - runs Stylelint and ESLint
  • yarn prettify - runs Prettier
  • yarn open-firefox - opens Sporran in Firefox
  • yarn open-chrome - opens Sporran in Chrome

Testing in browser

Getting the internal version of extension

  1. Go to actions page for "Packages the internal version".
  2. Click on the build you want to test.
  3. Download the extension file from the Artifacts section at the bottom.
  4. Unpack the downloaded sporran-???.zip file.

Getting the public version of extension

  1. Go to actions page for "Packages the public version".
  2. Click the buttons "Run workflow" -> "Run workflow" to prepare the public version and wait for the workflow to finish.
  3. Click the link for the just finished workflow and download the extension file from the Artifacts section at the bottom.
  4. Unpack the downloaded .zip file and unpack the sporran-???.zip from it as well.

Testing in Chrome

  1. Navigate to chrome://extensions.
  2. Enable Developer Mode by clicking the toggle switch next to Developer mode.
  3. Click the Load unpacked button and select the directory you have unpacked the extension into.

Testing in Firefox

  1. Navigate to about:debugging#/runtime/this-firefox.
  2. Click the Load Temporary Add-on... button.
  3. Select the manifest.json from the directory you have unpacked the extension into.

Build and package for uploading

Update the version in src/static/manifest.json and src/configuration/configuration.ts.

For the external version

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. This version will only connect to KILT Spiritnet blockchain via predefined node endpoints.

For the internal version

Run the following commands:

yarn install
yarn build-internal
yarn package

This will generate a file dist/web-ext-artifacts/sporran-???.zip ready for developers to use. This version will connect to any node endpoints the user inputs and by default to the KILT Peregrine blockchain.

Uploading to the releases page

We recommend external developers to download the test version of the Sporran extension from the releases page on GitHub. The uploads to this page occur manually. Only Sporran versions using changes merged to main should be published as releases.

To get a releasable Sporran Extension file you could either build and package it locally or, alternatively, follow these steps:

  1. Merge the wished changes to main.
  2. Go to the Sporran GitHub's Actions page for "Packages the internal version".
  3. Click on the workflow of the wished commit.
  4. Download the artifact.

Before updating it to the release page, please prepend a "TEST-" to the zip file's name. If you got the extension from the GitHub workflow, it would be nice to replace the commit hash with the Sporran version on the zip's name.

To upload:

  1. Go to the releases page.
  2. Copy title and description of an older release.
  3. Click on Draft a new release
  4. Paste title and description and attach the Sporran extension zip file.
  5. Choose as tag the version of Sporran being released. You can directly create the tag while publishing the release.
  6. Publish the release.

Built with

Misc. References