Skip to content

Commit

Permalink
Merge pull request #104 from rcpch/revert-103-revert-102-vite-vite
Browse files Browse the repository at this point in the history
Revert "Revert "Vite-vite""
  • Loading branch information
mbarton authored Aug 29, 2024
2 parents 1a66145 + f238812 commit 2bc7d8b
Show file tree
Hide file tree
Showing 46 changed files with 4,442 additions and 35,226 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-react-app-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:
- name: Build project
run: npm run build
env:
REACT_APP_GROWTH_API_BASEURL: ${{ secrets.REACT_APP_LIVE_GROWTH_API_BASEURL }}
REACT_APP_API_KEY: ${{secrets.REACT_APP_API_KEY }}
VITE_APP_GROWTH_API_BASEURL: ${{ secrets.VITE_APP_GROWTH_API_BASEURL }}
VITE_APP_API_KEY: ${{secrets.VITE_APP_API_KEY }}

- name: Upload production-ready build files
uses: actions/upload-artifact@v4
with:
name: production-files
path: ./build
path: ./dist

deploy:
name: Deploy
Expand All @@ -47,10 +47,10 @@ jobs:
uses: actions/download-artifact@v4
with:
name: production-files
path: ./build
path: ./dist

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_dir: ./dist
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
FROM node:16.20.1-alpine3.17
# Use the latest Node.js LTS version as the base image
FROM node:18-alpine3.18 AS base

# set working directory
# Set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# Add `/app/node_modules/.bin` to $PATH
ENV PATH=/app/node_modules/.bin:$PATH

# set ownership of .cache to node user
RUN mkdir -p node_modules/.cache && chmod -R 777 node_modules/.cache
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install
# Install app dependencies
RUN npm install --development

# add app
# Copy the rest of the application files
COPY . ./

# start app
CMD ["npm", "start"]
# Expose the port the app runs on
EXPOSE 3000

# Start the application
CMD ["npm", "run", "dev"]
8 changes: 0 additions & 8 deletions craco.config.js

This file was deleted.

38 changes: 38 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{
files: ['**/*.{js,jsx}'],
ignores: ['dist'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
26 changes: 26 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- <link rel="icon" href="%PUBLIC_URL%/dynamic-child-favicon.png" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="React Client for RCPCH Growth Chart API"
/>
<meta property="og:type" content="website" />
<meta property="og:title" content="RCPCH | Digital Growth Charts" />
<meta
property="og:description"
content="React Client for RCPCH Growth Chart API"
/>
<title>RCPCH | Digital Growth Charts</title>
</head>
<body>
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script type="module" src="/src/main.jsx"></script>
</body>
<!-- <script src="%PUBLIC_URL%/compatibilityCheck.js"></script> -->
</html>
Loading

0 comments on commit 2bc7d8b

Please sign in to comment.