Giter VIP home page Giter VIP logo

succus's Introduction

succus's People

Contributors

noctisatrae avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

i001962

succus's Issues

The need of enforcement of better typing & coding practices

In its current state, succus' types are a mess: everything is buggy and not precise. Here are some steps to follow:

  • Strengthen tsconfig.json to be more strict
  • Introduce testing (jest) + linting (ESLint)
  • Add package.json proper configuration for linting and testing.
  • Better organization and definition of types

It will a lot of work but with determination, I'm sure we can do it!

A `config.succus.json` needs to be added for better usability of library

It will be easier as everything will be fetched in an easier fashion. It would provide maybe the wallet provider, the SEA keypair, the namespace to use for gunDB, and all of the configuration for it. It could look like that:

export const conf = {
    keypair: await getKeypair(),
    namespace: "succus-supercool-chat",
    gun: {
       // use gun.eco/docs
    },
    dev: true // debug to not clutter public community peers with bloat data
    // etc
}

Why use JS over JSON? Well, here's a few reasons:

  • You can directly use functions
  • Therefore it allows to simplify the workflow, and the use of the library by centralising all needed information in a file.
  • Allows you to easily use environment variables
  • It's always good to split your code in a few parts for simplicity

Here are the step to implement it:

  • Implement a Config interface/type (doesn't know how to choose) to define what's mandatory and what is not!
  • Implement the parser thanks to the implemented type.
  • Implement parameters injection into the functions

Module not found error

Tried to test this by creating a react app using cra with nvm use 14, npm i succus, then importing succus and it's exported functions. Getting this error:

ERROR in ./node_modules/succus/dist/index.js 3:0-17
Module not found: Error: Can't resolve 'gun/sea' in '/Users/kmm/Dropbox/aws/gun/succus/node_modules/succus/dist'
Did you mean 'sea.js'?
BREAKING CHANGE: The request 'gun/sea' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.