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

WIP: Feature 616 / Vite migration #617

Draft
wants to merge 19 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .babelrc → .babelrc.old
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"presets": ["next/babel"],
"env": {
"test": {
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.19.0]
node-version: [18.17.1]
steps:
- uses: actions/[email protected]
with:
Expand Down
51 changes: 29 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,70 +73,77 @@ yarn test:headless

- Structure of the React components in this app

Application (in pages/\_app.js) contains:
**Startup** is main.jsx which renders the Application (App)

**Application** (App.jsx) contains:

- AuthContext context
- StoreContext context:

Home (in pages/index.js) contains:
<Layout>
<WorkspaceContainer />
</Layout>

WorkspaceContainer component manages the Resource workspace

- Contains Workspace component (resource workspace rcl) that contains several:
- ScriptureCard components
- ResourceCard components
<AuthContextProvider>
<StoreContextProvider>
<Layout>
<WorkspaceContainer />
</Layout>
</StoreContextProvider>
</AuthContextProvider>

Layout component:
**Layout** component:

- accesses authentication context and store context
- Manages server selection through url variables
- Displays Onboarding component if login is required
- displays the settings page if selected
- Contains the header and footer

BibleReference component:
**WorkspaceContainer** component manages the workspace containing the resource cards

- Contains Workspace component (resource workspace rcl) that contains several cards of type:
- ScriptureCard components
- ResourceCard components

**BibleReference** component:

- Uses bible Reference RCL
- Updates reference store context

Onboarding component
**Onboarding** component

- Displays the AccountSetup component when login is required

Header component:
**Header** component:

- Contains BibleReference component

Footer component:
**Footer** component:

- Shows app version/build

Drawer component (hamburger menu):
**Drawer** component (hamburger menu):

- Shows

TranslationSettings component:
**TranslationSettings** component:

- Prompts for organization and language

ResourceCard component:
**ResourceCard** component:

- Card that displays translationHelps content

ScriptureCard component:
**ScriptureCard** component:

- Card that displays scripture content

AuthContext context:
**AuthContext** context:

- Initializes the authentication context (defined in gitea-react-toolkit)

StoreContext context:

- Manages and persists application state data into local storage
- Manages and persists the rest of the application state data into local storage

useLocalStorage - custom hook that persists generic application data into local storage

useUserLocalStorage - custom hook that application data for logged in user into local storage

13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel='icon' href='/static/favicon.ico' />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>gatewayEdit</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
37 changes: 0 additions & 37 deletions jest.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
command = "npm run build"
publish = "out"

[[plugins]]
package = "@netlify/plugin-nextjs"

[[plugins]]
package = "/scripts/zulip-notification"
27 changes: 12 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
"name": "gateway-edit",
"version": "2.3.0",
"scripts": {
"dev": "bash -c \"source ./scripts/set-env.sh && next\"",
"build": "bash -c \"source ./scripts/set-env.sh && next build\"",
"start": "bash -c \"source ./scripts/set-env.sh && next start\"",
"export": "next export",
"dev": "bash -c \"source ./scripts/set-env.sh && vite\"",
"build": "bash -c \"source ./scripts/set-env.sh && vite build\"",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "bash -c \"source ./scripts/set-env.sh && vite preview",
"exportx": "next export",
"postinstall": "husky install",
"increment-build": "bash scripts/increment-build.sh && git add -A",
"cypress": "cross-env NODE_ENV=test cypress open",
"cypress:headless": "cross-env NODE_ENV=test cypress run",
"test": "cross-env NODE_ENV=test start-server-and-test dev http://localhost:3000 cypress",
"test:headless": "cross-env NODE_ENV=test start-server-and-test dev http://localhost:3000 cypress:headless",
"test:unit": "cross-env NODE_ENV='test' jest --coverage __tests__",
"test:unit-nocov": "cross-env NODE_ENV='test' jest",
"test:unit": "cross-env NODE_ENV='test' vitest --coverage __tests__",
"test:unit-nocov": "cross-env NODE_ENV='test' vitest",
"coverage-summary": "yarn nyc report --reporter=text-summary",
"mkdir:reports": "mkdir reports || true",
"precopy:reports": "yarn mkdir:reports",
Expand Down Expand Up @@ -41,7 +42,6 @@
"gitea-react-toolkit": "2.4.0",
"localforage": "^1.9.0",
"markdown-translatable": "2.0.3",
"next": "10.2.0",
"postcss": "^8.2.1",
"react": "^17.0.2",
"react-bootstrap": "0.32.4",
Expand All @@ -52,7 +52,7 @@
"resource-workspace-rcl": "2.1.4",
"scripture-resources-rcl": "5.5.9",
"scripture-tsv": "0.4.0",
"single-scripture-rcl": "3.4.17",
"single-scripture-rcl": "3.4.19-beta.2",
"tailwindcss": "^2.0.4",
"tc-ui-toolkit": "5.3.3",
"translation-helps-rcl": "3.5.14",
Expand All @@ -61,16 +61,12 @@
"word-aligner-rcl": "1.0.4"
},
"devDependencies": {
"@babel/core": "^7.15.8",
"@babel/preset-env": "^7.15.8",
"@cypress/code-coverage": "^3.9.11",
"@cypress/instrument-cra": "^1.4.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.1.2",
"@types/jest": "^27.0.2",
"babel-eslint": "^10.1.0",
"babel-jest": "^27.3.1",
"babel-plugin-istanbul": "^6.1.1",
"@vitejs/plugin-react": "^4.2.0",
"cross-env": "7.0.3",
"cypress": "^8.6.0",
"eslint": "^7.16.0",
Expand All @@ -86,12 +82,13 @@
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^5.2.0",
"jest": "^27.3.1",
"nyc": "^15.1.0",
"prettier": "^2.2.1",
"prop-types": "^15.7.2",
"react-icons": "^4.8.0",
"start-server-and-test": "^1.14.0"
"start-server-and-test": "^1.14.0",
"vite": "4.5.1",
"vitest": "0.34.6"
},
"nyc": {
"report-dir": "cypress-coverage"
Expand Down
49 changes: 0 additions & 49 deletions pages/404.js

This file was deleted.

41 changes: 0 additions & 41 deletions pages/_app.js

This file was deleted.

Loading
Loading