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

an-materials

v0.3.20

Published

materials used in skylla

Downloads

4

Readme

开发说明

使用 @skylla/dev 搭建 物料库开发环境

npm i -d @skylla/dev
# or
yarn add -D @skylla/dev
// package.json
{
  "scripts": {
    "serve": "server",
    "build": "render",
  }
}
# 1. 启动物料库本地浏览服务,默认端口:3000
yarn serve

# 2. 启动物料库开发监听服务
yarn build --watch

开启调试模式

https://printer.domain/visual?debug={material-namepsace}

目录结构

.
├─ index.js - 入口文件
├─ vue.config.js - 环境配置文件(参考 vue-cli 文档)
├─ /dist -(实时)编译输出目录
├─ /deploy - CICD 构建目录
└─ /src - 源码目录
   └─ <material-name> // 组件目录
      └─ index.vue // 组件主文件
      └─ option.vue // 组件配置文件

数据结构

{
  /* 组件名称 */
  "name": <string>,

  /* 源信息 */
  "meta": <object>,

  /* 坐标信息 */
  "axes": <object>,

  /* 数源 - 参考:https://yapi.lcops.xyz/mock/913/getResource */
  "source": <object>,

  /* 配置 - 参考:各组件目录下 readme.md 文件 */
  "option": {
    /* 样式类 */
    "css": <object>,

    /* 预设类 */
    "preset": <object>,

    /* 表单类 */
    "formic": <object>,

    /* 存续类 - 于 非编辑时态 使用 */
    "vars": <object>
  },
};

组件结构

index.vue

export default {
  // 组件注册名
  name: "m-text",

  // 组件源信息
  meta: {
    // 唯一身份标识
    id: "952713",
    // 图标(取自 Antv)
    icon: "FormOutlined",
    // 组件名称
    label: "文本",
    // 排序权重
    index: 100,
    // 可用性
    disabled: false
  },

  // 坐标信息
  axes: {
    x: 0,
    y: 0,
    w: 200,
    h: 160
  },

  // 入参: 整个 props 可以不写, 环境中默认有 mixin 处理
  props: {
    // 数源
    source: {
      type: [Object],
      default() {
        return {};
      }
    },

    // 配置
    option: {
      type: [Object],
      default() {
        return {};
      }
    }
  }
};

option.vue

// 纯净如新 (无需任何入参, 也可接受index.vue的prop)
export default {};

内置能力

  1. STORE 数仓
// 快速更新状态
// 注: `visual` 是 可视化平台 默认 命名空间
this.$store.update("visual", {
  namespace: "printer"
});

// 内置状态
this.preview; // 打印状态识别
this.preset; // 属性预设
this.setting; // 全局设置
this.background; // 背景设置
this.one; // 当前栅格单元
this.axes; // 坐标信息
this.materials; // 组件(物料)信息
  1. HTTP 请求
// Send a Get Request
await this.$http(<address>).get(<params>, <option>);

// Send a Post Request
await this.$http(<address>).post(<params>, <option>);
  1. 更多说明详见:vue-scaff 开发指南

版本发布

  • 物料库发布时,将读取 package.json 中的 version 信息作为版本号
  • 如需构建 latest 版本的,需在 cicd 构建过程中,添加参数 latest 即可