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

dubo-cli

v1.1.2

Published

Dubo CLI is the Standard Tooling for Mobile Web Development.

Downloads

7

Readme

Dubo CLI is the Standard Tooling for Mobile Web Development.

language npm package NPM downloads license

start

English | 简体中文

✨ Features

  • Use webpack@4 as bundler and integrate features of dynamic import, decorator, code-spliting.
  • Available to choose javascript or typescript as programming language.
  • Select vue and react as one of UI library.
  • Clearly structured directory.
  • Integrate font subsetting workflow in webpack.
  • Integrate upyun auto upload workflow in webpack.
  • Support service worker configuration.
  • Use node-gettext to implemente i18n plan.

📦 Install

npm install dubo-cli -g

🔨 Usage

Initialize one project:

$ dubo-cli init helloworld

And quickly create one page:

$ dubo-cli page user

Or quickly create one component:

$ dubo-cli component modal

Pull code from imgcook

dubo-cli pull <moduleid> [--path <path> <imgPath>]
  • moduleid is generated by imgcook when you saved your project.
  • path and imgPath. Optional, current path default, relative path.

🤜🏼 Structured directory

Take ts-react-scss for example, structured directory as follows:

├── build                                                 // webpack bundler file
│   ├── config.js
│   ├── constants.js
│   ├── fontmin-webpack-plugin.js                           // customize font subsetting plugin
│   ├── fontmin.txt                                         // what text do you want to subset
│   ├── index.html                                          // template file
│   ├── loaders.js                                          // loaders file
│   ├── optimization.js
│   ├── plugins.js                                          // plugins file
│   ├── scripts                                             // customize scripts, use for detact assets variation
│   │   ├── assets-hash.txt                                 // assets folder hash
│   │   ├── fontmin-hash.txt                                // fontmin.txt hash
│   │   └── index.js
│   ├── upload.js                                           // upyun upload script
│   ├── upyun-upload-webpack-plugin.js                      // upyun upload customize plugin
│   ├── utils.js
│   └── webpack.config.js
├── dubo.config.js                                          // dubo project configuration file
├── package.json
├── postcss.config.js
├── src
│   ├── App.tsx                                             // component main entry
│   ├── README.md
│   ├── assets                                              // assets folder for font, img or media
│   │   ├── font
│   │   └── img
│   ├── components                                          // components folder for common component or sub component
│   │   └── @shared
│   ├── constant
│   ├── index.tsx                                           // app main entry
│   ├── lib                                                 // customize library
│   ├── locales                                             // i18n file
│   ├── pages                                               // pages folder for page component
│   ├── router.tsx                                          // router file
│   ├── service-register.js                                 // service worker file
│   ├── services                                            // network io
│   ├── store                                               // state management
│   ├── styles                                              // common style
│   ├── sw.js
│   ├── types                                               // typescript types file here
│   └── utils                                               // utils library
├── tsconfig.json
└── tslint.json

dubo.config.js file use for configuration of App:

const
  fs = require('fs'),
  env = process.env.NODE_ENV,
  isProd = process.env.NODE_ENV === 'production';

const STATIC_URL = '';

/**
 * @warning baseConfig cannot be delete, use for dubo-cli to create new page or component
 */
const baseConfig = {
  lang: 'ts',                                           // project language
  ui: 'react',                                          // project ui library
  preprocessor: 'scss'                                  // project preprocessor
}

const devConfig = {
  ...baseConfig,
  pwa: false,                                           // open pwa
  project: 'ts-react-scss' || 'dubo',                   // project name
  env,                                                  // enviroment variable
  assetsPath: '/src/assets/',                           // assets path
  distPublicPath: '/dist/',                             // build path
  sourceMap: true,
  openssl: false,                                       // use https
  /*
    webpack-dev-server 是否开启 https,具体本机生成证书方法和配置方法详见:
    https://juejin.im/post/5a6db896518825732d7fd8e0
    https://webpack.docschina.org/configuration/dev-server/
  */
  https: {
    key: '',    // local https root secret
    cert: '',   // local https secret
    ca: '',     // local https certiciate
  }
}

const prodConfig = {
  ...baseConfig,
  ...devConfig,
  pwa: true,
  env,
  staticUrl: STATIC_URL,                                // cdn path
  assetsPath: STATIC_URL,
  distPublicPath: `/activity/${'ts-react-scss' || 'dubo'}/dist/`,
  sourceMap: false,
  bundleAnalyzerReport: false,                          // generate webpack bundleAnalyzerReport
  cdn: {                                                // upyun ftp account
    service: process.env.UPYUN_SERVICE || '',
    operator: process.env.UPYUN_OPERATOR || '',
    passwd: process.env.UPYUN_PASSWD || '',
    remoteFilePath: '',                                 // upyun ftp remote path
    filePath: ''                                        // upyun ftp local path
  },
}

module.exports = isProd ? prodConfig : devConfig