Skip to content

Deprecated framework react-scripts #114

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

Merged
merged 1 commit into from
Mar 21, 2025
Merged
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
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ $(SITE_DIR):
docker run \
-v $$(pwd)/src:/usr/src/app/src \
-v $$(pwd)/public:/usr/src/app/public \
-v $$(pwd)/index.html:/usr/src/app/index.html \
-v $$(pwd)/vite.config.mjs:/usr/src/app/vite.config.mjs \
-v $$(pwd)/package.json:/usr/src/app/package.json \
-v $$(pwd)/$(SITE_DIR):/usr/src/app/$(SITE_DIR) \
-e CURRENT_UID=$(CURRENT_UID) \
-w /usr/src/app node:12-alpine \
sh -c 'npm install && REACT_APP_VERSION=$(VERSION) npm run build && chown -R $$CURRENT_UID: $(SITE_DIR)'
-w /usr/src/app node:18-alpine \
sh -c 'npm install && VITE_VERSION=$(VERSION) npm run build && chown -R $$CURRENT_UID: $(SITE_DIR)'

start:
docker run \
-p $(PORT):3000 \
-v `pwd`:/usr/src/app \
-w /usr/src/app node:14-alpine \
-w /usr/src/app node:18-alpine \
sh -c 'npm install --silent && npm run build && npm install -g serve && serve -s $(SITE_DIR) -p 3000'

release: $(SITE_DIR)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ NeoFS status monitoring page using React framework under the hood

- make
- docker
- node.js
- node (`18+`)
- python

## Make instructions
Expand Down
36 changes: 36 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>NeoFS Status</title>
<meta charset='utf-8'>
<link rel="icon" href="/img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="title" content="NeoFS Status page">
<meta name="description" content="NeoFS status monitoring">
<meta property="og:url" content="https://status.fs.neo.org">
<meta property="og:title" content="NeoFS Status page">
<meta property="og:description" content="NeoFS status monitoring">
<meta property="og:type" content="website">
<meta name="theme-color" content="#2d333b" />
<meta http-equiv="Content-Security-Policy"
content="default-src 'none'; script-src 'self'; connect-src 'self' https://status.fs.neo.org; style-src 'unsafe-inline' 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self'; form-action 'self'; base-uri 'self';">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;800&display=swap" rel="stylesheet">
<style>
@media (prefers-color-scheme: dark) {
body {
background-color: #111827;
}
}
</style>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<script src="/js/d3.v3.min.js"></script>
<script src="/js/d3.geo.projection.v0.min.js"></script>
<script src="/js/topojson.v1.min.js"></script>
</body>
</html>
26 changes: 10 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,27 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"bulma": "^0.9.4",
"react": "^17.0.2",
"react": "^19.0.0",
"react-bulma-components": "^4.1.0",
"react-dom": "^17.0.2",
"react-dom": "^19.0.0",
"react-router-dom": "^6.10.0"
},
"scripts": {
"start": "REACT_APP_VERSION=$(make version) GENERATE_SOURCEMAP=false react-scripts start",
"build": "BUILD_PATH='./status.fs.neo.org' GENERATE_SOURCEMAP=false react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"dev": "VITE_VERSION=$(make version) vite",
"build": "vite build",
"preview": "vite preview"
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],
"devDependencies": {
"react-scripts": "^5.0.1",
"typescript": "^3.2.1"
"@vitejs/plugin-react": "^4.3.4",
"typescript": "^5.7.3",
"vite": "^6.1.0"
}
}
37 changes: 0 additions & 37 deletions public/index.html

This file was deleted.

5 changes: 3 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="vite/client" />
import React, { useEffect, useState } from 'react';
import { Link, Route, Routes, Navigate, useLocation } from "react-router-dom";
import {
Expand Down Expand Up @@ -114,7 +115,7 @@ export const App = () => {
<Navbar.Menu
className={menuActive ? 'is-active' : ''}
>
<Navbar.Container>
<Navbar.Container className="navbar-start">
<Link
to="/"
className="navbar-item"
Expand Down Expand Up @@ -239,7 +240,7 @@ export const App = () => {
subtitle
style={{ textAlign: 'center', fontSize: '.75rem' }}
>
{process.env.REACT_APP_VERSION}
{import.meta.env.VITE_VERSION}
</Heading>
</Footer>
</>
Expand Down
13 changes: 0 additions & 13 deletions src/index.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { App } from './App.tsx';
import { BrowserRouter } from "react-router-dom";

createRoot(document.getElementById('root') as HTMLElement).render(
<StrictMode>
<BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
<App />
</BrowserRouter>
</StrictMode>,
)
13 changes: 13 additions & 0 deletions vite.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
server: {
port: 3000,
},
build: {
sourcemap: false,
outDir: 'status.fs.neo.org',
},
});