mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-02-06 09:55:50 +00:00
refactor(other): consolidate Node.js versions and fix e2e workflow (#9126)
Co-authored-by: mahula <lenzmath@posteo.de>
This commit is contained in:
parent
dcff378727
commit
b39d1c737b
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
@ -17,6 +17,10 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
with:
|
||||
fetch-depth: 0 # Fetch full History for changelog
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Setup env
|
||||
run: |
|
||||
echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
|
||||
@ -57,6 +61,10 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
with:
|
||||
fetch-depth: 0 # Fetch full History for changelog
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Setup env
|
||||
run: |
|
||||
echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
|
||||
|
||||
5
.github/workflows/test-backend.yml
vendored
5
.github/workflows/test-backend.yml
vendored
@ -72,6 +72,11 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
|
||||
with:
|
||||
node-version-file: 'backend/.nvmrc'
|
||||
|
||||
- name: backend | Lint
|
||||
run: cd backend && yarn && yarn run lint
|
||||
|
||||
|
||||
7
.github/workflows/test-e2e.yml
vendored
7
.github/workflows/test-e2e.yml
vendored
@ -77,7 +77,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.4.0
|
||||
with:
|
||||
node-version-file: 'backend/.tool-versions'
|
||||
node-version-file: 'backend/.nvmrc'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Copy env files
|
||||
@ -87,7 +87,8 @@ jobs:
|
||||
|
||||
- name: Install cypress requirements
|
||||
run: |
|
||||
wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386"
|
||||
sudo wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386"
|
||||
sudo chmod +x /opt/cucumber-json-formatter
|
||||
cd backend
|
||||
yarn install
|
||||
yarn build
|
||||
@ -125,7 +126,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.4.0
|
||||
with:
|
||||
node-version-file: 'backend/.tool-versions'
|
||||
node-version-file: 'backend/.nvmrc'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Restore cypress cache
|
||||
|
||||
10
.github/workflows/test-webapp.yml
vendored
10
.github/workflows/test-webapp.yml
vendored
@ -30,6 +30,11 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
|
||||
with:
|
||||
node-version-file: 'webapp/.nvmrc'
|
||||
|
||||
- name: Check translation files
|
||||
run: |
|
||||
scripts/translations/sort.sh
|
||||
@ -64,6 +69,11 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
|
||||
with:
|
||||
node-version-file: 'webapp/.nvmrc'
|
||||
|
||||
- name: webapp | Lint
|
||||
run: cd webapp && yarn && yarn run lint
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
nodejs 20.12.1
|
||||
@ -1 +1 @@
|
||||
v24.2.0
|
||||
v25.3.0
|
||||
|
||||
@ -1 +0,0 @@
|
||||
nodejs 24.2.0
|
||||
@ -19,18 +19,16 @@ Wait a little until your backend is up and running at [http://localhost:4000/](h
|
||||
## Installation without Docker
|
||||
|
||||
For the local installation you need a recent version of
|
||||
[Node](https://nodejs.org/en/) (>= `v16.19.0`). We are using
|
||||
`v24.2.0` and therefore we recommend to use the same version
|
||||
([see](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues/4082)
|
||||
some known problems with more recent node versions). You can use the
|
||||
[Node](https://nodejs.org/en/). We are using
|
||||
`v25.3.0` and therefore we recommend to use the same version. You can use the
|
||||
[node version manager](https://github.com/nvm-sh/nvm) `nvm` to switch
|
||||
between different local Node versions:
|
||||
|
||||
```sh
|
||||
# install Node
|
||||
# install Node using '.nvmrc' file
|
||||
$ cd backend
|
||||
$ nvm install v24.2.0
|
||||
$ nvm use v24.2.0
|
||||
$ nvm install
|
||||
$ nvm use
|
||||
```
|
||||
|
||||
Install node dependencies with [yarn](https://yarnpkg.com/en/):
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
"cross-env": "~10.1.0",
|
||||
"dotenv": "~17.0.1",
|
||||
"email-templates": "^12.0.3",
|
||||
"express": "^5.2.1",
|
||||
"express": "^4.22.1",
|
||||
"graphql": "^14.6.0",
|
||||
"graphql-middleware": "~6.1.35",
|
||||
"graphql-middleware-sentry": "^3.2.1",
|
||||
@ -77,7 +77,7 @@
|
||||
"minimatch": "^10.1.1",
|
||||
"mustache": "^4.2.0",
|
||||
"neo4j-driver": "^4.4.11",
|
||||
"neo4j-graphql-js": "^2.11.5",
|
||||
"neo4j-graphql-js": "2.11.5",
|
||||
"neode": "^0.4.9",
|
||||
"node-fetch": "^2.7.0",
|
||||
"nodemailer": "^7.0.12",
|
||||
@ -135,7 +135,8 @@
|
||||
"**/strip-ansi": "6.0.1",
|
||||
"**/string-width": "4.2.0",
|
||||
"**/wrap-ansi": "7.0.0",
|
||||
"**/jwa": "^2.0.1"
|
||||
"**/jwa": "^2.0.1",
|
||||
"**/@types/express": "4.17.25"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.12.1"
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { GraphQLUpload } from 'graphql-upload'
|
||||
|
||||
export default {
|
||||
|
||||
@ -130,10 +130,13 @@ export const attachments = (config: S3Config) => {
|
||||
const { upload } = fileInput
|
||||
if (!upload) throw new UserInputError('Cannot find attachment for given resource')
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const uploadFile = await upload
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
||||
const { name: fileName, ext } = path.parse(uploadFile.filename)
|
||||
const uniqueFilename = `${uuid()}-${slug(fileName)}${ext}`
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
const url = await s3.uploadFile({
|
||||
...uploadFile,
|
||||
uniqueFilename,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
|
||||
@ -84,9 +84,12 @@ export const images = (config: S3Config) => {
|
||||
|
||||
const uploadImageFile = async (uploadPromise: Promise<FileUpload> | undefined) => {
|
||||
if (!uploadPromise) return undefined
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const upload = await uploadPromise
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
||||
const { name, ext } = path.parse(upload.filename)
|
||||
const uniqueFilename = `${uuid()}-${slug(name)}${ext}`
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
return await s3.uploadFile({ ...upload, uniqueFilename })
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/require-await */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
@ -19,7 +18,7 @@ const neode = getNeode()
|
||||
export default {
|
||||
Query: {
|
||||
currentUser: async (object, params, context, resolveInfo) =>
|
||||
neo4jgraphql(object, { id: context.user.id }, context, resolveInfo),
|
||||
await neo4jgraphql(object, { id: context.user.id }, context, resolveInfo),
|
||||
},
|
||||
Mutation: {
|
||||
login: async (_, { email, password }, context: Context) => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
import { makeAugmentedSchema } from 'neo4j-graphql-js'
|
||||
|
||||
import typeDefs from '@graphql/types/index'
|
||||
|
||||
@ -24,6 +24,7 @@ jest.mock('@aws-sdk/lib-storage', () => {
|
||||
|
||||
const uploadMock = Upload as unknown as jest.Mock
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const createReadStream: FileUpload['createReadStream'] = (() => ({
|
||||
pipe: () => ({
|
||||
on: (_: unknown, callback: () => void) => callback(), // eslint-disable-line promise/prefer-await-to-callbacks
|
||||
@ -32,6 +33,7 @@ const createReadStream: FileUpload['createReadStream'] = (() => ({
|
||||
const input = {
|
||||
uniqueFilename: 'unique-filename.jpg',
|
||||
mimetype: 'image/jpeg',
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
createReadStream,
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,9 @@ export const s3Service = (config: S3Config, prefix: string) => {
|
||||
Bucket,
|
||||
Key: s3Location,
|
||||
ACL: ObjectCannedACL.public_read,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
ContentType: mimetype,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||
Body: createReadStream(),
|
||||
}
|
||||
const command = new Upload({ client: s3, params })
|
||||
|
||||
4884
backend/yarn.lock
4884
backend/yarn.lock
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
v20.12.1
|
||||
v25.3.0
|
||||
|
||||
@ -1 +0,0 @@
|
||||
nodejs 20.12.1
|
||||
@ -4,14 +4,16 @@
|
||||
|
||||
## Installation
|
||||
|
||||
For preparation we need Node and recommend to use [node version manager](https://github.com/nvm-sh/nvm) `nvm` to switch
|
||||
For preparation you need a recent version of
|
||||
[Node](https://nodejs.org/en/). We are using
|
||||
`v25.3.0` and recommend to use [node version manager](https://github.com/nvm-sh/nvm) `nvm` to switch
|
||||
between different local Node versions:
|
||||
|
||||
```bash
|
||||
# install Node
|
||||
# install Node using '.nvmrc' file
|
||||
$ cd webapp
|
||||
$ nvm install v20.12.1
|
||||
$ nvm use v20.12.1
|
||||
$ nvm install
|
||||
$ nvm use
|
||||
```
|
||||
|
||||
Install node dependencies with [yarn](https://yarnpkg.com/en/):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user