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

Ignore projects where emitting is disabled #15

Merged

Conversation

nwalters512
Copy link
Contributor

Closes #14.

I did not make any changes to the non-build branch of code (that is, get_ts_project_paths), as I figured it doesn't make any sense to use this package with a single project where emitting is disabled.

src/helpers.ts Outdated
return build_project_path(cwd, reference.originalPath!, referenceConfig);
});
}).filter((project): project is TsProject => project !== null);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it would make sense to throw an error if at least one project doesn't have emitting enabled? 🤷

Copy link
Contributor

@bencergazda bencergazda Jul 17, 2023

Choose a reason for hiding this comment

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

Yes, maybe we should. But I'm not sure whether this should be stated as an error. What do you think about a yellow color_log message, and process.exit(0)?

I updated my answer, maybe a simple throw new Error is better, like how you mentioned.

@nwalters512 nwalters512 marked this pull request as ready for review June 7, 2023 00:31
@nwalters512
Copy link
Contributor Author

@bencergazda anything I can do to help this along?

@bencergazda
Copy link
Contributor

bencergazda commented Jul 17, 2023

Sorry, @nwalters512, I didn't have time to work on the project. I like the idea, and I'm happy to add this feature!

However, I would be happy to be more explicit on handling this. We should rather handle this case in build_project_path, and it would be better to add a new property to the returned TsProject type, e.g. no_emit: boolean.

Then we could throw the errors both in get_ts_projects_paths and get_ts_project_paths if there isn't any project with noEmit: false

src/helpers.ts Show resolved Hide resolved
src/helpers.ts Show resolved Hide resolved
@nwalters512
Copy link
Contributor Author

@bencergazda thanks for taking a look at this! I made the requested changes.

@bencergazda
Copy link
Contributor

Thanks a lot! I merge it and bump a new version soon!

@bencergazda bencergazda merged commit a385078 into body-builder:master Jul 20, 2023
@nwalters512 nwalters512 deleted the skip-projects-with-no-emit branch April 11, 2024 18:54
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.

Ignore project references with emitting disabled
2 participants