hey all, wanted to start a thread about the `\exam...
# dev
z
hey all, wanted to start a thread about the
\examples
. I'm encountering a lot of weirdness re missing packages. pretty sure it has to do with the monorepo setup because every example works fine if I move it outside the root dir and run npm i from there. here is a related issue: https://github.com/medplum/medplum-chart-demo/issues/5 also another aside: the way that this chart repo is a mirror of the same dir in the monorepo really threw me off. it also doesn't work because it is missing the packages from the monorepo
.
the medplum chart demo is a tad more complex because of the bots. but i can't even get the chat demo working with these steps:
Copy code
gh repo clone medplum/medplum
cd medplum-chat-demo
npm i
npm run dev
nor does
npm run dev --workspace examples/medplum-chat-demo
work.
nor does subsequently running
npm i
in each eaxmples' dir, as directed by the READMEs
BUT, move the chat demo outside of the monorepo then a simple
npm i && npm run dev
works like a charm ...
medplum-chart-demo
directory is def missing packages as the issue above notes. will make a pr for that rn
also worth noting that while these break-out example repos are mirrors of their monorepo origins, the issues made in these repos don't seem to propagate upstream or trigger any other GH action. might be worth making a ticket to further discuss how issues and PRs here don't fall through cracks
r
Thank you @zuchka_ !
This is all good feedback. Our goal with the mirrored repos was for it to be a better DX to clone a single example. But b/c of the monorepo structure, our tests sometimes don't catch missing packages b/c they are present in the root package.json
We're not experts at this mirroring workflow. Have you seen any repos that do this really well? Would love to get some feedback on what kind of toolchain would make sense to maek sure these things don't get lost
z
it's a cool setup. and I love the monorepo approach in general. just thinking out loud about some ways to help new users like me avoid speed bumps. I see the advantage of the examples being broken out. I def cloned the chart one exactly like that. But, I did notice when I first landed that the commit details for each of the files / directories were all wiped and replaced with a generic merge message. So my first impression was seeing this instead of this
excluding some gh action that syncs issues between here and the monorepo, not sure what quick solutions there are here re the larger problem
found the same issue with
medplum-patient-intake-demo
. needs some extra packages to run
npm run build:bots
. testing all the freestanding examples rn
r
Thank you so much 🙏 . We're happy to open up a PR to fix all of these
Sorry for the rough edge
z
no worries. already submitted a pr for the first one https://github.com/medplum/medplum/pull/5017. will test the rest before I submit anymore more 😎
319 Views