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

Move from create-react-app to parcel + babel #3041

Draft
wants to merge 96 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
7c46d90
Rename scripts folder to eject
imnasnainaec Feb 28, 2024
e90c36c
npm run eject
imnasnainaec Feb 28, 2024
7db05aa
Reintegrate scripts
imnasnainaec Feb 28, 2024
fa96376
Fix test scripts
imnasnainaec Feb 28, 2024
2df7e18
Move ejected deps to devDependencies
imnasnainaec Feb 28, 2024
b0a4704
Roll @testing-library/jest-dom back to match jest 27
imnasnainaec Feb 29, 2024
1d488cd
Fix modulePaths
imnasnainaec Feb 29, 2024
a017e6a
Build with Parcel
imnasnainaec Feb 28, 2024
8196a48
Run with Parcel
imnasnainaec Feb 29, 2024
5d13a71
Update i18n settings
imnasnainaec Feb 29, 2024
7358ff8
Update package.json scripts
imnasnainaec Feb 29, 2024
a26ed3c
Tidy
imnasnainaec Feb 29, 2024
1bc5d35
Tidy
imnasnainaec Feb 29, 2024
2122ffa
Try to get Jest working without breaking Parcel
imnasnainaec Mar 1, 2024
3de9d73
Remove babel conflict
imnasnainaec Mar 1, 2024
71ab4ac
Extract jest config
imnasnainaec Mar 1, 2024
0a11fc7
Simplify css mocking
imnasnainaec Mar 1, 2024
792b89c
Remove unneeded babel preset
imnasnainaec Mar 1, 2024
8370926
Remove unneeded svg transform
imnasnainaec Mar 1, 2024
0d3e561
Uninstall camelcase
imnasnainaec Mar 5, 2024
ef1b94b
Uninstall @babel/preset-typescript
imnasnainaec Mar 5, 2024
950ca89
Uninstall @babel/preset-react
imnasnainaec Mar 5, 2024
72bbcd0
Update coverage exclusions
imnasnainaec Mar 5, 2024
d896fc9
Uninstall @babel/plugin-proposal-private-property-in-object
imnasnainaec Mar 5, 2024
cb7b3b9
Move test configs into scrips/testConfig
imnasnainaec Mar 5, 2024
b4170c3
Remove unnecessary repo check
imnasnainaec Mar 5, 2024
2f408a7
Remove irrelevant type stuff
imnasnainaec Mar 5, 2024
206d87e
Fix decision made in b4170c32
imnasnainaec Mar 5, 2024
6b17d88
Replace ts-jest
imnasnainaec Mar 5, 2024
de4974f
Simplify ignore pattern
imnasnainaec Mar 5, 2024
323a550
Try babel-preset-react-app settings
imnasnainaec Mar 5, 2024
a507668
Revert
imnasnainaec Mar 5, 2024
9c107f1
Try copying and serving static files for i18n
imnasnainaec Mar 6, 2024
78b63a3
..and don't forget the rc files
imnasnainaec Mar 6, 2024
2c466da
Uninstall unneeded serve-static
imnasnainaec Mar 6, 2024
50069ae
Sort jest config
imnasnainaec Mar 6, 2024
3ffc0ff
Merge branch 'master' into parcel-babel-jest
imnasnainaec Mar 7, 2024
ac11e73
Merge branch 'master' into parcel-babel-jest
imnasnainaec Mar 28, 2024
cfe09e1
Trim scripts/test* files
imnasnainaec Mar 28, 2024
68ab9c7
Condense envTest
imnasnainaec Mar 28, 2024
40abb18
Absorb test, envTest into jestTest
imnasnainaec Mar 28, 2024
56ce51e
Add comments; Focus expects
imnasnainaec Mar 28, 2024
4bcda59
Merge branch 'master' into parcel-babel-jest
imnasnainaec Apr 2, 2024
5c0d787
Merge branch 'master' into parcel-babel-jest
imnasnainaec Apr 3, 2024
96b0f8a
Merge branch 'master' into parcel-babel-jest
imnasnainaec Apr 10, 2024
9a38762
[deploy] update folder from build to dist
imnasnainaec Apr 10, 2024
3a10820
Fix build/dist confusion
imnasnainaec Apr 10, 2024
681d5c8
Merge branch 'master' into parcel-babel-jest
imnasnainaec Apr 19, 2024
d3b5b05
Merge branch 'master' into parcel-babel-jest
imnasnainaec Apr 22, 2024
156ef98
Merge branch 'master' into parcel-babel-jest
imnasnainaec Apr 26, 2024
abcf239
Tidy debugging cruft
imnasnainaec Apr 26, 2024
b0671e5
Merge branch 'master' into parcel-babel-jest
imnasnainaec Jun 6, 2024
d9d9c17
Merge branch 'master' into parcel-babel-jest
imnasnainaec Jun 12, 2024
a4b30eb
Remove extraneous root redux files from over-generous merge
imnasnainaec Jun 12, 2024
6fe938c
Merge branch 'master' into parcel-babel-jest
imnasnainaec Jun 28, 2024
e31c9fe
Update frontend licence report
imnasnainaec Jun 28, 2024
46184f8
Merge branch 'master' into parcel-babel-jest
imnasnainaec Jun 28, 2024
f62f8e5
Merge branch 'master' into parcel-babel-jest
imnasnainaec Jul 1, 2024
2965367
Merge branch 'master' into parcel-babel-jest; Update npm packages
imnasnainaec Aug 2, 2024
f30bf00
[frontend] Update licenses and fix tests
imnasnainaec Aug 2, 2024
eb67065
[README] Update links in Learn More > Frontend
imnasnainaec Aug 2, 2024
bca6d66
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 5, 2024
2528742
Update babel deps and rollback unrelated changes
imnasnainaec Aug 5, 2024
f9abb52
Use parcel analyzer; Update eslint deps
imnasnainaec Aug 5, 2024
3a95890
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 13, 2024
f982a68
Run npm update
imnasnainaec Aug 13, 2024
bbdc531
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 14, 2024
e12bb3f
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 15, 2024
7427ba7
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 19, 2024
722b8f8
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 22, 2024
af39a23
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 26, 2024
4b2f095
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 27, 2024
c0a5385
Merge branch 'master' into parcel-babel-jest
imnasnainaec Aug 28, 2024
f0a7bf7
Add comments
imnasnainaec Aug 30, 2024
114e539
Merge branch 'master' into parcel-babel-jest
imnasnainaec Sep 20, 2024
f489985
Update new deps
imnasnainaec Sep 20, 2024
cdc376f
Split off analytics script as separate file
imnasnainaec Sep 20, 2024
158a02c
Merge branch 'master' into parcel-babel-jest
imnasnainaec Sep 24, 2024
bc50ce3
Try --ignore-scripts
imnasnainaec Sep 24, 2024
a4935ac
Try pinning @parcel/watcher to 2.1
imnasnainaec Sep 25, 2024
6b6cf9a
Use npm dedupe
imnasnainaec Sep 25, 2024
8a4fba0
Remove explicit @parcel/watcher dep
imnasnainaec Sep 25, 2024
04e5d9b
Delete and recreate package-lock.json, then npm dedup
imnasnainaec Sep 25, 2024
6a7d4ae
Delete node_modules, package-lock.json; Run npm i, npm dedup
imnasnainaec Sep 25, 2024
806ee95
Merge branch 'master' into parcel-babel-jest
imnasnainaec Sep 25, 2024
61dacae
Try to get both Docker and npm run frontend to work
imnasnainaec Sep 27, 2024
9d21728
Take 2
imnasnainaec Sep 27, 2024
9bb1075
Merge branch 'master' into parcel-babel-jest
imnasnainaec Sep 30, 2024
b65e8d9
Merge branch 'master' into parcel-babel-jest
imnasnainaec Oct 9, 2024
1f39c81
Give Prettier a cookie
imnasnainaec Oct 9, 2024
ca01f3e
Merge branch 'master' into parcel-babel-jest
imnasnainaec Oct 24, 2024
41786b1
Merge branch 'master' into parcel-babel-jest
imnasnainaec Nov 4, 2024
d97d35e
Merge branch 'tmaster' into parcel-babel-jest
imnasnainaec Dec 10, 2024
e8da3bf
Add svgo as explicit dep
imnasnainaec Dec 10, 2024
286c727
Merge branch 'master' into parcel-babel-jest
imnasnainaec Dec 13, 2024
7bb15ae
Merge branch 'master' into parcel-babel-jest
imnasnainaec Dec 13, 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
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
"plugin:react-hooks/recommended",
"plugin:import/recommended",
],
ignorePatterns: ["*.dic.js"],
ignorePatterns: ["*.dic.js", "react-app-env.d.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: { jsx: true },
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@

# Production
build
/dist

# Generated files for development use
docker-compose.yml
.env.*
!.env.development
.env*.local
.parcel-cache
nginx/scripts
/backups
/parcel-bundle-reports
/restore
script_conf.json
backup_conf.json
Expand All @@ -31,6 +34,7 @@ public/scripts/config.js
Session.vim
scripts/*.js
!scripts/createBackendLicenses.js
!scripts/jestTest.js
!scripts/printVersion.js
!scripts/setRelease.js
setup_cluster.log
Expand Down
9 changes: 9 additions & 0 deletions .parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [
"@parcel/config-default"
],
"reporters": [
"...",
"parcel-reporter-static-files-copy"
]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"url": "http://localhost:1234",
"webRoot": "${workspaceFolder}"
},
{
Expand Down
11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,14 @@
"wordlist",
"wordlists"
],
"git.branchProtection": ["master", "main"]
"git.branchProtection": ["main", "master"],
"search.exclude": {
".parcel-cache": true,
".tox": true,
"dist": true,
"mongo_database": true,
"node_modules": true,
"parcel-bundle-reports": true,
"venv": true
}
}
2 changes: 1 addition & 1 deletion Backend/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void ConfigureServices(IServiceCollection services)
.AllowAnyHeader()
.AllowAnyMethod()
// Add URL for React CLI using during development.
.WithOrigins("http://localhost:3000")
.WithOrigins("http://localhost:1234")
.AllowCredentials());
});
}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ RUN mkdir ${FRONTEND_HOST_DIR}/url_moved

# Setup web content
COPY --from=user_guide_builder /app/docs/user_guide/site ${USER_GUIDE_HOST_DIR}
COPY --from=frontend_builder /app/build ${FRONTEND_HOST_DIR}
COPY --from=frontend_builder /app/dist ${FRONTEND_HOST_DIR}
COPY public/locales ${FRONTEND_HOST_DIR}/locales
COPY nginx/pages/url_moved_home.html /etc/nginx/page_templates/url_moved_home.html
COPY public/favicon.ico ${FRONTEND_HOST_DIR}/url_moved/favicon.ico
COPY src/resources/tractor.png ${FRONTEND_HOST_DIR}/url_moved/tractor.png
COPY public/scripts/release.js ${FRONTEND_HOST_DIR}/scripts/release.js

# Setup nginx configuration templates
COPY nginx/templates/* /etc/nginx/templates/
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ In the project directory, you can run:

Installs the necessary packages and runs the app in the development mode.

Open <http://localhost:3000> to view it in the browser.
Open <http://localhost:1234> to view it in the browser.

#### `npm run frontend`

Expand All @@ -298,7 +298,7 @@ Runs only the mongo database.

#### `npm run build`

Builds the app for production to the `build` folder.
Builds the app for production to the `dist` folder.

It correctly bundles React in production mode and optimizes the build for the best performance.

Expand All @@ -308,9 +308,9 @@ Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

#### `npm run analyze`
#### `npm run build:analyze`

Run after `npm run build` to analyze the contents build bundle chunks.
Builds then generates a tree map of the bundle chunks.

### Using OpenAPI

Expand Down Expand Up @@ -1169,6 +1169,7 @@ The process for configuring and deploying _TheCombine_ for production targets is
- [React-i18next](https://react.i18next.com/) (text localization)
- [Jest](https://jestjs.io/docs/getting-started) (unit testing)
- [React-Test-Renderer](https://reactjs.org/docs/test-renderer.html) (unit testing)
- [Parcel](https://parceljs.org/docs/) (bundler/builder)

### Kubernetes/Helm

Expand Down
Loading
Loading