adkelley / purescript-webaudio

A PureScript wrapper around the HTML5 Web Audio API
MIT License
7 stars 5 forks source link

Add to package-sets? #10

Open newlandsvalley opened 3 years ago

newlandsvalley commented 3 years ago

I wonder if you could add this to the package sets sometime?

newlandsvalley commented 3 years ago

I've just started to take a look at this. What I think needs to be done is:

As far as I can see, none of the library code needs changing - only the DecodeAsync example because affjax has changed.

I will raise a PR - but before I do so, I just want to ask how you feel about the two different build mechanisms. I think I would now veer towards documenting the spago builds in the README but also retaining the bower builds (quietly) in package.json.

If we then eventually raise and publish a new version, because the bower registry presumably already knows about the library, I think it's just a matter of having an adkelley entry in the package-sets groups.

adkelley commented 3 years ago

Thanks for looking at it. Given that Bower is deprecated, let's support/document Spago and remove support for Pulp/Bower altogether. What can I help you with to get this done?

newlandsvalley commented 3 years ago

Thanks, Alex.

OK - I think what I'll do is carry on with my initial idea and leave Pulp/Bower intact but in the background for the moment. That's because I always hate messing with travis.yml and I want to make sure that the thing builds. Also, although bower is deprecated, you will still need to use pulp publish for the time being I think. Then perhaps we can remove them as a next step at some stage. It seems that the community is moving away from travis and towards github actions but this is not something I understand at the moment. Is this something you could help with? Travis still works, I think.

Otherwise you just need to review the PR I think.

newlandsvalley commented 3 years ago

Incidentally - re bower - hdgarrood has just today recommended retaining bower.json : https://discourse.purescript.org/t/up-to-date-instructions-for-publishing-new-packages/1953/1

adkelley commented 3 years ago

Yes, agreed. I'll look into Github Actions, as I suspect that'll be the go-to approach for the 0.14.0 build.

bagrounds commented 3 years ago

Just dropping in to say thanks for the library!

I manually added it to my package set, and everything worked out of the box.

➜ tail -20 packages.dhall
let additions =
      { web-storage =
        { dependencies = [ "web-events", "nullable" ]
        , repo = "https://github.com/purescript-web/purescript-web-storage.git"
        , version = "v3.0.0"
        }
      , webaudio =
        { dependencies =
          [ "effect"
          , "arraybuffer-types"
          , "arrays"
          , "maybe"
          , "aff"
          , "foldable-traversable"
          , "math"
          , "tuples"
          , "strings"
          , "lists"
          , "arraybuffer"
          ]
        , repo = "https://github.com/adkelley/purescript-webaudio.git"
        , version = "v0.2.1"
        }
      }

in  upstream // overrides // additions
beep' :: Effect Unit
beep' = do
  audioContext <- newAudioContext
  oscillatorNode <- createOscillator audioContext
  f <- frequency oscillatorNode
  value <- setValueAtTime 440.0 0.0 f
  dest <- destination audioContext
  connect oscillatorNode dest
  startOscillator 0.0 oscillatorNode
  stopOscillator 0.1 oscillatorNode
adkelley commented 3 years ago

I'm glad it worked. I belatedly merged the purescript compiler 13.8 migration changes from @newlandsvalley yesterday. So you may want to give it another go with the 13.8 release. We'll work to add purescript-webaudio to the 14.0 package set once the new version is released.