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

Default tsconfig.json option forceConsistentCasingInFileNames to True to create case consistency between filesystems #3013

Closed
2 of 7 tasks
dsilbergleithcu-godaddy opened this issue Oct 1, 2021 · 4 comments · Fixed by #3015
Labels
feature-request A feature should be added or improved. module/compiler Issues affecting the JSII compiler p2

Comments

@dsilbergleithcu-godaddy
Copy link
Contributor

dsilbergleithcu-godaddy commented Oct 1, 2021

🚀 Feature Request

Affected Languages

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

General Information

  • JSII Version: 6.14.14
  • Platform: MacOS Big Sur
  • I may be able to implement this feature request
  • This feature might incur a breaking change

Description

Typescript relies on the case sensitivity of the filesystem when it checks the paths for imports. This creates issues when developing on a Win/Mac box but running CICD on Linux. It is possible to get an "all clear" from the local build, and then fail in the CICD system if a filename doesn't match the casing of the import.

Proposed Solution

By default, set the forceConsistentCasingInFileNames to true in the default options of the generated tsconfig.json file

There appear to be 2 places where the compiler options for tsc are set:

I believe the first one will impact the compiler and generate the desired output. I'm not sure what the function of the second one is. It is likely a good idea to update both.

@dsilbergleithcu-godaddy dsilbergleithcu-godaddy added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 1, 2021
@RomainMuller RomainMuller added module/compiler Issues affecting the JSII compiler p2 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 5, 2021
@RomainMuller
Copy link
Contributor

RomainMuller commented Oct 5, 2021

I'm in favour of this feature, however this can probably be considered a breaking change (not sure). We might need to make this an opt-in setting?

The jsii-rosetta compiler is unlikely to need updating - it runs against files that it generates by itself, and typically should operate in "quirks" mode (i.e: maximising chances of getting an AST out of the files, as opposed to optimising for correctness overall).

@dsilbergleithcu-godaddy
Copy link
Contributor Author

I had a similar thought about this being a breaking change. Let me see about making this opt-in.

I'll back out the changes to jsii-rosetta. Thanks for the feedback.

@dsilbergleithcu-godaddy
Copy link
Contributor Author

@RomainMuller I've updated my PR to reflect your comments. Please take a look when you get a chance.

@mergify mergify bot closed this as completed in #3015 Oct 11, 2021
mergify bot pushed a commit that referenced this issue Oct 11, 2021
…c opts (#3015)

Addresses #3013 by setting the flags.

Fixes #3013

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/compiler Issues affecting the JSII compiler p2
Projects
None yet
2 participants