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

ridge-build

v1.0.0

Published

Ridge Component Build & Debug Tool

Downloads

4

Readme

Ridge Component Build & Debug Tool

参数

build-fc --help
 
 Usage: build.js [options] [command]
  
 Commands:
   help     Display help
   version  Display version
  
 Options:
   -d, --dir [value]  The Front Component Project Root Path (defaults to "./")
   -h, --help         Output usage information
   -p, --port         Package Provider Host Port
   -r, --remote       Enable Remote Debug
   -s, --src          No Minimize
   -v, --version      Output the version number
   -w, --watch        Build with Watch
-d 指定组件包所在目录。 默认在组件包目录执行此命令无需提供

-p 本地调试服务端口

-r 启动远程调试

-s 源代码方式构建 (组件调试需要)

-w 代码变动重新编译

可以将以下常用命令加入 package.json

{
    "name": "ridge-component-containers",
    "version": "1.0.2",
    "description": "容器组件",
    "releaseNote": "新增弹出层",
    "releaseTime": "2022-05-01",
    "apolloVersion": "V8.0.415.0",
    "scripts": {
        "storybook": "start-storybook -p 9003",
        "build": "build-fc",
        "watch": "build-fc -w",
        "help": "build-fc --help",
        "debug": "build-fc -w -s -p 8700",
        "bs": "build-fc -s",
        "pd": "npm publish --tag dev"
    },
    "keywords": [
        "Container"
    ],
    ....
}

Webpack配置修改

工具使用webpack对组件进行配置,如果需要对配置进行进一步修改,可以在组件项目根目录放置 apollo.config.js 进行配置覆盖

例如:

const path = require('path');

module.exports = {
    configureWebpack: {
        resolve: {
            alias: {
                '@common': path.resolve(__dirname, './src')
            }
        }
    }
}

这时,如果用storybook构建,也要同步补充修改story的配置保持一致

// .storybook/main.js
const path = require('path'),
{ merge } = require('webpack-merge'),
apolloConfig = require('../apollo.config');

module.exports = {
  "stories": [
    "../src/**/*.stories.mdx",
    "../src/**/*.stories.@(js|jsx|ts|tsx)"
  ],
  "addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials"
  ],
  "core": {
    "builder": "webpack5"
  },
  webpackFinal: async (config, { configType }) => {
    config.module.rules.push({
      test: /\.scss$/,
      use: ['style-loader', 'css-loader', 'sass-loader'],
      include: path.resolve(__dirname, '../'),
    });

    return merge(config, apolloConfig.configureWebpack);
  }
}

变更记录

  • 2.1.6 支持组件根目录下 apollo.config.js 文件,在其中配置configWebpack进行webpack属性合并修改
  • 2.1.5 支持用字符串替换的方式将所有JS文件中ACN(E)编译转换为CCV
  • 2.1.4 watch/debug模式忽略 package.json变化
  • 2.1.3 增加对主题ccvlist处理