Skip to content

Allow typescript project as parameter#138

Merged
alejandrofdiaz merged 10 commits into
mainfrom
allow-typescript-project-as-parameter
Oct 27, 2022
Merged

Allow typescript project as parameter#138
alejandrofdiaz merged 10 commits into
mainfrom
allow-typescript-project-as-parameter

Conversation

@alejandrofdiaz
Copy link
Copy Markdown
Contributor

Problem

While developing any project you expect the tools to work by default when type checking and linting, this includes this tool implementation in the IDE. Those tools use tsconfig.json by default which is something expected.

This configuration looks like this:

# tsconfig.json
{
  ...some typescript configuration
  "include": ["src/**/*", ".jest/**/*", ".storybook/**/*"],
}

This configuration will cause package-build library to compile all files included in the Typescript configuration. This means it will include in the bundle useless files for distribution like unit tests, storybook stories and test helpers.

To avoid this we should be able to define a different file for configuration like tsconfig.build.json only including library entrypoint, usually src/index.ts.

# tsconfig.build.json
{
  ...some typescript configuration
  "include": ["src/index.ts"],
}

This configuration will avoid transforming useless files into the bundle but allow the tools to use the root tsconfig.json as a reference.

@alejandrofdiaz alejandrofdiaz added the enhancement New feature or request label Oct 26, 2022
Copy link
Copy Markdown
Contributor

@christiandebarrio christiandebarrio left a comment

Choose a reason for hiding this comment

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

Just a nit suggestion

Comment thread CHANGELOG.md Outdated
@SaraMansori SaraMansori self-requested a review October 26, 2022 09:19
alejandrofdiaz and others added 7 commits October 27, 2022 08:22
Co-authored-by: Christian <christian.debarrio@cabify.com>
…bify/package-build-javascript into allow-typescript-project-as-parameter
@alejandrofdiaz alejandrofdiaz merged commit 941a5a1 into main Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

4 participants