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

chore: use radashi-helper #220

Merged

Conversation

MarlonPassos-git
Copy link
Contributor

@MarlonPassos-git MarlonPassos-git commented Aug 24, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Recently, I noticed some activity in this repository. I immediately wanted to set up the project so that these tools come pre-installed.

6d1a5176-df20-43b5-9a68-76c481e3700a-ezgif com-video-to-gif-converter

Related issue, if any:

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

@@ -8,17 +8,23 @@
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-contrib/features/pnpm": {
"version": "9.1.3"
"version": "9.8.0"
Copy link
Member

Choose a reason for hiding this comment

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

We pin the PNPM version to v9.1.3 in our package.json for reproducible builds and lockfile consistency. I've tried using 9 or 9.x.x, but apparently an exact version is required for the packageManager field.

https://github.com/radashi-org/radashi/blob/main/package.json#L15

Copy link
Contributor Author

@MarlonPassos-git MarlonPassos-git Aug 24, 2024

Choose a reason for hiding this comment

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

I updated the version more because of the warnings that appeared to me when I was going to install a new dependency. But really, it makes more sense to keep the same as package.json

Comment on lines 14 to 17
"ghcr.io/devcontainers-contrib/features/npm-package": {
"package": "radashi-helper",
"version": "latest"
}
Copy link
Member

Choose a reason for hiding this comment

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

Let's add radashi-helper to the package.json instead, so it's available even to people not using dev containers.

Probably best not to use latest as it might increase risk of supply chain attacks if one of our transient dependencies ever gets compromised. Once we have Renovate up and running, periodic updates should be good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can add it, but even when Radashi is included only as a development dependency, we still can't use the radashi keyword before adding pnpm prefix or similar. By configuring this in the Dev Container, anyone using it won't need to run pnpm radashi *.

Of course, there are some workarounds we could implement only with the package.json, but in this case, it would be better to just use pnpm prefix.

About the version, I agree with you.

image

},
"postCreateCommand": "pnpm i",
"postStartCommand": "pnpm i",
Copy link
Member

Choose a reason for hiding this comment

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

What's the difference between postCreate and postStart here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both commands are similar, but postCreateCommand runs during the container's initial setup, while postStartCommand is only executed once the container is fully functional. For me, it makes more sense to install dependencies in postStartCommand, ensuring the container is ready. In this current scenario, it doesn't make a difference, but I updated it to make it more semantic.

https://containers.dev/implementors/json_reference/#lifecycle-scripts

@aleclarson
Copy link
Member

Btw, I'm not sure if it's GitHub's doing or not, but your video/gif demonstration is very low resolution. Hard to see anything.

@aleclarson aleclarson changed the title chore: setup radish utils chore: use radashi-helper Aug 24, 2024
@MarlonPassos-git
Copy link
Contributor Author

Btw, I'm not sure if it's GitHub's doing or not, but your video/gif demonstration is very low resolution. Hard to see anything.

Yes, the compression makes the gif have a poor quality. I have the video link for you.

@aleclarson

This comment has been minimized.

@MarlonPassos-git MarlonPassos-git added the maintenance An improvement to codebase maintainability label Aug 26, 2024
@aleclarson aleclarson merged commit fda13eb into radashi-org:main Sep 8, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance An improvement to codebase maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants