Skip to content

Commit

Permalink
Merge pull request #181 from kmvan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
kmvan authored Apr 2, 2022
2 parents 9a07a3e + 6642e14 commit dd79bc7
Show file tree
Hide file tree
Showing 149 changed files with 523 additions and 546 deletions.
11 changes: 0 additions & 11 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion AppConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "8.8",
"APP_VERSION": "8.9",
"APP_NAME": "X Prober",
"APP_URL": "https://github.com/kmvan/x-prober",
"AUTHOR_URL": "https://inn-studio.com/prober",
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All Notable changes to `X-Prober` will be documented in this file

## 8.9.0 - 2022-04-02

### Optimize

- Remove babel-loader
- Upgrade to React 18
- Optimize file update logic

## 8.8.0 - 2022-01-08

### Fix
Expand Down
2 changes: 1 addition & 1 deletion build-lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const writeJsData = ({ langId, items }) => {
})

fs.writeFileSync(
path.resolve(__dirname, 'src/Components/Language/src/lang.json'),
path.resolve(__dirname, 'src/Components/Language/lang.json'),
JSON.stringify(deepSort(langs), null, 2),
(err) => {
if (err) {
Expand Down
10 changes: 5 additions & 5 deletions dist/prober.php

Large diffs are not rendered by default.

55 changes: 26 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,39 @@
],
"dependencies": {
"copy-to-clipboard": "^3.3.1",
"deep-sort-object": "^1.0.2",
"glob": "^7.2.0",
"isomorphic-unfetch": "^3.1.0",
"mobx": "^6.3.12",
"mobx-react-lite": "^3.2.3",
"polished": "^4.1.3",
"query-string": "^7.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"mobx": "^6.5.0",
"mobx-react-lite": "^3.3.0",
"polished": "^4.1.4",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-is": "^18.0.0",
"react-use": "^17.3.2",
"styled-components": "^5.3.3"
"styled-components": "^5.3.5"
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@types/core-js": "^2.5.5",
"@types/node": "^17.0.8",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@types/styled-components": "^5.1.19",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"babel-loader": "^8.2.3",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"@types/node": "^17.0.23",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/styled-components": "^5.1.24",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"deep-sort-object": "^1.0.2",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"pofile": "^1.1.2",
"terser-webpack-plugin": "^5.3.0",
"ts-loader": "^9.2.6",
"typescript": "^4.5.4",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"glob": "^7.2.0",
"pofile": "^1.1.3",
"prettier": "^2.6.1",
"terser-webpack-plugin": "^5.3.1",
"ts-loader": "^9.2.8",
"typescript": "^4.6.3",
"typescript-plugin-styled-components": "^2.0.0",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-common-shake": "^2.1.0",
"webpack-log": "^3.0.2"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Bootstrap/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct()
$appName = ConfigApi::$APP_NAME;
$version = ConfigApi::$APP_VERSION;
$scriptConf = json_encode(EventsApi::emit('conf', array()));
$scriptUrl = \defined('\\XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.js' : "?action=script&v={$version}";
$scriptUrl = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV ? 'app.js' : "?action=script&v={$version}";

echo <<<HTML
<!DOCTYPE html>
Expand Down
80 changes: 80 additions & 0 deletions src/Components/Bootstrap/components/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { observer } from 'mobx-react-lite'
import { FC } from 'react'
import { createRoot } from 'react-dom/client'
import styled, { ThemeProvider } from 'styled-components'
import { Cards } from '../../Card/components'
import { ColorScheme } from '../../ColorScheme/components'
import { ColorSchemeStore } from '../../ColorScheme/stores'
import { GUTTER } from '../../Config'
import { Container } from '../../Container/components'
import { DatabaseBootstrap } from '../../Database/bootstrap'
import { Footer } from '../../Footer/components'
import { Forkme } from '../../Forkme/components'
import { MyInfoBootstrap } from '../../MyInfo/bootstrap'
import { Nav } from '../../Nav/components'
import { NetworkStatsBoostrap } from '../../NetworkStats/bootstrap'
import { NodesBoostrap } from '../../Nodes/bootstrap'
import { PhpExtensionsBootstrap } from '../../PhpExtensions/bootstrap'
import { PhpInfoBootstrap } from '../../PhpInfo/bootstrap'
import { PingBootstrap } from '../../Ping/bootstrap'
import { ServerBenchmarkBoostrap } from '../../ServerBenchmark/bootstrap'
import { ServerInfoBoostrap } from '../../ServerInfo/bootstrap'
import { ServerStatusBoostrap } from '../../ServerStatus/bootstrap'
import { TemperatureSensorBoostrap } from '../../TemperatureSensor/bootstrap'
import { Title } from '../../Title/components'
import { Toast } from '../../Toast/components'
import { ready } from '../../Utils/components/ready'
import { Normalize } from './style'
DatabaseBootstrap()
MyInfoBootstrap()
NetworkStatsBoostrap()
NodesBoostrap()
PhpExtensionsBootstrap()
PhpInfoBootstrap()
PingBootstrap()
ServerBenchmarkBoostrap()
ServerInfoBoostrap()
ServerStatusBoostrap()
TemperatureSensorBoostrap()
const StyledApp = styled.div`
padding: calc(${GUTTER} * 3.5) 0 calc(${GUTTER} * 2);
background: ${({ theme }) => theme['app.bg']};
/* notch right angle square */
::before,
::after {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: calc(${GUTTER} * 2);
border: ${GUTTER} solid ${({ theme }) => theme['app.border']};
pointer-events: none;
z-index: 1;
content: '';
}
::after {
border-radius: calc(${GUTTER} * 3);
}
`
const Bootstrap: FC = observer(() => (
<ThemeProvider theme={ColorSchemeStore.scheme}>
<Normalize />
<Title />
<StyledApp>
<Container>
<ColorScheme />
<Cards />
<Footer />
</Container>
</StyledApp>
<Nav />
<Forkme />
<Toast />
</ThemeProvider>
))
ready(() => {
const c = document.createElement('div')
document.body.innerHTML = ''
document.body.appendChild(c)
createRoot(c).render(<Bootstrap />)
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createGlobalStyle, css } from 'styled-components'
import { ANIMATION_DURATION_SC, GUTTER } from '../../../../Config/src'
import { device } from '../../../../Style/src/components/devices'
import { ANIMATION_DURATION_SC, GUTTER } from '../../../Config'
import { device } from '../../../Style/components/devices'
const normalize = css`
@media ${device('desktopSm')} {
::-webkit-scrollbar-track {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Bootstrap/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { conf } from '../Utils/src/components/conf'
import { conf } from '../Utils/components/conf'
class Main {
public readonly id = 'bootstrap'
public readonly conf = conf?.[this.id]
Expand Down
80 changes: 0 additions & 80 deletions src/Components/Bootstrap/src/components/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC } from 'react'
import { FC } from 'react'
import styled from 'styled-components'
import { BORDER_RADIUS, GUTTER } from '../../../Config/src'
import { BORDER_RADIUS, GUTTER } from '../../Config'
const StyledCardDes = styled.div`
padding: calc(${GUTTER} / 2) ${GUTTER};
background-color: ${({ theme }) => theme['card.des.bg']};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { FC, ReactNode } from 'react'
import { FC, ReactNode } from 'react'
import styled from 'styled-components'
import { GUTTER } from '../../../Config/src'
import { Grid, GridProps } from '../../../Grid/src/components/grid'
import { device } from '../../../Style/src/components/devices'
import { GUTTER } from '../../Config'
import { Grid, GridProps } from '../../Grid/components/grid'
import { device } from '../../Style/components/devices'
export interface CardGridProps extends GridProps {
name?: ReactNode
children: ReactNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { AnchorHTMLAttributes, FC } from 'react'
import { AnchorHTMLAttributes, FC } from 'react'
import styled from 'styled-components'
const StyledCardLink = styled.a`
::before {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { rgba } from 'polished'
import React, { FC, HTMLAttributes, ReactNode } from 'react'
import { FC, HTMLAttributes, ReactNode } from 'react'
import styled from 'styled-components'
import { gettext } from '../../../Language/src'
import { gettext } from '../../Language'
interface StyledRubyProps extends HTMLAttributes<HTMLElement> {
isResult?: boolean
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC, HTMLAttributes } from 'react'
import { FC, HTMLAttributes } from 'react'
import styled from 'styled-components'
import { GUTTER } from '../../../Config/src'
import { GUTTER } from '../../Config'
const StyledCardError = styled.div`
padding: ${GUTTER};
`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { observer } from 'mobx-react-lite'
import React, { FC } from 'react'
import { FC } from 'react'
import styled from 'styled-components'
import { GUTTER } from '../../../Config/src'
import { gettext } from '../../../Language/src'
import { NavStore } from '../../../Nav/src/stores'
import { device } from '../../../Style/src/components/devices'
import { ElevatorNavBody } from '../../../Utils/src/components/elevator-nav'
import { GUTTER } from '../../Config'
import { gettext } from '../../Language'
import { NavStore } from '../../Nav/stores'
import { device } from '../../Style/components/devices'
import { ElevatorNavBody } from '../../Utils/components/elevator-nav'
import { CardStore } from '../stores'
interface StyleArrowProps {
isHidden: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import styled from 'styled-components'
const StyledMultiItemContainer = styled.div`
display: flex;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { observer } from 'mobx-react-lite'
import React, { FC } from 'react'
import { FC } from 'react'
import styled, { keyframes } from 'styled-components'
import {
ANIMATION_DURATION_SC,
BORDER_RADIUS,
GUTTER,
} from '../../../Config/src'
import { ANIMATION_DURATION_SC, BORDER_RADIUS, GUTTER } from '../../Config'
import { ColorSchemeStore } from '../stores'
import { colorSchemes } from '../stores/color-schemes'
const fadeIn = keyframes`
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { darken, lighten, rgba } from 'polished'
import { gettext } from '../../../Language/src'
import { gettext } from '../../Language'
import { ColorSchemeProps } from '../typings'
const light = '#ccc'
const dark = '#000'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { darken, lighten, rgba } from 'polished'
import { gettext } from '../../../Language/src'
import { gettext } from '../../Language'
import { ColorSchemeProps } from '../typings'
const light = '#f8f8f8'
const dark = '#333'
Expand Down
Loading

0 comments on commit dd79bc7

Please sign in to comment.