angular-klingon / klingon

Angular Klingon: The UI companion for the @angular/cli
https://angular.run
MIT License
188 stars 19 forks source link

feat: add a .klingon.json that will hold upcoming configurations #68

Open sumitparakh opened 6 years ago

sumitparakh commented 6 years ago

Hi @manekinekko . Please suggest what kind of configuration options would this file contain? Any basic ones would you recommend?

manekinekko commented 6 years ago

Well basically, anything needed by Klingon. There is no fixed list for now. But, I was thinking about having something similar to angular.json. A per-project config file that will hold klingon specific config. What do you suggest?

sumitparakh commented 6 years ago

Well basically, anything needed by Klingon. There is no fixed list for now. But, I was thinking about having something similar to angular.json. A per-project config file that will hold klingon specific config. What do you suggest?

I was thinking the same but in a bit centralized manner. My idea is to have a single klingon.json file in the root folder of main project. A command woud be run before each npm start which will check for updated config and create/update config files in respective packages, i.e., inside packages/\<project> .

After that, each project can handle their configs accordingly, as we code them to do.

I've made a small pictorial presentation of it:-

config

In above image, klingon.json would contain top level keys of every lerna package (if there is any). For ex. if there are 2 packages as k-app and k-ui , then klingon.json would be as follows:-

{ "k-app": { }, "k-ui": { } }

Based on these key names, our node js code will validate packages. So we won't need to go through config files in each project to update anything. We can just do it from one main json file and our nodejs program will do the rest.

What say @manekinekko ?

manekinekko commented 6 years ago

A command woud be run before each npm start which will check for updated config and create/update config files in respective packages, i.e., inside packages/$project.

What would be the reason for having different files under inside packages/$project? We could just centralize all the config under klingon.json at the root, as you mentionned. Is their any technical limitations to this?

sumitparakh commented 6 years ago

A command woud be run before each npm start which will check for updated config and create/update config files in respective packages, i.e., inside packages/ .

What would be the reason for having different files? We could just centralize all the config under klingon.json. Right?

Ok. If we keep only one config file then how can we independently access it in production build of each project? Because each package in itself is a project. So if i publish klingon electron app and run it separately, then how will i access config file if it's not available in the root folder of klingon-app project?