Skip to content

Commit

Permalink
feat: upgrade view config (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng authored Aug 12, 2022
1 parent c039712 commit 4ff9d5f
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 198 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
| :---: | :---: | :---: | :---: | :---: |


This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon Nov 01 2021 21:58:05 GMT+0800`.
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Fri Aug 12 2022 11:07:28 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->

Expand Down
67 changes: 0 additions & 67 deletions cli/bin/reliable-cli-make.js

This file was deleted.

7 changes: 7 additions & 0 deletions config/config.default.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const path = require('path');
const dbConfig = require('../database/config');

module.exports = appInfo => {
Expand Down Expand Up @@ -94,5 +95,11 @@ module.exports = appInfo => {

config.sequelize = dbConfig.development;

const distDirName = 'dist';
config.static = {
prefix: `/${distDirName}/`,
dir: path.resolve(__dirname, '..', 'view', distDirName),
};

return config;
};
4 changes: 4 additions & 0 deletions config/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ exports.validate = {
enable: true,
package: 'egg-validate',
};

exports.static = {
enable: true,
};
2 changes: 1 addition & 1 deletion database/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const defaultConfig = {
username: 'root',
password: 'reliable',
password: '',
database: 'reliable_development',
host: process.env.MYSQL_HOST || '127.0.0.1',
port: process.env.MYSQL_PORT || '3306',
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"uuid": "^3.3.2",
"vuepress": "^1.8.2"
},
"engines": {
"node": ">=8.9.0"
},
"scripts": {
"start": "NODE_ENV=production npm run db:migrate && eggctl start --port=9900 --title=egg-server-reliable-web",
"stop": "eggctl stop --title=egg-server-reliable-web",
Expand Down
1 change: 1 addition & 0 deletions view/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ screenshots
reports
logs
coverage
dist
4 changes: 2 additions & 2 deletions view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
var assetsUrl = window.pageConfig.assetsUrl || '//' + location.hostname + ':' + location.port;
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = assetsUrl + '/public/reliable-view.js';
script.src = assetsUrl + '/dist/reliable-view.js';
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = assetsUrl + '/public/reliable-view.css';
link.href = assetsUrl + '/dist/reliable-view.css';
var head = document.getElementsByTagName('head')[0];
head.appendChild(link);
head.appendChild(script);
Expand Down
33 changes: 15 additions & 18 deletions view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,14 @@
"document": "https://macacajs.github.io/reliable"
},
"scripts": {
"dev": "NODE_ENV=development webpack-dev-server --mode development",
"dev:test": "NODE_ENV=test webpack-dev-server --mode development",
"dev": "cross-env NODE_ENV=development webpack serve",
"dev:test": "NODE_ENV=test npm run dev",
"serve": "npm run dev:test &",
"test": "macaca run -d ./test",
"lint": "eslint --fix . --ext jsx,js && stylelint --fix assets/**/*.less -s less",
"build": "NODE_ENV=production webpack -p --mode production",
"build:local": "DIST_DIR=./public npm run build",
"build:report": "npm run build --report",
"prepublishOnly": "npm run build:local",
"ci": "npm run lint && npm run build && npm run serve && npm test"
"build": "cross-env NODE_ENV=production webpack",
"prepublishOnly": "npm run build"
},
"precommit": [
"lint"
],
"devDependencies": {
"@ant-design/icons": "^4.7.0",
"@babel/core": "^7.0.0",
Expand All @@ -42,21 +36,23 @@
"babel-loader": "^8.0.0",
"babel-plugin-import": "^1.2.1",
"babel-plugin-istanbul": "^5.0.1",
"cross-env": "^7.0.3",
"css-loader": "^0.28.11",
"dayjs": "^1.7.7",
"eslint": "^4.5.0",
"eslint-config-antife": "^1.0.2",
"eslint-plugin-mocha": "^5.0.0",
"eslint-plugin-react": "^7.2.1",
"husky": "^1.3.1",
"less": "^2.7.2",
"less-loader": "^4.1.0",
"lodash.get": "^4.4.2",
"lodash.uniqby": "^4.7.0",
"macaca-cli": "2",
"macaca-electron": "18",
"macaca-wd": "3",
"mini-css-extract-plugin": "^0.4.0",
"mini-css-extract-plugin": "^2.5.3",
"postcss-loader": "^2.1.6",
"pre-commit": "^1.2.2",
"qrcode-react": "^0.1.16",
"query-string": "^6.2.0",
"react": "^16.6.0",
Expand All @@ -74,14 +70,15 @@
"svgo-loader": "^3.0.0",
"url-loader": "^1.1.2",
"url-parse": "^1.4.3",
"webpack": "^4.10.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.0.1",
"webpack-dev-server": "^3.1.4",
"webpack": "^5.69.1",
"webpack-cli": "^4.9.0",
"webpack-dev-server": "^4.7.4",
"whatwg-fetch": "^2.0.3",
"xutil": "1"
},
"dependencies": {
"dayjs": "^1.7.7"
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
}
}
1 change: 0 additions & 1 deletion view/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ module.exports = {
require('autoprefixer'),
],
};

1 change: 0 additions & 1 deletion view/src/components/BuildsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import React from 'react';
import dayjs from 'dayjs';
import { Link } from 'react-router-dom';
import Clipboard from 'awesome-clipboard';
import {
Table,
} from 'antd';
Expand Down
2 changes: 1 addition & 1 deletion view/src/components/Icon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classnames from 'classnames';

function Icon(props) {
function Icon (props) {
const { className, type, width, height, fill, radius, style = {} } = props;
return (
<svg
Expand Down
6 changes: 3 additions & 3 deletions view/src/components/SiteSetting.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const buttonFormItemLayout = {
};

const SiteSetting = () => {
const [form] = Form.useForm();
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);

const fetchSite = async () => {
Expand All @@ -38,7 +38,7 @@ const SiteSetting = () => {

const assetsUrl = safeGet(res, 'data.site.assetsUrl');
form.setFieldsValue({
assetsUrl
assetsUrl,
});
};

Expand Down Expand Up @@ -91,7 +91,7 @@ const SiteSetting = () => {
</Spin>
</Form>
);
}
};

export default SiteSetting;

4 changes: 0 additions & 4 deletions view/src/page/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import React from 'react';
import { Link } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
import {
Row,
Col,
Card,
Breadcrumb,
} from 'antd';
Expand All @@ -14,8 +12,6 @@ import ReliableLayout from '../components/ReliableLayout';
import SiteSetting from '../components/SiteSetting';
import DingdingSetting from '../components/DingdingSetting';

import pkg from '../../package.json';

import './Setting.less';

export default class Setting extends React.Component {
Expand Down
Loading

0 comments on commit 4ff9d5f

Please sign in to comment.