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 🙏

© 2026 – Pkg Stats / Ryan Hefner

web2apps

v0.2.3

Published

web2apps — scan a Web/H5 project and scaffold iOS (UIKit) + Android (Kotlin) with a 0-to-1 migration workflow

Readme

web2apps

独立安装的 CLI:扫描 Web/H5,检测或创建 iOS + Android 工程,写出项目卡,再渲染从 0 把 H5 迁到原生的工作流文档。

  • iOS:UIKit + SwiftAppDelegate / SceneDelegate / 代码布局),不用 SwiftUI、不用 Storyboard
  • Android:Kotlin + ViewBinding,不用 Jetpack Compose
  • 两端任务分开:各有一份 inventory 和阶段。iOS 某页成功、Android 同页失败时,只勾 iOS,Android 保持未勾。

npm 包名 web2apps,命令 web2apps。兼容命令 web2appweb2ios 仍指向同一入口。

安装

npm i -g web2apps
npx web2apps onboard --root /path/to/your-h5

开发中改源码后:

cd web2ios && npm pack && npm i -g ./web2apps-0.2.3.tgz

(仓库目录仍可叫 web2ios;发布包名是 web2apps。)

0 → 1 怎么用

终端里直接:

web2apps onboard --root /path/to/your-h5

会分步询问。若检测到已有 iOS 工程,会先问 「iOS 是否已经迁完」:选 y 则 iOS 轨道改为 operate,Android 仍走 migrate,两套清单互不阻塞。没有已有工程时:

  1. 要迁到哪些端:1 两端 / 2 仅 iOS / 3 仅 Android
  2. 工程名(如 Litemall
  3. 类名前缀(如 CxLm

脚本/管道环境没有终端询问,必须把参数写在命令上:

web2apps onboard --root . --platforms all --name Litemall --prefix Lm
web2apps onboard --root . --platforms android --name Litemall --prefix Lm
web2apps onboard --root . --platforms ios --name Litemall --prefix Lm
  • 已有 .xcworkspace / .xcodeproj 或 Android settings.gradle:直接使用,不必再问工程名和前缀
  • 没有:终端会询问;非 TTY 必须写 --name / --prefix。不默认 App / Cx
  • 创建 iOS 需要完整 Xcode 和 CocoaPods;只建 Android 不需要 Xcode
  • --package 可选,Android applicationId;不填则为 app.web2apps.<name>
  • 重建:--reset-ios / --reset-android

不要对尚未迁完的那一端执行 set-phase <端> operate

文档在 docs/web2app-workflow/ios/docs/web2app-workflow/android/。一条 本端 切片完成 = 总控已派 H5 专家和本端源码专家 / review,且取证落盘 + 对齐 H5 + 不丢逻辑 + 图标和背景图来自 H5 + 跨端差异已告知 + 本端真机跑通。总控勾 该端 inventory.md。另一端失败或未做,不挡住本端。

某一端全部勾完:

web2apps set-phase ios operate
web2apps set-phase android operate

两端都迁完:

web2apps set-phase operate

硬约束(禁止发挥):

  • 图标必须用 H5 资源,禁止系统图标 / 自绘顶替
  • 背景图必须把 H5 的图迁过来,禁止用纯色代替
  • H5 机制在原生上必然不同时继续做,但回复里必须单独写「跨端差异」

已 onboard 过的仓库升级后执行 web2apps render(或 sync)刷新文档。旧的根目录 inventory.md 会变成指向两端的跳转;各端自己的 [x] 分开保留。旧的 .web2ios/ 项目卡仍能读;写出时改到 .web2app/

扫描支持 UniApppages.json)和 Vue SPAvue + Vite / src/router / src/App.vue)。

其它命令:scanrendersyncstatus

iOS 已经迁完、还要迁 Android

两端继续都写在项目卡里,但阶段分开:

web2apps onboard --root /path/to/workspace
# 对「iOS 是否已经迁完」答 y,对「还要迁 Android」答 y

或:

web2apps set-phase ios operate
web2apps onboard --root /path/to/workspace --platforms all --name YourApp --prefix Cx
  • iOS:docs/web2app-workflow/ios/ 为 operate,不再走切片
  • Android:docs/web2app-workflow/android/inventory.md 从空清单开始
  • 不要整仓 set-phase operate,也不要对已迁完的 iOS 使用 --reset-ios

已经迁完的产品(operate)

web2apps onboard --root /path/to/workspace \
  --phase operate \
  --h5 your-h5 \
  --workspace your.xcworkspace \
  --scheme YourScheme