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

get all .js files and use their paths to generate foreigns #58

Open
github-actions bot opened this issue Dec 19, 2023 · 0 comments
Open

get all .js files and use their paths to generate foreigns #58

github-actions bot opened this issue Dec 19, 2023 · 0 comments
Labels
help wanted Extra attention is needed todo

Comments

@github-actions
Copy link
Contributor

command used `grep -rl --include "*.js" import src/ | xargs -I _ sh -c "S=_; grep module \${S/js/purs} | cut -d ' ' -f2"`

command used for nested dependencies `spago install && grep -rl --include "*.js" import .spago/ | xargs -I _ sh -c "S=_; grep -H module \${S/js/purs}"`

# TODO get all .js files and use their paths to generate foreigns

# this is a purs-nix overlay (not nixpkgs overlay)
system: inputs: pkgs: npmlock2nix: self: super: with self;
let
  inherit (pkgs.lib.attrsets) recursiveUpdate;
  # FIXME we should rely on node_modules from ctl-scaffhold
  node_modules_ = npmlock2nix.v1.node_modules { src = inputs.ctl; };
  node_modules = node_modules_ + /node_modules;
  ffi = { inherit node_modules; };
  purs-nix = inputs.purs-nix { inherit system; };
  inherit (purs-nix) build;
in
{
  cardano-transaction-lib = build {
    name = "cardano-transaction-lib";
    # TODO find a way to reuse ctl to build cardano-transaction-lib overlay
    #  it seems that we'll need a purs-nix api change for that
    #  also applies to other inputs
    src.path = inputs.ctl;
    info = {
      version = "7.0.0";
      foreign = {
        # TODO get all .js files and use their paths to generate foreigns
        #  command used `grep -rl --include "*.js" import src/ | xargs -I _ sh -c "S=_; grep module \${S/js/purs} | cut -d ' ' -f2"`
        #  command used for nested dependencies `spago install && grep -rl --include "*.js" import .spago/ | xargs -I _ sh -c "S=_; grep -H module \${S/js/purs}"`
        "Ctl.Internal.BalanceTx.UtxoMinAda" = ffi;
        "Ctl.Internal.Deserialization.FromBytes" = ffi;
        "Ctl.Internal.Deserialization.Keys" = ffi;
        "Ctl.Internal.Deserialization.Language" = ffi;
        "Ctl.Internal.Deserialization.NativeScript" = ffi;
        "Ctl.Internal.Deserialization.PlutusData" = ffi;
        "Ctl.Internal.Deserialization.Transaction" = ffi;
        "Ctl.Internal.Deserialization.UnspentOutput" = ffi;
        "Ctl.Internal.Plutip.PortCheck" = ffi;
        "Ctl.Internal.Plutip.Spawn" = ffi;
        "Ctl.Internal.Plutip.Utils" = ffi;
        "Ctl.Internal.QueryM.UniqueId" = ffi;
        "Ctl.Internal.Serialization.Address" = ffi;
        "Ctl.Internal.Serialization.AuxiliaryData" = ffi;
        "Ctl.Internal.Serialization.BigInt" = ffi;
        "Ctl.Internal.Serialization.Hash" = ffi;
        "Ctl.Internal.Serialization.MinFee" = ffi;
        "Ctl.Internal.Serialization.NativeScript" = ffi;
        "Ctl.Internal.Serialization.PlutusData" = ffi;
        "Ctl.Internal.Serialization.PlutusScript" = ffi;
        "Ctl.Internal.Serialization.WitnessSet" = ffi;
        "Ctl.Internal.Types.BigNum" = ffi;
        "Ctl.Internal.Types.ByteArray" = ffi;
        "Ctl.Internal.Types.Int" = ffi;
        "Ctl.Internal.Types.TokenName" = ffi;
        "Ctl.Internal.Wallet.Cip30.SignData" = ffi;
        "Ctl.Internal.Wallet.Bip32" = ffi;
        "Ctl.Internal.Affjax" = ffi;
        "Ctl.Internal.ApplyArgs" = ffi;
        "Ctl.Internal.Hashing" = ffi;
        "Ctl.Internal.JsWebSocket" = ffi;
        "Ctl.Internal.Serialization" = ffi;
      };

      dependencies = [
        aeson
        aff
        aff-promise
        aff-retry
        affjax
        ansi
        argonaut
        argonaut-codecs
        arraybuffer-types
        arrays
        avar
        bifunctors
        js-bigints
        bignumber
        checked-exceptions
        console
@github-actions github-actions bot added help wanted Extra attention is needed todo labels Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed todo
Projects
None yet
Development

No branches or pull requests

0 participants