diff --git a/.github/workflows/ci-tsc-build.yml b/.github/workflows/ci-tsc-build.yml new file mode 100644 index 0000000000..4f59642344 --- /dev/null +++ b/.github/workflows/ci-tsc-build.yml @@ -0,0 +1,38 @@ +name: CI - TypeScript Build + +on: + pull_request: + push: + branches: [ main ] + + workflow_dispatch: + +jobs: + tests-tsc-build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [18.x] + + name: Node.js ${{ matrix.node-version }} + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + + - name: Install npm dependencies + run: npm ci + + - name: Testing TypeScript build + run: npm run test:tsc-build diff --git a/Changelog.md b/Changelog.md index f8e27b7184..d7a08e38f6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,12 @@ # Changelog +## [3.2.3](https://github.com/sidorares/node-mysql2/compare/v3.2.2...v3.2.3) (2023-04-16) + + +### Bug Fixes + +* **types:** add decimalNumbers to createConnection/createPool typings. fixes [#1803](https://github.com/sidorares/node-mysql2/issues/1803) ([#1817](https://github.com/sidorares/node-mysql2/issues/1817)) ([bb48462](https://github.com/sidorares/node-mysql2/commit/bb48462db7b83bd4825a3d53e192e5363139ec3c)) + ## [3.2.2](https://github.com/sidorares/node-mysql2/compare/v3.2.1...v3.2.2) (2023-04-16) diff --git a/package-lock.json b/package-lock.json index cad9a36fb8..ef5b27de67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mysql2", - "version": "3.2.2", + "version": "3.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mysql2", - "version": "3.2.2", + "version": "3.2.3", "license": "MIT", "dependencies": { "denque": "^2.1.0", diff --git a/package.json b/package.json index 3f4f48cc66..4d40bf8008 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mysql2", - "version": "3.2.2", + "version": "3.2.3", "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS", "main": "index.js", "directories": { @@ -12,6 +12,7 @@ "lint:code": "eslint index.js promise.js \"lib/**/*.js\" \"test/**/*.js\" \"benchmarks/**/*.js\"", "lint:docs": "eslint Contributing.md \"documentation/**/*.md\" \"examples/*.js\"", "test": "node ./test/run.js", + "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"", "coverage-test": "c8 -r cobertura -r lcov -r text node ./test/run.js", "benchmark": "node ./benchmarks/benchmark.js", "prettier": "prettier --single-quote --trailing-comma none --write \"{lib,examples,test}/**/*.js\"", diff --git a/test/tsc-build/index.ts b/test/tsc-build/index.ts new file mode 100644 index 0000000000..1956ed7467 --- /dev/null +++ b/test/tsc-build/index.ts @@ -0,0 +1,4 @@ +import mysql from '../../index'; +import mysqlp from '../../promise'; + +export { mysql, mysqlp }; diff --git a/test/tsc-build/tsconfig.json b/test/tsc-build/tsconfig.json new file mode 100644 index 0000000000..6f7c8c0b7c --- /dev/null +++ b/test/tsc-build/tsconfig.json @@ -0,0 +1,18 @@ +{ + "include": ["index.ts"], + "compilerOptions": { + "target": "ES2016", + "module": "CommonJS", + "moduleResolution": "Node", + "isolatedModules": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "noImplicitAny": true, + "strictFunctionTypes": false, + "skipLibCheck": false, + "noEmitOnError": true, + "noEmit": true + } +} diff --git a/typings/mysql/lib/Connection.d.ts b/typings/mysql/lib/Connection.d.ts index 08a51b4662..41c37183f0 100644 --- a/typings/mysql/lib/Connection.d.ts +++ b/typings/mysql/lib/Connection.d.ts @@ -11,6 +11,12 @@ import {EventEmitter} from 'events'; declare namespace Connection { export interface ConnectionOptions { + + /** + * DECIMAL and NEWDECIMAL types will be returned as numbers if this option is set to `true` ( default: `false`). + */ + decimalNumbers?: boolean; + /** * The MySQL user to authenticate as */