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

@wakeadmin/transpiler

v0.7.3

Published

静态资源转译器

Downloads

5

Readme

应用模板转换器

目录结构约定

__apps__ # 子应用目录
  foo/   # 子应用放置在自己目录下
  bar/
    mapp.json # 可选,子应用配置
__entry__ # 主应用目录
__i18n__ # 语言包目录
__theme__ # 主题包目录
__config__ # 配置目录
  config.yml # 可选,主配置文件
  config/  # 可选, 子配置文件,会合并到 config.yml, 优先级比 config.yml 高
    myconfig.yml

内置变量

| 变量名称 | 描述 | 默认值 | | ------------------------------- | ------------------------------------------------------------------------- | ------ | | title?: string | 应用标题 | '' | | version?: string | 基座版本 | '' | | description?: string | 应用描述, 可以用于 head.meta | '' | | keywords?: string | 应用关键字,可以用于 head.meta | '' | | base?: string | 应用的基础路径, 比如 '/portal' | '/' | | domain?: string | 主域名,比如 www.wakedata.com, 不要包含 http、// 协议前缀,以及路径 | '' | | cdnDomain?: string | CDN 域名,比如 cdn.wakedata.com, 不要包含 http、// 协议前缀,以及路径 | '' | | npmTheme?: string | npm 主题包, 指定包名, 比如 demo, [email protected] | 无 | | npmRegistry?: string | npm 镜像地址,默认为 npm 官方镜像。如果你的主题包来源于私有环境,需要指定 | 无 | | debug?: boolean | 调试模式。如果开启,将输出更多日志,以及开启 .map 文件拷贝 | false | | assets?: Record<string, string> | 资源映射 | {} |

自动变量

| 变量名称 | 描述 | | ------------------------------------------------- | ------------------------------------------------------- | | microApps: MicroApp[] | 已注册的微应用,可以手动配置或者自动发现 | | theme: { stylesheets: string[],scripts: string[]} | 主题包内容 | | i18n: {[locale: string]} | 多语言包内容 | | hash: string | 唯一 hash,配置文件变动后会生成 hash, 可以用于缓存管理 | | timestamp: string | 时间戳(毫秒) | | random: number | 随机值 | | year: number | 年份 | | month: number | 月份 | | date: number | 日期 | | themePath: string | 主题路径 | | i18nPath: string | 语言包路径 | | entryPath: string | 基座路径 | | appsPath: string | 子应用路径 |

内置方法

| 名称 | 描述 | | -------------------------------------------- | ------------------------------------------ | | pathJoin(...p: string[]) | 路径连结 | | normalizePath(p: string) | 规范化路径,添加 '/' 前缀,并移除 '/' 后缀 | | removeHeadingSlash(p: string) | 移除 '/'前缀 | | removeTrailingSlash(p: string) | 移除 '/' 后缀 | | addHeadingSlash(p: string) | | | addTrailingSlash(p: string) | | | domainJoin(domain: string, path: string) | 连结域名和路径 | | queryString(object) | 序列化查询字符串 | | queryJoin(url: string, qs: string | object) | 连结 url 和查询字符串 |