Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Suggestion: centralised configuration for easier project customisation #446

Closed
ghost opened this issue Mar 5, 2015 · 4 comments
Closed

Comments

@ghost
Copy link

ghost commented Mar 5, 2015

Currently to adapt MEAN.JS as the framework for any project, one has to modify multiple files in different folders throughout the repository so as to change the name, description, server routes, home page, icons etc.

It would be nice if all definitions were centralised in one location and no other core MEAN.JS files would need modified. For example, they could be written as environment configuration, with the help of lodash to merge from one of the existing env files:

var _=require('lodash');

module.exports = _.merge(require('./development'), {
app : {
title: 'A Project',
description: 'A project based on MEAN.JS',
},
db: {
uri: 'mongodb://localhost/project-dev',
},
sessionSecret: process.env.SESSION_SECRET || 'my_secret'
});

Some properties are already defined in config/env/all.js. What's left is to absorb the rest. For example, the glob pattern './app/routes/*/.js' for matching server routes could go in. A project that doesn't need the article module would have this pattern changed to exclude it, instead of having the routes.js removed completely.

This way, base MEAN.JS files would be largely retained along with the project-specific files that are only addition to the framework. Any project taking a cut from MEAN.js would continue to benefit from MEAN project's update afterwards without having to resolve a lot of merge conflicts.

What do you guys think?

@dancancro
Copy link

Hi,

This post made me think you might be interested in a study I have been doing of where people put the same types of code. Have a look here, in particular, the "Settings" code types. The main idea is that "Settings" is one type of code with multiple specificities (specific to environment, to each module, to the whole app) and sides (client/server). I put my own proposal for how to do it in the first column.

@ilanbiala
Copy link
Member

Please format your code in GFM code blocks and clarify what you would like it to look like.

@ghost
Copy link
Author

ghost commented Mar 10, 2015

@lirantal
Copy link
Member

we can close this one

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants