diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd33f7a5..f81e6a58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' cache: 'npm' - run: npm ci - run: npm run lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3945cdc8..ce0af3c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,11 +16,11 @@ jobs: - 27017:27017 if: "!contains(github.event.head_commit.message, '[skip tests]')" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' cache: 'npm' - run: npm ci - run: npm run test -- --watch=false --progress=false --browsers=ChromeHeadless - - run: npm run testbe \ No newline at end of file + - run: npm run test:be \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8eddad7e..3d0fba1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM node:18-alpine +FROM node:20-alpine WORKDIR /usr/src/app COPY package*.json ./ RUN npm ci COPY . . ENV MONGODB_URI mongodb://mongo:27017/angularfullstack -#RUN npm run builddev +#RUN npm run build:dev RUN npm run build EXPOSE 3000 CMD [ "npm", "start" ] diff --git a/README.md b/README.md index 248611ae..8280ca8f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ A window will automatically open at [localhost:4200](http://localhost:4200). Ang `npm run prod`: run the project with a production bundle listening at [localhost:3000](http://localhost:3000) ### Manual mode -1. Build frontend: `npm run builddev` for dev or `npm run build` for prod +1. Build frontend: `npm run build:dev` for dev or `npm run build` for prod 2. Build backend: `npm run predev` 3. Run MongoDB: `mongod` 4. Run the app: `npm start` @@ -64,7 +64,7 @@ A window will automatically open at [localhost:4200](http://localhost:4200). Ang ## Running tests Run `ng test` to execute the frontend unit tests via [Karma](https://karma-runner.github.io). -Run `npm run testbe` to execute the backend tests via [Jest](https://jestjs.io/) (it requires `mongod` already running). +Run `npm run test:be` to execute the backend tests via [Jest](https://jestjs.io/) (it requires `mongod` already running). ## Running linters Run `npm run lint` to execute [Angular ESLint](https://github.com/angular-eslint/angular-eslint), [HTML linting](https://github.com/htmlhint/HTMLHint) and [SASS linting](https://github.com/sasstools/sass-lint). diff --git a/package-lock.json b/package-lock.json index add5bde2..ea2250ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,8 +62,8 @@ "typescript-eslint": "8.1.0" }, "engines": { - "node": ">=18", - "npm": ">=8" + "node": ">=20", + "npm": ">=10" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index 7daefb26..7f17b439 100644 --- a/package.json +++ b/package.json @@ -5,22 +5,22 @@ "author": "Davide Violante", "description": "Angular Full Stack project built using Angular 2+, Express, Mongoose and Node.", "engines": { - "node": ">=18", - "npm": ">=8" + "node": ">=20", + "npm": ">=10" }, "scripts": { "ng": "ng", - "builddev": "ng build -c development && tsc -p server", + "build:dev": "ng build -c development && tsc -p server", "build": "ng build && tsc -p server", "start": "node dist/server/app.js", "predev": "tsc -p server", "dev": "concurrently \"mongod\" \"ng serve --open\" \"tsc -w -p server\" \"nodemon dist/server/app.js\"", "prod": "concurrently \"mongod\" \"ng build && tsc -p server && node dist/server/app.js\"", "test": "ng test", - "testbe": "tsc -p server && jest", - "testbecov": "tsc -p server && jest --coverage", + "test:be": "tsc -p server && jest", + "test:becov": "tsc -p server && jest --coverage", "lint": "ng lint && htmlhint \"client/**/*.html\" && sass-lint \"client/**/*.scss\" -v", - "lintfix": "ng lint --fix" + "lint:fix": "ng lint --fix" }, "private": true, "dependencies": {