Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b779ebf
add type extending
icebob Dec 10, 2023
3c4b898
add type extending
icebob Dec 10, 2023
313f544
switch to master
icebob Dec 10, 2023
e373168
switch to next branch
icebob Dec 10, 2023
7d30cc3
bump node version
icebob Dec 17, 2023
3a66b16
update broker.createService signature
icebob Dec 17, 2023
4c87203
using new file streaming in 0.15
icebob Dec 4, 2024
16e61ec
using new file streaming in 0.15
icebob Dec 4, 2024
7328ad7
fix error msg check
icebob Dec 4, 2024
3d0b316
changelog
icebob Dec 4, 2024
3e28430
changelog indent
icebob Dec 4, 2024
36c5f51
fix example
icebob Dec 4, 2024
1d53f88
eslint+prettier+reformat
icebob Dec 4, 2024
3a414ea
update deps
icebob Dec 4, 2024
a6afc52
update major deps
icebob Dec 4, 2024
6bd9b83
upgrade path-to-regexp, formidable
icebob Dec 4, 2024
86810ad
changelog
icebob Dec 4, 2024
28f3e66
0.11.0-beta1
icebob Dec 4, 2024
a9afcca
fix peer deps version
icebob Apr 30, 2025
361003b
update deps
icebob Jun 11, 2025
bd1173c
update major deps
icebob Jun 11, 2025
d98c4e4
update major deps
icebob Jun 11, 2025
a039454
better handling port is used
icebob Jun 11, 2025
0679942
update changelog
icebob Jun 11, 2025
bc46ffd
minimum node 20
icebob Jun 11, 2025
0e9ad94
0.11.0-beta2
icebob Jun 11, 2025
a479033
changelog
icebob Jun 11, 2025
604a7a2
fix typo
icebob Jun 11, 2025
f99ace6
fix TS import issue in case of module node16
icebob Jun 18, 2025
d97b76d
fix d.ts
icebob Jun 19, 2025
507fd54
Update index.d.ts
icebob Jun 19, 2025
756e6ac
Update index.d.ts
icebob Jun 19, 2025
50eba84
fix d.ts export
icebob Jun 25, 2025
ba6bee9
fix d.ts
icebob Jun 29, 2025
b500bce
cors boolean
icebob Aug 9, 2025
460ea2b
add context response type
icebob Aug 24, 2025
bffed17
add missing exported 3rd-party types
icebob Sep 10, 2025
6923a73
add missing exported 3rd-party types
icebob Sep 10, 2025
d9874d3
add missing exported 3rd-party types
icebob Sep 10, 2025
625303d
add missing exported 3rd-party types
icebob Sep 10, 2025
55411dc
update changelog
icebob Oct 9, 2025
1349514
0.11.0-beta3
icebob Oct 9, 2025
cb4daf4
Merge master into next (0.10.8 changes)
icebob Mar 23, 2026
e1500ad
Merge master into next (bug fix PRs #366, #363, #332)
icebob Mar 23, 2026
5b8e448
Add tests for blacklist+autoAliases and fix mergeParams for internal …
icebob Mar 23, 2026
d530452
Remove declare module wrapper from index.d.ts
icebob Mar 23, 2026
80a3914
Update all dependencies
icebob Mar 23, 2026
a998c28
CI updates, changelog, and npm publish workflow
icebob Mar 23, 2026
9a6768e
Merge master into next (resolve package-lock conflict)
icebob Mar 23, 2026
b896057
Fix: reject promise on server listen error in started()
icebob Mar 23, 2026
9d1304b
Bump minimum Node.js version to 22.x
icebob Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 4

[{package,bower}.json]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2

[*.js]
quote_type = "double"
68 changes: 0 additions & 68 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
node-version: [22.x, 24.x]

steps:
- uses: actions/checkout@v4
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to NPM

on:
release:
types: [published]

permissions:
id-token: write
contents: read

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Publish
run: npm publish --provenance
142 changes: 142 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,145 @@
<a name="0.11.0-beta4"></a>
# 0.11.0-beta4 (2026-03-23)

## Changes

### Bug fixes
- fix: skip blacklisted actions in auto-alias regeneration [#366](https://github.com/moleculerjs/moleculer-web/pull/366)
- fix: crash when the upload file size exceeds the limit [#363](https://github.com/moleculerjs/moleculer-web/pull/363)
- fix: mergeParams for internal services ($node.*) — params were not merged on the current request [#332](https://github.com/moleculerjs/moleculer-web/pull/332)

### Improvements
- Remove incorrect `declare module "moleculer-web"` wrapper from TypeScript definitions (based on [#357](https://github.com/moleculerjs/moleculer-web/pull/357))
- Add tests for blacklist with autoAliases and mergeParams with internal services

### Dependencies
- Update all dependencies (major: eslint 10, @sinonjs/fake-timers 15, @types/serve-static 2, cross-env 10, eslint-plugin-security 4, webpack-dev-middleware 8)
- Remove unused `eslint-plugin-node`
- Add `@eslint/js` and `globals` for ESLint 10 flat config

### CI
- Update Node.js CI matrix: remove 18.x and 20.x, add 24.x
- Bump minimum Node.js version to 22.x

-----------------------------
<a name="0.11.0-beta3"></a>
# 0.11.0-beta3 (2025-10-09)

## Changes

- Added missing exported 3rd-party types
- Added context response type
- Added boolean CORS option
- Fixed TypeScript definition exports
- Fixed TypeScript import issue in case of module node16
- Fixed typo in documentation

<a name="0.11.0-beta2"></a>
# 0.11.0-beta2 (2025-06-11)

## Changes

### BREAKING: Minimum Node 20

The minimum Node version is Node 20.x.

### BREAKING: Update dependencies
Many dependencies (major, minor, patch) is upgraded which can contain breaking changes

<a name="0.11.0-beta1"></a>
# 0.11.0-beta1 (2024-12-04)

## Changes

### BREAKING: Updated `path-ro-regexp` library

The `path-to-regexp` has been updated to 8.x.x. It contains many breaking changes in the path resolving. Check the [documentation](https://github.com/pillarjs/path-to-regexp?tab=readme-ov-file#express--4x) of library to how migrate your alias paths.

**Optional parameter alias path**

```
// Old way
"GET user/:name?": "user.get"

// New way
"GET user{/:name}": "user.get"
```

**Repeating parameter alias path**

```
// Old way
"GET /users/*username": "user.resolveUsersByNames",

// New way
"GET /users/:username*": "user.resolveUsersByNames",
```


### Using 0.15 new streaming solution

The moleculer-web@0.11.x supports Moleculer v0.15.x including the new streaming solution. It means, it doesn't support 0.13 and 0.14 moleculer versions.

Thanks for the new solution, the multipart fields and request parameters are sent via `ctx.params` instead of meta and the file stream is available in `ctx.stream` in action handlers.

**Example**

```js
module.exports = {
name: "file",
actions: {
save: {
handler(ctx) {
return new this.Promise((resolve, reject) => {
const filePath = path.join(uploadDir, ctx.params.$filename);
const f = fs.createWriteStream(filePath);
f.on("close", () => {
// File written successfully
this.logger.info(`Uploaded file stored in '${filePath}'`);
resolve({ filePath });
});

ctx.stream.on("error", err => {
this.logger.info("File error received", err.message);
reject(err);

// Destroy the local file
f.destroy(err);
});

f.on("error", () => {
// Remove the errored file.
fs.unlinkSync(filePath);
});

ctx.stream.pipe(f);
});
}
}
}
};
```

Example content of `ctx.params`:

```js
{
// Multipart file properties
$fieldname: "myfile",
$filename: "avatar.png",
$encoding: "7bit",
$mimetype: "image/png",

// Other multipart fields
// e.g.: `<input type="text" name="name" id="name" value="Test User">`
name: "Test User",

// Request path parameter, e.g.: `/upload/single/1234`
id: "1234"
}
```

-----------------------------
<a name="0.10.8"></a>
# 0.10.8 (2025-03-24)

Expand Down
31 changes: 18 additions & 13 deletions benchmarks/cluster/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
/* eslint-disable no-console */

"use strict";

const
os = require("os"),
const os = require("os"),
cluster = require("cluster"),
stopSignals = [
"SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT",
"SIGBUS", "SIGFPE", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGTERM"
"SIGHUP",
"SIGINT",
"SIGQUIT",
"SIGILL",
"SIGTRAP",
"SIGABRT",
"SIGBUS",
"SIGFPE",
"SIGUSR1",
"SIGSEGV",
"SIGUSR2",
"SIGTERM"
],
production = true; //process.env.NODE_ENV == "production";

let stopping = false;

cluster.on("disconnect", function(worker) {
cluster.on("disconnect", function (worker) {
if (production) {
if (!stopping) {
cluster.fork();
}
} else
process.exit(1);
} else process.exit(1);
});

if (cluster.isMaster) {
Expand All @@ -30,11 +36,11 @@ if (cluster.isMaster) {
}

if (production) {
stopSignals.forEach(function(signal) {
process.on(signal, function() {
stopSignals.forEach(function (signal) {
process.on(signal, function () {
console.log(`Got ${signal}, stopping workers...`);
stopping = true;
cluster.disconnect(function() {
cluster.disconnect(function () {
console.log("All workers stopped, exiting.");
process.exit(0);
});
Expand All @@ -48,7 +54,6 @@ if (cluster.isMaster) {
worker.process.argv.push(hostname + "-worker-" + worker.id);

require("./worker.js");

}

/**
Expand Down
8 changes: 3 additions & 5 deletions benchmarks/cluster/worker.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable no-console */
"use strict";

const { ServiceBroker } = require("moleculer");
const ApiService = require("../../index");
const { ServiceBroker } = require("moleculer");
const ApiService = require("../../index");

// Create broker
const broker = new ServiceBroker({
Expand All @@ -24,5 +23,4 @@ broker.createService({
broker.createService(ApiService);

// Start server
broker.start()
.then(() => console.log(`Worker '${broker.nodeID}' started.`));
broker.start().then(() => console.log(`Worker '${broker.nodeID}' started.`));
Loading
Loading