Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For instance, assuming the resolved .wediaportalrc file has the following shape:

Code Block
{
  "extends": "<some other wediaportalrc>", // new in 2023.3
  "environments": {
    "my-customer": {
      // ...
    },
    "other-customer": {
      // ...
    }
  },
  "aliases": {
    "default": "my-customer"
  }
}

...

NOTE: when parsed, a JSON5 parser is used ; this means that the JSON stream is much more permissive than a regular JSON is expected to be ; in particular, you are allowed to add single line comments //, block comments /* */, un-ambiguous keys are not to be double-quoted…

Extending a .wediaportalrc

Starting from 2023.3, .wediaportalrc files can be extended. Using the root property extends, you can specify which wediaportalrc file the current file is extending.

This can be useful especially when different members of the team are running their local server with different configurations.

Expand
titleSee how this feature can be useful if some team members need specific configuration

Given the integration server is available at https://project-int.wedia-group.com
Given team member 1 uses a server available at http://localhost:8080/project
Given team member 2 uses a server available at http://localhost:8082/project

it is possible to define a project wise configuration:

Code Block
// .wediaportalrc
{
  "environments": {
    "project": {
      "": {
        "vue_app_api_path": "",
        // ...
      },
      "development": {
        "vue_app_api_path": "https://project-int.wedia-group.com"
      }
    }
  },
  "aliases": {
    "local": {
      "of: "project",
      "override": {}
    }
  }
}

team can agree to exclude .wediaportalrc_private from git:

Code Block
// .gitignore
.env.local
.wediaportalrc_private

team member1 and team member 2can define in .env.local that they wants to use .wediaportalrc_private

Code Block
// .env.local
WEDIAPORTALRC=.wediaportalrc_private

team member 1 will create .wediaportalrc_private as extending .wediaportalrc with his own environment:

Code Block
// team member 1 .wediaportalrc_private
{
  "extends": ".wediaportalrc",
  "aliases": {
    "local": {
      "override": {
        "*": {
          "vue_app_api_path": "http://localhost:8080/project"
        }
      }
    }
  }
}

team member 2 will do the same:

Code Block
// team member 2 .wediaportalrc_private
{
  "extends": ".wediaportalrc",
  "aliases": {
    "local": {
      "override": {
        "*": {
          "vue_app_api_path": "http://localhost:8082/project"
        }
      }
    }
  }
}

Interface of a .wediaportalrc file

...