Skip to content

Commit 2b5a8d5

Browse files
authored
Merge pull request #77 from NeuroJSON/staging
Update main with latest staging
2 parents 3626493 + 14f653f commit 2b5a8d5

File tree

82 files changed

+16525
-3329
lines changed

Some content is hidden

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

82 files changed

+16525
-3329
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy to Production
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-22.04
14+
env:
15+
CI: false
16+
17+
steps:
18+
- name: Check out the repository
19+
uses: actions/checkout@v3
20+
21+
- name: Install dependencies
22+
run: yarn install --frozen-lockfile
23+
24+
- name: Build React App for production
25+
run: |
26+
echo "Building for production at root /"
27+
PUBLIC_URL="/" yarn build
28+
29+
- name: Copy JS libraries
30+
run: |
31+
mkdir -p build/js
32+
cp -r public/js/* build/js/
33+
34+
- name: Deploy to neurojson.io
35+
uses: NeuroJSON/[email protected]
36+
with:
37+
server: ${{ secrets.NEUROJ_IO_SERVER }}
38+
username: ${{ secrets.NEUROJ_SERVER_USER }}
39+
ssh_private_key: ${{ secrets.NEUROJ_SERVER_SSH_KEY }}
40+
local_path: "./build/*"
41+
remote_path: "${{ secrets.NEUROJ_IO_CI_PATH }}"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy Zodiac Server
2+
3+
on:
4+
push:
5+
branches:
6+
- dev-fan
7+
- dev_mario
8+
- fangq
9+
- staging
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-22.04
14+
env:
15+
CI: false
16+
17+
steps:
18+
- name: Check out the repository
19+
uses: actions/checkout@v3
20+
21+
- name: Install dependencies
22+
run: yarn install --frozen-lockfile
23+
24+
- name: Determine Branch Name
25+
id: get_branch
26+
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
27+
28+
- name: Print GitHub Runner Public IP
29+
run: |
30+
echo "GitHub runner public IP:"
31+
curl https://api.ipify.org
32+
33+
- name: Build React App with Dynamic PUBLIC_URL
34+
run: |
35+
echo "Building for /dev/${{ env.BRANCH_NAME }}/"
36+
PUBLIC_URL="/dev/${{ env.BRANCH_NAME }}/" yarn build
37+
38+
- name: Copy JS libraries (jdata, bjdata etc.)
39+
run: |
40+
mkdir -p build/js
41+
cp -r public/js/* build/js/
42+
43+
- name: Copy package to server
44+
uses: NeuroJSON/[email protected]
45+
with:
46+
server: ${{ secrets.NEUROJ_SERVER }}
47+
username: ${{ secrets.NEUROJ_SERVER_USER }}
48+
ssh_private_key: ${{ secrets.NEUROJ_SERVER_SSH_KEY }}
49+
local_path: "./build/*"
50+
remote_path: "${{ secrets.NEUROJ_CI_PATH }}/${{ env.BRANCH_NAME }}"

.github/workflows/validate.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validate NeuroJson_io Project
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
8+
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: "18"
20+
21+
- name: Install dependencies
22+
run: yarn install
23+
24+
# - name: Run Linter (Report Issues)
25+
# run: yarn lint
26+
27+
- name: Compile TypeScript
28+
run: |
29+
PUBLIC_URL="/dev/${{ github.head_ref }}/" yarn build
30+
31+
- name: Run Security Audit (non-blocking)
32+
run: yarn audit --level moderate || echo "Audit failed with moderate issues, continuing anyway."

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.env
22
node_modules
3-
.DS_Store
3+
.DS_Store
4+
package-lock.json
5+
6+
build

build-log.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
yarn run v1.22.22
2+
$ craco build --debug
3+
Creating an optimized production build...
4+
Compiled with warnings.
5+
6+
Critical dependency: the request of a dependency is an expression
7+
8+
Search for the keywords to learn more about each warning.
9+
To ignore, add // eslint-disable-next-line to the line before.
10+
11+
File sizes after gzip:
12+
13+
717.18 kB build/static/js/main.30f0cad2.js
14+
15+
The bundle size is significantly larger than recommended.
16+
Consider reducing it with code splitting: https://goo.gl/9VhYWB
17+
You can also analyze the project dependencies: https://goo.gl/LeUzfb
18+
19+
The project was built assuming it is hosted at /.
20+
You can control this with the homepage field in your package.json.
21+
22+
The build folder is ready to be deployed.
23+
You may serve it with a static server:
24+
25+
yarn global add serve
26+
serve -s build
27+
28+
Find out more about deployment here:
29+
30+
https://cra.link/deployment
31+
32+
Done in 15.95s.

craco.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
webpack: {
3+
configure: (webpackConfig) => {
4+
webpackConfig.resolve.fallback = {
5+
...webpackConfig.resolve.fallback,
6+
path: require.resolve("path-browserify"),
7+
};
8+
9+
webpackConfig.module.rules.push({
10+
test: /\.js$/,
11+
parser: {
12+
requireEnsure: false, // Prevents Webpack from treating require() as a critical dependency
13+
},
14+
});
15+
16+
webpackConfig.ignoreWarnings = [/the request of a dependency is an expression/];
17+
18+
return webpackConfig;
19+
},
20+
},
21+
};

package.json

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,61 @@
44
"private": true,
55
"dependencies": {
66
"3d-force-graph": "^1.73.4",
7+
"@babel/helpers": "7.26.10",
8+
"@babel/runtime": "7.26.10",
9+
"@craco/craco": "^7.1.0",
710
"@emotion/react": "^11.11.1",
811
"@emotion/styled": "^11.11.0",
912
"@mui/icons-material": "^5.14.3",
1013
"@mui/material": "^5.14.4",
1114
"@reduxjs/toolkit": "^1.9.5",
15+
"@rjsf/core": "^5.24.8",
16+
"@rjsf/mui": "^5.24.8",
17+
"@rjsf/utils": "^5.24.8",
18+
"@rjsf/validator-ajv8": "^5.24.8",
1219
"@testing-library/jest-dom": "^5.14.1",
1320
"@testing-library/react": "^13.0.0",
1421
"@testing-library/user-event": "^13.2.1",
1522
"@types/jest": "^27.0.1",
23+
"@types/numjs": "^0.16.8",
1624
"@types/react": "^18.0.0",
1725
"@types/react-dom": "^18.0.0",
18-
"@types/three": "^0.169.0",
26+
"@types/three": "^0.176.0",
27+
"ajv": "^8",
28+
"ajv-keywords": "^5",
1929
"axios": "^1.4.0",
30+
"bda": "^1.0.0",
31+
"bjd": "^0.3.2",
32+
"buffer": "6.0.3",
2033
"dayjs": "^1.11.10",
34+
"jquery": "^3.7.1",
35+
"json-stringify-safe": "^5.0.1",
2136
"jwt-decode": "^3.1.2",
37+
"lzma": "^2.3.2",
38+
"numjs": "^0.16.1",
39+
"pako": "1.0.11",
40+
"path-browserify": "^1.0.1",
2241
"query-string": "^8.1.0",
2342
"react": "^18.2.0",
2443
"react-dom": "^18.2.0",
44+
"react-json-view": "^1.21.3",
2545
"react-redux": "^8.1.2",
2646
"react-router-dom": "^6.15.0",
27-
"react-scripts": "5.0.1",
28-
"three": "^0.169.0",
47+
"react-scripts": "^5.0.1",
48+
"react-syntax-highlighter": "^15.6.1",
49+
"sharp": "^0.33.5",
50+
"stats-js": "^1.0.1",
51+
"stats.js": "0.17.0",
52+
"three": "0.145.0",
2953
"typescript": "^5.1.6",
54+
"uplot": "1.6.17",
3055
"web-vitals": "^2.1.0"
3156
},
3257
"devDependencies": {
3358
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
3459
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
3560
"@types/node": "^20.5.7",
61+
"@types/pako": "^2.0.3",
3662
"@typescript-eslint/eslint-plugin": "^5.31.0",
3763
"@typescript-eslint/parser": "^5.31.0",
3864
"eslint": "^8.21.0",
@@ -46,10 +72,11 @@
4672
"prettier": "^2.3.1"
4773
},
4874
"scripts": {
49-
"start": "react-scripts start",
50-
"build": "react-scripts build",
51-
"test": "react-scripts test",
52-
"eject": "react-scripts eject"
75+
"start": "craco start || react-scripts start",
76+
"build": "craco build || react-scripts build",
77+
"test": "craco test || react-scripts test",
78+
"eject": "craco eject || react-scripts eject",
79+
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}' --ext .js,.jsx,.ts,.tsx"
5380
},
5481
"browserslist": {
5582
"production": [
@@ -62,5 +89,11 @@
6289
"last 1 firefox version",
6390
"last 1 safari version"
6491
]
92+
},
93+
"resolutions": {
94+
"postcss": "^8.4.31",
95+
"nth-check": "^2.0.1",
96+
"@babel/runtime": "7.26.10",
97+
"3d-force-graph": "1.74.6"
6598
}
6699
}

public/.htaccess

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
RedirectMatch 404 /\.git
2+
<IfModule mod_rewrite.c>
3+
RewriteEngine On
4+
RewriteBase /
5+
RewriteCond %{REQUEST_FILENAME} -f [OR]
6+
RewriteCond %{REQUEST_FILENAME} -d
7+
RewriteRule ^ - [L]
8+
RewriteRule ^ index.html [L]
9+
</IfModule>

public/img/3d_graph_logo.png

88.5 KB
Loading

public/img/about_page/api.png

8.95 KB
Loading

0 commit comments

Comments
 (0)