Skip to content

Commit

Permalink
upgrade pnpm and other deps (#98)
Browse files Browse the repository at this point in the history
* Use fixed version of GHA ubuntu runner to avoid "moving target" issues
* Normalize GHA scripts parallel to ferdium-app repo
  • Loading branch information
vraravam authored Feb 11, 2024
1 parent dcaa296 commit 2fd7fa4
Show file tree
Hide file tree
Showing 7 changed files with 506 additions and 543 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,37 @@ on:

jobs:
adonis-js-check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Use Node.js specified in the '.nvmrc' file
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: 'pnpm'

- name: Install pnpm
run: npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v

- run: pnpm install
- name: Install node dependencies recursively
uses: nick-fields/retry@v3
with:
command: pnpm i
timeout_minutes: 15
max_attempts: 3
retry_on: error

- run: pnpm typecheck
- name: Run typecheck
run: pnpm typecheck

- run: pnpm lint
- name: Run linter
run: pnpm lint

- run: pnpm test
- name: Run tests
run: pnpm test

- run: pnpm run build
- name: Run build
run: pnpm run build
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
docker:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
-
name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Currently, these are the combinations of system dependencies that work for MacOS
$ jq --null-input '[inputs.engines] | add' < ./package.json < ./recipes/package.json
{
"node": "20.11.0",
"pnpm": "8.14.1",
"pnpm": "8.15.1",
"python": "3.12.1"
}
```
Expand Down
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
FROM node:20.11.0-alpine as build
FROM node:20.11.0-alpine as builder

WORKDIR /server-build

RUN apk add --no-cache python3 make gcc g++ libc-dev sqlite-dev

COPY . /server-build

ENV CI=true
RUN PNPM_VERSION=$(node -p 'require("./package.json").engines.pnpm'); npm i -g pnpm@$PNPM_VERSION

COPY package*.json ./
COPY .npmrc ./

RUN npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v
RUN pnpm install --config.build-from-source=sqlite --config.sqlite=/usr/local

COPY . .

RUN pnpm build

# ---- RUNTIME IMAGE ----------------------------------------------------------
Expand All @@ -20,12 +25,12 @@ LABEL maintainer="ferdium"
# TODO: Shouldn't we set 'NODE_ENV=production' when running in production mode?
ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data"

# TODO: Are all these packages needed for the runtime image?
RUN apk add --no-cache sqlite-libs curl su-exec python3 make g++ py3-pip git py3-pip sqlite
# The next command is needed for sqlite3 install command executed by node-gyp
# RUN ln -s /usr/bin/python3 /usr/bin/python


COPY --from=build /server-build /app
COPY --from=builder /server-build /app
RUN npm i -g @adonisjs/cli

HEALTHCHECK --start-period=5s --interval=30s --retries=5 --timeout=3s CMD curl -sSf http://localhost:${PORT}/health
Expand Down
65 changes: 33 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
"description": "Ferdium server to replace the default Franz/Ferdi server.",
"engines": {
"node": "20.11.0",
"pnpm": "8.14.1",
"pnpm": "8.15.1",
"python": "3.12.1"
},
"engine-strict": true,
"volta": {
"node": "20.11.0",
"pnpm": "8.14.1",
"pnpm": "8.15.1",
"python": "3.12.1"
},
"packageManager": "pnpm@8.15.1",
"homepage": "https://github.com/ferdium/ferdium-server",
"license": "MIT License",
"scripts": {
Expand All @@ -34,33 +35,33 @@
"@adonisjs/assembler": "5.9.5",
"@japa/preset-adonis": "1.2.0",
"@japa/runner": "2.5.1",
"@symfony/webpack-encore": "4.4.0",
"@types/bcrypt": "5.0.0",
"@types/fs-extra": "11.0.1",
"@types/luxon": "3.3.1",
"@types/node-fetch": "2.6.4",
"@types/proxy-addr": "^2.0.0",
"@types/semver": "7.5.0",
"@types/source-map-support": "0.5.6",
"@types/targz": "1.0.1",
"@types/uuid": "9.0.2",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"@symfony/webpack-encore": "4.6.1",
"@types/bcrypt": "5.0.2",
"@types/fs-extra": "11.0.4",
"@types/luxon": "3.4.2",
"@types/node-fetch": "2.6.11",
"@types/proxy-addr": "2.0.3",
"@types/semver": "7.5.6",
"@types/source-map-support": "0.5.10",
"@types/targz": "1.0.4",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"adonis-preset-ts": "2.1.0",
"cross-env": "7.0.3",
"eslint": "8.46.0",
"eslint-config-prettier": "8.9.0",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-adonis": "2.1.1",
"eslint-plugin-import": "2.28.0",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-unicorn": "48.0.1",
"husky": "8.0.3",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-unicorn": "50.0.1",
"husky": "9.0.10",
"is-ci": "3.0.1",
"pino-pretty": "10.2.0",
"prettier": "3.0.0",
"typescript": "5.1.6",
"youch": "3.2.3",
"youch-terminal": "2.2.2"
"pino-pretty": "10.3.1",
"prettier": "3.2.5",
"typescript": "5.3.3",
"youch": "3.3.3",
"youch-terminal": "2.2.3"
},
"dependencies": {
"@adonisjs/auth": "8.2.3",
Expand All @@ -72,25 +73,25 @@
"@adonisjs/shield": "7.1.1",
"@adonisjs/view": "6.2.0",
"adonis5-jwt": "github:SpecialAro/adonis5-jwt#34941c10adcf89583a40767552b994ea499b92e3",
"aws-sdk": "2.1425.0",
"aws-sdk": "2.1555.0",
"bcrypt": "5.1.1",
"fs-extra": "11.1.1",
"fs-extra": "11.2.0",
"jose": "4.14.6",
"luxon": "3.3.0",
"moment": "2.29.4",
"luxon": "3.4.4",
"moment": "2.30.1",
"mysql": "2.18.1",
"node-fetch": "2",
"pg": "8.11.1",
"pg": "8.11.3",
"phc-bcrypt": "1.0.8",
"proxy-addr": "2.0.7",
"rand-token": "1.0.1",
"reflect-metadata": "0.1.13",
"sanitize-filename": "1.6.3",
"semver": "7.5.4",
"semver": "7.6.0",
"source-map-support": "0.5.21",
"sqlite3": "5.1.6",
"targz": "1.0.1",
"uuid": "9.0.0"
"uuid": "9.0.1"
},
"pnpm": {
"allowedDeprecatedVersions": {
Expand Down
Loading

0 comments on commit 2fd7fa4

Please sign in to comment.