Files
raucao 66e58c49da Cut and publish extension releases from the version lifecycle
Releases were built and signed in CI, which meant AMO credentials had to
live on the runner. Move the whole flow local: builds and Firefox signing
happen on the maintainer's machine and only the finished artifacts are
published.

Add `ext:pack:firefox` and `ext:pack:chrome` (production builds; the
Firefox one is signed via `web-ext sign` unlisted with credentials read
from the GNOME Keyring through `secret-tool`, the Chrome one is zipped)
and wire them to the `version` lifecycle:

- `preversion` runs lint and tests.
- `version` builds and signs into `web-ext-artifacts/`.
- `postversion` pushes the bump commit and tag, then uploads both
  artifacts to the Gitea release and publishes it if still a draft.

Switch the plain `ext:build:*` scripts to production and add
`ext:build:dev:*` for development builds; `ext:dev` is unchanged. The
build manifest now takes its version from package.json and drops the
"(dev)" name suffix when `DASHTAB_RELEASE=1`.

Because packaging needs a production build, relax the AGENTS.md
production-build restriction to allow it for packaging and releasing.
2026-11-10 12:14:14 +04:00

4.3 KiB

dashtab

This README outlines the details of collaborating on this Ember application. A short introduction of this app could easily go here.

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone <repository-url> this repository
  • cd dashtab
  • pnpm install

Running / Development

Development CORS proxy

pnpm start also launches a small local CORS proxy (cors-anywhere) on http://localhost:8081/, tied to the Vite dev server lifecycle. This lets cross-origin requests (e.g. Discourse notifications, the Bitcoin ticker) work when opening the app directly in a browser, without a third-party proxy.

  • It is bound to 127.0.0.1 and only accepts requests from the app origin that include the X-Dashtab-Proxy header, so it cannot be abused as an open proxy.
  • Override the address/port with DASHTAB_CORS_PROXY (the base URL the client uses) and DASHTAB_CORS_PROXY_PORT (the port the server binds).
  • It is only active in development; production relies on the browser extension's host permissions.

Browser extension

The built app is packaged as an MV3 extension that serves the dashboard directly as the new-tab page (no iframe), so it behaves the same in development and production: requests go out with the extension's host permissions and authorizations use the browser's identity.launchWebAuthFlow.

  • pnpm ext:build:firefox / pnpm ext:build:chrome build the app into extension/build/firefox/ and extension/build/chrome/ respectively (production), with the matching extension/manifest.<browser>.json.
  • pnpm ext:build:dev:firefox / pnpm ext:build:dev:chrome do the same as a development build.
  • pnpm ext:dev rebuilds on change and launches Firefox via web-ext (dedicated temporary profile). Changes reload the add-on rather than using HMR.
  • pnpm ext:serve runs web-ext against an existing extension/build/firefox/.
  • Load manually: about:debugging#/runtime/this-firefox → Load Temporary Add-on… → select extension/build/firefox/manifest.json (Firefox), or chrome://extensions → Load unpacked → extension/build/chrome/ (Chrome).
  • pnpm ext:lint validates the packaged Firefox extension.

Releasing

Cutting a release is local: builds and the Firefox signing happen on your machine, and only the resulting artifacts are published.

  • pnpm ext:pack builds both targets and produces a signed Firefox .xpi and a Chrome .zip in web-ext-artifacts/. Firefox signing uses web-ext sign (unlisted); the AMO API credentials are read from the GNOME Keyring with secret-tool (see scripts/release/sign-firefox.mjs for the entry names).
  • pnpm version <patch|minor|major> runs the linters and tests, bumps the version, builds and signs (pnpm ext:pack), commits and tags, then pushes and uploads both artifacts to the Gitea release for the new tag.

The version in the built manifest comes from package.json; release builds also drop the (dev) name suffix.

The extension IDs are pinned (key in the Chrome manifest, browser_specific_settings.gecko.id in the Firefox manifest) so the OAuth redirect URL is stable. See doc/extension_auth.md for the redirect URLs forum admins must allowlist.

Code Generators

Make use of the many generators for code, try pnpm ember help generate for more details

Running Tests

  • pnpm test

Linting

  • pnpm lint
  • pnpm lint:fix

Building

  • pnpm vite build --mode development (development)
  • pnpm build (production)

Deploying

Specify what it takes to deploy your app.