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

@easyv/cli

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@easyv/cli - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

example/helpers/data-string2number.js

2

bin/index.js

@@ -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`));
}
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