Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

Commit

Permalink
v1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jirapo committed Jun 28, 2017
2 parents 9657dd1 + 777870b commit a4f5664
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 67 deletions.
10 changes: 9 additions & 1 deletion app/History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
1.8.1 / 2017-06-26
1.8.4 / 2017-06-28
==================
# zh
* 开放 Nowa GUI 插件接口 [https://github.com/Jirapo/nowa-gui-plugin-demo]

# en
* Add Nowa GUI plugin API

1.8.2 / 2017-06-26
==================
# zh
* 支持工具内自更新
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nowa-gui-version",
"version": "1.8.2",
"version": "1.8.4",
"description": "A tool for nowa developement.",
"productName": "ElectronWebpack",
"main": "./main.js",
Expand Down
10 changes: 2 additions & 8 deletions app/readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# zh
* 支持工具内自更新
* 项目支持重载
* 增加 nowa 插件管理功能
* 接入蚂蚁模板 [http://scaffold.ant.design/list.json]
* 开放 Nowa GUI 插件接口 [https://github.com/Jirapo/nowa-gui-plugin-demo]
# en
* Support application self updating
* Support project reloading
* Add plugin manager
* Add Ant-Design templates [http://scaffold.ant.design/list.json]
* Add Nowa GUI plugin API [https://github.com/Jirapo/nowa-gui-plugin-demo]
36 changes: 22 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "NowaGUI",
"version": "1.8.2",
"version": "1.8.4",
"description": "A tool for nowa developement.",
"scripts": {
"postinstall": "install-app-deps",
"dev:renderer": "./node_modules/.bin/webpack-dev-server --config ./webpack/renderer.dev.conf.js",
"dev:dll": "./node_modules/.bin/webpack --config ./webpack/renderer.dll.conf.js",
"dev:main": "./node_modules/.bin/webpack --config ./webpack/main.dev.conf.js -w",
"show:main": "./node_modules/.bin/webpack --config ./webpack/main.dev.conf.js -j | webpack-bundle-size-analyzer",
"build:main": "./node_modules/.bin/webpack --config ./webpack/main.prod.conf.js",
"build:renderer": "./node_modules/.bin/webpack --config ./webpack/renderer.prod.conf2.js",
"show:renderer": "./node_modules/.bin/webpack --config ./webpack/renderer.prod.conf.js -j | webpack-bundle-size-analyzer",
"dev:renderer": "webpack-dev-server --config ./webpack/renderer.dev.conf.js",
"dev:dll": "webpack --config ./webpack/renderer.dll.conf.js",
"dev:main": "webpack --config ./webpack/main.dev.conf.js -w",
"show:main": "webpack --config ./webpack/main.dev.conf.js -j | webpack-bundle-size-analyzer",
"build:main": "webpack --config ./webpack/main.prod.conf.js",
"build:renderer": "webpack --config ./webpack/renderer.prod.conf2.js",
"show:renderer": "webpack --config ./webpack/renderer.prod.conf.js -j | webpack-bundle-size-analyzer",
"build": "npm run build:main & npm run build:renderer",
"dev": "npm run dev:renderer & npm run dev:main",
"start": "electron ./app/main.js",
Expand All @@ -19,10 +19,10 @@
"pack": "npm run prepack && build --dir",
"pack:mac": "npm run prepack && build -m",
"pack:win": "npm run prepack && build -w",
"pack:linux": "npm run prepack && npm run build && build -l",
"pack:linux": "npm run prepack && build -l",
"lint": "eslint --ext .js src",
"precommit": "lint-staged",
"rebuild": "./node_modules/.bin/electron-rebuild -d=https://gh-contractor-zcbenz.cnpmjs.org/atom-shell/dist/ -m ./app",
"rebuild": "electron-rebuild -d=https://gh-contractor-zcbenz.cnpmjs.org/atom-shell/dist/ -m ./app",
"log": "git log --color --graph --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit"
},
"keywords": [],
Expand Down Expand Up @@ -65,10 +65,7 @@
"git add"
]
},
"author": {
"name": "Poling",
"email": "[email protected]"
},
"author": "Poling <[email protected]>",
"homepage": "https://github.com/nowa-webpack/nowa-gui",
"license": "ISC",
"devDependencies": {
Expand Down Expand Up @@ -132,5 +129,16 @@
"react": "^15.4.2",
"react-dom": "^15.5.4",
"react-dropzone": "^3.13.1"
},
"main": "prePacker.js",
"directories": {
"doc": "doc"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nowa-webpack/nowa-gui.git"
},
"bugs": {
"url": "https://github.com/nowa-webpack/nowa-gui/issues"
}
}
3 changes: 0 additions & 3 deletions src/main/services/commands/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import { BIN_PATH, NODE_PATH, APP_PATH, NOWA_INSTALL_DIR } from '../paths';
fixPath();

const npmEnv = npmRunPath.env();
// const pathEnv = [process.env.Path, npmEnv.PATH, BIN_PATH, NODE_PATH]
// .filter(p => !!p)
// .join(delimiter);
const pathEnv = [process.env.Path, npmEnv.PATH, BIN_PATH, NODE_PATH]
.filter(p => !!p)
.join(delimiter);
Expand Down
7 changes: 1 addition & 6 deletions src/main/services/commands/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,4 @@ function normalizeExecArgs(command, options) {
export default function () {
const parsed = normalizeExecArgs.apply(null, arguments);
return spawn(parsed.shell, parsed.args, parsed.options);
};
/*module.exports = function() {
const parsed = normalizeExecArgs.apply(null, arguments);
return spawn(parsed.shell, parsed.args, parsed.options);
};*/
}
3 changes: 1 addition & 2 deletions src/main/services/menu/menuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ export default function () {
}

return item;
};

}
1 change: 1 addition & 0 deletions src/main/services/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const NODE_PATH = join(APP_PATH, 'nodes');
export const LINK_NOWA_PATH = isWin ? join(process.env.APPDATA, 'npm', 'nowa') : '/usr/local/bin/nowa';

export const DOT_NOWA_PATH = join(homedir(), '.nowa-gui');
export const DOT_NOWA_CLI_PATH = join(homedir(), '.nowa');
export const TEMPLATES_DIR = join(DOT_NOWA_PATH, 'template');
export const NOWA_INSTALL_DIR = join(DOT_NOWA_PATH, 'installation');
export const USER_CONFIG_PATH = join(DOT_NOWA_PATH, 'user_config.json');
Expand Down
10 changes: 10 additions & 0 deletions src/renderer/assets/styles/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,14 @@
&-inline{
/*padding: 0 0 0 20px;*/
}
}

.promts-modal-form{
.ant-form-item{
margin-bottom: 15px;
}

&-text{
color: #108ee9;
}
}
3 changes: 2 additions & 1 deletion src/renderer/assets/styles/modal.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
}
}
}
}
}

13 changes: 6 additions & 7 deletions src/renderer/components/Project/PluginPromtsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ const PluginPromtsModal = ({
const handleOk = () => {
validateFields((err, answers) => {
if (!err) {
const filter = promts.filter(item => item.type === 'text');
if (filter.length) {
answers[filter[0].key] = filter[0].value;
}
console.log(answers);

dispatch({
Expand Down Expand Up @@ -80,7 +84,6 @@ const PluginPromtsModal = ({
key={obj.key}
{...formItemLayout}
label={obj.label[lang]}
required
>
{getFieldDecorator(obj.key, options)(<Input />)}
</FormItem>
Expand All @@ -93,9 +96,8 @@ const PluginPromtsModal = ({
key={obj.key}
{...formItemLayout}
label={obj.label[lang]}
required
>
<div>{obj.value}</div>
<div className="promts-modal-form-text">{obj.value}</div>
</FormItem>
);
};
Expand All @@ -111,7 +113,6 @@ const PluginPromtsModal = ({
key={obj.key}
{...formItemLayout}
label={obj.label[lang]}
required
>
{getFieldDecorator(obj.key, options)(
<Select>
Expand All @@ -137,7 +138,6 @@ const PluginPromtsModal = ({
key={obj.key}
{...formItemLayout}
label={obj.label[lang]}
required
>
{getFieldDecorator(obj.key, options)(<Switch size="small" />)}
</FormItem>
Expand All @@ -157,7 +157,6 @@ const PluginPromtsModal = ({
key={obj.key}
{...formItemLayout}
label={obj.label[lang]}
required
>
{getFieldDecorator(obj.key, options)(
<CheckboxGroup options={opt} />
Expand All @@ -175,7 +174,7 @@ const PluginPromtsModal = ({
okText={i18n('form.ok')}
cancelText={i18n('form.cancel')}
>
<Form style={{ marginTop: 20 }}>
<Form className="promts-modal-form">
{
promts.length &&
promts.map(item => {
Expand Down
13 changes: 6 additions & 7 deletions src/renderer/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isWin } from 'shared-nowa';
import { isWin, isDev } from 'shared-nowa';

export const SHUTDOWN_PAGE = 'SHUTDOWN_PAGE'; // 退出页面
export const PREINIT_PAGE = 'PREINIT_PAGE'; // 工具初始化安装nowa页面
Expand Down Expand Up @@ -55,11 +55,6 @@ export const WEBSTORM_BASE_PATH = isWin
? 'C:/Program Files (x86)/JetBrains/WebStorm 2017.1/bin/webstorm.exe'
: '/Applications/WebStorm.app';

// export const UPGRADE_URL = isWin
// ? 'https://alixux.org/downloads/nowa-gui.exe'
// : isMac
// ? 'https://alixux.org/downloads/nowa-gui.dmg'
// : 'https://alixux.org/downloads/nowa-gui.deb';

export const URL_MATCH = /^((ht|f)tps?):\/\/([\w-]+(\.[\w-]+)*\/)*[\w-]+(\.[\w-]+)*\/?(\?([\w-.,@?^=%&:/~+#]*)+)?/;

Expand All @@ -69,4 +64,8 @@ export const NAME_MATCH = /^([A-Za-z0-9]|[._@\/-])+$/;
// export const NAME_MATCH = /^(@\w+\/)?[\w-]+$/;
// export const NAME_MATCH = /^[a-z][a-z0-9-]*$/;

export const PORT_MATCH = /^([1-9]|[1-9]\d{1,3}|[1-6][0-5][0-5][0-3][0-5])$/;

export const PORT_MATCH = /^([1-9]|[1-9]\d{1,3}|[1-6][0-5][0-5][0-3][0-5])$/;


export const GUI_PLUGIN_NPM = isDev ? 'nowa-gui-plugins-test' : 'nowa-gui-plugins';
1 change: 1 addition & 0 deletions src/renderer/models/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export default {
});
yield delay(500);
removeSync(paths.DOT_NOWA_PATH);
removeSync(paths.DOT_NOWA_CLI_PATH);
yield put({
type: 'changeStatus',
payload: { loading: false }
Expand Down
28 changes: 15 additions & 13 deletions src/renderer/models/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { remote } from 'electron';
import i18n from 'i18n-renderer-nowa';
import { request, delay } from 'shared-nowa';
import { msgError, readPluginConfig, writePluginConfig } from 'util-renderer-nowa';
import { REGISTRY_MAP } from 'const-renderer-nowa';
import { REGISTRY_MAP, GUI_PLUGIN_NPM } from 'const-renderer-nowa';
import { getLocalPlugins, setLocalPlugins } from 'store-renderer-nowa';
import { merge } from 'lodash-es';

const { commands, paths, tasklog } = remote.getGlobal('services');
// const target = name => join(paths.NODE_MODULES_PATH, name, 'index.js');
const target = name => join(paths.NODE_MODULES_PATH, name);


Expand Down Expand Up @@ -67,7 +67,7 @@ export default {
const { registry } = yield select(state => state.setting);
const { pluginList } = yield select(state => state.plugin);

const { data } = yield request(`${registry}/nowa-gui-plugins/latest`);
const { data } = yield request(`${registry}/${GUI_PLUGIN_NPM}/latest`);
let npmPluginList = data.plugins;

if (!atAli) {
Expand Down Expand Up @@ -186,11 +186,6 @@ export default {
payload: { reinstall: true, ...payload }
});

// yield put({
// type: 'changePluginList',
// payload,
// });

const storePlugin = getLocalPlugins();
setLocalPlugins(
storePlugin.map(item => (item.name === payload.name ? payload : item))
Expand Down Expand Up @@ -239,7 +234,6 @@ export default {
},
* initUIPluginList(o, { put, select }) {
const pluginList = getLocalPlugins().filter(item => item.type === 'ui');

const UIPluginList = pluginList.map(({ name }) => ({
name,
file: remote.require(target(name)),
Expand All @@ -257,13 +251,14 @@ export default {
const command = file.name.en;
const cwd = current.path;
let preData;
const defaultPluginConfig = readPluginConfig(target(payload));

const defaultPluginConfig = readPluginConfig(join(target(payload), '.nowa'));

const config = { ...defaultPluginConfig, ...current.config };

// const config = { ...defaultPluginConfig, ...current.config };
const config = merge(defaultPluginConfig, current.config);
writePluginConfig(cwd, config);

current.config = config;

yield put({
type: 'project/changeProjects',
payload: current
Expand Down Expand Up @@ -347,6 +342,13 @@ export default {
const cwd = current.path;
console.log('do execPluginTask', file.name.en);

yield put({
type: 'changeStatus',
payload: {
showPromtsModal: false,
}
});

const logger = (data) => {
console.log(data);
tasklog.writeLog(command, cwd, data);
Expand Down
5 changes: 1 addition & 4 deletions src/shared/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// plase don't import electron here

// const is = require('electron-is');
// const request = require('./request');
import is from 'electron-is';

export { default as request } from './request';
export { default as checkver } from './checkver';
// export const isDev = process.env.NODE_ENV !== 'production';
export const isDev = is.dev();
export const isMac = is.macOS();
export const isWin = is.windows();
Expand All @@ -29,4 +26,4 @@ const PROD_DINGDING_TOKEN = 'be77cc501c1d5a466f91690266495a28b1a0e0cb654cc578cfd
// test token
const DEV_DINGDING_TOKEN = '399b920a41af24d5c4d0e12f302a496a37e816bf7eaad10aa59fb93f8330cc78';

export const FEEDBACK_URL = `https://oapi.dingtalk.com/robot/send?access_token=${isDev ? DEV_DINGDING_TOKEN : PROD_DINGDING_TOKEN}`
export const FEEDBACK_URL = `https://oapi.dingtalk.com/robot/send?access_token=${isDev ? DEV_DINGDING_TOKEN : PROD_DINGDING_TOKEN}`;

0 comments on commit a4f5664

Please sign in to comment.