mocks-server / main

Node.js mock server running live, interactive mocks in place of real APIs
https://www.mocks-server.org
Apache License 2.0
281 stars 14 forks source link

mocks-server-lite - An Alternative #493

Open burt202 opened 2 months ago

burt202 commented 2 months ago

https://www.npmjs.com/package/mocks-server-lite

Firstly to the author, feel free to close/delete if you want. Im only posting this here as this project seems dead and i wanted to make others who are interested aware of another option.

Ive been really enjoying using mocks-server, so thanks, but its frustrating to use in a TypeSsript project due to the lack of supplied types and also i worry this project is no longer maintained so thats a risk for me.

Because of this, I decided to write from the ground up, a lightweight alternative that is heavily inspired by the core elements of mocks-server. It is NOT a drop in replacement and only has minimal features, but its similar enough for anyone with the same frustrations to try out.

Any comments or suggestions, post them over on the repo.

Cheers!

javierbrea commented 2 months ago

Hi @burt202 !

First of all, I'm glad you like the project! No problem in posting this here, maybe it's not the most appropriate place, given that it is not an issue, but I'll leave it here until I think about where should it be placed instead (maybe in a discussion).

About the project being dead, not yet, but it is true that lately I don't have the time it deserves. I try to answer issues as soon as I can, and I hope I will have time to work on them again. Meanwhile, I have planned to continue publishing versions periodically updating the dependencies at least.

About TypeScript, there is already a TypeScript beta version available that you may use: https://github.com/mocks-server/main/releases/tag/v5.0.0-beta.4 . The code is in the branch https://github.com/mocks-server/main/tree/refactor/typescript-migration. The documentation in the website is still not ready, and it produces some breaking changes that are only defined in the CHANGELOG files for the moment, but, who knows, if it is ok for you or any othe user maybe someone may be interested in finishing the docs, write some missing tests, etc. and prepare it as a stable release. I will be happy to collaborate with anyone interested 😃

Cheers, and good luck with your lite version, I hope it will make you enjoy as well. And remember, feel free also to contribute to this project whenever you want.

manuelscurti commented 1 month ago

hi @javierbrea! first, thanks for such awesome work on this project 🙂 second, I would like to help you out. I think I just need to know in details where you need help to speed up things, otherwise I can try to figure it out myself if you don't have time to write some tasks!

javierbrea commented 1 month ago

Hi @manuelscurti!, thank you very much, it would be great!

As I mentioned in my previous comment here, I think that currently the more urgent thing to do would be to release the branch with the TypeScript migration, because of next reasons:

I know that onboarding to a project by writing documentation, tests, or CI workflows is not the best approach, but, unfortunately, those are mainly the parts that are pending to do. Anyway, please let me some time to reorganize the project backlog in order to split this into small tasks with a clear description, so you or anyone else interested could contribute, ideally in parallel. I will try to do it this weekend. This version is already in the release branch, so PRs could be opened to that branch until all the job is done, and we can release it as a stable version. Then, it would be possible again to start adding new features.

javierbrea commented 1 month ago

Hi again @manuelscurti , sorry for the delay. I have created a project with the pending tasks for finishing the TypeScript migration, which will unblock adding new features to the project. If you are still interested in contributing you can take a look at https://github.com/orgs/mocks-server/projects/4/views/1 and let me know if you have any doubt. Thanks again! 🙂

manuelscurti commented 2 weeks ago

hey there! @javierbrea I started looking around the codebase but failing to understand how to actually run a local instance of the mocks server starting from its sources. I see you are using pnpm in combination with nx but can't see any "start" script configured in the root package.json, neither in other config files (e.g. nx.json). I usually use yarn + npm but I don't expect much differences.

can you help on that? 🙂

javierbrea commented 2 weeks ago

Hi @manuelscurti , in fact, there is no "start" script in any package because I usually only execute tests while developing. Anyway, you could easily add one to the "main" package, for example:

{
"scripts": {
    "start": "./bin/mocks-server"
 }
}

Using Nx, you can execute any script from any package in the monorepo by using pnpm nx [script] [package-name] in the root folder, so, once you have added the script, you could run:

pnpm nx start main