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

SDK import by module #431

Closed
wants to merge 13 commits into from
Closed

SDK import by module #431

wants to merge 13 commits into from

Conversation

wcalderipe
Copy link
Collaborator

@wcalderipe wcalderipe commented Jul 16, 2024

The SDK's main index.ts file was exporting everything, which led to frequent name clashing issues (e.g., client).

This PR updates the SDK to have modules by path, such as @narval-xyz/armory-sdk/vault or @narval-xyz/armory-sdk/data-source. It also fixes the packages/release target error because it was unable to derive the tag from git.

Another important change was the proxy to signature and policy-engine-shared packages. These are now also exported as modules.

Interface comparison

From

import { getAddress, RsaKey, VaultClient, AuthClient } from '@narval-xyz/armory-sdk'

To

import { VaultClient } from '@narval-xyz/armory-sdk/vault'
import { AuthClient } from '@narval-xyz/armory-sdk/auth'
import { getAddress } from '@narval-xyz/armory-sdk/policy-engine-shared'
import { RsaKey } from '@narval-xyz/armory-sdk/signature'

Why manually move the files from src to the dist's root?

For some reason, I couldn't make it work with the NX release build system when the external option is set to none. As a reminder, the external option is crucial in the build process to bundle the signature and policy-engine-shared into the SDK artifact.

For more information about the external option, see #301.

Why not a major version bump?

The SDK is in its early stages and the interface is also going to evolve quickly in the next month. I'd rather reserve the 1.0.0 for when we have a stable interface.

@wcalderipe wcalderipe self-assigned this Jul 16, 2024
@wcalderipe wcalderipe changed the title SDK import by module SDK import by module Jul 16, 2024
@wcalderipe wcalderipe marked this pull request as ready for review July 16, 2024 15:08
@wcalderipe
Copy link
Collaborator Author

Blocked by lack of bandwidth at the moment.

Copy link

vercel bot commented Jul 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
devtool ❌ Failed (Inspect) Jul 26, 2024 0:26am

@samteb
Copy link

samteb commented Jul 26, 2024

@wcalderipe please check that we are still exposing types from policy-engine-shared and signature packages.

@mattschoch
Copy link
Contributor

I'm going to close this PR; the branch exists if we decide to keep running w/ this, but this PR is getting pretty stale & not imminently going to be addressed.

@mattschoch mattschoch closed this Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants