#Using lustre_dev_tools should I add /priv/ to .gitignore?

1 messages · Page 1 of 1 (latest)

hoary robin
last arrow
#

priv is the home for files that are not source but are to be distributed with your application

#

It’s up to you what in there you want to check it

#

Typically most things in there would be checked in

hoary robin
#

Ok, thanks!

#

So you would also check in /priv/static/app.mjs? That's my lustre app compiled to JS, right?

#

So it's a bit like checking a build result into Git. Typically I wouldn't do that.

last arrow
#

I personally would opt to not check it in and regenerate it as part of the deployment process, but it’s up to you and what you want your process to be

hoary robin
#

It's also pretty big.

#

Sure.

#

As I said I'm very new, so it's not clear to me what is what. I know it's ultimately up to me 🙂

#

So say I have some CI/CD to deploy my app.

#

Should I ignore all of /priv/, only /priv/static or only /priv/static/app.mjs ?

last arrow
#

It’s up to you

#

Most the time you would want to have other things in priv also, but you may not have anything else in there

hoary robin
#

Other things like what?

last arrow
#

In a web application perhaps images, stylesheets, that sort of thing

#

But it could be literally anything

hoary robin
#

Aha! Makes sense.

last arrow
#

Any file that isn’t code that your application uses at runtime

hoary robin
#

I think the name "priv" is a bit confusing.

last arrow
#

I agree, aye

#

I think originally it was short for “private”? Can’t quite remember.

#

A lot of this stuff would probably be different if it was made today. Programming was different in the 80s

hoary robin
#

Is it some convention coming from Erlang?

#

I thought it's specific to Lustre.

last arrow
#

Yup it’s the BEAM project structure

#

The VM has a bunch of interfaces that applications implement. The Gleam build tool largely handles it all for you

hoary robin
#

I found this from https://www.erlang.org/doc/system/applications.html :

The priv directory holds assets that the application needs during runtime. Executables should reside in priv/bin and dynamically-linked libraries should reside in priv/lib. Other assets are free to reside within the priv directory but it is recommended they do so in a structured manner.

#

The name is a bit weird, but otherwise it makes sense.

#

Probably I should read the deployment chapters from Lustre documentation to better understand what fits where. Thank you!