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

build: make bundle compatible with Windows and test it in CI #344

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

joanise
Copy link
Member

@joanise joanise commented Sep 24, 2024

In CI, let's this npx nx bundle web-component on both Windows and Linux, and on Linux let's display the diff in a way that we can see the bits that changed even though it's minified.

PR Goal?

Make npx nx bundle web-component compatible with Windows, and exercise it in CI

Fixes?

the fact that the bundle command was specifically a bash command, but did not enforce being rush by bash

Feedback sought?

rubber stamping

Priority?

low

Tests added?

yes

How to test?

run npx nx bundle web-component on Windows and see it no longer fail

Confidence?

high

Version change?

no

In CI, let's this npx nx bundle web-component on both Windows and Linux, and on
Linux let's display the diff in a way that we can see the bits that changed
even though it's minified.
Copy link

semanticdiff-com bot commented Sep 24, 2024

Review changes with SemanticDiff.

Analyzed 1 of 4 files.

Filename Status
packages/web-component/bundle.sh Unsupported file format
✔️ packages/web-component/package.json Analyzed
.github/workflows/end-to-end-tests.yml Unsupported file format
.github/workflows/windows-tests.yml Unsupported file format

Copy link
Contributor

github-actions bot commented Sep 24, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-09-25 13:56 UTC

Copy link
Collaborator

@dhdaines dhdaines left a comment

Choose a reason for hiding this comment

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

Good idea!

node b64Fonts.js
npx webpack --config webpack.config.js
packageVersion=$(npm view ../../node_modules/@readalongs/web-component version)
timestamp=$(date "+%Y-%m-%d+%H-%M-%S")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Guessing that if you have bash on Windows then you also have date?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, once you're in bash, you get the standard *nix command line tools, even on Windows, through msys, mingw64, cygwin or some derivative. I'm not aware of any instance of bash on Windows that's not based on one of those. Git systematically comes with Git Bash on Windows, that's the one I always use now, it's lightweight but has everything I need to make my Windows machine pleasant to use.

@@ -15,7 +15,7 @@
"dist/"
],
"scripts": {
"bundle": "node b64Fonts.js && webpack --config webpack.config.js; packageVersion=$(npm view ../../node_modules/@readalongs/web-component version); timestamp=$(date \"+%Y-%m-%d+%H-%M-%S\") && cd ../studio-web && npm pkg set singleFileBundleVersion=\"${packageVersion}\" && npm pkg set singleFileBundleTimestamp=\"${timestamp}\"",
"bundle": "bash bundle.sh",
Copy link
Collaborator

Choose a reason for hiding this comment

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

well, that's ... much nicer looking

@joanise joanise merged commit 1690f7e into main Sep 25, 2024
2 checks passed
@joanise joanise deleted the dev.ej/bundle-on-windows branch September 25, 2024 13:56
joanise added a commit that referenced this pull request Oct 16, 2024
In CI, let's this npx nx bundle web-component on both Windows and Linux, and on
Linux let's display the diff in a way that we can see the bits that changed
even though it's minified.

To make bundle compatible with Windows, I turned the one liner in `package.json`
into a script that is much easier to read and maintain.
joanise added a commit that referenced this pull request Oct 16, 2024
In CI, let's this npx nx bundle web-component on both Windows and Linux, and on
Linux let's display the diff in a way that we can see the bits that changed
even though it's minified.

To make bundle compatible with Windows, I turned the one liner in `package.json`
into a script that is much easier to read and maintain.
joanise added a commit that referenced this pull request Oct 17, 2024
In CI, let's this npx nx bundle web-component on both Windows and Linux, and on
Linux let's display the diff in a way that we can see the bits that changed
even though it's minified.

To make bundle compatible with Windows, I turned the one liner in `package.json`
into a script that is much easier to read and maintain.

(cherry picked from commit 1690f7e)
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