question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Predefined options in newly generated projenrc's

See original GitHub issue

We are building multiple project types for usage with the --from flag. This process really helps in standardisation within our company.

One thing i’m looking into is adding default configuration options into generated projenrc files (a big wish is to have this as a typescript file)

What I was thinking of is that when the new project is generated that the project class can return a predefined struct of configuration options that are put into the options part of the projenrc file.

Example usage:

class MyCustomTypescriptProject extends TypeScriptProject {
  
  generateDemoConfiguration() {
    return {
      ...super.generateDemoConfiguration(),
      environments: {
        staging: {},
        prod: {}
      }
    }
  }
}

This would then end up in the projenrc file as:

const project = new MyCustomTypescriptProject({
  name: 'project name',
  environments: {
        staging: {},
        prod: {}
      }
})

This will give more options in adding things like “best practices”, mandatory options, example usages.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
pgarbecommented, Feb 17, 2021

I like that idea. If you’re not using GitHub, a lot of (useful) defaults needs to be disabled. Although, there might be another solution to my problem as well. Like group these GitHub options somehow together as presets? Have an OpenSourceGitHub preset and one for my company…

1reaction
Chriscbrcommented, Feb 17, 2021

Yes, I agree. I don’t like them either. That’s why I’d like to only show a bunch of “featured” options to make it easy for people to get started. But I am not sure about this TBH (@Chriscbr might have an opinion).

I’m totally cool with cutting down on the wall of options through some kind of featured label, and including those featured options as uncommented (if it’s possible avoid the snag w/ complex types you mentioned).

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found