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

syc-cms-dept2

v2.3.2-dept2-beta.1

Published

## 代码管理

Downloads

5

Readme

CMS2.0 外部控件

代码管理

  • 代码应该存放于 https://gitlab.syc-cms.com/fe 前端分组下
  • 现有一个 cms2.0-widgets 的仓库
  • 可以分多个仓库,也可以单个仓库
  • 也可以用分支划分不同的项目
  • 一个仓库可以包含多个控件

打包机制

  • 使用构建工具打包输出 js ,该 js 包含其导出的一个或多个控件,相当于一个控件包
  • 打包之后的结果会排除 Vue,最终与基座使用同一个 Vue
  • 所以 Vue 的版本应该操持一致,避免开发时与打包后因版本不同而导致不一致
  • 输出的结果应如下
    • dist
      • Widget1
        • index.js
        • ...
      • Widget2
        • index.js
        • ...

加载机制

  • 打包后的外部控件,应放置于服务器 wwwroot/widgets 目录下
  • 基座会通过接口返回的外部控件 WidgetX/index.js url 列表,然后通过 import('WidgetX/index.js') 进行引入
  • 基座将引入的控件包的控件注册到控件库
  • 控件库中即可看到引入的控件,并且可以进行使用

示例代码

git clone https://gitlab.syc-cms.com:8443/fe/cms2.0-widgets.git

开发文档

  • 一个控件包含以下内容
type Widget = {
  is: string
  name: string
  category: string
  icon: string
  canvasView: DefineComponent // 画布视图 import X from 'X.vue'
  settingsView: DefineComponent // 设置视图 import XSettings from 'X.settings.vue'
}
  • is 是控件的唯一标识,如果相同将会被覆盖
  • 其它与内部控件相同