Skip to content

benkitzelman/upland-stats-extension

Repository files navigation

Upland Stats

A Chrome extension to give additional property and neighbourhood stats for play.upland.me

Get neighbourhood rental rates as you nav around Upland:

Screen Shot 2023-02-03 at 7 26 54 pm

Zoom viewscreen into a neighbourhood (must be only 1 nighbourhood in viewscreen), and get property data. Filter by atttribute like USD / UPX purchasable properties

Screen Shot 2023-02-03 at 7 27 25 pm

Save properties to your stash to track and compare.

Screen Shot 2023-02-04 at 12 39 55 pm

Compare your property list and track the base Return on Investment (ROI) on each.

Screen Shot 2023-02-04 at 12 40 07 pm

Installation

To install the extension as is, either pull with GIT or:

  • download a zip and extract
  • In Chrom(ium) visit chrome://extensions
  • Click Load unpacked
  • Select the ./dist folder from wherever you extracted to

Finally, when visiting play.upland.me - open the extension from the extensions menu (or pin it)... its in dev - still highly buggy - so if you have loading issues pre logging in - visit the chrome://extensions page agin and hit refresh to reload the extension..

Layout & Tech

  • Typescript + JS
  • Chrome Extension Manifest v3
  • Lib / Services Layer - plumbing coordinating upland api calls
  • UI - The Upland Stats extension popup uses Vue 3 in Vite
  • Worker - A background worker is responsible for monitoring play.upland.me nd echoes state to the UI's vue reactive store. Specifically it:
    • Monitors play.upland.me requests for viewing context
    • Can fetch / parse play.upland.me html on demand

State of things

ATM its just a POC / hack for fun thing - no tests (yet ;)) - tho feel free to add any needed - Playwright and vitest are setup.

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

npm run test:unit

Run End-to-End Tests with Playwright

# Install browsers for the first run
npx playwright install

# When testing on CI, must build the project first
npm run build

# Runs the end-to-end tests
npm run test:e2e
# Runs the tests only on Chromium
npm run test:e2e -- --project=chromium
# Runs the tests of a specific file
npm run test:e2e -- tests/example.spec.ts
# Runs the tests in debug mode
npm run test:e2e -- --debug

Lint with ESLint

npm run lint