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

@spaas/materilas

v1.2.2

Published

This is a material project

Downloads

12

Readme

自定义物料初始模板

简介

用于自定义物料,支持自定义区块、布局、模板

目前只用来开发自定义区块

使用

安装开发者工具

$ npm install @spaas/spaas-devtools -g

在项目根目录下配置好 ossConfig.js 文件

// 文件内容如下
// 对应的OSS_REGION,OSS_KEY,OSS_SECRET,OSS_BUCKET,OSS_DIR分别为
module.exports = {
  region: OSS_REGION,
  accessKeyId: OSS_KEY,
  accessKeySecret: OSS_SECRET,
  bucket: OSS_BUCKET,
  dir: OSS_DIR,
};

区块预览

$ cd blocks/ExampleBlock
$ npm install
$ npm run start

模板预览

$ cd scaffolds/ExampleScaffold
$ npm install
$ npm run start

添加物料

# 根据提示自定义添加
# 需要到根目录下添加
$ spaas add

添加区块物料

  1. 在根目录执行如下命令
spaas add
  1. 在 shell 选中“block” 选项

  2. 填写好输入的完整信息

根据提示填写好所有信息,就会在项目根目录下  的 block 文件夹中生成对应的区块项目

  1. 进入到 block 文件夹下生成的区块项目,进行开发
# 安装相应的依赖
npm install
# 启动项目进行开发
npm run start
  1. 开发完毕区块后不用发 npm 包

注意:区块开发不需要 npm 包发布,只需要在项目目录下执行如下命令即可

npm run prepublishOnly
  1. 如果执行上一步没报错,即可将代码提交到 git 远程仓库

TODO 后面需要一个人改 build/materilas.json 文件

添加组件物料

  1. 在项目根目录下执行如下命令
spaas add
  1. 在 shell 选中“component”选项

  2. 填写好输入的完整信息

根据提示填写好所有信息,就会在项目根目录下  的 component 文件夹中生成对应的区块项目

  1. 进入到 component 文件夹下生成的组件项目,进行开发
# 安装相应的依赖
npm install
# 启动项目进行开发
npm run start

注意:现在的组件脚手架已经去除 elementUI 的依赖,需要自己进行引入。

引入 ElementUI

npm install element-ui --save

新增一个文件:styleguide/element.js

import Vue from 'vue';
import Element from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(Element);

修改配置文件:styleguide.config.js

module.exports = {
  // ...
  require: ['./styleguide/element.js'],
};

如需要添加其他依赖,详情请看链接

  1. 开发完毕组件后需要发布对应的 npm 包
# 1、需要手动升级package.json文件中的version版本(具体的version版本定义如下:)
# 2、执行发版命令(在事先应该进行npm login,以及npm不能是淘宝源)
npm publish --access=public

注意:布局组件统一命名: ContainerXXX

将新增的包添加到飞冰库进行管理

  1. 进入到整个物料库项目的根目录更改 package.json 的版本号

A.B.C 第一位为大版,第二位为小版(例如我们新添加了组件就是小版本),第三位为修复 bug,或者完善小功能

  1. 执行如下命令
npm run deploy
  1. 如果提示 success 则发版成功

注意:发布成功后,如果需要在飞冰上看到对应的区块/组件,则需要选择对应的分类,点击右上角的刷新列表按钮。

详情

  1. 将本地代码提到远程仓库