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

dl-project

v1.2.4

Published

'微研产品版项目模板脚手架'

Downloads

1

Readme

dl-project 脚手架

微研产品版项目模板脚手架 可以在项目 build/dl-pro.conf.js 文件中对脚手架进行配置

脚手架的基础默认配置

  /**
   * handleConfig: 基础配置项
   */
  let handleConfig = {
    projectNameTest: /^[a-zA-Z_-]+$/, // 项目名称的校验规则
    proJsonPath: 'config/projectJson.json', // json 文件路径
    basePath: 'src/projects', // 输出的文件路径
    tempPath: path.join(__dirname, '../template'), // 模板路径
    // jsonNameTemplate: '$1', // json 配置项的 项目名称模板 $1: projectName
    jsonNameTemplate(projectName, data) {
      console.log('项目名称模板', data)
      return `${projectName} 1235646`
    }, // json 配置项的 项目名称模板 $1: projectName
    prompts: [ // 交互数组
      {
        type: 'input',
        name: 'authorName',
        message: '请输入开发人员名称:'
      },
      {
        type: 'list',
        name: 'type',
        message: '请输入下载方式:',
        choices: ['npm', 'yarn', 'cnpm'],
        default: 2 // 指定默认值 为选项索引号
      },
      {
        type: 'checkbox', // 多选题 返回一个数组
        name: 'dependencies',
        message: '请输入项目依赖:',
        choices: ['npm', 'yarn', 'cnpm']
      },
      {
        type: 'confirm', // 判断题 返回一个布尔值
        name: 'isAlone',
        message: '是否独立开发:'
      },
      {
        type: 'confirm',
        message: '是否在创建项目后直接运行新项目:',
        name: 'runPro'
      }
    ],
    beforeClone() { // 克隆模板前的回调函数
      console.log('克隆模板前的回调函数', data)
      return Promise.resolve()
    },
    handlePro(data) { // json 的配置对象
      const projects = Object.values(projectJson).sort((a, b) => parseInt(b.port) - parseInt(a.port))
      const prot = projects.length ? parseInt(projects[0].port) + 1 : 2300;
      return {
        describtion: data.describtion,
        prefix: `'${data.projectName}'`,
        localPath: `./src/projects/${data.projectName}/`,
        port: prot.toString(),
        rootPath: `src/projects/${data.projectName}`
      }
    },
    handleAfterInit(data) { // 创建新项目的回调函数
      console.log('操作结束', data)
    }
  }

版本记录

| 版本号 | 时间 | 内容 | | --- | --- | --- | | 1.2.4 | 2021.03.31 | 添加JSON配置项的文件名模板属性,和克隆模板前的回调函数 | | 1.1.8 | 2020.12.10 | 脚手架命令添加 config 选项,可设置配置文件所在的路径。默认在项目根目录下 | | 1.1.7 | 2020.12.7 | 导出配置 projectName 的校验规则,并修改默认的校验规则 | | 1.1.6 | 2020.12.5 | 使用 inquirer,ora,commander 美化并重构脚手架 | | 1.1.4 | 2020.12.2 | 增加配置项问题交互是否必填的字段 | | 1.1.2 | 2020.12.2 | 可配置项 bug 修复 | | 1.1.0 | 2020.12.2 | 增加可配置项 | | 1.0.0 | 2020.12.1 | 测试版 |