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

@meta-adapter/asset-agent-cli

v1.0.20

Published

> TODO: description

Downloads

20

Readme

asset-agent-cli

资源分组规则

  1. 多个同类资源可以放在一个文件夹里作为资源组,但是必须加后缀指定组的类型 "_list" 或者 "_map"
  2. 后续计划支持资源类型 altas,plist,spine,unity,font,bm-font
├── assets                         // 资源根目录(命名不限)
│   ├── loading-scene              // 资源分类,可以是场景,预加载或其他
│   │   ├── texture                // 纹理图片
│   │   │   ├── blast_list         // _list 资源列表,如序列帧,随机列表
│   │   │   │   ├── blast001.png 
│   │   │   │   └── blast002.png 
│   │   │   ├── btn_map            // _map 某一类资源集合,如按钮集合,武器 M468 零件资源集合
│   │   │   │   ├── copy.png 
│   │   │   │   └── play.jpg 
│   │   │   └── logo.png
│   │   ├── audio                  // 音频
│   │   │   └── hit.mp3
│   │   ├── video                  // 视频
│   │   │   └── intro.mp4
│   │   ├── altas                  // (待支持) 图集
│   │   ├── plist                  // (待支持) 配置文件
│   │   ├── spine                  // (待支持) 骨骼资源(spine or dragonbone)
│   │   ├── laya-unity             // (待支持) laya-unity 插件导出的资源
│   │   ├── bm-font                // (待支持) 位图字体
│   │   └── ....
│   ├── game                       // game
│   │   └── ....

安装

# 全局安装(推荐)
npm install @meta-adapter/asset-agent-cli -g

使用方式,可采用 cli 或者 脚本

cli 方式

# 查看配置选项
asset-agent -h

# 不依赖编辑器的引擎使用
asset-agent ./src/assets -t

# 兼容特定引擎(目前支持 layaair)
asset-agent ./bin/assets -t ./src/typings -e xxx

script 方式

  1. 在项目根目录下新建 asset-agent-cli.js、复制如下内容
const register = require('@meta-adapter/asset-agent-cli');
const path = require('path');
const assetsPath = path.resolve(__dirname, '../laya/assets');
const distPath = path.resolve(__dirname, '../bin');
register.once(assetsPath, distPath, {
  enableType: true,
  engine: 'layaair'
});
  1. 修改 packages.json 文件,新增如下
{
  "scripts": {
    "asset-cli": "node asset-agent-cli.js"
  }
}

LayaAir 引擎实践

asset-agent ./bin/assets -t ./src/typings -e layaair
├── bin
│   ├── assets(文件夹命名可更改,脚本对应即可)
│   │   ├── loading-scene
│   │   │   ├── texture 
│   │   │   │   └── play.jpg 
│   │   │   └── audio 
│   │   │       └── play.mp3 
│   │   └── main-scene
│   └── ....
├── laya(编辑器资源)
│   ├── assets
│   │   ├── assets (双击设置不打包)(文件夹命名可更改,脚本对应即可。目录和 bin 目录下的保持一致,编辑器编译会做合并)
│   │   │   └── loading-scene
│   │   │       └── texture 
│   │   │            └── logo.jpg 
│   │   └── comp
│   └── pages
├── src
│   ├── typings
│   └── ....
└── ...