Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

l #216

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open

l #216

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
e2f3038
f
TubTubTub Sep 1, 2024
a0037f3
s
TubTubTub Sep 1, 2024
13685b9
fdfdf
TubTubTub Sep 1, 2024
8c39402
s
TubTubTub Sep 1, 2024
9edc45f
aa
TubTubTub Sep 2, 2024
de360fd
s
TubTubTub Sep 2, 2024
5db49eb
s
TubTubTub Sep 2, 2024
5fba4ac
w
TubTubTub Sep 2, 2024
d6191af
sdfff
TubTubTub Sep 2, 2024
8efabd6
s
TubTubTub Sep 2, 2024
30b83ec
s
TubTubTub Sep 2, 2024
8939007
sadadasd
TubTubTub Sep 2, 2024
1508736
sd
TubTubTub Sep 2, 2024
0f8d4ab
fso exercises 11.6 - 11.9
TubTubTub Sep 2, 2024
a8a92dd
d
TubTubTub Sep 3, 2024
191167b
z
TubTubTub Sep 3, 2024
08fdbfe
s
TubTubTub Sep 3, 2024
66e955e
tre
TubTubTub Sep 3, 2024
66a35bf
d
TubTubTub Sep 3, 2024
c5ad15f
s
TubTubTub Sep 3, 2024
a3bb62f
s
TubTubTub Sep 3, 2024
1e5a7b3
xc
TubTubTub Sep 3, 2024
5d0e697
sdsd
TubTubTub Sep 3, 2024
0f22ec3
s
TubTubTub Sep 3, 2024
058830b
asdadsad
TubTubTub Sep 3, 2024
43f84a7
fso exercises 11.10 - 11.2
TubTubTub Sep 3, 2024
d2c8290
d
TubTubTub Sep 4, 2024
b4404ff
sdfdsfsf
TubTubTub Sep 4, 2024
79bbc83
sdsd
TubTubTub Sep 4, 2024
44eae27
s
TubTubTub Sep 4, 2024
4028774
ssfsdf
TubTubTub Sep 4, 2024
161a2f2
s
TubTubTub Sep 4, 2024
3d6a68d
cool
TubTubTub Sep 4, 2024
22cbeb7
sdfsf
TubTubTub Sep 4, 2024
93f5b65
sdsd
TubTubTub Sep 4, 2024
f9c074e
wow #skip
TubTubTub Sep 4, 2024
51a3a94
ssdsd #skip
TubTubTub Sep 4, 2024
58b8073
wow #skip
TubTubTub Sep 4, 2024
37b8ed5
wow
TubTubTub Sep 4, 2024
7a8e291
sssss
TubTubTub Sep 4, 2024
7c178bd
sdsd
TubTubTub Sep 4, 2024
345bc29
fck
TubTubTub Sep 4, 2024
c9b34d4
s
TubTubTub Sep 4, 2024
573c5b2
qwqw
TubTubTub Sep 4, 2024
a0aa405
sdsd
TubTubTub Sep 4, 2024
f3e546f
zxczcc
TubTubTub Sep 4, 2024
536bebb
dssd
TubTubTub Sep 4, 2024
e1a0633
sdsd
TubTubTub Sep 4, 2024
4e393e1
new
TubTubTub Sep 5, 2024
32b3814
Merge pull request #1 from TubTubTub/testing-branch
TubTubTub Sep 5, 2024
d73b9c1
wtf #skip
TubTubTub Sep 5, 2024
0ae5168
wow finall #skip
TubTubTub Sep 5, 2024
fc7943e
test
TubTubTub Sep 5, 2024
1cad878
tet #skip
TubTubTub Sep 5, 2024
2c56fc7
sdsd
TubTubTub Sep 5, 2024
2e44566
www
TubTubTub Sep 5, 2024
c1ae15b
sdsds
TubTubTub Sep 5, 2024
f909b73
sdsd
TubTubTub Sep 5, 2024
a024660
cool
TubTubTub Sep 5, 2024
cb652f3
sd
TubTubTub Sep 5, 2024
58fdda7
sdsdsd
TubTubTub Sep 5, 2024
020b0a5
sdssd #skip
TubTubTub Sep 5, 2024
03950c6
sdsdsd
TubTubTub Sep 5, 2024
8c66e3d
ss
TubTubTub Sep 5, 2024
dc54c78
sdfsf
TubTubTub Sep 5, 2024
66f8cb5
sdsd
TubTubTub Sep 5, 2024
2be7f2b
dd
TubTubTub Sep 5, 2024
8c7cbc4
sdsdsd
TubTubTub Sep 6, 2024
546558b
sdsds
TubTubTub Sep 6, 2024
dafb364
sds #skip
TubTubTub Sep 6, 2024
884f9e1
h
TubTubTub Sep 7, 2024
9ea2bac
s
TubTubTub Sep 7, 2024
850740b
cron terminatino #skip
TubTubTub Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 42 additions & 36 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"jest/globals": true
'settings': {
'react': {
'version': 'detect'
}
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
'env': {
'browser': true,
'es6': true,
'jest/globals': true,
'node': true
},
'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
],
'linebreak-style': [
'error',
'unix'
],
"quotes": [
"error",
"single"
'quotes': [
'error',
'single'
],
"semi": [
"error",
"never"
'semi': [
'error',
'never'
],
"eqeqeq": "error",
"no-trailing-spaces": "error",
"object-curly-spacing": [
"error", "always"
'eqeqeq': 'error',
'no-trailing-spaces': 'error',
'object-curly-spacing': [
'error', 'always'
],
"arrow-spacing": [
"error", { "before": true, "after": true }
'arrow-spacing': [
'error', { 'before': true, 'after': true }
],
"no-console": "error",
"react/prop-types": 0
'no-console': 'error',
'react/prop-types': 0
}
}
15 changes: 15 additions & 0 deletions .github/workflows/health_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# name: Health Check

# on:
# schedule:
# - cron: '0 12 */1 * *'

# jobs:
# health_check:
# name: health_check
# runs-on: ubuntu-20.04
# steps:
# - name:
# uses: jtalk/url-health-check-action@b716ccb6645355dd9fcce8002ce460e5474f7f00
# with:
# url: https://full-stack-open-pokedex-ixmj.onrender.com/health
20 changes: 20 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Hello World!

on:
push:
branches:
- main

jobs:
hello_job:
runs-on: ubuntu-20.04
steps:
- name: Say hello
run: |
echo "Hello world!"
- name: Now it is
run: |
date
- name: Directory content
run: |
ls -l
69 changes: 69 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Deployment pipeline

env:
SKIP_CONDITION: ${{ contains(join(github.event.commits.*.message, ', '), '#skip') }}

on:
push:
branches:
- main
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
simple_deployment_pipeline:
name: 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
- name: Check style
run: npm run eslint
- name: build
run: npm run build
- name: test
run: npm run test
- name: install playwright browsers
run: npx playwright install --with-deps
- name: e2e tests
run: npm run test:e2e
- name: Trigger deployment
if: ${{ github.event_name == 'push' }}
run: curl https://api.render.com/deploy/srv-${{ secrets.RENDER_SERVICE_ID }}?key=${{ secrets.RENDER_API_KEY }}

- name: Success
uses: Ilshidur/action-discord@e3927b5d7bb18e3ad2b1e334226af57c6391aaeb
if: ${{ success() }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: "GitHub Bot Part 11"
DISCORD_AVATAR: "https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png"
with:
args: "A new version of Pokedex deployed to https://pdex.fly.dev by {{ EVENT_PAYLOAD.repository.owner.name }}"

- name: Error
uses: Ilshidur/action-discord@e3927b5d7bb18e3ad2b1e334226af57c6391aaeb
if: ${{ failure() }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: "GitHub Bot Part 11"
DISCORD_AVATAR: "https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png"
with:
args: "commit {{ EVENT_PAYLOAD.commits.0.url }} by {{ EVENT_PAYLOAD.repository.owner.name }} broke the build :( "

tag_release:
needs: [simple_deployment_pipeline]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1
if: ${{ github.event_name == 'push' && env.SKIP_CONDITION == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
dist/
node_modules/
node_modules/
.env
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
18 changes: 12 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
const express = require("express");
const app = express();
require('dotenv').config()
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.get('/health', (req, res) => {
res.send('ok')
})

app.listen(PORT, () => {
console.log(`server started on port ${PORT}`);
});
// eslint-disable-next-line no-console
console.log(`server started on port ${PORT}`)
})
6 changes: 6 additions & 0 deletions build_step.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo "Build script"

npm install
npm run build
20 changes: 20 additions & 0 deletions e2e-tests/pokedex.spec.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { test, describe, expect, beforeEach } = require('@playwright/test')

describe('Pokedex', () => {
beforeEach(async ({ page }) => {
await page.goto('/')
})

test('front page can be opened', async ({ page }) => {
await expect(page.getByText('ivysaur')).toBeVisible()
await expect(page.getByText('Pokémon and Pokémon character names are trademarks of Nintendo.')).toBeVisible()
})

test('pokemon page has proper information', async ({ page }) => {
await page.getByRole('link', { name: 'bulbasaur' }).click()
await page.getByText('bulbasaur').waitFor()
await expect(page.getByText('bulbasaur')).toBeVisible()
await expect(page.getByText('Overgrow')).toBeVisible()
await expect(page.getByText('chlorophyll')).toBeVisible()
})
})
Loading