Skip to content

Avoid duplicated serial plotter builds #1174

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

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

francescospissu
Copy link
Contributor

Motivation

IDE2 contains two serial plotter apps, one in the build directory and the other in node_modules/arduino-ide-extension/build.

Change description

Do not copy the app into the build folder.

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Jul 12, 2022
@kittaakos kittaakos self-requested a review July 12, 2022 12:38
Comment on lines 17 to 18
'build',
'..',
'node_modules',
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't test this, but are you sure this works for the bundled version of the app as well? they have different file locations, I think we cannot include from the node_modules this way...

Copy link
Contributor Author

@francescospissu francescospissu Jul 12, 2022

Choose a reason for hiding this comment

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

No, it doesn't work. It just works locally. I'm reverting it.

Copy link
Contributor

@kittaakos kittaakos Jul 13, 2022

Choose a reason for hiding this comment

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

Let Node.js find the plotter app: require.resolve.

See the working example here: fspissu/avoid-twice-serial-plotter-app...kittaakos:avoid-twice-serial-plotter-app-2.

The bundled electron app contains the plotter only once:
Screen Shot 2022-07-13 at 09 07 56

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was already investigating to do it in this way. Thanks for the hint @kittaakos 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

nice implementation, using the resolve to leverage how node looks for packages is quite clever!

Signed-off-by: Akos Kitta <[email protected]>

Co-authored-by: Akos Kitta <[email protected]>
@francescospissu francescospissu marked this pull request as ready for review July 13, 2022 10:42
@fstasi fstasi self-requested a review July 13, 2022 13:44
Copy link
Contributor

@fstasi fstasi left a comment

Choose a reason for hiding this comment

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

lgtm

@francescospissu francescospissu merged commit c51b201 into main Jul 13, 2022
@francescospissu francescospissu deleted the fspissu/avoid-twice-serial-plotter-app branch July 13, 2022 15:20
@AlbyIanna AlbyIanna changed the title Avoid twice serial plotter apps Avoid duplicated serial plotter builds Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants