diff --git a/.travis.yml b/.travis.yml index 75db0e51..25915a76 100755 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,7 @@ script: - nyc check-coverage --lines 70 after_success: - npm run build - - semantic-release pre - - npm publish - - semantic-release post + - semantic-release notifications: email: false sudo: false diff --git a/package.json b/package.json index 7148c56e..6d3c10f0 100644 --- a/package.json +++ b/package.json @@ -10,37 +10,37 @@ ] }, "dependencies": { - "ajv": "^5.3.0", + "ajv": "^6.5.0", "array-flatten": "^2.1.1", "bluebird": "^3.5.1", "boolean": "^0.1.3", - "es6-error": "^4.0.2", - "pg": "^7.4.0", + "es6-error": "^4.1.1", + "pg": "^7.4.3", "pg-connection-string": "^2.0.0", "pretty-hrtime": "^1.0.3", - "roarr": "^2.0.2", + "roarr": "^2.3.0", "serialize-error": "^2.1.0", "stack-trace": "0.0.10", "ulid": "^2.3.0" }, "description": "A PostgreSQL client with strict types, detail logging and assertions.", "devDependencies": { - "@babel/cli": "^7.0.0-beta.46", - "@babel/core": "^7.0.0-beta.46", - "@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.46", - "@babel/preset-env": "^7.0.0-beta.46", - "@babel/register": "^7.0.0-beta.46", + "@babel/cli": "^7.0.0-beta.49", + "@babel/core": "^7.0.0-beta.49", + "@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.49", + "@babel/preset-env": "^7.0.0-beta.49", + "@babel/register": "^7.0.0-beta.49", "ava": "^1.0.0-beta.4", "babel-plugin-istanbul": "^4.1.6", - "coveralls": "^3.0.0", - "eslint": "^4.10.0", - "eslint-config-canonical": "^9.3.1", - "flow-bin": "^0.71.0", - "flow-copy-source": "^1.2.1", + "coveralls": "^3.0.1", + "eslint": "^4.19.1", + "eslint-config-canonical": "^10.2.1", + "flow-bin": "^0.74.0", + "flow-copy-source": "^2.0.0", "husky": "^0.14.3", - "nyc": "^11.7.2", - "semantic-release": "^8.2.0", - "sinon": "^4.1.2" + "nyc": "^12.0.2", + "semantic-release": "^15.5.1", + "sinon": "^5.1.0" }, "engines": { "node": ">=8.0" diff --git a/src/index.js b/src/index.js index 7a9b3552..681f3087 100644 --- a/src/index.js +++ b/src/index.js @@ -53,20 +53,6 @@ import { SLONIK_LOG_VALUES } from './config'; -export type { - DatabaseConnectionType, - DatabasePoolConnectionType, - DatabasePoolType, - DatabaseSingleConnectionType -} from './types'; - -export { - DataIntegrityError, - UniqueViolationError, - SlonikError, - NotFoundError -}; - // eslint-disable-next-line id-match const INT8_OID = 20; const TIMESTAMPTZ_OID = 1184; @@ -90,6 +76,20 @@ const log = Logger.child({ const ulid = ulidFactory(detectPrng(true)); +export type { + DatabaseConnectionType, + DatabasePoolConnectionType, + DatabasePoolType, + DatabaseSingleConnectionType +} from './types'; + +export { + DataIntegrityError, + UniqueViolationError, + SlonikError, + NotFoundError +}; + // eslint-disable-next-line complexity export const query: InternalQueryType<*> = async (connection, rawSql, values, queryId) => { let stackTrace; @@ -403,14 +403,14 @@ export const transaction: InternalTransactionType = async (connection, handler) } }; -const sql = (parts: $ReadOnlyArray, ...values: AnonymouseValuePlaceholderValuesType): TaggledTemplateLiteralInvocationType => { +export const sql = (parts: $ReadOnlyArray, ...values: AnonymouseValuePlaceholderValuesType): TaggledTemplateLiteralInvocationType => { return { sql: parts.join('?'), values }; }; -const createConnection = async ( +export const createConnection = async ( connectionConfiguration: DatabaseConfigurationType, clientConfiguration: ClientConfigurationType = {} ): Promise => { @@ -449,7 +449,7 @@ const createConnection = async ( return bindConnection; }; -const createPool = ( +export const createPool = ( connectionConfiguration: DatabaseConfigurationType, clientConfiguration: ClientConfigurationType = {} ): DatabasePoolType => { @@ -507,9 +507,3 @@ const createPool = ( } }; }; - -export { - createConnection, - createPool, - sql -}; diff --git a/src/types.js b/src/types.js index 9babc6aa..80bb40e3 100644 --- a/src/types.js +++ b/src/types.js @@ -1,6 +1,6 @@ // @flow -/* eslint-disable no-use-before-define */ +/* eslint-disable no-use-before-define, import/exports-last */ type FieldType = { +columnID: number, diff --git a/test/slonik/transaction.js b/test/slonik/transaction.js index 7f0ce695..f908e446 100644 --- a/test/slonik/transaction.js +++ b/test/slonik/transaction.js @@ -47,7 +47,7 @@ test('rollbacks unsuccessful transaction', async (t) => { const transactionExecution = transaction(connection, async () => { await query('FOO'); - throw new Error(); + throw new Error('Instigated error.'); }); await t.throws(transactionExecution);