Skip to content

Monorepo structure #17

@gadenbuie

Description

@gadenbuie

A couple quick suggestions about the monorepo structure:

First, I recommend using pkg-r and pkg-py rather than r-package and python-package for the package subdirectory names. The pkg- prefix keeps these folders together and the shorter versions require less typing, e.g. pak::pak("posit-dev/querychat@pkg-r") vs pak::pak("posit-dev/querychat@r-package"). I used this pattern in brand-yml and upcoming in shinychat.

Second, unlike R packages, Python's pyproject.toml file can be at the root of the repo, which then obviates the need for the subdirectory= directive when installing from GitHub. It's relatively simple to set up, you only need to update the project metadata to refer to pkg-py/src/querychat instead of src/querychat.

A small note: .Rbuildignore needs to be in the R package subdir.

Finally, with these larger projects, I think it's worth moving the Makefile to the top level and using it to coordinate everything, including common R tasks. The Makefile in this repo came from chatlas which was adapted from brand.yml's Makefile which was set up to work in a monorepo context. You can see in the shinychat monorepo branch how I extended the Makefile to cover R, Python, and docs in that file.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions