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 extending dojorc configuration #295

Closed
agubler opened this issue Sep 10, 2019 · 1 comment · Fixed by #297
Closed

Support extending dojorc configuration #295

agubler opened this issue Sep 10, 2019 · 1 comment · Fixed by #297

Comments

@agubler
Copy link
Member

agubler commented Sep 10, 2019

Enhancement

In Dojo 6 we added support for using a custom dojorc file with the CLI. This opened many possibilities for creating multiple configurations with tweaked options simply by using the --dojorc option.

Unfortunately this requires all common configuration to be duplicated across each dojorc file, we should support extending dojorc files.

@JamesLMilner
Copy link
Contributor

JamesLMilner commented Sep 23, 2019

What level of config merging would we like to do here? I think top level property merging is an obvious requirement i.e.

// .dojorc
{
  "extends": "./base-dojorc",
  "build-app": {
    "legacy": false,
    "build-time-render": {
       // stuff
     }
  }
}

// .base-dojorc
{
  "pwa": {
    "manifest": {...},
  }
}

// Results in:

{
  "extends": "./base-dojorc",
  "build-app": {
    "legacy": false,
    "build-time-render": {
       // stuff
     }
  }
  "pwa": {
    "manifest": {...},
  }
}

However, if we have matching top level properties like so, how would we expect this to behave?

// .dojorc
{
 "extends": "./base-dojorc",
  "build-app": {
    "legacy": false,
    "build-time-render": {
       // child properties
     }
  }
}


// .base-dojorc
{
  "build-app": {
    "legacy": true,
    "build-time-render": {
        // child properties
     }
     "proxy": {
        // child properties
    }
}

// Results in?

Here the question is should it completely replace the whole build-app top level property, or should it try and merge it's child properties? If so, do we merge all the way down the tree or do we stop at the first level of children?

To me a sensible output for this situation would be :

{
 "extends": "./base-dojorc",
  "build-app": {
    "legacy": false,
    "build-time-render": {
       // .dojorc "build-time-render" properties
     }
    "proxy": {
        // .base-dojorc "proxy" properties
     }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants