Giter VIP home page Giter VIP logo

fakeyou.ts's Introduction

Me!

I am predominantly a web developer. Websites are my thing! I do all sorts, from front-end to back-end, and everything in between. TypeScript is my speciality, but I also dabble in some Rust occasionally. ๐Ÿ˜„

The projects you'll find here are mostly just for fun, and are usually just me messing around with something new. I'm always looking to learn new things, and I'm always looking for new projects to work on. Usually, the projects I work on are just for me, but I share them in case someone else finds them useful.

My full-time occupation is writing software for the UK healthcare sector (NHS) with Docker, React, TypeScript, GraphQL, MongoDB, and Node.js. I enjoy it a lot!

fakeyou.ts's People

Contributors

dependabot[bot] avatar jack3898 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

joacocinnamon

fakeyou.ts's Issues

V2v model add missing methods

Ttsmodels have nice methods like fetchTtsModelByName I should make sure the equivalent is available for V2v models.

Add options for polling

Today fakeyous servers have been very slow for anonymous users and the 120 attempt limit sometimes is not enough.

It should still be 120, but the user should be able to decide the intervals and attempt counts to suit their application.

Add importable tsconfig

The great thing about a tsconfig is that is can be extended.

I should be able to provide a tsconfig so that users of the project have the recommended config:

E.g. in a user's project this is what their tsconfig could look like:

{
    "extends": "fakeyou.ts/tsconfig.recommended.json"
}

This tsconfig will be really minimal. It'll just make sure their module resolution is set and that they have strict null checks set to true.

The rest will be up to the user.

add pre-commit and pre-push hooks

For the sake of getting fakeyou.ts developed fast, I started without having any git hooks.

However, now the repository has matured, I think it is time to add pre-commit and pre-push hooks.

Pre-commit will simply run a lint and type check, whereas pre-push will run all of pre-commit + unit tests.

All commits should now follow a given structure for consistency.

Hide data property in classes

The data property is there, but all properties should be migrated to the class and I should look at removing all of the getters (which is what it currently does)

Optimise subscription class and remove the fakeyou_plan key from the API

The Product class is simply unnecessary, as the product only consists of a namespace and slug. This could be simplified into a Map. Delete the Product class.

The fakeyouPlan key in the sessionUser instance is wrong, as FakeYou return false information. This should be removed and instead the user should use fetchSubscription() instead for correct plan details.

V3 - Remove static methods

Static methods have caused an organisation nightmare, and should be migrated to the parent class.

More information in the v3 announcement.

#58

V3 - Remove dataloader

The dataloader seemed like a great idea at first, but is very hard to read.

More information in the v3 announcement.

#58

Configure dependabot

Would be useful for dependabot to automatically create PR's for security updates and NPM package updates.

Create interface for classes

All classes need access to the client as their first argument. This interface will enforce this as a policy on service classes that need it.

Add batch audio processing

FakeYou has rate limiting, so it is not possible to hit their api with a bunch of requests at once.

It would be really handy to be able to do the following, so that the user can leave the responsibility of getting around the rate limiter to the package:

const [audio1, audio2, audio3] = Promise.all(
    model.infer("Speech 1"),
    model.infer("Speech 2"),
    model.infer("Speech 3"),
);

This can be handled with a dataloader.

Moar jsdoc

The online documentation leaves a lot to be desired!
Even though the API is simple, I think for a library project it's worth including more jsdoc to help people out

Simplify audio file as one class

There was some duplication around the audio file to get the code done quick, but logic is repeated and could be abstracted into one class.

allow cookie to be detected in environment

To stop repeated logins, and to speed up e2e tests, the package should be able to read FAKEYOU_SESSION to auto-authenticate the user without the need to use the login() function.

The login function will still be available, and useage of it will override the cookie in the environment.

Should update the workflows to use this environment variable and run e2e tests before deploy.

Tidy validation schemas

The schemas all live in a monolithic file, they should be broken out and tidied up as it's starting to get hard to follow!

Category search

Fetch categories and provide tooling to pick models from them

setup unit tests

This package has gone a long way without them! I should add a test runner into the build pipelines and make sure things are green before publish.

add audio transformers

At the moment wav is the only option. Users should be able to download other formats other than just wav.

Improve docs

I have submitted a PR to js.org, so get an official fakeyouts.js.org domain for documentation.

I have also installed typedoc to generate the site with documentation.

The documentation though still does not contain much useful information, and I want the documentation to be A*, so I should add more information and fix the issue where some classes are not being included in the generated documentation. This now includes information about api data units and classes as a whole.

I should also refactor to named exports as I will need to provide exports in the root index file to allow the documentation to generate them in.

Implementation derived classes

Inspired by Rust, it would be very powerful to define reusable functions that can be implemented on any class using bind().

So long as the class meets the contract of the binding, the function will work. These functions can then be reused on any class with no inheritance.

E.g. if a class has a username property, it should be easy to define an implementation function that can fetch the user so long as the class holds a username.

Dependandabot unexpected pipeline failures

Dependabots PRs all failed the pipeline, and the error logs suggest the authentication cookie is not working or there might be a bug. This should be looked into before accepting any of those PRs.

Optimise Leaderboard class

The Leaderboard class has getters, which creates new LeaderboardUser instances every time. This is memory inefficient and wasteful.

The getters should be removed, and replaced with values calculated when the Leaderboard class is instantiated.

Minify npm package

The npm package is multiple kilobytes because it's not only generating js source code but declarations and sourcemaps.

One tool I could look into is esbuild for minification, which has the handy cherry on top of being faster than TSC.

Finalise version 3

Test all functionality manually, update README's and publish version 3!

V3 - Add browser support

This package should support a modern browser environment!

  • Remove toDisk
  • Disable CORS checks in Rest class. Browser environments have it enabled blocking fetches to FakeYou API.
  • Remove use of Buffers and use ArrayBuffer
  • Change imports with node prefix to standard import e.g. node:crypto to crypto
  • Change dependencies to use unpkg
  • Change logging util to conditionally use chalk

CDN: unpkg.com/fakeyou.ts@latest will be where the magic happens! ๐Ÿฅณ

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.