New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

riot-zero

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

riot-zero - npm Package Compare versions

Comparing version 0.0.3 to 1.0.0

src/config/gulpfile.js

60

bin/riot-zero.js
#!/usr/bin/env node
var chalk = require('chalk');
console.log('嗯,启动命令了');
// style a string
chalk.blue('Hello world!');
const commander = require('commander');
const msg = require('../src/utils/msg.js');
const fs = require('fs-extra');
const path = require('path');
const version = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8')).version;
const currentPath = process.cwd();
// 配置文件
const GULP_CONFIG = path.join(__dirname, '../src/config/gulpfile.js');
const SERVER_CONFIG = path.join(__dirname, '../src/config/server.js');
const WEBPACK_CONFIG = path.join(__dirname, '../src/config/webpack.config.js');
const PACKAGE_CONFIG = path.join(__dirname, '../src/config/package.json');
const REAL_GULP_CONFIG = path.join(currentPath, './gulpfile.js');
const REAL_SERVER_CONFIG = path.join(currentPath, './server.js');
const REAL_WEBPACK_CONFIG = path.join(currentPath, './webpack.config.js');
const REAL_PACKAGE_CONFIG = path.join(currentPath, './package.json');
//文件目录
const DEFAULT_STATIC = path.join(__dirname, '../src/static');
const REAL_STATIC = path.join(currentPath, './src');
commander.version(version)
commander.command('init')
.option('-y --yes')
.description('初始化你的项目,riot-zero将为你准备基本的项目目录和配置文件')
.action(function(params){
if(!params.yes){
return msg.error('请添加-y或者--yes参数');
}
if (!fs.existsSync(REAL_GULP_CONFIG)) {
fs.copySync(GULP_CONFIG, REAL_GULP_CONFIG);
msg.info('gulp配置文件创建成功, 请根据项目情况进行配置');
}
if (!fs.existsSync(REAL_WEBPACK_CONFIG)) {
fs.copySync(WEBPACK_CONFIG, REAL_WEBPACK_CONFIG);
msg.info('webpack配置文件创建成功, 请根据项目情况进行修改并安装依赖');
}
if (!fs.existsSync(REAL_SERVER_CONFIG)) {
fs.copySync(SERVER_CONFIG, REAL_SERVER_CONFIG);
msg.info('server配置文件创建成功, 请根据项目情况进行修改并安装依赖');
}
if (!fs.existsSync(REAL_STATIC)) {
fs.copySync(DEFAULT_STATIC, REAL_STATIC);
msg.info('静态文件目录创建成功');
}
if (!fs.existsSync(REAL_PACKAGE_CONFIG)) {
fs.copySync(PACKAGE_CONFIG, REAL_PACKAGE_CONFIG);
msg.info('静态文件目录创建成功');
}
msg.notice('now,你可以运行npm run dev命令,在指定的8007端口查看你的项目。');
msg.notice('或者,你也可以运行npm run build命令,获取用于线上的代码');
msg.hehe();
})
commander.parse(process.argv);

9

package.json
{
"name": "riot-zero",
"version": "0.0.3",
"version": "1.0.0",
"description": "",

@@ -10,3 +10,3 @@ "main": "index.js",

"bin": {
"qk": "./bin/riot-zero.js"
"zero": "./bin/riot-zero.js"
},

@@ -18,3 +18,8 @@ "keywords": [],

"chalk": "^1.1.3"
},
"devDependencies": {
"commander": "^2.10.0",
"fs-extra": "^3.0.1",
"mockjs": "^1.0.1-beta3"
}
}

@@ -1,1 +0,5 @@

目前这个包是个空包,请不要下载,后续补充该包
## 目前这个包是个空包,请不要下载,后续补充该包
##
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc