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

@roothub/material

v0.2.26

Published

把每一个物料(模板、页面、区块等)看做项目的一个元素,通过各自的material.json去获取对应的依赖信息,生成最终完整的项目

Downloads

28

Readme

物料CLI

把每一个物料(模板、页面、区块等)看做项目的一个元素,通过各自的material.json去获取对应的依赖信息,生成最终完整的项目

material.json部分字段解释

type MaterialConfigType = {
  path: string;
  title: string;
  type: string; // 物料类型[block、page、component]
  belong?: string; // 归属那套框架下(material-vue等)
  belongLib?: string; // 归属那套库(ant-design-vue/element-ui等)
  namespace?: string;
  name?: string;
  key: string; // 物料名字,要和文件夹名字一致
  description?: string;
  features?: string[];
  tags?: string[];
  img: string;
  private?: boolean;
  dependencies?: string[]; // 三方库依赖
  materialDeps?: string[]; // 物料依赖,格式:ui库:物料类型:物料key, eg: [ant-design-vue:blocks:AdminLogin,ant-design-vue:blocks:AboutUs]
};

注意地方

  1. 目前手动维护manifest.default.json
type MaterialResourcesConfigType = {
  name: string;
  git?: string;
  description: string;
  localPath?: string;
  belong?: 'template' | 'material';
  materialsIncludes?: Array<string>; // 只选择符合当前模板的物料库
}
  1. template模板必须包含src文件和material.json文件,原因组装的物料必须存放在src/materials
  2. 所有物料必须有material.json文件才能被识别

TODO

create

  • [x] 初始化本地物料库及模板
  • [x] 支持命令生成已选模板和物料项目工程
  • [x] 支持命令式用户交互(询问)、直接式命令交互(create -t xxx -l xxx -m xxx)
  • [x] 支持增量添加远程物料库至本地
  • [ ] 物料dependencies下依赖,向下兼容模板工程
  • [ ] 支持本地物料库开发

update

  • [ ] 更新模板物料