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

fix(bindings): building package #1113

Merged

Conversation

MCozhusheck
Copy link
Contributor

@MCozhusheck MCozhusheck commented Aug 6, 2024

Description

Tari.js is depending on this package but after inspecting it's dependencies I found issues with bindings package like incorrect package.json deceleration and project structure.

Motivation and Context

This PR is necessary to also fix Tari.js which throws errors in others project depending on it with error message that Tari.js is missing types declarations.

How Has This Been Tested?

Locally build bindings and imported it to local Tari.js and after that imported Tari.js to the Tari-Universe and checked if application was working as expected.

What process can a PR reviewer use to test or verify this change?

Build it locally with npm run build command and use it as dependency in other projects.

Breaking Changes

  • None
  • Requires data directory to be deleted
  • Other - Please specify

Some types have changed their name to distinguish from each other and everything now it's exported directly from main file index.ts so imports like

import type { ComponentAddressOrName } from "@tari-project/typescript-bindings/wallet-daemon-client";

should be now:

import type { ComponentAddressOrName } from "@tari-project/typescript-bindings";

Copy link

github-actions bot commented Aug 6, 2024

Test Results (CI)

556 tests  ±0   556 ✅ ±0   1h 42m 15s ⏱️ + 9m 9s
 65 suites ±0     0 💤 ±0 
  2 files   ±0     0 ❌ ±0 

Results for commit 1c71647. ± Comparison against base commit 001f797.

This pull request removes 36 and adds 36 tests. Note that renamed tests count towards both.
tari_indexer_client ‑ types::export_bindings_addpeerrequest
tari_indexer_client ‑ types::export_bindings_addpeerresponse
tari_indexer_client ‑ types::export_bindings_connection
tari_indexer_client ‑ types::export_bindings_connectiondirection
tari_indexer_client ‑ types::export_bindings_getallvnsrequest
tari_indexer_client ‑ types::export_bindings_getallvnsresponse
tari_indexer_client ‑ types::export_bindings_getcommsstatsresponse
tari_indexer_client ‑ types::export_bindings_getconnectionsresponse
tari_indexer_client ‑ types::export_bindings_getepochmanagerstatsresponse
tari_indexer_client ‑ types::export_bindings_getidentityresponse
…
tari_indexer_client ‑ types::export_bindings_indexeraddpeerrequest
tari_indexer_client ‑ types::export_bindings_indexeraddpeerresponse
tari_indexer_client ‑ types::export_bindings_indexerconnection
tari_indexer_client ‑ types::export_bindings_indexerconnectiondirection
tari_indexer_client ‑ types::export_bindings_indexergetallvnsrequest
tari_indexer_client ‑ types::export_bindings_indexergetallvnsresponse
tari_indexer_client ‑ types::export_bindings_indexergetcommsstatsresponse
tari_indexer_client ‑ types::export_bindings_indexergetconnectionsresponse
tari_indexer_client ‑ types::export_bindings_indexergetepochmanagerstatsresponse
tari_indexer_client ‑ types::export_bindings_indexergetidentityresponse
…

♻️ This comment has been updated with latest results.

@MCozhusheck MCozhusheck force-pushed the fix/bindings-package-build branch from 1298016 to 1aa8cd5 Compare August 6, 2024 14:29
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

Did a quick test this doesnt break any of the WebUIs. LGTM

I have added all generated files (from npm run build command) to .gitignore file - this should prevent from situations where released package comes from older builds.

Was the gitignore change removed? Just checking if we should continue to run npm run build when types change.

Maybe we just need to add a step to build the bindings before running CI - but we can leave that for another PR

@MCozhusheck
Copy link
Contributor Author

Did a quick test this doesnt break any of the WebUIs. LGTM

I have added all generated files (from npm run build command) to .gitignore file - this should prevent from situations where released package comes from older builds.

Was the gitignore change removed? Just checking if we should continue to run npm run build when types change.

Maybe we just need to add a step to build the bindings before running CI - but we can leave that for another PR

Yes I have reverted changes to the .gitignore and github action workflow so we have more control when we are building type bindings

@sdbondi sdbondi enabled auto-merge August 9, 2024 09:33
@sdbondi sdbondi added this pull request to the merge queue Aug 9, 2024
Merged via the queue into tari-project:development with commit 3db6653 Aug 9, 2024
13 checks passed
@MCozhusheck MCozhusheck deleted the fix/bindings-package-build branch August 9, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants