@easyv/cli
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -20,2 +20,2 @@ #!/usr/bin/env node | ||
require('../scripts/start'); | ||
require('../scripts/index'); |
{ | ||
"name": "@easyv/cli", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Easy[V] component tools", | ||
@@ -11,3 +11,3 @@ "engines": { | ||
"scripts", | ||
"template" | ||
"example" | ||
], | ||
@@ -19,3 +19,3 @@ "bin": { | ||
"start": "node ./index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "easyv publish --host a -h a1 -p b tab" | ||
}, | ||
@@ -29,4 +29,7 @@ "keywords": [], | ||
"cross-spawn": "^7.0.3", | ||
"validate-npm-package-name": "^3.0.0" | ||
"crypto": "^1.0.1", | ||
"request": "^2.88.2", | ||
"validate-npm-package-name": "^3.0.0", | ||
"yargs": "^15.4.0" | ||
} | ||
} | ||
} |
@@ -1,23 +0,23 @@ | ||
npm i -g datav-cli | ||
datav create [aa] | ||
datav publish [aa] | ||
npm i -g easyv-cli | ||
easyv create <project_name> --with react|vue|jquery|vanilla | ||
easyv publish <component_name> | ||
easyv dev --component [a b c] | ||
easyv login -u <username> -p <password> | ||
easyv config set <key> <value> | ||
easyv config get <key> | ||
easyv config --list | ||
easyv generate | ||
- 最精简项目运行 √ | ||
- 封装除了用户代码以外的其他文件 √ | ||
- 自动创建项目 √ | ||
- 项目打包成单文件umd | ||
- 配置栏整改 交互测试 | ||
- 生命周期定一版 | ||
- 解决用jquery开发 | ||
- 项目打包成单文件 umd (css 外链) √ | ||
- webpack 配置扩展 √ | ||
- 界面修改 / 数据编辑 / 交互测试 | ||
- 命令名称统一 | ||
- 解决用 jquery 开发 | ||
later: | ||
1. 输出信息格式化一下 | ||
2. 使用文档 | ||
3. 创建时预先选择模版? | ||
// 资源上传问题 | ||
// 数据编辑做成什么样子 | ||
// 数据修改是否保存 | ||
1. 开发输出信息格式化一下 (自动打开浏览器) √ | ||
2. 使用文档 (放到最后) |
@@ -5,8 +5,9 @@ const validateProjectName = require('validate-npm-package-name'); | ||
const chalk = require('chalk'); | ||
const copyDir = require('./utils/copy-dir'); | ||
const cmd = require('cross-spawn'); | ||
const execSync = require('child_process').execSync; | ||
const os = require('os'); | ||
const { appRoot, appPackage, getPluginRoot } = require('./paths'); | ||
const generate = require('./generate'); | ||
function checkName(name) { | ||
function checkNameDuplication(name) { | ||
const validationResult = validateProjectName(name); | ||
@@ -58,8 +59,10 @@ if (!validationResult.validForNewPackages) { | ||
const withPlugin = 'react-template'; | ||
checkNameDuplication(folderName); | ||
console.log(); | ||
console.log(chalk.blueBright(`Creating a new component project`)); | ||
console.log(chalk.blueBright(`Creating a new easyv project`)); | ||
console.log(); | ||
checkName(folderName); | ||
const dir = path.resolve(folderName) | ||
@@ -70,24 +73,18 @@ if (!fs.existsSync(dir)) { | ||
// copy files | ||
const root = path.resolve(folderName); | ||
const packageJson = { | ||
name: folderName, | ||
version: '0.1.0', | ||
private: true, | ||
scripts: { | ||
"start": "easyv-scripts start", | ||
}, | ||
dependencies: { | ||
"@easyv/scripts": "^1.0.3", | ||
} | ||
}; | ||
// 生成package.json | ||
const createdBy = withPlugin; | ||
const templatePackage = require(`./template/package.${createdBy}.json`); | ||
templatePackage.name = folderName; | ||
templatePackage.easyv.by = createdBy; | ||
fs.writeFileSync( | ||
path.join(root, 'package.json'), | ||
JSON.stringify(packageJson, null, 2) + os.EOL | ||
path.join(appRoot, 'package.json'), | ||
JSON.stringify(templatePackage, null, 2) + os.EOL | ||
); | ||
copyDir(path.resolve(__dirname, '../template'), path.resolve(root, 'src')); | ||
// copy 用例 | ||
const appPackageJSON = require(appPackage); | ||
const componentsPath = path.join(appRoot, appPackageJSON.easyv.components) | ||
fs.mkdirSync(componentsPath, { recursive: true }) | ||
// 默认用yarn | ||
// 下载包 | ||
yarnVersion = execSync('yarnpkg --version') | ||
@@ -97,9 +94,11 @@ .toString() | ||
if (yarnVersion) { | ||
cmd.sync('yarn', ['install'], '--registry=https://registry.npm.taobao.org', { stdio: 'inherit', cwd: root }); | ||
cmd.sync('yarn', ['install', '--registry=https://registry.npm.taobao.org'], { stdio: 'inherit', cwd: appRoot }); | ||
} else { | ||
cmd.sync('npm', ['install', '--registry=https://registry.npm.taobao.org'], { stdio: 'inherit', cwd: root }); | ||
cmd.sync('npm', ['install', '--registry=https://registry.npm.taobao.org'], { stdio: 'inherit', cwd: appRoot }); | ||
} | ||
generate() | ||
console.log(); | ||
console.log(`Success! Created ${folderName} at ${chalk.green(root)}`); | ||
console.log(`Success! Created ${folderName} at ${chalk.green(appRoot)}`); | ||
console.log(); | ||
@@ -109,5 +108,5 @@ console.log(`Typing this to begin:`); | ||
console.log(`${chalk.blueBright('cd')} ${folderName}`); | ||
console.log(chalk.blueBright(`npm start`)); | ||
console.log(chalk.blueBright(`easyv dev`)); | ||
} | ||
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
114337
30
3604
1
24
7
13
3
+ Addedcrypto@^1.0.1
+ Addedrequest@^2.88.2
+ Addedyargs@^15.4.0
+ Addedajv@6.12.6(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcamelcase@5.3.1(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcliui@6.0.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcrypto@1.0.1(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfind-up@4.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedlocate-path@5.0.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@4.1.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@2.0.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedwrap-ansi@6.2.0(transitive)
+ Addedy18n@4.0.3(transitive)
+ Addedyargs@15.4.1(transitive)
+ Addedyargs-parser@18.1.3(transitive)