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

@hyext/ext-sdk-cli

v0.6.22

Published

小程序SDK构建工具

Downloads

3,456

Readme

小程序SDK构建工具

安装

npm install -D @hyext/ext-sdk-cli

命令行

创建项目

npx extsdk init

本地开发:

npx extsdk start
  • SDK访问路径:
    • pc: http://localhost:8088/hyExt-pc.js
    • web: http://localhost:8088/hyExt-web.js

生成发布包

  • 生成发布到线上用于构建的文件
npx extsdk release

生成JSON配置

  • 将所有modules文件的JSDoc注释转为JSON配置到dist/json/***.json
npx extsdk parse

示例 src/modules/exampleApi.js

export default {
  /**
   * 示例API
   * @param {string} data 传参
   * @returns {string} 返回数据
   */
  exampleApi(data) {
    return `result ${data}`;
  }
}

编译结果 dist/json/exampleApi.json

[
  {
    "comment": "/**\n   * 示例API\n   * @param {string} data 传参\n   * @returns {string} 返回数据\n   */",
    "meta": null,
    "description": "示例API",
    "params": [
      {
        "type": {
          "names": [
            "string"
          ]
        },
        "description": "传参",
        "name": "data"
      }
    ],
    "returns": [
      {
        "type": {
          "names": [
            "string"
          ]
        },
        "description": "返回数据"
      }
    ],
    "name": "exampleApi",
    "longname": "hyExt.exampleApi",
    "kind": "function",
    "memberof": "hyExt",
    "scope": "static"
  }
]

生成DTS声明文件

  • 将所有modules文件的JSDoc注释转为DTS声明文件到 dist/rn/types.d.ts
npx extsdk dts

其他

  • 本地测试项目构建,慎用,
$ npx extsdk build -e test 
  • 上传编译文件,需要制定CDN配置, 慎用
npx extsdk deploy -e test 

传参

Options:
  -e, --env <string>        环境变量 开发: env, 测试: test, 生产: prod, 默认 dev (default: "dev")
  -t, --taskName <string>   指定任务名,不填执行所有任务
  -u, --user <string>       CND服务用户名
  -p, --password <string>   CND服务密码
  -i, --CDNIps <string>     CND服务服务IPS
  -m, --CDNModule <string>  CND服务module
  -H, --CDNHost <string>    CND服务域名
  -P, --CDNPath <string>    上传CND目录,默认 /hyext-sdk/${taskName}/
  -h, --help                output usage information

构建流程(测试)

  1. 生成入口文件 entry/**;
  2. (metro) 生成要发布到 npm 的文件 /dist/rn
  3. 生成声明文件 types.d.ts
  4. 生成编译文件 /dist/**

发布流程

  1. release 生成可上传文件到 release/ 下
  2. 上传发布文件到构建服务进行构建