mappersmith
Advanced tools
Comparing version 2.43.0-beta.1 to 2.43.0
# Changelog | ||
## 2.43.0 | ||
### Minor Changes | ||
- 6e94f97: Bundle with ESM exports. | ||
- The recommended way to use mappersmith in ESM projects is to do `import { forge } from 'mappersmith'` rather than the old `import forge from 'mappersmith'`. The reason is because test runners like jest and vitest might get confused when mixing named/default exports together with ESM, even though tsc and node has no problems with it. | ||
- A similar recommendation change goes for importing middleware: do `import { EncodeJsonMiddleware } from 'mappersmith/middleware'` (note the `mappersmith/middleware` folder) rather than deep import `import EncodeJsonMiddleware from 'mappersmith/middleware/encode-json'`. We still support the old import, but it will be deprecated in the future. | ||
- The same recommendation goes for importing gateway: do `import { FetchGateway } from 'mappersmith/gateway'` (note the `mappersmith/gateway` folder) rather than deep import `import FetchGateway from 'mappersmith/gateway/fetch'`. We still support the old import, but it will be deprecated in the future. | ||
- 9da82f6: Fixes memory leak when using http(s) agent with keep-alive | ||
### Patch Changes | ||
- e01114f: Fixed missing type declaration for `unusedMocks` | ||
## 2.42.0 | ||
@@ -4,0 +20,0 @@ |
@@ -101,17 +101,23 @@ "use strict"; | ||
} | ||
socket.on("lookup", () => { | ||
if (httpOptions.onSocketLookup) { | ||
httpOptions.onSocketLookup(requestParams); | ||
} | ||
}); | ||
socket.on("connect", () => { | ||
if (httpOptions.onSocketConnect) { | ||
httpOptions.onSocketConnect(requestParams); | ||
} | ||
}); | ||
socket.on("secureConnect", () => { | ||
if (httpOptions.onSocketSecureConnect) { | ||
httpOptions.onSocketSecureConnect(requestParams); | ||
} | ||
}); | ||
if (httpRequest.reusedSocket) { | ||
return; | ||
} | ||
if (httpOptions.onSocketLookup) { | ||
socket.on("lookup", () => { | ||
var _a; | ||
(_a = httpOptions.onSocketLookup) == null ? void 0 : _a.call(httpOptions, requestParams); | ||
}); | ||
} | ||
if (httpOptions.onSocketConnect) { | ||
socket.on("connect", () => { | ||
var _a; | ||
(_a = httpOptions.onSocketConnect) == null ? void 0 : _a.call(httpOptions, requestParams); | ||
}); | ||
} | ||
if (httpOptions.onSocketSecureConnect) { | ||
socket.on("secureConnect", () => { | ||
var _a; | ||
(_a = httpOptions.onSocketSecureConnect) == null ? void 0 : _a.call(httpOptions, requestParams); | ||
}); | ||
} | ||
}); | ||
@@ -118,0 +124,0 @@ httpRequest.on("error", (e) => this.onError(e)); |
{ | ||
"name": "mappersmith", | ||
"version": "2.43.0-beta.1", | ||
"version": "2.43.0", | ||
"description": "It is a lightweight rest client for node.js and the browser", | ||
@@ -108,4 +108,2 @@ "author": "Tulio Ornelas <ornelas.tulio@gmail.com>", | ||
"test": "yarn test:types && yarn prettier --check . && yarn lint && yarn test:unit", | ||
"build:node": "yarn babel src -d lib/ --extensions '.js,.ts' --ignore '**/*.spec.ts','**/*.spec.js','**/*.d.ts'", | ||
"build:browser": "yarn webpack --config webpack.conf.ts", | ||
"build:typings": "yarn tsc --project tsconfig.typings.json && yarn copy:dts", | ||
@@ -145,6 +143,2 @@ "build": "yarn copy:version:src && yarn tsup && yarn build:typings", | ||
"devDependencies": { | ||
"@babel/cli": "^7.22.10", | ||
"@babel/core": "^7.22.11", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.20.7", | ||
"@babel/preset-env": "^7.22.14", | ||
@@ -161,3 +155,2 @@ "@babel/preset-typescript": "^7.22.11", | ||
"@typescript-eslint/parser": "^6.5.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-jest": "^29.6.4", | ||
@@ -178,3 +171,2 @@ "babel-loader": "^9.1.3", | ||
"eslint-plugin-n": "^16.0.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
@@ -197,3 +189,2 @@ "express": "^4.18.2", | ||
"node-fetch": "<3.0.0", | ||
"pnp-webpack-plugin": "^1.7.0", | ||
"prettier": "^3.0.3", | ||
@@ -206,6 +197,4 @@ "puppeteer": "^21.1.1", | ||
"typescript": "^5.2.2", | ||
"uglifyjs-webpack-plugin": "^2.2.0", | ||
"wait-on": "^7.0.1", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4", | ||
"whatwg-fetch": "^3.6.18" | ||
@@ -212,0 +201,0 @@ }, |
@@ -64,6 +64,2 @@ [![npm version](https://badge.fury.io/js/mappersmith.svg)](http://badge.fury.io/js/mappersmith) | ||
#### Browser | ||
Download the tag/latest version from the dist folder. | ||
#### Build from the source | ||
@@ -1421,3 +1417,4 @@ | ||
First, update package version and generate an updated `CHANGELOG.md`: | ||
1. Create a release branch, e.g. `git checkout -b release/2.43.0` | ||
2. Update package version and generate an updated `CHANGELOG.md`: | ||
@@ -1428,10 +1425,15 @@ ```sh | ||
Second, build the `lib/` folder which will be published to npm: | ||
3. Merge the PR. | ||
4. From main: pull the latest changes, and build the `lib/` folder which will be published to npm: | ||
```sh | ||
yarn build:project | ||
yarn publish:prepare | ||
``` | ||
Finally, publish to npm: | ||
5. Verify the release works, using `npm pack` to create a local tarball. | ||
6. Finally, publish the contents of `dist/` folder to npm: | ||
```sh | ||
yarn changeset publish | ||
cd dist/ | ||
npm publish | ||
``` | ||
@@ -1438,0 +1440,0 @@ |
@@ -99,17 +99,21 @@ import * as url from 'url' | ||
socket.on('lookup', () => { | ||
if (httpOptions.onSocketLookup) { | ||
httpOptions.onSocketLookup(requestParams) | ||
} | ||
}) | ||
socket.on('connect', () => { | ||
if (httpOptions.onSocketConnect) { | ||
httpOptions.onSocketConnect(requestParams) | ||
} | ||
}) | ||
socket.on('secureConnect', () => { | ||
if (httpOptions.onSocketSecureConnect) { | ||
httpOptions.onSocketSecureConnect(requestParams) | ||
} | ||
}) | ||
if (httpRequest.reusedSocket) { | ||
return | ||
} | ||
if (httpOptions.onSocketLookup) { | ||
socket.on('lookup', () => { | ||
httpOptions.onSocketLookup?.(requestParams) | ||
}) | ||
} | ||
if (httpOptions.onSocketConnect) { | ||
socket.on('connect', () => { | ||
httpOptions.onSocketConnect?.(requestParams) | ||
}) | ||
} | ||
if (httpOptions.onSocketSecureConnect) { | ||
socket.on('secureConnect', () => { | ||
httpOptions.onSocketSecureConnect?.(requestParams) | ||
}) | ||
} | ||
}) | ||
@@ -116,0 +120,0 @@ |
@@ -35,2 +35,3 @@ import type { Client } from '../client-builder' | ||
export function uninstall(): void | ||
export function unusedMocks(): number | ||
export function mockClient< | ||
@@ -37,0 +38,0 @@ ResourcesType, |
@@ -1,1 +0,1 @@ | ||
export const version = '2.43.0-beta.0' | ||
export const version = '2.43.0' |
@@ -35,2 +35,3 @@ import type { Client } from '../client-builder' | ||
export function uninstall(): void | ||
export function unusedMocks(): number | ||
export function mockClient< | ||
@@ -37,0 +38,0 @@ ResourcesType, |
@@ -1,1 +0,1 @@ | ||
export declare const version = "2.43.0-beta.0"; | ||
export declare const version = "2.43.0"; |
@@ -24,3 +24,3 @@ "use strict"; | ||
module.exports = __toCommonJS(version_exports); | ||
const version = "2.43.0-beta.0"; | ||
const version = "2.43.0"; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -27,0 +27,0 @@ 0 && (module.exports = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
974310
53
347
13090
0
1451
16