@hedia/recommendation-screen
v4.4.5
Published
Hedia Recommendation Screen for Bolus and Carbohydrates
Readme
Recommendation Screen
@hedia/recommendation-screen is the bolus and carbohydrate recommendation screen used by the Hedia app on iOS, Android and web. It is a pure TypeScript React Native library: it has no native code of its own and no runnable app in this repo.
Developing
yarn install
yarn validate # dedupe check, tsc, eslint, package.json lint, prettier, jest (100% coverage required)react-native and the other React Native packages are dev dependencies here so the source can be type-checked, linted and unit-tested. They are not bundled into lib/; the host app provides them at runtime.
Seeing the screen on a simulator or device
The screen is rendered inside hedia-app. To develop against a local checkout of this repo with hot reload:
In
hedia-app/packages/mobile, start Metro against this checkout:yarn start:recommendation-devThis repo must be cloned next to hedia-app (same parent folder).
Run the app as usual (
yarn ios,yarn ios:device,yarn android). Metro bundles this repo'ssrc/instead of the installed npm package and hot reloads on edits.Open the dev screen from
hedia-app/packages/mobile(debug builds only, while logged in and on the Dashboard):yarn recommendation-dev:ios yarn recommendation-dev:android
See packages/mobile/README.md in hedia-app for details.
React Native version policy
react-native, react, @react-native/* and @testing-library/react-native in devDependencies are the local toolchain for type-checking (yarn tsc), linting and Jest. Keep them at the same versions hedia-app uses so type errors and test behaviour here match what ships. Upgrading React Native in this repo is a package.json and yarn.lock change followed by yarn validate.
Releasing
Every non-draft pull request publishes an alpha (x.y.z-alpha.N) to npm and comments the install command on the PR. Merging to master publishes a release and creates a GitHub Release.
Don't change version in package.json in a PR (CI fails if you do). Set one of the major, minor or patch labels instead. After the merge, CI bumps the version by that label, commits it as chore: release x.y.z [skip ci], tags vx.y.z as hedia-bot, and publishes it, so package.json on master always matches the latest version on npm. If publishing fails, re-run the job: it publishes the version it already committed instead of bumping again.
After a release, update the pinned version of @hedia/recommendation-screen in hedia-app's root package.json.
