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 Project Archetypes #11

Open
daedalus28 opened this issue Aug 15, 2017 · 4 comments
Open

Support Project Archetypes #11

daedalus28 opened this issue Aug 15, 2017 · 4 comments

Comments

@daedalus28
Copy link
Contributor

daedalus28 commented Aug 15, 2017

For use in our application projects

@sean-clayton
Copy link
Contributor

sean-clayton commented Aug 15, 2017

So I've been coming up with an API for configuration and this is what I have:

{
  "extends": ["smartprocure-duti-application"], // <-- Able to extend other configurations
  "directories": ["web", "api"], // <-- Tells duti to gather data from all of these directories
  "rules": {
    "readmeUpdate": "disabled", // <-- This disables the "emptyChangelog" function from running
    "requestedReviewers": ["warn", { "recommendedPrReviewers": 2 }], // <-- Makeshift tuple—1st item is the severity, 2nd item is configuration
    "bigPr": { "prNetChangeThreshold": 500 } // <-- If you pass just a configuration object, the severity is the default
  }
}

Thoughts?

@daedalus28
Copy link
Contributor Author

It basically mimics the eslint config api which is great.

Some Notes

  • I'm a bit blurry on what directories will do.
  • I don't think we need a tuple style syntax - just pass an object to the methods (e.g. just extend the config object)

@stellarhoof
Copy link
Member

stellarhoof commented Jan 25, 2019

I'm not clear on what the motivation for using JSON for configuration was. Why was it preferred over JS? If users of the library want to implement their own "duties" we'd have to design a JSON api to compose their duties into the config file. If we go the other route and support both dangerfiles in JS and the JSON config file separately then why have a JSON config at all?

@daedalus28
Copy link
Contributor Author

The original theory was to match the approach of eslint and webpack config. However, given the pattern the community has of danger plugins which are just functions, we probably don't need to pursue the json configuration route and can simply wrap up multiple functions in higher order ones.

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

5 participants