diff --git a/.gitignore b/.gitignore index 8ddeddd8..a5f89fe7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,6 @@ node_modules/ *.map .github/workflows/nodejs.yml -app/**/*.js -config/**/*.js app/**/*.map config/**/*.map dist/ diff --git a/README.md b/README.md index 821ceaf0..2eb3083b 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,18 @@ Nebula Graph Studio (Studio for short) is a web-based visualization tool for Neb ## Development Quick Start -### Set up nebula-graph-studio +### set up studio and server at the same time +``` +$ npm install +$ npm run dev-all +``` + +### Set up nebula-graph-studio only ``` $ npm install $ npm run dev ``` -### Set up go-server +### Set up go-server only ``` $ cd server $ go build -o server @@ -25,18 +31,18 @@ $ nohup ./server & ``` $ npm run install $ npm run build +$ mv dist server/assets ``` -### 1. Build Web +### 2. Build Server ``` -// remove default port 7001 in config/example-config.yaml first $ cd server +// update default port 9000 to 7001 in config/example-config.yaml first $ go build -o server ``` ### 3. Start ``` -$ mv dist server/assets $ nohup ./server & ``` diff --git a/config/server.js b/config/server.js new file mode 100644 index 00000000..9917714f --- /dev/null +++ b/config/server.js @@ -0,0 +1,33 @@ +const path = require('path'); +const process = require('process'); +const fs = require('fs'); +const chalk = require('chalk'); +const { spawn, spawnSync } = require('child_process'); +const webpack = require('webpack'); +const openBrowser = require('react-dev-utils/openBrowser'); +const WebpackDevServer = require('webpack-dev-server'); +const config = require('./webpack.dev'); + +const compiler = webpack(config); +const portal = config.devServer.https ? 'https' : 'http'; +const port = config.devServer.port; +const ip = config.devServer.host || '127.0.0.1'; + +const goServerPath = path.resolve(process.cwd(), './server'); + +const goServerProcess = spawn('go run main.go', { cwd: goServerPath, shell: true }); +goServerProcess.stdout.on('data', (data) => console.log(chalk.blue(`server::${data.toString().slice(0, -1)}`))); +goServerProcess.on('close', () => + console.log(chalk.red('\ngo server 启动失败,服务器将不可用,请切换到 server 目录调试异常\n')) +); + +const server = new WebpackDevServer(config.devServer, compiler); +server.startCallback(() => { + console.log(`Listening at localhost: ${port}`); + console.log('Opening your system browser...'); + openBrowser(`${portal}://${ip}:${port}`); +}); + +process.on('exit', (code) => { + console.log(`process exits with code: ${code}`); +}); diff --git a/config/webpack.base.ts b/config/webpack.base.js similarity index 87% rename from config/webpack.base.ts rename to config/webpack.base.js index dd93657a..2409347d 100644 --- a/config/webpack.base.ts +++ b/config/webpack.base.js @@ -1,10 +1,9 @@ -import HtmlWebpackPlugin from 'html-webpack-plugin'; -import path, { resolve } from 'path'; -import webpack, { Configuration } from 'webpack'; -import Package from '../package.json'; -import AntdDayjsWebpackPlugin from 'antd-dayjs-webpack-plugin'; - -const commonConfig: Configuration = { +const path = require('path'); +const webpack = require('webpack'); +const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const Package = require('../package.json') +const commonConfig = { entry: { app: [path.join(__dirname, '../app/index.tsx')], }, @@ -89,7 +88,7 @@ const commonConfig: Configuration = { new HtmlWebpackPlugin({ filename: 'index.html', template: path.join(__dirname, '../app/index.html'), - favicon: resolve(__dirname, '../favicon.ico'), + favicon: path.resolve(__dirname, '../favicon.ico'), minify: { collapseWhitespace: true, removeComments: true, @@ -121,4 +120,4 @@ const commonConfig: Configuration = { }, }; -export default commonConfig; +module.exports = commonConfig; diff --git a/config/webpack.dev.ts b/config/webpack.dev.js similarity index 85% rename from config/webpack.dev.ts rename to config/webpack.dev.js index f45ef1af..7ab107b5 100644 --- a/config/webpack.dev.ts +++ b/config/webpack.dev.js @@ -1,8 +1,9 @@ -import path from 'path'; -import { mergeWithCustomize } from 'webpack-merge'; -import commonConfig from './webpack.base'; +const path = require('path'); +const merge = require('webpack-merge'); +const commonConfig = require('./webpack.base'); const devConfig = { + mode: 'development', devtool: 'inline-source-map', entry: { app: [ @@ -27,6 +28,7 @@ const devConfig = { devServer: { port: 7001, + open: true, headers: { 'Access-Control-Allow-Origin': '*' }, historyApiFallback: true, host: 'localhost', @@ -61,7 +63,7 @@ const devConfig = { }, }; -module.exports = mergeWithCustomize({ +module.exports = merge.mergeWithCustomize({ customizeArray(_, b, key) { if (key === 'entry.app') { return b; diff --git a/config/webpack.prod.ts b/config/webpack.prod.js similarity index 60% rename from config/webpack.prod.ts rename to config/webpack.prod.js index 0ba55e1d..b0dc23e2 100644 --- a/config/webpack.prod.ts +++ b/config/webpack.prod.js @@ -1,12 +1,12 @@ -import { CleanWebpackPlugin } from 'clean-webpack-plugin'; -import MiniCssExtractPlugin from 'mini-css-extract-plugin'; -import path from 'path'; -import webpack, { Configuration } from 'webpack'; -import merge from 'webpack-merge'; +const { CleanWebpackPlugin } = require('clean-webpack-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const path = require('path'); +const webpack = require('webpack'); +const { merge } = require('webpack-merge'); -import commonConfig from './webpack.base'; +const commonConfig = require('./webpack.base'); -const publicConfig: Configuration = { +const publicConfig = { mode: 'production', output: { path: path.join(__dirname, '../dist/'), @@ -33,8 +33,8 @@ const publicConfig: Configuration = { new CleanWebpackPlugin(), new MiniCssExtractPlugin({ - filename: '[name].[hash].css', - chunkFilename: '[id].[hash].css', + filename: '[name].[fullhash].css', + chunkFilename: '[id].[fullhash].css', }), ], }; diff --git a/deployment/docker/README.md b/deployment/docker/README.md new file mode 100644 index 00000000..c75d134e --- /dev/null +++ b/deployment/docker/README.md @@ -0,0 +1,14 @@ +# Nebula Studio Docker Deploy + +### Package: + +`tar -czf nebula-graph-studio-$VERSION.tar.gz + +### Use: + +``` +tar -xvf nebula-graph-studio-$VERSION.tar.gz +cd nebula-graph-studio-$VERSION +docker-compose pull +docker-compose up -d +``` \ No newline at end of file diff --git a/deployment/docker/docker-compose.yml b/deployment/docker/docker-compose.yml new file mode 100644 index 00000000..657d7fe6 --- /dev/null +++ b/deployment/docker/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.4' +services: + web: + image: vesoft/nebula-graph-studio:v3.3.0-beta + environment: + USER: root + UPLOAD_DIR: ${MAPPING_DOCKER_DIR} + ports: + - 7001:7001 + networks: + - nebula-web + +networks: + nebula-web: \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3a575aba..e086af79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2695,6 +2695,12 @@ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, + "address": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/address/-/address-1.1.2.tgz", + "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==", + "dev": true + }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmmirror.com/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -2960,6 +2966,12 @@ "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.0.7.tgz", "integrity": "sha512-Pj2IR7u8hmUEDOwB++su6baaRi+QvsgajuFB9j95foM1N2gy5HM4z60hfusIO0fBPG5uLAEl6yCJr1jNSVugEQ==" }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "autoprefixer": { "version": "9.8.8", "resolved": "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-9.8.8.tgz", @@ -4299,6 +4311,12 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, "default-gateway": { "version": "6.0.3", "resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-6.0.3.tgz", @@ -4388,6 +4406,33 @@ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", "dev": true }, + "detect-port-alt": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz", + "integrity": "sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q==", + "dev": true, + "requires": { + "address": "^1.0.1", + "debug": "^2.6.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + } + } + }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmmirror.com/diff/-/diff-4.0.2.tgz", @@ -5424,6 +5469,12 @@ "resolved": "https://registry.npmmirror.com/file-saver/-/file-saver-2.0.5.tgz", "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" }, + "filesize": { + "version": "8.0.7", + "resolved": "https://registry.npmmirror.com/filesize/-/filesize-8.0.7.tgz", + "integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==", + "dev": true + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz", @@ -5556,6 +5607,129 @@ } } }, + "fork-ts-checker-webpack-plugin": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.5.0.tgz", + "integrity": "sha512-cS178Y+xxtIjEUorcHddKS7yCMlrDPV31mt47blKKRfMd70Kxu5xruAFE2o9sDY6wVC5deuob/u/alD04YYHnw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@types/json-schema": "^7.0.5", + "chalk": "^4.1.0", + "chokidar": "^3.4.2", + "cosmiconfig": "^6.0.0", + "deepmerge": "^4.2.2", + "fs-extra": "^9.0.0", + "glob": "^7.1.6", + "memfs": "^3.1.2", + "minimatch": "^3.0.4", + "schema-utils": "2.7.0", + "semver": "^7.3.2", + "tapable": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "schema-utils": { + "version": "2.7.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-2.7.0.tgz", + "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.4", + "ajv": "^6.12.2", + "ajv-keywords": "^3.4.1" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + } + } + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz", @@ -6115,6 +6289,12 @@ "dev": true, "optional": true }, + "immer": { + "version": "9.0.12", + "resolved": "https://registry.npmmirror.com/immer/-/immer-9.0.12.tgz", + "integrity": "sha512-lk7UNmSbAukB5B6dh9fnh5D0bJTOFKxVg2cyJWTYrWRfhLrLMBquONcUs3aFq507hNoIZEDDh8lb8UtOizSMhA==", + "dev": true + }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.0.tgz", @@ -6477,6 +6657,12 @@ "integrity": "sha512-OZ4IlER3zmRIoB9AqNhEggVxqIH4ofDns5nRrPS6yQxXE1TPCUpFznBfRQmQa8uC+pXqjMnukiJBxCisIxiLGA==", "dev": true }, + "is-root": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-root/-/is-root-2.1.0.tgz", + "integrity": "sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==", + "dev": true + }, "is-shared-array-buffer": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", @@ -6742,6 +6928,12 @@ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, "klona": { "version": "2.0.5", "resolved": "https://registry.npmmirror.com/klona/-/klona-2.0.5.tgz", @@ -7944,6 +8136,66 @@ } } }, + "pkg-up": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/pkg-up/-/pkg-up-3.1.0.tgz", + "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true + } + } + }, "polyline-miter-util": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/polyline-miter-util/-/polyline-miter-util-1.0.1.tgz", @@ -8334,6 +8586,16 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, "prop-types": { "version": "15.8.1", "resolved": "https://registry.npmmirror.com/prop-types/-/prop-types-15.8.1.tgz", @@ -8887,6 +9149,101 @@ "prop-types": "^15.5.8" } }, + "react-dev-utils": { + "version": "12.0.0", + "resolved": "https://registry.npmmirror.com/react-dev-utils/-/react-dev-utils-12.0.0.tgz", + "integrity": "sha512-xBQkitdxozPxt1YZ9O1097EJiVpwHr9FoAuEVURCKV0Av8NBERovJauzP7bo1ThvuhZ4shsQ1AJiu4vQpoT1AQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.0", + "address": "^1.1.2", + "browserslist": "^4.18.1", + "chalk": "^4.1.2", + "cross-spawn": "^7.0.3", + "detect-port-alt": "^1.1.6", + "escape-string-regexp": "^4.0.0", + "filesize": "^8.0.6", + "find-up": "^5.0.0", + "fork-ts-checker-webpack-plugin": "^6.5.0", + "global-modules": "^2.0.0", + "globby": "^11.0.4", + "gzip-size": "^6.0.0", + "immer": "^9.0.7", + "is-root": "^2.1.0", + "loader-utils": "^3.2.0", + "open": "^8.4.0", + "pkg-up": "^3.1.0", + "prompts": "^2.4.2", + "react-error-overlay": "^6.0.10", + "recursive-readdir": "^2.2.2", + "shell-quote": "^1.7.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "loader-utils": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-3.2.0.tgz", + "integrity": "sha512-HVl9ZqccQihZ7JM85dco1MvO9G+ONvxoGa9rkhzFsneGLKSUg1gJf9bWzhRhcvm2qChhWpebQhP44qxjKIUCaQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "react-dom": { "version": "17.0.2", "resolved": "https://registry.npmmirror.com/react-dom/-/react-dom-17.0.2.tgz", @@ -8897,6 +9254,12 @@ "scheduler": "^0.20.2" } }, + "react-error-overlay": { + "version": "6.0.10", + "resolved": "https://registry.npmmirror.com/react-error-overlay/-/react-error-overlay-6.0.10.tgz", + "integrity": "sha512-mKR90fX7Pm5seCOfz8q9F+66VCc1PGsWSBxKbITjfKVQHMNF2zudxHnMdJiB1fRCb+XsbQV9sO9DCkgsMQgBIA==", + "dev": true + }, "react-hot-loader": { "version": "4.13.0", "resolved": "https://registry.npmmirror.com/react-hot-loader/-/react-hot-loader-4.13.0.tgz", @@ -9169,6 +9532,26 @@ "resolve": "^1.9.0" } }, + "recursive-readdir": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "dev": true, + "requires": { + "minimatch": "3.0.4" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, "redent": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/redent/-/redent-3.0.0.tgz", @@ -9655,6 +10038,12 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "shell-quote": { + "version": "1.7.3", + "resolved": "https://registry.npmmirror.com/shell-quote/-/shell-quote-1.7.3.tgz", + "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", + "dev": true + }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.0.4.tgz", @@ -9683,6 +10072,12 @@ "totalist": "^1.0.0" } }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/slash/-/slash-3.0.0.tgz", diff --git a/package.json b/package.json index 1c0f32a0..febe75ae 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "description": "nebula-graph-studio", "private": true, "scripts": { - "dev": "webpack-dev-server --config ./config/webpack.dev.ts --mode development --color --progress --hot", + "dev": "webpack-dev-server --config ./config/webpack.dev.js --mode development --color --progress --hot", "lint": "eslint 'app/**/*.{ts,tsx}' && stylelint **/*.{html,less}", "lint-fix": "eslint 'app/**/*.{ts,tsx}' --fix && stylelint **/*.{html,less} --fix", - "build": "webpack --config config/webpack.prod.ts" + "build": "webpack --config config/webpack.prod.js", + "dev-all": "node ./config/server.js" }, "dependencies": { "@ant-design/icons": "^4.7.0", @@ -104,6 +105,7 @@ "less-loader": "^10.2.0", "mini-css-extract-plugin": "^2.5.0", "prettier": "^2.3.2", + "react-dev-utils": "^12.0.0", "style-loader": "^2.0.0", "stylelint": "^13.13.1", "stylelint-config-recommended": "^5.0.0", diff --git a/scripts/build.sh b/scripts/build.sh index 5616220c..1204879d 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -14,6 +14,7 @@ npm run build cp -r ./dist/. ./server/assets # build server +sed -i "s/9000/7001/g" ./server/config/example-config.yaml cd ./server go build -o server diff --git a/scripts/pack_CentOS.sh b/scripts/pack_CentOS.sh index 30100a85..04a0c6a1 100644 --- a/scripts/pack_CentOS.sh +++ b/scripts/pack_CentOS.sh @@ -34,4 +34,8 @@ cp -r $STUDIO/server/config $TAR_TARGET/ cp -r $STUDIO/server/server $TAR_TARGET/ cd $DIR -tar -czf nebula-graph-studio-$VERSION.x86_64.tar.gz nebula-graph-studio \ No newline at end of file +tar -czf nebula-graph-studio-$VERSION.x86_64.tar.gz nebula-graph-studio + +# build docker-compose dir +cd $DIR +tar -czf nebula-graph-studio-$VERSION.tar.gz -C $STUDIO/deployment/docker . diff --git a/server/config/example-config.yaml b/server/config/example-config.yaml index 0050b47a..5b635b2b 100644 --- a/server/config/example-config.yaml +++ b/server/config/example-config.yaml @@ -4,4 +4,4 @@ web: # tasks_dir: # sqlitedb_file_path: # ip: - port: 7001 \ No newline at end of file + port: 9000 \ No newline at end of file