But now, to ensure consistency and type-safety at least, you pass a single object param, whose properties are required, in order to maintain/retain familiarity with the package.
[x] This will also drastically simply linting and formatting with the near-zero config toolchain, biome
[x] Introduce pre-commit hooks for formatting and testing with husky
[x] Re-write all internal methods.
[x] Provinces
[x] Districts
[x] Sectors
[x] Cells
[x] Villages
[x] Re-write all data in TS
[x] East
[x] Kigali
[x] North
[x] West
[x] South
[x] Write all tests
How should this be manually tested?
pnpm test in the root dir.
If you wish to test the package in a real app locally, navigate into the apps/www dir, hit pnpm i, and hit pnpm dev. You'll notice a bunch of type errors in the src/routes/+page.svelte, which are a demonstration of type violations. Correct them, and in localhost:5173, you should see the correctly rendered data.
Any background context you want to provide?
PNPM and Vite seemed the logical backbones for this. They have excellent D/X, imo.
Would have liked to make all param properties optional, i.e., one could just access the villages of a district or villages of a province, without having to pass all other params, only what you need, but I guess that would be considered in another release.
Since this P.R has gotten too broad, I plan to open another for the docs creation. That is, if the current one is accepted.
I didn't know the effect typing vars that hold tens-of-thousands of values would have on performance and/or bundle size, so I just left typing for provinces, districts, and sectors
What does this PR do?
e.g.
Before, to access districts, it was:
But now, to ensure consistency and type-safety at least, you pass a single object param, whose properties are required, in order to maintain/retain familiarity with the package.
Description of Task to be completed?
pnpm workspace
monorepo with:apps
dir for the docs site, andpackages
dir which will host the actualrwanda
package.formatting
andtesting
with huskyHow should this be manually tested?
pnpm test
in the root dir.apps/www
dir, hitpnpm i
, and hitpnpm dev
. You'll notice a bunch of type errors in thesrc/routes/+page.svelte
, which are a demonstration of type violations. Correct them, and inlocalhost:5173
, you should see the correctly rendered data.Any background context you want to provide?
villages
of adistrict
orvillages
of aprovince
, without having to pass all other params, only what you need, but I guess that would be considered in another release.docs
creation. That is, if the current one is accepted.provinces
,districts
, andsectors
Screenshots (if appropriate)