Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
zoumiaojiang committed Jun 29, 2017
1 parent 4046d59 commit 053d857
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 36 deletions.
6 changes: 3 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* @author mj(zoumiaojiang@gmail.com)
*/

import path from 'path';
const path = require('path');

import utils from './utils';
const utils = require('./utils');

/* eslint-disable fecs-use-method-definition */
export default {
module.exports = {

/**
* 本地模版存放路径
Expand Down
10 changes: 5 additions & 5 deletions lib/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* @author mj(zoumiaojiang@gmail.com)
*/

import requestP from 'request-promise';
const requestP = require('request-promise');

import store from './store';
import conf from './config';
const store = require('./store');
const conf = require('./config');

/**
* 请求全局的配置json
*
* @return {Object} json 数据
*/
export default (async function () {
module.exports = async function () {
let data = store.get('data');

// 如果 store 中已经存在了,那 2s 后我们再去尝试更新一下是不是有最新的数据
Expand All @@ -40,4 +40,4 @@ export default (async function () {
store.set('data', data);

return data;
});
};
7 changes: 3 additions & 4 deletions lib/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

/* eslint-disable */

import chalk from 'chalk';
import util from 'util';
const chalk = require('chalk');
const util = require('util');

let log = {};
let logTypes = [
Expand Down Expand Up @@ -149,5 +149,4 @@ log.write = function (format, varArgs) {

log.chalk = chalk;


export default log;
module.exports = log;
10 changes: 5 additions & 5 deletions lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @author mj(zoumiaojiang@gmail.com)
*/

import Ajv from 'ajv';
const Ajv = require('ajv');

import lavasScaffoldSchema from './schema';
import lavasScaffoldTemplate from './template';
import log from './log';
const lavasScaffoldSchema = require('./schema');
const lavasScaffoldTemplate = require('./template');
const log = require('./log');

/**
* 验证参数
Expand All @@ -33,7 +33,7 @@ async function validate(fields) {
}

/* eslint-disable fecs-use-method-definition */
export default {
module.exports = {

/**
* 导出 pwa 项目
Expand Down
4 changes: 2 additions & 2 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* @author mj(zoumiaojiang@gmail.com)
*/

import gData from './data';
const gData = require('./data');

/* eslint-disable fecs-use-method-definition */
export default {
module.exports = {

/**
* 获取和初始化 pwa 项目相关的 fields
Expand Down
2 changes: 1 addition & 1 deletion lib/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

let store = {};

export default {
module.exports = {

/**
* setter
Expand Down
18 changes: 9 additions & 9 deletions lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* @author mj(zoumiaojiang@gmail.com)
*/

import git from 'simple-git';
import glob from 'glob';
import archiver from 'archiver';
import etpl from 'etpl';
import fs from 'fs-extra';
import path from 'path';
const git = require('simple-git');
const glob = require('glob');
const archiver = require('archiver');
const etpl = require('etpl');
const fs = require('fs-extra');
const path = require('path');

import conf from './config';
import gData from './data';
const conf = require('./config');
const gData = require('./data');

/**
* 从git上downloa代码下来
Expand Down Expand Up @@ -127,7 +127,7 @@ function renderTemplate(fields, ltd, template, isStream) {
}

/* eslint-disable fecs-use-method-definition */
export default {
module.exports = {

/**
* 获取云端所有的模版数据
Expand Down
10 changes: 5 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* @author mj(zoumiaojiang@gmail.com)
*/

import shelljs from 'shelljs';
import fs from 'fs-extra';
import os from 'os';
import path from 'path';
const shelljs = require('shelljs');
const fs = require('fs-extra');
const os = require('os');
const path = require('path');

/* eslint-disable fecs-use-method-definition */
export default {
module.exports = {

/**
* 系统是否存在某条命令
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/setupLavas.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* @author mj(zoumiaojiang@gmail.com)
*/

import lavas from '../../index';
import path from 'path';
const lavas = require('../../index');
// const path = require('path');

async function setupLavas() {
// const schema = await lavas.getSchema();
Expand Down

0 comments on commit 053d857

Please sign in to comment.