From d2d510ee7c323fc5f422d13e3ccc4e2b368bfe3e Mon Sep 17 00:00:00 2001 From: beanlee Date: Tue, 19 Jan 2021 10:54:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(scripts&webconsole):=20=E9=9C=80=E6=B1=82?= =?UTF-8?q?=EF=BC=8Cwebconsole=E6=89=93=E5=BC=80=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=8D=E5=B8=A6=E5=90=8E=E7=BC=80=E7=9A=84=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #83 --- packages/rocketact-scripts/package.json | 4 ++-- packages/rocketact-scripts/src/commands/start.ts | 14 ++++++++++++-- packages/rocketact-web-console/package.json | 4 ++-- .../src/client/routes/pages.tsx | 13 +++++++++++-- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/packages/rocketact-scripts/package.json b/packages/rocketact-scripts/package.json index d4a5388..7e8f3b1 100644 --- a/packages/rocketact-scripts/package.json +++ b/packages/rocketact-scripts/package.json @@ -1,6 +1,6 @@ { "name": "rocketact-scripts", - "version": "1.10.4", + "version": "1.10.5", "description": "", "main": "index.js", "scripts": { @@ -60,7 +60,7 @@ "postcss-loader": "^3.0.0", "progress-bar-webpack-plugin": "^1.11.0", "rocketact-dev-utils": "^1.1.4", - "rocketact-web-console": "^1.1.8", + "rocketact-web-console": "^1.1.11", "sass-loader": "^7.1.0", "semver": "^6.0.0", "style-loader": "^0.23.1", diff --git a/packages/rocketact-scripts/src/commands/start.ts b/packages/rocketact-scripts/src/commands/start.ts index e518411..b9b3045 100644 --- a/packages/rocketact-scripts/src/commands/start.ts +++ b/packages/rocketact-scripts/src/commands/start.ts @@ -1,4 +1,3 @@ -import path from "path"; import fs from "fs"; import webpack from "webpack"; import WebpackDevServer from "webpack-dev-server"; @@ -13,6 +12,8 @@ import { warningBlock, warning, resolveToAppRoot, + getValidEntries, + appRoot } from "rocketact-dev-utils"; import CoreAPI from "../CoreAPI"; @@ -27,6 +28,14 @@ export default (api: CoreAPI) => { process.env.NODE_ENV = "development"; process.env.PUBLIC_URL = ""; + const validEntries = getValidEntries(appRoot()); + const validEntryRewrites = Object.keys(validEntries).map(item => { + return { + from: new RegExp(`${item}`), + to: `/${item}.html` + } + }); + return new Promise((resolve, reject) => { const webpackConfig = api.resolveWebpackConfig(); const devServerOptions: WebpackDevServer.Configuration = { @@ -34,7 +43,7 @@ export default (api: CoreAPI) => { overlay: true, hot: true, host: "127.0.0.1", - https: process.env.HTTPS ? true : false, + https: !!process.env.HTTPS, publicPath: "/", contentBase: fs.existsSync(publicDir) && @@ -49,6 +58,7 @@ export default (api: CoreAPI) => { }, historyApiFallback: { rewrites: [ + ...validEntryRewrites, { from: /^(\/[^/]*\.html)\/.*$/, to: (context) => context.match[1], diff --git a/packages/rocketact-web-console/package.json b/packages/rocketact-web-console/package.json index aa0df5a..549e989 100644 --- a/packages/rocketact-web-console/package.json +++ b/packages/rocketact-web-console/package.json @@ -1,13 +1,13 @@ { "name": "rocketact-web-console", - "version": "1.1.10", + "version": "1.1.11", "description": "Rocketact Web Console", "main": "index.js", "keywords": [ "rocketact" ], "scripts": { - "build": "tsc --project tsconfig-server.json; webpack", + "build": "tsc --project tsconfig-server.json & webpack", "watch": "tsc --project tsconfig-server.json --watch & webpack --watch", "watch:client": "webpack --watch", "watch:server": "tsc --project tsconfig-server.json --watch", diff --git a/packages/rocketact-web-console/src/client/routes/pages.tsx b/packages/rocketact-web-console/src/client/routes/pages.tsx index 1a67117..0bf69cd 100644 --- a/packages/rocketact-web-console/src/client/routes/pages.tsx +++ b/packages/rocketact-web-console/src/client/routes/pages.tsx @@ -2,7 +2,7 @@ import React from "react"; import * as API from "../api"; -import { Table } from "antd"; +import { Table, Tooltip } from "antd"; interface IPage { name: string; @@ -31,7 +31,16 @@ class Pages extends React.PureComponent<{}, IPagesState> { { title: "Name", dataIndex: "name", - key: "name" + key: "name", + render: (text: any, record: IPage) => ( + + + + {record.name} + + + + ) }, { title: "Title",