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 🙏

© 2025 – Pkg Stats / Ryan Hefner

microservice-platform-front

v1.0.0

Published

A Vue.js project

Downloads

4

Readme

Stargis 公共组件库

组件库改变

由原来的源码直接暴露于项目文件,改为一个独立项目通过npm来控制发布。

项目结构


build                         // webpack 配置文件

config                        // webpack 用户配置文件

node_modules                  // node 模组

publish -
      package.json            // 发布用的信息包

src  -
      components              // vue组件文件

      App.vue                 // 项目测试页面

      main.js                 // 项目dev入口

      register.js             // 项目组件注册器 项目prod入口

static

.postcssrc.js                 // postcss 配置文件

index.html                    // html 模版

package-lock.json             // 工具版本管理

package.json                  // 工具版本管理

1. 开发模式

1.1 启动指令

npm run dev

1.2 组件文件夹

在/src -> components 下编写独立组件。

内部的vue组件于普通vue写法相同。

1.3 register.js (组件注册器)


//引用 components组件文件夹中的组件
import Attachment from './components/Attachment';

const Components = {
  Attachment
  // 将引入的组件填入此 Components 对象中
};

function install (Vue) {

  Object.keys(Components).forEach((key) => {
    Vue.component(key, Components[key]);
  });
}

export default install;

添加新组件,删除组件,重命名组件都要修改组件注册器的引用,否则组件将无法载入甚至报错。

2 生产模式

2.1 打包指令

npm run build

打包过后会产生一个dist文件,包含一个app.js最终文件,内部拥有全部的组件。

3. 发布

3.1 设置npm全局官方源

 npm config set registry http://registry.npmjs.org

发布新版本需要切换至npm官方源

3.2 发布配置文件

/publish -> package.json 发布包的信息文件

{
  "name": "stargis",  // 项目名称
  "version": "0.0.1",  //版本号
  "description": "", //描述
  "main": "app.js", //入口文件
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

3. 发布指令

npm publish

提示: 如果出现 You need to authorize this machine using `npm adduser`

需要执行npm adduser 填入相应账号密码

[email protected] 邮箱密码: stargis123

发布后十分钟左右就可以拉取新的镜像

使用

只需在根目录引入,无需在项目中重复声明,使stargis的公共组件与项目完全解耦

项目中使用

1. 安装

1.1 设置npm全局本地源

npm config set registry http://172.18.215.15:8088/nexus/content/repositories/taobao-npm/

1.2 安装 stargis 组件库

npm install --save stargis

2. 移除原来的依赖方式

去除原有项目中的 ~~components~~ 文件夹

去除原有项目中的 通过 import 引入的 @component 组件和 components 的声明

// 删除对公共组件的声明
components: {
    flowStep,
    suggest,
    attachmentListTable
},

3. 引入

特别注意stargis的组件库要在iview组件后面注册进Vue中

/src/main.js


import iView from 'iview';
import 'iview/dist/styles/iview.css';

import Stargis from 'stargis';

Vue.use(iView); //注意和stargis的先后顺序

Vue.use(Stargis); //注意和iview的先后顺序