Skip to content

Commit 3f2a4b5

Browse files
committed
Get initial implementation for react working
1 parent 3771576 commit 3f2a4b5

File tree

8 files changed

+344
-422
lines changed

8 files changed

+344
-422
lines changed

package.json

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
{
22
"name": "pterodactyl-panel",
33
"dependencies": {
4+
"@hot-loader/react-dom": "^16.8.6",
45
"axios": "^0.18.0",
56
"brace": "^0.11.1",
67
"date-fns": "^1.29.0",
78
"feather-icons": "^4.10.0",
89
"jquery": "^3.3.1",
910
"lodash": "^4.17.11",
11+
"react": "^16.8.6",
12+
"react-dom": "^16.8.6",
13+
"react-hot-loader": "^4.9.0",
1014
"socket.io-client": "^2.2.0",
11-
"vee-validate": "^2.1.7",
12-
"vue": "^2.6.4",
13-
"vue-axios": "^2.1.1",
14-
"vue-i18n": "^8.6.0",
15-
"vue-router": "^3.0.1",
16-
"vuex": "^3.0.1",
17-
"vuex-router-sync": "^5.0.0",
1815
"ws-wrapper": "^2.0.0",
1916
"xterm": "^3.5.1"
2017
},
2118
"devDependencies": {
22-
"@babel/cli": "^7.2.3",
2319
"@babel/core": "^7.2.2",
24-
"@babel/plugin-proposal-class-properties": "^7.3.0",
25-
"@babel/plugin-proposal-object-rest-spread": "^7.3.1",
2620
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
2721
"@babel/preset-env": "^7.3.1",
22+
"@babel/preset-react": "^7.0.0",
2823
"@types/feather-icons": "^4.7.0",
2924
"@types/lodash": "^4.14.119",
30-
"@types/node": "^10.12.15",
31-
"@types/socket.io-client": "^1.4.32",
25+
"@types/react": "^16.8.19",
26+
"@types/react-dom": "^16.8.4",
3227
"@types/webpack-env": "^1.13.6",
3328
"babel-loader": "^8.0.5",
3429
"clean-webpack-plugin": "^0.1.19",
@@ -45,31 +40,24 @@
4540
"precss": "^3.1.2",
4641
"purgecss-webpack-plugin": "^1.1.0",
4742
"resolve-url-loader": "^3.0.0",
43+
"source-map-loader": "^0.2.4",
4844
"style-loader": "^0.23.1",
4945
"tailwindcss": "^0.7.4",
46+
"terser-webpack-plugin": "^1.3.0",
5047
"ts-loader": "^5.3.3",
5148
"typescript": "^3.3.1",
52-
"uglifyjs-webpack-plugin": "^2.1.1",
53-
"vue-devtools": "^3.1.9",
54-
"vue-feather-icons": "^4.7.1",
55-
"vue-loader": "^15.6.2",
56-
"vue-mc": "^0.2.4",
57-
"vue-template-compiler": "^2.6.4",
58-
"vueify-insert-css": "^1.0.0",
5949
"webpack": "^4.29.0",
6050
"webpack-assets-manifest": "^3.1.1",
6151
"webpack-cli": "^3.0.2",
6252
"webpack-dev-server": "^3.1.14",
6353
"webpack-manifest-plugin": "^2.0.3",
64-
"webpack-shell-plugin": "^0.5.0",
6554
"webpack-stream": "^4.0.3"
6655
},
6756
"scripts": {
6857
"watch": "NODE_ENV=development ./node_modules/.bin/webpack --watch --progress",
6958
"build": "NODE_ENV=development ./node_modules/.bin/webpack --progress",
7059
"build:production": "NODE_ENV=production ./node_modules/.bin/webpack",
7160
"serve": "NODE_ENV=development webpack-dev-server --host 0.0.0.0 --hot",
72-
"v:serve": "PUBLIC_PATH=http://pterodactyl.test:8080 yarn run serve",
73-
"compile:assets": "php artisan vue-i18n:generate & php artisan ziggy:generate resources/assets/scripts/helpers/ziggy.js"
61+
"v:serve": "PUBLIC_PATH=http://pterodactyl.test:8080 yarn run serve"
7462
}
7563
}

resources/assets/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as React from 'react';
2+
import { hot } from 'react-hot-loader/root';
3+
4+
class App extends React.PureComponent {
5+
render () {
6+
return (
7+
<h1>Hello</h1>
8+
);
9+
}
10+
}
11+
12+
export default hot(App);

resources/scripts/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as React from 'react';
2+
import * as ReactDOM from 'react-dom';
3+
import App from "@/components/App";
4+
5+
ReactDOM.render(<App/>, document.getElementById('app'));

resources/themes/pterodactyl/templates/wrapper.blade.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,13 @@
3535
<body class="{{ $css['body'] ?? 'bg-neutral-50' }}">
3636
@section('content')
3737
@yield('above-container')
38-
<div id="pterodactyl" class="flex flex-col">
38+
<div id="app" class="flex flex-col">
3939
@yield('container')
4040
</div>
4141
@yield('below-container')
4242
@show
4343
@section('scripts')
4444
{!! $asset->js('main.js') !!}
45-
{!! $asset->js('vendor.js') !!}
46-
{!! $asset->js('locales.js') !!}
4745
@show
4846
</body>
4947
</html>

tsconfig.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
{
22
"compilerOptions": {
3-
"target": "es6",
3+
"target": "es5",
44
"module": "esnext",
5+
"jsx": "react",
56
"strict": true,
67
"noImplicitReturns": true,
78
"moduleResolution": "node",
8-
"lib": [
9-
"es2016",
10-
"dom"
11-
],
9+
"sourceMap": true,
1210
"baseUrl": ".",
1311
"paths": {
1412
"@/*": [
15-
"./resources/assets/scripts/*"
13+
"./resources/scripts/*"
1614
]
1715
}
1816
},
1917
"include": [
20-
"./resources/assets/scripts/**/*"
18+
"./resources/scripts/**/*"
2119
]
2220
}

0 commit comments

Comments
 (0)