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

feat: npm package #7

Merged
merged 21 commits into from
Apr 9, 2024

Conversation

gentlementlegen
Copy link
Contributor

@gentlementlegen gentlementlegen commented Apr 5, 2024

Resolves #5

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Lines Statements Branches Functions
Coverage: NaN%
Unknown% (0/0) Unknown% (0/0) Unknown% (0/0)

JUnit

Tests Skipped Failures Errors Time
0 0 💤 0 ❌ 0 🔥 6.494s ⏱️

@gentlementlegen
Copy link
Contributor Author

NPM_TOKEN would be needed in the env to properly publish the package.

What does this PR change:

No logic has been changed except adding an overload to be able to call this without needed a Context object, for convenience of use. Otherwise, added a package publish workflow with bundling steps.

https://www.npmjs.com/package/@ubiquibot/permit-generation

@gentlementlegen gentlementlegen marked this pull request as ready for review April 7, 2024 20:56
@0x4007
Copy link
Member

0x4007 commented Apr 8, 2024

I don't have time to look through code, and will instead focus on communication.

I think that permit requests make sense to make a library for, but actual permit generation should only happen in one place- and after our earlier discussion, perhaps from within the bot kernel.

Due to this, I would expect that most of the logic to be related to "permit requests" from each planned plugin.

@gentlementlegen
Copy link
Contributor Author

@pavlovcik yep I agree. This library will simply allow us to move the logic and code outside to not pollute other repos and to avoid duplicating the code. Very handy currently because even if the generation is made only in the kernel, reading the actual permit can happen in multiple places, like currently in pay.ubq.fi. No more code duplication thanks to this.

.github/workflows/publish-package.yml Outdated Show resolved Hide resolved
src/handlers/generate-payout-permit.ts Show resolved Hide resolved
@gitcoindev
Copy link
Contributor

I noticed Knip is failing in this repo, I will fix this today.

@gitcoindev
Copy link
Contributor

I fixed Knip configuration and opened an another pull request, should be green after merging. We can either merge this one first and fix any detected issues later, or merge #9 first .

If Knip will be merged first we should be able to see if this one does not introduce any new regressions.

@gentlementlegen gentlementlegen mentioned this pull request Apr 8, 2024
@gitcoindev
Copy link
Contributor

@gentlementlegen as expected after merging there are a few conflicts that have to be resolved by rebase / merge against fresh development branch, perhaps I will be able to resolve them directly in the GitHub's web editor.

@gitcoindev
Copy link
Contributor

I found a few issues and fixed them, it complains about jest types, I will revert this asap and we should be ready to merge.

@gitcoindev
Copy link
Contributor

Knip kung-fu and Jest tests green (tests passing on branch locally). I see that pull_request_target workflow is used for tests, perhaps we need to change this to pull_request as pull_request_target uses base branch, not pr branch.

@gentlementlegen
Copy link
Contributor Author

Knip kung-fu and Jest tests green (tests passing on branch locally). I see that pull_request_target workflow is used for tests, perhaps we need to change this to pull_request as pull_request_target uses base branch, not pr branch.

@gitcoindev I changed the pull_request trigger accordingly. However, it seems that Jest tests are broken now. I suspect Knip to have imported inside of itself Jest or something with similar names, could you have a look?

@gitcoindev
Copy link
Contributor

Knip kung-fu and Jest tests green (tests passing on branch locally). I see that pull_request_target workflow is used for tests, perhaps we need to change this to pull_request as pull_request_target uses base branch, not pr branch.

@gitcoindev I changed the pull_request trigger accordingly. However, it seems that Jest tests are broken now. I suspect Knip to have imported inside of itself Jest or something with similar names, could you have a look?

Sure, I will have a look today. I have just checked locally and tests work on my machine, I will compare and fix this.

Add explicit jest imports in register wallet test.

Add @jest/globals to dev dependencies.

Add missing explicit jest imports.

Add jest imports.

Fix failing mocks.
@gitcoindev
Copy link
Contributor

@gentlementlegen I fixed tests, had to add explicit imports and fix a few types that compiler complained with TS2345 error. Knip is also green, and I think we can merge this now and continue rework in next prs. I leave @whilefoo to re-review, approve from his side and merge.

@0x4007
Copy link
Member

0x4007 commented Apr 9, 2024

Knip: the Sisyphusian task

@gitcoindev
Copy link
Contributor

Knip: the Sisyphusian task

myths-legends-greek-greek_mythology-myth-legends-zeus-wda2048_low

😄

@whilefoo whilefoo merged commit a54158a into ubiquibot:development Apr 9, 2024
2 of 3 checks passed
@gentlementlegen gentlementlegen deleted the feat/npm-package branch April 10, 2024 07: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.

Package and GitHub agnostic option
4 participants