bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

Multiple basedirs

Open thusc opened this issue 4 years ago • 3 comments

This branch allows the Pug templating system to find templates in multiple basedirs. This is part of the required changes to let Bedrock be installed outside a project using it. See https://github.com/usebedrock/bedrock/issues/320.

I have rebased my cli branch on top of this one, and with some additional changes, was able to npm install 'git+https://github.com/thusc/bedrock.git#cli'. You can have a look at this Dockerfile to see an example usage.

I will turn the cli branch into smaller PRs in the next days.

I don't think users that have Bedrock core within their project have to do anything following this change. But if they want to remove it in the future (once a package is available), the required changes can be see in the Make content use proper Pug prefixes. commit of this PR.

thusc avatar Jul 18 '21 11:07 thusc

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/monocompany/bedrock/H7yT8SPT3HydHa8NCJnyEvhLBJeZ
✅ Preview: https://bedrock-git-fork-thusc-multiple-basedirs-monocompany.vercel.app

vercel[bot] avatar Jul 18 '21 11:07 vercel[bot]

So users have to remove relative paths to core, and other than that, things keep working as-is? I am fine with that.

I am not that familiar with Docker and don't completely understand the use case you are going for yet.

My current understand is that it's something with building out the HTML for different components to explicit folders (while still being able to use Bedrock to develop that HTML and corresponding CSS), to then use that HTML as a base for usage in other contexts.

In general, the process you are solving #320, which will help with future upgradeability of Bedrock, but also is needed for your use case, and to have clean code in general - is that right?

Wolfr avatar Jul 19 '21 12:07 Wolfr

So users have to remove relative paths to core, and other than that, things keep working as-is? I am fine with that.

Yes, and that's necessary only if you want to benefit from a Bedrock core that is not in the current directory. Otherwise, it should still work fine.

This is only about https://github.com/usebedrock/bedrock/issues/320, proper separation of concern, and to turn Bedrock in a really nice standalone tool. Installing it will be just a npm install away, it will be easier to get updates (or rollback to a previous version) or try a branch on different projects.

thusc avatar Jul 19 '21 13:07 thusc