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

@xsyx/common-portal

v0.1.30

Published

```javascript import commonPortal from '@xsyx/common-portal'

Downloads

40

Readme

通用 PORTAL 平台原型

import commonPortal from '@xsyx/common-portal'


// use

<common-portal injections brand system-name nav-src default-open default-active/>
  • injections: 可选,注入配置,调试时期用于模拟数据
  • brand: string, 平台左上角logo
  • system-name: string, 平台名称
  • nav-src: function, 返回一个获取导航配置的 Promise
  • default-open: array, 当前展开的导航项
  • default-active: string, 默认选中项

业务模块通用要求

  1. 名称规范: m-业务名-功能名

如: m-basic-setting, m-basic-userlist

  1. 为了和 one portal 对接, 入口要求以function 包裹,从而接入 portal 应用的上下文,如下

vue 默认

new Vue({
    el: selector,
    render(h){
        return h(App);
    },
})

注入 portal 上下文

export default function(selector, context){
    return new Vue({
        el: selector,
        render(h){
            return h(App);
        },
    })
}

编译选项

  1. 为了集成到 on portal 应用,业务模块必须以 umd 规范输出;
  2. 为了使用 unpkg 动态加载,业务模块必须取消代码分割,同时内联css
  3. 可将 Vue element 作为 externals 输出,减少业务模块打包体积
module.exports = {
    filenameHashing: false,
    configureWebpack: () => ({
        // ...
        // 取消代码分割
        optimization: {
            splitChunks: false
        },
        // 抽出公共资源减少打包体积
        externals: {
            vue: 'Vue',
            'element-ui': 'ELEMENT',
        }
        // ...
    }),
    // 样式内联
    css: {
        extract: false
    },
    // ...
}