Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Add WASM support #103

Closed
wants to merge 2 commits into from
Closed

Add WASM support #103

wants to merge 2 commits into from

Conversation

swenson
Copy link

@swenson swenson commented Nov 10, 2023

Moved some functions and constants around so common ones are in ui_common.js.

ui_js.go Mostly contains a basic call out to prompt() to ask for input. It's not perfect, but it works and is simple.

@dekimsey
Copy link

Hi, not a maintainer. But I've run into this myself with WASM targets. This is great, thank you for taking the time to make it work! And test! :swoon:

I think my only ⛏️ is would you mind including a copy of the error that set you down this path? I think it's a common problem with terminal libraries. Would be nice to have something reference.

@swenson
Copy link
Author

swenson commented Nov 13, 2023

The errors in this repo were:

# github.com/bgentry/speakeasy
../../go/pkg/mod/github.com/bgentry/[email protected]/speakeasy.go:23:18: undefined: getPassword
# github.com/fatih/color
../../go/pkg/mod/github.com/fatih/[email protected]/color.go:21:12: undefined: isatty.IsTerminal

Usually these missing functions are because of underspecified build tags, like using go:build !windows and assuming it is a UNIX os that will have access to the UNIX syscall, or just not having a definition specified for go:build js or go:build wasm.

Christopher Swenson added 2 commits November 20, 2023 13:03
Moved some functions and constants around so common ones are in
`ui_common.js`.

`ui_js.go` Mostly contains a basic call out to `prompt()` to ask for
input. It's not perfect, but it works and is simple.
@swenson
Copy link
Author

swenson commented Nov 20, 2023

Closing in favor of hashicorp#1

@swenson swenson closed this Nov 20, 2023
@swenson swenson deleted the wasm branch November 20, 2023 21:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants