Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for local configuration file #4

Open
machadogj opened this issue Jul 15, 2016 · 3 comments
Open

Support for local configuration file #4

machadogj opened this issue Jul 15, 2016 · 3 comments

Comments

@machadogj
Copy link

It would be awesome if we could somewhat define the required wml config for a specific project in a configuration file, and then be able to add, enable and disable everything at once.

@dutzi
Copy link
Contributor

dutzi commented Jul 28, 2016

Sounds interesting. Let's expand this a bit.

  • .wmlconfig - a file that contains Wml's configurations, looks something like links.json (current Wml's config file).
  • Wml Project - a folder that contains a .wmlconfig file (all child folders of that folder are also part of that project)
  • wml start - When running Wml it will look for .wmlconfig in the current path, if it can't find it will start going up (looking for it in parent folders) until it reached the home folder.
  • wml init will initialize a .wmlconfig in the current folder
  • wml add [-g] will add a rule to the current project or (-g) to the global project (home folder).
  • ... (you get where i'm going with this)

Pretty much taking NPMs approach for project management and applying it here.

WDYT?

@dutzi
Copy link
Contributor

dutzi commented Jul 28, 2016

Example .wmlconfig

{
  "0": {
    "src": "/Users/dutzi/documents/wix/restaurants-components",
    "dest": "/Users/dutzi/documents/wix/restaurants-dashboard/node_modules/@wix/restaurants-components",
    "enabled": false
  },
  "1": {
    "src": "/Users/dutzi/documents/wix/wixrest-utils-js",
    "dest": "/Users/dutzi/documents/wix/restaurants-orders/node_modules/@wix/wixrest-utils",
    "enabled": true
  },
  "2": {
    "src": "/Users/dutzi/documents/wix/restaurants-redux",
    "dest": "/Users/dutzi/documents/wix/restaurants-orders/node_modules/@wix/restaurants-redux",
    "enabled": true
  },
  "3": {
    "src": "/Users/dutzi/documents/wix/restaurants-reflux",
    "dest": "/Users/dutzi/documents/wix/restaurants-orders/node_modules/@wix/restaurants-reflux",
    "enabled": false
  },
  "4": {
    "src": "/Users/dutzi/documents/wix/restaurants-components",
    "dest": "/Users/dutzi/documents/wix/restaurants-orders/node_modules/@wix/restaurants-components",
    "enabled": true
  }
}

@esakal
Copy link

esakal commented Feb 28, 2017

@dutzi the wml tools seems great, I'm in the process of testing it in our environment as a replacement for the npm link poor support for local module development. I think this is a superior feature because it is always good avoiding the global if possible.

For now I'm installing wix/wml locally and using $(npm bin)/wml [command]. It is working but it is not intuitive and I think this enhancement will be very useful and simpler to most of the users.

A few thoughts on your suggestion:

  • .wmlconfig - Since this is a local file I think the 'dest' should be a relative path inside the project. So moving the project to another location will not break it.
  • wml init - I'm not sure if it is needed since you can create it once a link is added.
  • wml add - To prevent people from adding the config file to the git repo, consider checking
    .gitignore and if this file is not there prompt the user if he wants it to be added.
  • wml start - I'm not sure if looking for the file in the parents is the right approach. It can yield to confusing / weird behaviors. Consider maybe adding the -g flag. ie wml start [-g] will search only in the current folder, or (-g) in the global npm directory.

I would like to correct my comment about wml start. Since wml affect node_modules folder which is relative to the package.json:

  • wml start [-g] - When running Wml it will look for .wmlconfig and package.json in the current path, if it can't find it will start going up (looking for it in parent folders) until it reached the home folder. or (-g) will search only in the global npm directory.

What do you think?

motornyi pushed a commit to motornyi/wml that referenced this issue Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants