Skip to content

Commit c2efeba

Browse files
committed
Merge branch 'master' into #2862
2 parents fbd2138 + a47c480 commit c2efeba

File tree

287 files changed

+11521
-5103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+11521
-5103
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM node:12
6+
FROM node:20
77

88
# Avoid warnings by switching to noninteractive
99
ENV DEBIAN_FRONTEND=noninteractive
@@ -16,9 +16,11 @@ ARG USERNAME=node
1616
ARG USER_UID=1000
1717
ARG USER_GID=$USER_UID
1818

19+
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
20+
1921
# Configure apt and install packages
2022
RUN apt-get update \
21-
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
23+
&& apt-get -y install --no-install-recommends dialog 2>&1 \
2224
#
2325
# Verify git and needed tools are installed
2426
&& apt-get -y install git iproute2 procps \
@@ -33,6 +35,7 @@ RUN apt-get update \
3335
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
3436
&& apt-get update \
3537
&& apt-get -y install --no-install-recommends yarn tmux locales postgresql \
38+
&& apt-get install libpq-dev g++ make \
3639
#
3740
# Install eslint globally
3841
&& npm install -g eslint \
@@ -47,7 +50,6 @@ RUN apt-get update \
4750
&& apt-get install -y sudo \
4851
&& echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
4952
&& chmod 0440 /etc/sudoers.d/$USERNAME \
50-
#
5153
# Clean up
5254
&& apt-get autoremove -y \
5355
&& apt-get clean -y \

.devcontainer/devcontainer.json

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
11
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
22
{
3-
"name": "Node.js 12 & Postgres",
3+
"name": "Node.js 20 & Postgres",
44
"dockerComposeFile": "docker-compose.yml",
55
"service": "web",
66
"workspaceFolder": "/workspace",
7-
8-
// Use 'settings' to set *default* container specific settings.json values on container create.
9-
// You can edit these settings after create using File > Preferences > Settings > Remote.
10-
"settings": {
11-
"terminal.integrated.shell.linux": "/bin/bash"
12-
},
13-
14-
// Uncomment the next line if you want start specific services in your Docker Compose config.
15-
// "runServices": [],
16-
17-
// Uncomment the line below if you want to keep your containers running after VS Code shuts down.
18-
// "shutdownAction": "none",
19-
20-
// Uncomment the next line to run commands after the container is created.
21-
// "postCreateCommand": "npm install",
22-
23-
// Uncomment the next line to have VS Code connect as an existing non-root user in the container. See
24-
// https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist.
25-
// "remoteUser": "node",
26-
277
// Add the IDs of extensions you want installed when the container is created in the array below.
28-
"extensions": [
29-
"dbaeumer.vscode-eslint"
30-
]
31-
}
8+
"customizations":{
9+
"vscode": {
10+
"extensions": ["dbaeumer.vscode-eslint"],
11+
"settings": {
12+
"terminal.integrated.shell.linux": "/bin/bash"
13+
}
14+
}
15+
}
16+
}

.devcontainer/docker-compose.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
version: '3'
6+
version: '3.9'
77
services:
88
web:
99
# Uncomment the next line to use a non-root user for all processes. You can also
@@ -32,16 +32,21 @@ services:
3232
# Overrides default command so things don't shut down after the process ends.
3333
command: sleep infinity
3434

35-
links:
35+
depends_on:
3636
- db
3737

38+
links:
39+
- db:db
40+
3841
db:
39-
image: postgres
42+
image: postgres:14-alpine
4043
restart: unless-stopped
4144
ports:
4245
- 5432:5432
46+
command: postgres -c password_encryption=md5
4347
environment:
48+
POSTGRES_HOST_AUTH_METHOD: trust
49+
POSTGRES_INITDB_ARGS: "--auth-local=md5"
4450
POSTGRES_PASSWORD: pass
4551
POSTGRES_USER: user
4652
POSTGRES_DB: data
47-

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/packages/*/dist/

.eslintrc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"plugins": ["prettier"],
2+
"plugins": ["@typescript-eslint", "prettier"],
33
"parser": "@typescript-eslint/parser",
4-
"extends": ["plugin:prettier/recommended", "prettier/@typescript-eslint"],
4+
"extends": ["eslint:recommended", "plugin:prettier/recommended", "prettier"],
55
"ignorePatterns": ["node_modules", "coverage", "packages/pg-protocol/dist/**/*", "packages/pg-query-stream/dist/**/*"],
66
"parserOptions": {
77
"ecmaVersion": 2017,
@@ -11,5 +11,25 @@
1111
"node": true,
1212
"es6": true,
1313
"mocha": true
14-
}
14+
},
15+
"rules": {
16+
"@typescript-eslint/no-unused-vars": ["error", {
17+
"args": "none",
18+
"varsIgnorePattern": "^_$"
19+
}],
20+
"no-unused-vars": ["error", {
21+
"args": "none",
22+
"varsIgnorePattern": "^_$"
23+
}],
24+
"no-var": "error",
25+
"prefer-const": "error"
26+
},
27+
"overrides": [
28+
{
29+
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
30+
"rules": {
31+
"no-undef": "off"
32+
}
33+
}
34+
]
1535
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/packages/pg-connection-string @hjr3

.github/workflows/ci.yml

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,71 @@ permissions:
66
contents: read
77

88
jobs:
9-
build:
9+
lint:
10+
timeout-minutes: 5
1011
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
- name: Setup node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18
20+
cache: yarn
21+
- run: yarn install --frozen-lockfile
22+
- run: yarn lint
23+
build:
24+
timeout-minutes: 15
25+
needs: lint
1126
services:
1227
postgres:
13-
image: postgres:11
28+
image: ghcr.io/railwayapp-templates/postgres-ssl
1429
env:
1530
POSTGRES_USER: postgres
1631
POSTGRES_PASSWORD: postgres
32+
POSTGRES_HOST_AUTH_METHOD: 'md5'
1733
POSTGRES_DB: ci_db_test
1834
ports:
1935
- 5432:5432
2036
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2137
strategy:
38+
fail-fast: false
2239
matrix:
23-
node: ['8', '10', '12', '14', '16', '18']
24-
os: [ubuntu-latest, windows-latest, macos-latest]
25-
name: Node.js ${{ matrix.node }} (${{ matrix.os }})
40+
node:
41+
- '16'
42+
- '18'
43+
- '20'
44+
- '22'
45+
- '23'
46+
- '24'
47+
os:
48+
- ubuntu-latest
49+
name: Node.js ${{ matrix.node }}
50+
runs-on: ubuntu-latest
51+
env:
52+
PGUSER: postgres
53+
PGPASSWORD: postgres
54+
PGHOST: localhost
55+
PGDATABASE: ci_db_test
56+
PGTESTNOSSL: 'true'
57+
SCRAM_TEST_PGUSER: scram_test
58+
SCRAM_TEST_PGPASSWORD: test4scram
2659
steps:
27-
- uses: actions/checkout@v3
60+
- name: Show OS
61+
run: |
62+
uname -a
63+
- run: |
64+
psql \
65+
-c "SET password_encryption = 'scram-sha-256'" \
66+
-c "CREATE ROLE scram_test LOGIN PASSWORD 'test4scram'"
67+
- uses: actions/checkout@v4
2868
with:
2969
persist-credentials: false
3070
- name: Setup node
31-
uses: actions/setup-node@v3
71+
uses: actions/setup-node@v4
3272
with:
3373
node-version: ${{ matrix.node }}
3474
cache: yarn
35-
- run: yarn install
36-
# TODO(bmc): get ssl tests working in ci
37-
- run: PGTESTNOSSL=true PGUSER=postgres PGPASSWORD=postgres PGDATABASE=ci_db_test yarn test
75+
- run: yarn install --frozen-lockfile
76+
- run: yarn test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ package-lock.json
77
*.swp
88
dist
99
.DS_Store
10+
/.eslintcache
1011
.vscode/
1112
manually-test-on-heroku.js

.travis.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)