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

Add hyper-sdk-bundle.js to npm package #93

Open
basham opened this issue Sep 13, 2021 · 2 comments
Open

Add hyper-sdk-bundle.js to npm package #93

basham opened this issue Sep 13, 2021 · 2 comments
Labels
building An error that happens due to build errors enhancement New feature or request help wanted Extra attention is needed

Comments

@basham
Copy link

basham commented Sep 13, 2021

Thanks for adding hyper-sdk-bundle.js to the repo, in v3.0.10. However, can you also add it to the npm package? It would make it much easier to import it to projects if it was there, instead of copying and pasting it in the project source code.

@RangerMauve
Copy link
Owner

Yeah, having prebuild bundles seems like it'd make life easier for folks.

I was thinking of using github actions to publish the bundle inside the GitHub releases so people could either download or link to them directly.

Would that work for your use case? Would you be interested in editing the GH actions to enable it?

@RangerMauve RangerMauve added building An error that happens due to build errors enhancement New feature or request help wanted Extra attention is needed labels Sep 15, 2021
@basham
Copy link
Author

basham commented Sep 15, 2021

I've never used GitHub actions. Is that something that I can test on a fork of this repo? I could see benefit to adding it to the releases page, although I would never use it.

My hope for this issue was as simple as adding "hyper-sdk-bundle.js" to the package.json "files" list.

For my use case, I'm using Snowpack as the build environment. I'd like to import the SDK from the npm package, so that it is directly included in the build process. I currently accomplish it like this:

// Copy the bundle to the project.
import './hyper-sdk-bundle.js'
// Access the SDK via window.
const SDK = window.hyperSDK

I'd prefer something like this:

import 'hyper-sdk/hyper-sdk-bundle.js'
const SDK = window.hyperSDK

In the long term, I'd prefer to have access to modules:

import SDK from 'hyper-sdk'

// Or:

import { SDK } from 'hyper-sdk'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building An error that happens due to build errors enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants