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

feat: generate d2.config.json from d2.config.js #471

Merged
merged 1 commit into from
Oct 19, 2020
Merged

Conversation

amcgee
Copy link
Member

@amcgee amcgee commented Oct 19, 2020

This generates a new config file d2.config.json from the compiled application config (merge of package.json and d2.config.js). The .json file is placed at the root of the application output, next to manifest.webapp, which it will eventually replace. The data in this config file is necessary to enforce immutable application slugs, parse version numbers, and other things when publishing to the App Hub.

Here is a sample d2.config.json output generated from examples/simple-app :

{
  "name": "simple-app",
  "title": "Simple Example App",
  "description": "This is a simple example application",
  "standalone": true,
  "type": "app",
  "version": "1.0.0",
  "author": {
    "name": "Austin McGee",
    "email": "austin@dhis2.org"
  }
}

@amcgee amcgee requested a review from varl October 19, 2020 15:05
Copy link
Contributor

@varl varl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short and sweet.

Question: will it be more common to include or omit properties in the json output?

@amcgee
Copy link
Member Author

amcgee commented Oct 19, 2020

Question: will it be more common to include or omit properties in the json output?

I think it should be rare to do either.... the endPoints property is omitted here because it references an entrypoint in source which doesn't exist in the compiled output, most everything else is configuration options which serve as input to the compiler and metadata to the compiled app

@amcgee
Copy link
Member Author

amcgee commented Oct 19, 2020

@varl does that seem reasonable? Should we explicitly construct the d2.config.json here to more clearly define its structure?

@amcgee
Copy link
Member Author

amcgee commented Oct 19, 2020

Some additions we might consider... icon, buildTimestamp, ...

@amcgee
Copy link
Member Author

amcgee commented Oct 19, 2020

Some exclusions we might consider... type, standalone

@varl
Copy link
Contributor

varl commented Oct 19, 2020

I think it's reasonable to just delete the key now, and when we need a more sophisticated schema for the json, we can create a function that constructs the d2.config.json and handle inclusions/exclusions there.

@amcgee amcgee merged commit 2046074 into master Oct 19, 2020
@amcgee amcgee deleted the feat/d2-config-json branch October 19, 2020 16:00
dhis2-bot added a commit that referenced this pull request Oct 19, 2020
# [5.4.0](v5.3.0...v5.4.0) (2020-10-19)

### Features

* generate d2.config.json from d2.config.js ([#471](#471)) ([2046074](2046074))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 5.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants