Skip to content

Commit

Permalink
Merge pull request #104 from malthe/lint-check-ci
Browse files Browse the repository at this point in the history
Add 'prettier' style check
  • Loading branch information
malthe authored Feb 15, 2024
2 parents 9436b77 + b51de37 commit b67261c
Show file tree
Hide file tree
Showing 31 changed files with 1,246 additions and 1,185 deletions.
8 changes: 2 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
"browser": true,
"es2021": true
},
"extends": [
"plugin:@typescript-eslint/recommended"
],
"extends": ["plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-explicit-any": 0
}
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -17,6 +17,20 @@ permissions:
id-token: write

jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Prettier
run: |
npm i -D
set +e
npx prettier --experimental-ternaries --check
code=$?
npx prettier --experimental-ternaries --log-level warn --write
git diff
exit "$code"
build:
runs-on: ubuntu-latest
timeout-minutes: 1
Expand Down Expand Up @@ -75,8 +89,8 @@ jobs:
strategy:
matrix:
version:
- 18.x
- 20.x
- 18.x
- 20.x
runs-on: ubuntu-latest
needs: [build]
timeout-minutes: 3
Expand Down Expand Up @@ -116,7 +130,7 @@ jobs:
PGUSER: postgres
PGPASSWORD: postgres
- uses: actions/download-artifact@v4
- name: "Example: Connect"
- name: 'Example: Connect'
run: |
pkg_path=`ls $PWD/pkg/ts-postgres-*.tgz`
cd examples/connect
Expand All @@ -132,7 +146,7 @@ jobs:
PGPORT: ${{ job.services.postgres.ports[5432] }}
PGUSER: postgres
PGPASSWORD: postgres
- name: "Example: Generic Pool"
- name: 'Example: Generic Pool'
run: |
pkg_path=`ls $PWD/pkg/ts-postgres-*.tgz`
cd examples/generic-pool
Expand All @@ -152,7 +166,7 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [build, test]
needs: [style, build, test]
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
.rpt2_cache
node_modules
.*
!.eslintrc.json
coverage
dist
docs
node_modules
npm
yarn.lock
59 changes: 17 additions & 42 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ In next release ...
connected when the promise returns. The `Client` symbol is now a
type instead of a value.

1.9.0 (2024-01-23)
------------------
## v1.9.0 (2024-01-23)

- Add support for ESM modules.

Expand All @@ -15,8 +14,7 @@ In next release ...

- Fix issue handling connection error during secure startup.

1.8.0 (2023-12-14)
------------------
## v1.8.0 (2023-12-14)

- Reduce buffer allocation and intelligently scale initial allocation when creating
a new buffer.
Expand All @@ -34,8 +32,7 @@ In next release ...

- Fixed a regression where some symbols were not correctly exposed for importing.

1.7.0 (2023-12-13)
------------------
## v1.7.0 (2023-12-13)

- The `execute` method has been removed.

Expand All @@ -50,8 +47,7 @@ In next release ...

The same change has been made to `prepare`.

1.6.0 (2023-12-13)
------------------
## v1.6.0 (2023-12-13)

- The iterator methods now return reified representations of the query result
(i.e. objects), carrying the generic type parameter specified for the query
Expand All @@ -61,8 +57,7 @@ In next release ...
This separates the query results interface into an iterator interface (providing
objects) and a result interface (providing rows and column names).

1.5.0 (2023-12-06)
------------------
## v1.5.0 (2023-12-06)

- The `Value` type has been replaced with `any`, motivated by the new
generic result type as well as the possibility to implement custom
Expand Down Expand Up @@ -93,8 +88,7 @@ In next release ...

- Use `bigint` everywhere as a type instead of `BigInt`.

1.4.0 (2023-11-10)
------------------
## v1.4.0 (2023-11-10)

- A statement error during the processing of a prepared statement is
now handled correctly (#73).
Expand All @@ -104,21 +98,15 @@ In next release ...
- The [ts-typed-events](https://www.npmjs.com/package/ts-typed-events)
dependency was updated to version 3.0.0.


1.3.1 (2023-06-19)
------------------
## v1.3.1 (2023-06-19)

- Added details of database error to thrown error message (#64).


1.3.0 (2022-08-22)
------------------
## v1.3.0 (2022-08-22)

- Fix prepare statement with no return data (#56).


1.2.1 (2021-12-23)
------------------
## v1.2.1 (2021-12-23)

- Fix range error that could occur when parsing an incomplete data row
after one or more previous messages had already been processed.
Expand All @@ -136,8 +124,7 @@ In next release ...
- Fix issue where a query with multiple columns would yield incomplete
rows when protocol data spans multiple receive buffers.

1.2.0 (2021-11-19)
------------------
## v1.2.0 (2021-11-19)

- The "execute" method is now public and must be used now when passing
a query object rather than individual arguments when querying.
Expand All @@ -162,19 +149,15 @@ In next release ...

- Updated dependency on "ts-typed-events".

1.1.3 (2020-02-23)
------------------
## v1.1.3 (2020-02-23)

- Added support for `BigInt`.

1.1.2 (2019-12-28)
------------------
## v1.1.2 (2019-12-28)

- Fixed handling of null values in arrays. [matthieusieben]


1.1.1 (2019-12-06)
------------------
## v1.1.1 (2019-12-06)

- Fixed `ECONNRESET` deprecation.

Expand All @@ -184,9 +167,7 @@ In next release ...

- Encoding argument now uses `BufferEncoding` type.


1.1.0 (2019-06-24)
------------------
## v1.1.0 (2019-06-24)

- The rejection value is now a `DatabaseError` object which inherits
from `Error`. Previously, this value was a plain string.
Expand All @@ -199,9 +180,7 @@ In next release ...

- Handle `JSONB` and null values.


1.0.2 (2019-02-08)
------------------
## v1.0.2 (2019-02-08)

- Connection state variable 'closed' is now public. This should be
checked before using the connection to make sure that an unexpected
Expand All @@ -210,9 +189,7 @@ In next release ...
- Handle protocol errors gracefully, passing error to open data
handlers and marking the connection as 'closed'.


1.0.1 (2019-01-13)
------------------
## v1.0.1 (2019-01-13)

- Parse JSON data only on non-null value.

Expand All @@ -221,8 +198,6 @@ In next release ...
- Fixed an issue with `Result.one()` and `Result.first()` methods
where a rejection would be uncaught.


1.0.0 (2019-01-08)
------------------
## v1.0.0 (2019-01-08)

- Initial release.
Loading

0 comments on commit b67261c

Please sign in to comment.