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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate files for configuration #1644

Closed
5 of 6 tasks
anshulguleria opened this issue May 11, 2020 · 6 comments
Closed
5 of 6 tasks

Separate files for configuration #1644

anshulguleria opened this issue May 11, 2020 · 6 comments
Labels
closed-for-staleness effort/medium Medium work item 鈥撀燼 couple days of effort feature-request A feature should be added or improved. management/devenv Related to jsii development/build environment p1

Comments

@anshulguleria
Copy link

anshulguleria commented May 11, 2020

馃殌 Feature Request

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)

General Information

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Since the package.json is still a valid configuration source hence, it won't be a breaking change.

Description

Through the readme of the package I found that this package takes configuration through package.json file. Although this works fine but makes my package.json file quite big and messy. I prefer to keep most of the part of package.json auto updating. Would it be a good feature if you can take all that configuration which does not directly affect package.json through a separate configuration file?

I am coming from an example where packages like eslint, babel, husky, lint-staged who can take configuration through pacakge.json but, also give alternatives like js file, yaml file or json file. With this my package.json is pretty small and does not depend on the plugins and their configurations(apart from their dependency).

It also opens new possibilities. Like if you are taking configuration through js file, then it allows developers to write their logic to export those configurations. For example I can separate configurations based on local, test and production environments.

Proposed Solution

Hence, I am proposing a feature using which configurations can be taken through separate files too.

@anshulguleria anshulguleria added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 11, 2020
@SomayaB SomayaB added the management/devenv Related to jsii development/build environment label May 12, 2020
@RomainMuller
Copy link
Contributor

We have been thinking about this and this is definitely a direction I want to pursue. Eventually, you'll be able to configure jsii via some jsiirc.json file or something of the likes.

In fact, we are planning to build this as part of the submodules (see #1286) feature, where leaving such a configuration file next to a namespaced export (export * as ns from './ns';) would enable you to customize naming (different Java package name, C# namespace, etc...) on a per-submodule basis.

@RomainMuller RomainMuller added effort/medium Medium work item 鈥撀燼 couple days of effort and removed needs-triage This issue or PR still needs to be triaged. labels May 12, 2020
@RomainMuller
Copy link
Contributor

I've actually shifted around here a bit, and I think it'd be better to have the alternate source of jsii configuration be a user-owned tsconfig.json file, so you can also control the typescript compiler parameters beyond what jsii auto-configures for you.

@anshulguleria
Copy link
Author

Does that mean users now have to provide jsii configuration in tsconfig.json instead of package.json?

I think it still causes confusion. Ideally tsconfig.json should contain configuration for typescript compilation only not for other things. That keeps configurations to each plugin owned files.

Another problem would be, tsconfig.json is a static file so user can't write logic which, having file like .jsiirc.js can accomplish.

@RomainMuller
Copy link
Contributor

Another problem would be, tsconfig.json is a static file so user can't write logic which, having file like .jsiirc.js can accomplish.

I actually would rather have configuration that does not involve/allow logic. Is there anything in particular you have in mind where logic would be needed/useful?

@anshulguleria
Copy link
Author

In situations, like I want to use different configurations based on environments, this logic helps. Similar examples have been followed by libraries like webpack, eslint, etc.

Having a possibility to allow logic can make this configuration extensible.

@github-actions
Copy link
Contributor

This issue has not received any attention in 2 years. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness effort/medium Medium work item 鈥撀燼 couple days of effort feature-request A feature should be added or improved. management/devenv Related to jsii development/build environment p1
Projects
None yet
Development

No branches or pull requests

3 participants