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

js-homos

v0.2.3

Published

SDK of HomOS

Downloads

47

Readme

Intro

NPM version NPM downloads Apache-2.0

基于 father 及 wx 小程序接口搭建

┏━━━━━━━━━━ js-homos ━━━━━━━━━━━━━┓
┃                                   ┃
┃ ┌─── WechatMiniprogram.Wx ──────┐ ┃
┃ │ wx.request │ wx.connectSocket │ ┃
┃ └────────────┴──────────────────┘ ┃
┃         ┌─── cloud ───┐           ┃
┃         │  meizgd.com │           ┃
┃         └─────────────┘           ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

在项目使用

pnpm add js-homos

执行 构建npm 后即可引用:

// ~/package-mine/device-replace/index.ts
import { deviceReplace } from 'js-homos'

const res = await deviceReplace({
    newDevId,
    oldDevId,
}, { loading: true })

console.log('deviceReplace', res.result)

如下动图,支持接口 payload、参数、返回数据的类型自动提示:

intellisense

开发&调试

$ pnpm i # 安装开发依赖
$ pnpm add yalc -g # 全局安装yalc,本地调试可代替 `npm link`
$ pnpm dev # 运行项目

$ yalc publish # 发布到本地仓库
$ yalc push # 手动同步,本地发布到关联项目

$ yalc link js-homos # 在要关联的项目下执行

# 在sdk项目下执行即可
$ pnpm build:push # 构建的同时,本地发布到关联项目
$ yalc remove all # 清除项目关联

关联项目中,忽略文件增加:

# ~/.gitignore

yalc.lock
.yalc

构建&发布

$ pnpm build # 构建

$ npm version major # 更新主版本号(major),做了不兼容的API修改
$ npm version minor # 更新次版本号(minor),做了向下兼容的功能性新增
$ npm version patch # 修订号(patch),做了向下兼容的问题修正

$ npm publish # 自动重新构建并发布

$ pnpm add js-homos@latest  # 项目端执行,更新到最新版本

代码结构

js-homos
 ├── docs // 接口文档
 ├── src // 源代码目录
 │    ├── apis // 接口定义
 │    ├── config // 项目配置
 │    ├── request // 请求方法定义
 │    ├── types // 类型定义
 │    ├── utils // 工具方法定义
 │    └── index.ts // 入口文件
 └── .fatherrc.ts // SDK 框架参数定义

相关文档

umijs/father

yalc