-
Notifications
You must be signed in to change notification settings - Fork 245
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: allow per-submodule naming configuration #1690
Conversation
Supports setting the `targets.python.module` configuration in submodules via the `.jsiirc.json` file, and leverage this information during code generation.
Allow providing a `targets.java.package` on submodules via entries in a `.jsiirc.json` file, allowing customization of java pcakge names.
Allows customizing the .Net namespace used by submodules by adding new `targets.dotnet.namespace` entries in the `.jsiirc.json` file.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the root package name be required in the .jsiirc.json file? Can it still be assumed so instead the custom submodule config for @scope/jsii-calc-lib/lib would be
{
"targets": {
"dotnet": {
"namespace": "CustomSubmoduleName"
},
"java": {
"package": "calculator.custom_submodule_name"
},
"python": {
"module": "custom_submodule_name"
}
}
}
What happens if a user uses a root package name in one file that doesn't match the rest of the package? In effect, it makes sense to allow users to nest their submodule's output arbitrarily DEEPER but does it make sense to allow them to be output shallower? And if not why not remove that part of the config?
} | ||
return parts.join('.'); | ||
return assm.targets!.dotnet!.namespace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the 'non-nullability' of these fields not be represented in the assembly spec because of the presence of the dotnet target isn't guaranteed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is the spec doesn't actually represent per-language configurations... so they're opaque stuff entirely.
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Merging (with squash)... |
Introduces a new
.jsiirc.json
file leveraged by sumodules definedusing the
export * as namespace from './namespace';
syntax. The.jsiirc.json
file is a sibling to what./namespace
resolves to (sincethis typically resolves to
./namespace/index.ts
, the.jsiirc.json
filemust be at
./namespace/.jsiirc.json
).The
targets
key can je set within this.jsiirc.json
document andinclude specific configuration for various targets:
Related to #1286
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.