moleculerjs / moleculer

:rocket: Progressive microservices framework for Node.js
https://moleculer.services/
MIT License
6.17k stars 587 forks source link

Export ESM Runner from index.mjs instead of cjs runner #1280

Closed prasadmadanayake closed 7 months ago

prasadmadanayake commented 7 months ago

:memo: Description

cjs runner is exported from index.mjs instead of esm runner

:dart: Relevant issues

:gem: Type of change

//can use runner with native esm const runner = new Runner(); runner.start(["--env","--hot","--repl","--config","service/moleculer.config.ts","service/**.service.ts"])



## :vertical_traffic_light: How Has This Been Tested?
Created a sample service schema and from the main mjs file created a new runner and tested manually.

## :checkered_flag: Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] **I have added tests that prove my fix is effective or that my feature works**
- [x] **New and existing unit tests pass locally with my changes**
- [ ] I have commented my code, particularly in hard-to-understand areas
PetrChalov commented 7 months ago

@prasadmadanayake please see this, this and this

icebob commented 7 months ago

In 0.15 I will drop the esm generator script and it will be solved.