diff --git a/.eslintrc.js b/.eslintrc.js index 8a182fff92..22f2434a0f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,49 +1,51 @@ module.exports = { - "env": { - "browser": true, - "es6": true, - "jest/globals": true + 'env': { + 'browser': true, + 'es6': true, + 'jest/globals': true, + 'node':true }, - "extends": [ - "eslint:recommended", - "plugin:react/recommended" + 'extends': [ + 'eslint:recommended', + 'plugin:react/recommended' ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true + 'parserOptions': { + 'ecmaFeatures': { + 'jsx': true }, - "ecmaVersion": 2018, - "sourceType": "module" + 'ecmaVersion': 2018, + 'sourceType': 'module' }, - "plugins": [ - "react", "jest" + 'plugins': [ + 'react', 'jest' ], - "rules": { - "indent": [ - "error", - 2 - ], - "linebreak-style": [ - "error", - "unix" + 'rules': { + 'indent': [ + 'error', + 2 ], - "quotes": [ - "error", - "single" + 'linebreak-style': [ + 'error', + 'unix' ], - "semi": [ - "error", - "never" + 'quotes': [ + 'error', + 'single' ], - "eqeqeq": "error", - "no-trailing-spaces": "error", - "object-curly-spacing": [ - "error", "always" + 'semi': [ + 'error', + 'never' ], - "arrow-spacing": [ - "error", { "before": true, "after": true } + 'eqeqeq': 'error', + 'no-trailing-spaces': 'warn', + 'object-curly-spacing': [ + 'error', 'always' ], - "no-console": "error", - "react/prop-types": 0 + 'arrow-spacing': [ + 'error', { 'before': true, 'after': true } + ], + 'no-console': 'off', + 'react/prop-types': 0, + 'no-unused-vars':'warn' } } diff --git a/.github/workflows/hello.yml b/.github/workflows/hello.yml new file mode 100644 index 0000000000..929179bb35 --- /dev/null +++ b/.github/workflows/hello.yml @@ -0,0 +1,22 @@ +name: Hello World! +run-name: ${{github.actor }} is running GitHub Actions + +on: + push: + branches: + - main + +jobs: + hello_world_job: + runs-on: ubuntu-20.04 + steps: + - name: Say hello + run: | + echo "Hello World!" + - name: Print date + run: | + date + - name: Print directory + run: | + ls -a + diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000000..3b932928f3 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,25 @@ +name: Deployment pipeline + +on: + push: + branches: + - main + +jobs: + simple_deployment_pipeline: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - name: Install dependencies + run: npm install + - run: npm install eslint @eslint/js --save-dev + - run: npx eslint --init + - run: npm run eslint + - name: build + run: npm run build + - name: test + run: npm run test + diff --git a/app.js b/app.js index 0b172aece0..32cdedac65 100644 --- a/app.js +++ b/app.js @@ -1,11 +1,11 @@ -const express = require("express"); -const app = express(); +const express = require('express') +const app = express() // get the port from env variable -const PORT = process.env.PORT || 5000; +const PORT = process.env.PORT || 5000 -app.use(express.static("dist")); +app.use(express.static('dist')) app.listen(PORT, () => { - console.log(`server started on port ${PORT}`); -}); + console.log(`server started on port ${PORT}`) +}) diff --git a/package.json b/package.json index d7c454f137..c0f5a8b7b0 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "start-prod": "node app.js", "test": "jest", "eslint": "eslint './**/*.{js,jsx}'", - "build": "webpack --mode production" + "build": "webpack --mode production", + "dev":"nodemon node app.js" }, "repository": { "type": "git", diff --git a/public/index.html b/public/index.html index 06fff788da..764bbaf9c1 100644 --- a/public/index.html +++ b/public/index.html @@ -1,11 +1,15 @@ +