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

Break source code into modules #28

Closed
wants to merge 1 commit into from
Closed

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Nov 5, 2024

This PR attempts to breaks source code into modules.

While breaking the source code, I merged the duplicate code in eol-versions and isNodeEOL.
I also checked in the contents of content and etag files for schedule and security. This will reduce GET calls when etag is latest and is verified using HEAD calls. We can also set up recurring GitHub workflow to update the contents of cache.

This will also allow migrating to TypeScript in future, and either transpiling or type stripping using amaro depending on what maintainers think. It will also allow adding unit tests using Node.js Test Runner for individual components.

@trivikr trivikr marked this pull request as draft November 5, 2024 01:31
@trivikr trivikr marked this pull request as ready for review November 5, 2024 02:10
Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

What's the reasoning behind this change?

To be honest, I don't see this package adopting TypeScript for any reason (as I said in #24)

If the idea was to make the core clearer, that's reasonable. Although, I feel this is a bit of overengineering for a quite simple project.

@trivikr
Copy link
Member Author

trivikr commented Nov 5, 2024

What's the reasoning behind this change?

Ease of maintenance, like ability to add unit tests. Only the files being edited will be changed in future PRs.
I've given examples on how this reduced duplicate code by creating isNodeEOL, and reduced GET calls by vendoring etag and JSON files.

I don't see this package adopting TypeScript for any reason (as I said in #24)

Adopting TypeScript was just an example, as there are multiple functions. We don't need to adopt it, and continue using equivalent, like JSDoc.

@trivikr
Copy link
Member Author

trivikr commented Nov 7, 2024

Moving to draft, as this might break GitHub Action which expects json and etag files in root folder.
It can be revisited after action is moved to a new package in #22

@trivikr trivikr marked this pull request as draft November 7, 2024 00:35
@trivikr
Copy link
Member Author

trivikr commented Nov 13, 2024

Replaced by a subset in #29

@trivikr trivikr closed this Nov 13, 2024
@trivikr trivikr deleted the modular branch November 13, 2024 05:29
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