Skip to content

Commit c4cb781

Browse files
authored
Merge pull request #23 from weaponsforge/dev
v1.0.4
2 parents 624b6f7 + d0a0cad commit c4cb781

File tree

48 files changed

+623
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+623
-99
lines changed

.github/workflows/deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy to Production Environment
2+
3+
# This workflow will trigger on any tag/release created on *any* branch
4+
# Make sure to create tags/releases only from the "master" branch for consistency
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
lint-client:
11+
name: Lint and Export client
12+
runs-on: ubuntu-latest
13+
env:
14+
NEXT_PUBLIC_BASE_PATH: ${{ secrets.NEXT_PUBLIC_BASE_PATH }}
15+
steps:
16+
- name: Checkout the repository
17+
uses: actions/checkout@v3
18+
- name: Use NodeJS v18.14.2
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18.14.2
22+
- name: Install Dependencies
23+
run: |
24+
cd client
25+
npm install
26+
27+
- name: Lint Client
28+
run: |
29+
cd client
30+
npm run lint
31+
32+
- name: Export static files
33+
run: |
34+
cd client
35+
npm run export
36+
mv out/404/index.html out/404.html
37+
38+
- name: Disable Jekyll
39+
run: |
40+
cd client
41+
touch out/.nojekyll
42+
43+
- name: Archive Development Artifact
44+
uses: actions/upload-artifact@v3
45+
with:
46+
name: main-out
47+
path: client/out
48+
retention-days: 3
49+
50+
deploy-client:
51+
name: Deploy client to Github Pages
52+
needs: lint-client
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Download Artifact
56+
uses: actions/download-artifact@v3
57+
with:
58+
name: main-out
59+
60+
- name: List files for publish
61+
run: ls -l -a
62+
63+
- name: Deploy to Github Pages
64+
uses: peaceiris/actions-gh-pages@v3
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
publish_dir: ./
68+
publish_branch: gh-pages

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ The following dependecies are used for this project. Feel free to experiment usi
3232
### Manual Installation and Usage
3333

3434
1. Navigate to the **/client** directory from the commandline.
35-
2. Run: `npm run install`
36-
3. Run: `npm run dev`
35+
2. Create a `.env` file from the `/client/.env.example` file. Copy it's content when working on localhost.
36+
3. Run: `npm run install`
37+
4. Run: `npm run dev`
3738

3839
### Localhost Development Using Docker
3940

client/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_BASE_PATH=''

client/.eslintrc.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
"env": {
33
"node": true,
44
"browser": true,
5-
"es6": true
5+
"commonjs": true,
6+
"es2021": true
67
},
7-
"extends": "next/core-web-vitals",
8+
"extends": [
9+
"next/core-web-vitals",
10+
"eslint:recommended",
11+
"plugin:react/recommended",
12+
"plugin:react-hooks/recommended"
13+
],
814
"plugins": [
915
"eslint-plugin-react", "eslint-plugin-react-hooks"
1016
],
@@ -15,7 +21,10 @@
1521
"semi": ["error", "never"],
1622
"no-unused-vars": "error",
1723
"no-undef": "error",
18-
"no-trailing-spaces": "error",
19-
"no-console": ["error", { "allow": ["error"] }]
24+
// "no-console": ["error", { "allow": ["error"] }],
25+
"react/react-in-jsx-scope": "off",
26+
"no-restricted-imports": [
27+
"error", { "patterns": ["@/features/*/*"] }
28+
]
2029
}
21-
}
30+
}

client/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ yarn-error.log*
3030

3131
# vercel
3232
.vercel
33+
34+
.env

client/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ The following dependecies are used for this project. Feel free to experiment usi
2525
1. Clone this repository.<br>
2626
`https://github.com/weaponsforge/react-hooks-playground.git`
2727

28+
2. Create a `.env` file from the `/client/.env.example` file. Copy it's content when working on localhost.
29+
2830
## Available Scripts
2931

3032
### `npm run dev`

client/jsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
"paths": {
44
"@/*": ["./src/*"],
55
"@/hooks/*": ["./src/lib/hooks/*"],
6-
"@/public/*": ["./public/*"],
7-
"@/services/*": ["./src/lib/services/*"],
8-
"@/store/*": ["./src/lib/store/*"],
9-
"@/utils/*": ["./src/lib/utils/*"]
6+
"@/public/*": ["public/*"],
7+
"@/store/*": ["./src/lib/store/*"]
108
}
119
}
1210
}

client/next.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
reactStrictMode: true,
4+
trailingSlash: true,
5+
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
6+
assetPrefix: `${process.env.NEXT_PUBLIC_BASE_PATH}/`,
7+
images: {
8+
unoptimized: true
9+
},
10+
eslint: {
11+
dirs: ['src']
12+
}
413
}
514

615
module.exports = nextConfig

client/src/common/layout/page/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import PropTypes from 'prop-types'
12
import HeadComponent from '../head'
23

3-
export default function Page ({ children }) {
4+
function Page ({ children }) {
45
return (
56
<div style={{
67
height: '100vh',
@@ -11,3 +12,10 @@ export default function Page ({ children }) {
1112
</div>
1213
)
1314
}
15+
16+
Page.propTypes = {
17+
children: PropTypes.node
18+
}
19+
20+
export default Page
21+

client/src/common/ui/card/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types'
12
import styles from './Card.module.css'
23

34
function Card ({ children }) {
@@ -8,4 +9,8 @@ function Card ({ children }) {
89
)
910
}
1011

12+
Card.propTypes = {
13+
children: PropTypes.node
14+
}
15+
1116
export default Card

0 commit comments

Comments
 (0)