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

Fix the build command #13

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Fix the build command #13

merged 1 commit into from
Aug 3, 2023

Conversation

hayata-suenaga
Copy link
Contributor

@hayata-suenaga hayata-suenaga commented Aug 2, 2023

cc: @tgolen

Related Issues

GH_LINK: #12

This PR fixes the build command specified in package.json.

Problem

The "Publish package to npmjs" workflow failed here because of the incompatibility between a TypeScript configuration and an option passed to the TypeScript compiler.

Specifically, the following configuration and option conflicted with each other.

tsconfig.json: "noEmit": true
package.json: npx tsc --emitDeclarationOnly

During the build, --emitDeclarationOnly instructs tsc (TypeScript compiler) to generate only d.ts files.

If you're curious, the actual compilation is handled by babel

However, the noEmit option, which is turned on in tsconfig.json, tells tsc to not to generate anything at all, conflicting with the above emitDeclarationOnly option.

Fix

Removes "noEmit": true from tsconfig.json. This is safe because the ts command in package.json, which is used to type-check, already passes --noEmit option.

Cleanup

Removes the ts:declarations command from package.json and directly run the tsc command inside the build command.

Test

Run npm run build in the project root directory. Confirm that the command runs without an error and the dist folder is created.

@hayata-suenaga hayata-suenaga requested a review from a team August 2, 2023 23:16
@hayata-suenaga hayata-suenaga self-assigned this Aug 2, 2023
@melvin-bot melvin-bot bot requested review from grgia and removed request for a team August 2, 2023 23:16
@hayata-suenaga hayata-suenaga marked this pull request as ready for review August 2, 2023 23:19
@hayata-suenaga hayata-suenaga changed the title fix: build command Fix the build command Aug 2, 2023
Copy link

@grgia grgia left a comment

Choose a reason for hiding this comment

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

Great job on the description of this PR @hayata-suenaga, that was really helpful!

@grgia
Copy link

grgia commented Aug 3, 2023

I'll hold off on merging incase @tgolen had any comments, feel free to merge @hayata-suenaga

@hayata-suenaga
Copy link
Contributor Author

Merging this because this is blocking Expensify/App#22703

@hayata-suenaga hayata-suenaga merged commit 49f696a into main Aug 3, 2023
2 checks passed
@melvin-bot melvin-bot bot added the Emergency label Aug 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 3, 2023

@hayata-suenaga looks like this was merged without a test passing. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@hayata-suenaga hayata-suenaga deleted the hayata-fix-build-command branch August 3, 2023 18:28
@hayata-suenaga
Copy link
Contributor Author

npm package version and the version specified in package.json is out of sync, but build command succeeded.

Screenshot 2023-08-03 at 11 29 38 AM

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.

2 participants