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

Use standard TypeScript config #159

Merged
merged 1 commit into from
Jul 15, 2021
Merged

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jul 15, 2021

The TypeScript config has been updated to match the configuration we use in other libraries, mostly. The remaining differences are that strict is still not enabled, and there is a separate config used for testing. The test config was preserved for now, but that will be replaced soon when we migrate the tests to Jest. strict mode will be enabled in a later PR after we update dependencies, as that will make the necessary changes much easier.

The changes are:

  • inlineSources has been enabled. This embeds a complete copy of the source code with the source maps, allowing for a much better debugging experience.
  • lib has been set to ES2020, ensuring that we only rely upon JavaScript APIs. Previously it also allowed use of browser APIs.
  • rootDir is now set explicitly to src, which will help ensure we don't accidentally change the structure of the package.
  • The old prod config was merged with the base config, so it was no longer needed as a separate file.

Closes #142

@Gudahtt Gudahtt requested a review from a team as a code owner July 15, 2021 15:33
@Gudahtt Gudahtt force-pushed the use-standard-typescript-config branch 2 times, most recently from 46aa107 to 4d7681e Compare July 15, 2021 15:34
The TypeScript config has been updated to match the configuration we
use in other libraries, mostly. The remaining differences are that
`strict` is still not enabled, and there is a separate config used for
testing. The test config was preserved for now, but that will be
replaced soon when we migrate the tests to Jest. `strict` mode will be
enabled in a later PR after we update dependencies, as that will make
the necessary changes much easier.

The changes are:
* `inlineSources` has been enabled. This embeds a complete copy of the
  source code with the source maps, allowing for a much better debugging
  experience.
* `lib` has been set to `ES2020`, ensuring that we only rely upon
  JavaScript APIs. Previously it also allowed use of browser APIs.
* `rootDir` is now set explicitly to `src`, which will help ensure we
  don't accidentally change the structure of the package.
* The old `prod` config was merged with the base config, so it was no
  longer needed as a separate file.

Closes #142
@Gudahtt Gudahtt force-pushed the use-standard-typescript-config branch from 4d7681e to 7b3fa04 Compare July 15, 2021 15:40
Comment on lines +6 to +7
"rootDir": "",
"outDir": "",
Copy link
Member

@rekmarks rekmarks Jul 15, 2021

Choose a reason for hiding this comment

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

I've never seen this before. Do we output the test index.js to the repo root?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope! Seemingly this "unsets" the outDir set in the base config. So it defaults to outputting it alongside the source, in the test directory.

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

@Gudahtt Gudahtt merged commit 1489507 into main Jul 15, 2021
@Gudahtt Gudahtt deleted the use-standard-typescript-config branch July 15, 2021 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include original .ts files in the NPM package to allow proper debugging
2 participants