Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wpbase-cli

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wpbase-cli

A front end project seed for whatever

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

what-seed

A front end project seed for whatever

Functionality

这是一个前端webpack种子项目,可以用来生成前端的起始项目。通过问答完成移动端适配、sass编译等环境配置,类似vue-init.

详见已实现功能

Usage

$ wpbase-cli create <project-name>

Installation

git clone

$ git clone https://github.com/pillarBoy/what-seed
$ cd what-seed
$ npm link  # make wpbase-cli a global command, might have accession issues.
            # alternatively, set path-to-webcli-dir as env variable

$ wpbase-cli create myproject  
$ cd myproject

start to work

Customize this seed

当前可以通过修改 src/config.template.js 来修改默认配置,这个文件将会复制到生成项目的 webpack/config.js 由webpack引用

问答可以定制一些不同场景下的不同配置,在 src/questions.js 中可以定制问答项目。

引入单元测试,编写测试文件 test/test.jsnpm test 运行测试,npm run coverage 运行istanbul覆盖率测试

istanbul 依赖的 esprima 暂不支持async,因此控制台会有一些无关的报错

Details

移动端适配方案: 依照750px设计图写尺寸(后续将增设配置),单位用px, 编译时,由px2rem转为rem,根据ClientWidth设定根字体,完成响应式适配。

在webpack中引入了px2rem,基准宽度是750px,因此750px宽度设计图的尺寸可以直接用到css文件中,单位是px

代码在生成项目中的 src/utils/htmlFontSize.js

不想转换的,如1px 线,写作 border: 1px solid #ddd; /*no*/,想转换,但需要保留px单位的,如字体,写作 font-size: 28px; /*px*/

详见px2rem文档

支持版本

async await 需要node > 7.6支持

项目包管理,使用yarn

项目初始化

yarnnpm install

dev

yarn start

build

yarn build

Regards

vue-cli

px2rem

FAQs

Package last updated on 01 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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