npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ygyg/yg-cli

v2.6.0

Published

A simple CLI for front-end engineering automation construction tool.

Downloads

55

Readme

yg-cli

前端工程自动化构建工具 该构建模版可选择 react.js 或 vue.js 的 PC 端模版, react.js 相关的移动端模版

  • 安装

npm install yg-cli -g

  • 配置文件 .ygclirc

当前环境指定的配置文件,dev 与 build 会更新文件 例子:examples

module.exports = { envfile: {path: 'examples/defaultSetting.json',key:'channelName'} };

egg 环境

module.exports = { envfile: {path: 'app/web/utils/defaultSetting.json',key:'channelName'} };
  • 用法

yg dev

直接输入

yg dev -- -x ygego:alpha

交互式

yg dev

手工输入 [saas 门户渠道:环境]

$ ygego:alpha

不输入,直接回车,默认按选择交互方式

选择 ygego
选择 alpha

yg build

直接输入

yg build -- -x ygego:alpha

交互式

yg build

手工输入 [saas 门户渠道:环境]

$ ygego:alpha

不输入,直接回车,默认按选择交互方式

选择 ygego
选择 alpha

yg urls 生成 httpUrls

apiprefix: {
    url:'http://{channelName}.ygego.{channelServer}',
    envs:[
        'alpha1','alpha2','alpha3','alpha4','alpha5','alpha5',
        'test1','test2','test3','test4','test5','test5','test6',
    ],
},

由 apiprefix 的 envs 指定

生成至指定的 defaultSetting.json 中

yg-cli 支持 非渠道设置

dev build 交互选择 ok

dev -- -x ygego:alpha ok build -- -x ygego:alpha ok

  needChannel: false, // 2.0.7
  channels: {
    default: {name: 'yunadmin', value: 1}, // 平台后台
  },

lint 设置

ygclirc 设置

lints: {
    lintpath: './app/web/src',
  },

或者在package.json设置

"ygcliConfig": {
    "lints": {
      "lintpath": "./src"
    }
  },

默认值:"lintpath": "./src"

release

支持monorepo

支持独立的package包,采用semantic-release

faq: 继承非relase的历史版本号?

如果第一次发,会采用1.0.0, 为继承已有版本号,建议standard-version -r 'patch',用于设置lastrelease.

Semantic Git environment variables

| Variable | Description | Default | |-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------| | GIT_AUTHOR_NAME | The author name associated with the Git release tag. See Git environment variables. | @semantic-release-bot. | | GIT_AUTHOR_EMAIL | The author email associated with the Git release tag. See Git environment variables. | @semantic-release-bot email address. | | GIT_COMMITTER_NAME | The committer name associated with the Git release tag. See Git environment variables. | @semantic-release-bot. | | GIT_COMMITTER_EMAIL | The committer email associated with the Git release tag. See Git environment variables. | @semantic-release-bot email address. |

TODO:yg init

前端自动化构建流程:

1. 获取远程模板信息
2. 选择所需远程模板
3. 判断本地模板仓库是否有该模板?
若没有进入第 4 步;
若有,则进入确认是否覆盖?
若确认覆盖则进入第 4 步,
反之跳到第 6 步
4. 输入模板远程仓库中你所需的分支,默认是 master
5. 下载模板至本地模板库
6. 回答四个问题:
A)项目名称;
B)项目版本;
C)项目描述;
D)项目路径
7. 进入构建过程
8. 构建完毕,进入开发阶段