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.
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 repositorycd dashtabpnpm install
Running / Development
pnpm start- Visit your app at http://localhost:4200.
- Visit your tests at http://localhost:4200/tests.
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.1and only accepts requests from the app origin that include theX-Dashtab-Proxyheader, so it cannot be abused as an open proxy. - Override the address/port with
DASHTAB_CORS_PROXY(the base URL the client uses) andDASHTAB_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:chromebuild the app intoextension/build/firefox/andextension/build/chrome/respectively (production), with the matchingextension/manifest.<browser>.json.pnpm ext:build:dev:firefox/pnpm ext:build:dev:chromedo the same as a development build.pnpm ext:devrebuilds on change and launches Firefox viaweb-ext(dedicated temporary profile). Changes reload the add-on rather than using HMR.pnpm ext:serverunsweb-extagainst an existingextension/build/firefox/.- Load manually:
about:debugging#/runtime/this-firefox→ Load Temporary Add-on… → selectextension/build/firefox/manifest.json(Firefox), orchrome://extensions→ Load unpacked →extension/build/chrome/(Chrome). pnpm ext:lintvalidates 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:packbuilds both targets and produces a signed Firefox.xpiand a Chrome.zipinweb-ext-artifacts/. Firefox signing usesweb-ext sign(unlisted); the AMO API credentials are read from the GNOME Keyring withsecret-tool(seescripts/release/sign-firefox.mjsfor 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 lintpnpm lint:fix
Building
pnpm vite build --mode development(development)pnpm build(production)
Deploying
Specify what it takes to deploy your app.