Skip to content

Commit

Permalink
release v0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tengge1 committed Jul 12, 2020
1 parent c042759 commit b507ccd
Show file tree
Hide file tree
Showing 10 changed files with 4,223 additions and 54 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@
"type": "node",
"request": "launch",
"program": "${file}"
},
{
"name": "Electron Main",
"type": "pwa-node",
"request": "launch",
"cwd": "${workspaceFolder}/build/desktop/ShadowEditor-win32-x64/resources/app",
"program": "${workspaceFolder}/utils/electron/main.js",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
},
"skipFiles": [
"<node_internals>/**"
]
}
]
}
43 changes: 18 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ English / [中文](README_zh.md) &nbsp;&nbsp; | &nbsp;&nbsp; <a href="https://gi
)](https://twitter.com/tengge11)

* Name: Shadow Editor
* Version: v0.5.5 (Coming Soon)
* Version: v0.5.5
* Description: Cross-platform 3D scene editor based on three.js, golang and mongodb.
* Source: [GitHub](https://github.com/tengge1/ShadowEditor) [Gitee](https://gitee.com/tengge1/ShadowEditor) | Document: [Gitee](https://gitee.com/tengge1/ShadowEditor/wikis/pages) | Demo: [GitHub](https://tengge1.github.io/ShadowEditor-examples/) [Gitee](http://tengge1.gitee.io/shadoweditor-examples/) | Video: [Weibo](https://weibo.com/tv/v/IjIn9AyvX?fid=1034:4446986821107725) [Bilibili](https://www.bilibili.com/video/av78428475?from=search&seid=9203731141485399611) | Assets: [BaiduNetdisk](https://pan.baidu.com/s/1IxJVM6fFLoIAJG-GKHjVTA)
* Technology Stack: html, css, javascript, rollup, react.js, webgl, three.js, golang, mongodb, nodejs, electron, WebWorldWind.
Expand All @@ -23,34 +23,17 @@ English / [中文](README_zh.md) &nbsp;&nbsp; | &nbsp;&nbsp; <a href="https://gi

![image](images/scene20200705.jpg)

## v0.5.5 is Coming
## v0.5.5 has Released

1. Add WebGL extension window, you can view the name and description of WebGL extension supported by the browser, and you can jump to MDN.
2. 3D Earth. (In development)

## v0.5.4 has Released

* Release Date: June 27, 2020
* Release Date: July 12, 2020
* Update Logs:

1. Create desktop app with `Electron`.

Windows Desktop: https://github.com/tengge1/ShadowEditor/releases/download/v0.5.4/ShadowEditor-win32-x64.zip

Ubuntu Desktop: https://github.com/tengge1/ShadowEditor/releases/download/v0.5.4/ShadowEditor-linux-x64.zip

Note: Windows requires `Visual C++ Redistributable for Visual Studio 2015`. You can install from: https://www.microsoft.com/en-us/download/details.aspx?id=48145

2. Using command line to install and start `ShadowEditor` service on Windows.

`.\ShadowEditor install`: install service on Windows.
`.\ShadowEditor remove`: remove service on Windows.
`.\ShadowEditor start`: start service on Windows.
`.\ShadowEditor stop`: stop service on Windows.

You can also manage this service in the `Windows Services Manager`.
1. Add WebGL extension window, you can view the name and description of WebGL extension supported by the browser, and you can jump to MDN.
2. 3D Earth. (In development)
3. Added loading mask on software loading page.
4. The desktop version reads MongoDB and website ports from the configuration file.

3. Use `nodejs` to rewrite the scripts, and you can now use `npm` to manage this project.
Note: If the desktop version cannot be opened, you can view `logs.txt`; if the port conflicts, you can modify the MongoDB and website ports in `resources/app/config.toml`.

## Features

Expand Down Expand Up @@ -197,6 +180,9 @@ add the files or directories to be ignored to the `.gitignore` file.

## Frequently Asked Questions

<details>
<summary>Expand to view details</summary>

1. Failed when upload models.

You need to compress the model assets into a `zip` file, and the entry file cannot be nested in a folder. The server will decompress and put it in the `./build/public/Upload/Model` folder, and add a record in the MongoDB `_Mesh` collection.
Expand All @@ -220,6 +206,13 @@ Edit `config.toml` and set `authority.enabled` to `true`. The default administra
The data structure and web client is not changed, just copy `./ShadowEditor.Web/Upload/` folder to
`build/public/Upload/`.

6. The desktop version cannot be opened.

Windows requires `Visual C++ Redistributable for Visual Studio 2015`. You can install from: https://www.microsoft.com/en-us/download/details.aspx?id=48145
If the desktop version cannot be opened, you can view `logs.txt`; if the port conflicts, you can modify the MongoDB and website ports in `resources/app/config.toml`.

</details>

## License

MIT License
Expand Down
43 changes: 18 additions & 25 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)](https://twitter.com/tengge11)

* 名称:Shadow Editor
* 版本:v0.5.5 (开发中)
* 版本:v0.5.5
* 简介:基于Three.js、Go语言和MongoDB的跨平台的3D场景编辑器。
* 源码:[GitHub](https://github.com/tengge1/ShadowEditor) [Gitee](https://gitee.com/tengge1/ShadowEditor) | 文档:[Gitee](https://gitee.com/tengge1/ShadowEditor/wikis/pages) | 示例:[GitHub](https://tengge1.github.io/ShadowEditor-examples/) [Gitee](http://tengge1.gitee.io/shadoweditor-examples/) | 视频:[微博](https://weibo.com/tv/v/IjIn9AyvX?fid=1034:4446986821107725) [Bilibili](https://www.bilibili.com/video/av78428475?from=search&seid=9203731141485399611) | 资源:[百度网盘](https://pan.baidu.com/s/1IxJVM6fFLoIAJG-GKHjVTA)
* 技术栈:html、css、javascript、rollup、react.js、webgl、three.js、golang、mongodb、nodejs、electron、WebWorldWind。
Expand All @@ -22,34 +22,17 @@

![image](images/scene20200705.jpg)

## v0.5.5即将发布
## v0.5.5发布[【更新日志】](https://gitee.com/tengge1/ShadowEditor/wikis/pages?sort_id=2215122&doc_id=188900)

1. 增加WebGL扩展窗口,可以查看浏览器支持的WebGL扩展名称和描述,并可以跳转到MDN。
2. 三维地球。(开发中)

## v0.5.4发布[【更新日志】](https://gitee.com/tengge1/ShadowEditor/wikis/pages?sort_id=2215122&doc_id=188900)

* 发布日期:2020年6月27日
* 发布日期:2020年7月12日
* 更新日志:

1. 使用`Electron`创建桌面应用程序。

Windows桌面版:https://github.com/tengge1/ShadowEditor/releases/download/v0.5.4/ShadowEditor-win32-x64.zip

Ubuntu桌面版:https://github.com/tengge1/ShadowEditor/releases/download/v0.5.4/ShadowEditor-linux-x64.zip

说明:Windows需要`Visual C++ Redistributable for Visual Studio 2015`。你可以从这安装:https://www.microsoft.com/en-us/download/details.aspx?id=48145

2. 使用命令行在Windows上安装和启动ShadowEditor服务。

`.\ShadowEditor install`: 在Windows上安装服务。
`.\ShadowEditor remove`: 在Windows上移除服务。
`.\ShadowEditor start`: 在Windows上启动服务。
`.\ShadowEditor stop`: 在Windows上停止服务。

你也可以在`Windows服务管理器`中管理这个服务。
1. 增加WebGL扩展窗口,可以查看浏览器支持的WebGL扩展名称和描述,并可以跳转到MDN。
2. 三维地球。(开发中)
3. 软件载入页面增加加载遮罩。
4. 桌面版从配置文件中读取MongoDB和网站端口。

3. 使用`nodejs`重写脚本,现在你可以使用`npm`管理这个项目。
说明:如果桌面版打不开,可以查看`logs.txt`;如果端口冲突,可以修改`resources/app/config.toml`中的MongoDB和网站端口。

## 功能特点

Expand Down Expand Up @@ -194,6 +177,9 @@ ShadowEditor是一个为用户和开发者而生的项目。在这个项目上

## 常见问题

<details>
<summary>展开查看详情</summary>

1. 上传模型失败。

需要把模型贴图等资源压缩成一个zip包,而且入口文件不能嵌套文件夹。服务端会解压上传的zip包到`./build/public/Upload/Model`文件夹,并在MongoDB `_Mesh`表里添加一条记录。
Expand All @@ -215,6 +201,13 @@ ShadowEditor是一个为用户和开发者而生的项目。在这个项目上

数据结构和客户端都没变,只需要把文件夹`./ShadowEditor.Web/Upload/`复制到`build/public/Upload/`即可。

6. 桌面版打不开。

说明:Windows需要`Visual C++ Redistributable for Visual Studio 2015`。你可以从这安装:https://www.microsoft.com/en-us/download/details.aspx?id=48145
说明:如果桌面版打不开,可以查看`logs.txt`;如果端口冲突,可以修改`resources/app/config.toml`中的MongoDB和网站端口。

</details>

## 开源项目

感谢以下开源项目。
Expand Down
1 change: 1 addition & 0 deletions scripts/build_desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ async function main() {
fs.copySync(mongoDir, 'build/mongo');
fs.copySync('utils/electron/main.js', 'build/main.js');
fs.copySync('utils/electron/package.json', 'build/package.json');
fs.copySync('utils/electron/toml', 'build/toml');

// Build desktop package
console.log('enter build');
Expand Down
16 changes: 12 additions & 4 deletions utils/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');
const os = require('os');
const subprocess = require('child_process');
const { app, BrowserWindow, Menu } = require('electron');
const toml = require('./toml');

let mongo, server, win;

Expand All @@ -18,7 +19,7 @@ function log(data) {
* Start MongoDB Service
* @param {String} root electron root path
*/
function startMongoDB(root) {
function startMongoDB(root, mongoPort) {
const mongod = os.platform() === 'win32' ? 'mongod.exe' : './mongod';
const cwd = path.join(root, 'mongo');

Expand All @@ -27,7 +28,7 @@ function startMongoDB(root) {
process.env.LD_LIBRARY_PATH = `LD_LIBRARY_PATH:${cwd}`
}

mongo = subprocess.spawn(mongod, ['--dbpath=db'], {
mongo = subprocess.spawn(mongod, ['--dbpath=db', `--port=${mongoPort}`], {
cwd: cwd
});
mongo.stdout.on('data', data => {
Expand Down Expand Up @@ -65,8 +66,13 @@ function startServer(root) {

function start() {
const root = app.getAppPath();
const tomlPath = path.join(root, 'config.toml');
const tomlString = fs.readFileSync(tomlPath).toString()
const config = toml.parse(tomlString);
const mongoPort = config.database.port; // 27017
const serverPort = config.server.port.split(':')[1] // 2020

startMongoDB(root);
startMongoDB(root, mongoPort);
startServer(root);

Menu.setApplicationMenu(null);
Expand All @@ -77,8 +83,10 @@ function start() {
nodeIntegration: true
}
});

// win.maximize();
win.loadURL('http://localhost:2020?electron=true');

win.loadURL(`http://localhost:${serverPort}?electron=true`);
win.on('close', () => {
if (mongo) {
mongo.kill('SIGTERM');
Expand Down
22 changes: 22 additions & 0 deletions utils/electron/toml/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2012 Michelle Tilley

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
93 changes: 93 additions & 0 deletions utils/electron/toml/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
TOML Parser for Node.js
=======================

[![Build Status](https://travis-ci.org/BinaryMuse/toml-node.png?branch=master)](https://travis-ci.org/BinaryMuse/toml-node)

[![NPM](https://nodei.co/npm/toml.png?downloads=true)](https://nodei.co/npm/toml/)

If you haven't heard of TOML, well you're just missing out. [Go check it out now.](https://github.com/mojombo/toml) Back? Good.

TOML Spec Support
-----------------

toml-node supports version 0.4.0 the TOML spec as specified by [mojombo/toml@v0.4.0](https://github.com/mojombo/toml/blob/master/versions/en/toml-v0.4.0.md)

Installation
------------

toml-node is available via npm.

npm install toml

toml-node also works with browser module bundlers like Browserify and webpack.

Usage
-----

### Standalone

Say you have some awesome TOML in a variable called `someTomlString`. Maybe it came from the web; maybe it came from a file; wherever it came from, it came asynchronously! Let's turn that sucker into a JavaScript object.

```javascript
var toml = require('toml');
var data = toml.parse(someTomlString);
console.dir(data);
```

`toml.parse` throws an exception in the case of a parsing error; such exceptions have a `line` and `column` property on them to help identify the offending text.

```javascript
try {
toml.parse(someCrazyKnuckleHeadedTrblToml);
} catch (e) {
console.error("Parsing error on line " + e.line + ", column " + e.column +
": " + e.message);
}
```

### Streaming

As of toml-node version 1.0, the streaming interface has been removed. Instead, use a module like [concat-stream](https://npmjs.org/package/concat-stream):

```javascript
var toml = require('toml');
var concat = require('concat-stream');
var fs = require('fs');

fs.createReadStream('tomlFile.toml', 'utf8').pipe(concat(function(data) {
var parsed = toml.parse(data);
}));
```

Thanks [@ForbesLindesay](https://github.com/ForbesLindesay) for the suggestion.

### Requiring with Node.js

You can use the [toml-require package](https://github.com/BinaryMuse/toml-require) to `require()` your `.toml` files with Node.js

Live Demo
---------

You can experiment with TOML online at http://binarymuse.github.io/toml-node/, which uses the latest version of this library.

Building & Testing
------------------

toml-node uses [the PEG.js parser generator](http://pegjs.majda.cz/).

npm install
npm run build
npm test

Any changes to `src/toml.peg` requires a regeneration of the parser with `npm run build`.

toml-node is tested on Travis CI and is tested against:

* Node 0.10
* Node 0.12
* Latest stable io.js

License
-------

toml-node is licensed under the MIT license agreement. See the LICENSE file for more information.
9 changes: 9 additions & 0 deletions utils/electron/toml/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var parser = require('./lib/parser');
var compiler = require('./lib/compiler');

module.exports = {
parse: function(input) {
var nodes = parser.parse(input.toString());
return compiler.compile(nodes);
}
};
Loading

0 comments on commit b507ccd

Please sign in to comment.