Comments (10)
So much +1
from dendritic.
I agree with /config
over /env
.
/src
makes sense for projects where you are actually building from /src
to a /dist
folder or similar, though not for projects where that isn't the case. No need to go one folder deep if not necessary, and you can leave models
, lib
etc.. all at root level.
from dendritic.
@nwinch the reason you want all models, routes and stuff under one folder is that you will end up with a symmetric structure in the test/
folder. this way it is much easier to flip between code and tests, there are even plugins for editors that do that. it is a convention and a good practice that carried over from a language to language. you just know immediately what's where.
also, the root level is usually a crowded place, there is config/
, there is bin/
there are migrations/
, logs
, tmp
, docs
etc. etc. so having a dedicated place where you could say "here is where all the code lives", "here is where all the tests live" makes sense and gives a hint to the future developers where everything should go.
as for src
vs. lib
, i'm fine either way. but, i'm personally trying not to use lib
for two reasons: firstly, lib
was historically it was used for "shared libraries", basically what node_modules
is for. it's not for the main application code, but for things that can be reused between projects. and secondly: when you switch between projects that transpile and those that don't having it named consistently helps. a bit.
from dendritic.
The alignment between /src
and /test
makes sense. If I think hard and squint my eyes, I'd say my main gripe would you've got to prefix src
in all your import/requires. This could be solved with a symlink I guess, and/or using relative paths but that's a different kind of messiness ;)
But yep, I'd generally be happy for things to go in /src
.
from dendritic.
Re src
vs lib
- I prefer src
. lib
's meaning is already taken in my opinion.
from dendritic.
do i understand correctly that we are aligned on this? can i make the change?
from dendritic.
@nwinch @davidbanham are on the same page with this one? i feel that this also should go in rather sooner than later
from dendritic.
The outlined structure makes sense to me.
from dendritic.
In my mind lib
is a halfway house between src
and node_modules
. It's for things designed to be used by multiple parts of the code within this project, but not genericly useful enough to make sense to other projects. Project-specific helper functions, basically. I do have a tendency to let too much stuff slop in there during times of concerted effort, though.
src
in the top level for non-compiled projects feels a little weird to me, too, but I'm happy with Nikolay's rationale. Root is only getting more crowded with CI configs, docker configs, etc. Let's run with src
as Nikolay laid it out.
So in light of that I think any project specific helper libs (as and when they exist) should be in src/lib/
from dendritic.
resolved in the thinky
branch rework
from dendritic.
Related Issues (20)
- "utils" vs "lib" HOT 3
- Route paths using filenames as relative base HOT 7
- Build analytics HOT 5
- Revision id is not checked when updating HOT 1
- "definitions" schema returned via /schema HOT 4
- /schemas folder location HOT 3
- Add the soft-delete option for models HOT 3
- Last build time + commit HOT 3
- Validation errors do not show fieldname HOT 2
- Validation errors difficult to match to form inputs HOT 6
- Docker automation package
- Move the redbeard specific code from boilerplate into dependencies
- v5 Validations
- thinky.dbReady is borked in docker
- Tests are flaky due to random project/resource names
- app-module-path must go
- Update deps
- createdAt/updatedAt as default schema/model fields HOT 7
- Base Controller .update uses this.find which can be overwritten. HOT 4
- Interview partners for research about communication in GitHub projects wanted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dendritic.