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

@cloudbase/framework-plugin-mp

v1.9.7

Published

云开发 Tencent CloudBase Framework MiniProgram Plugin 插件,可以一键部署项目下的微信小程序应用。

Downloads

9

Readme

Tencent CloudBase Framework MP Plugin

Tencent CloudBase Framework MiniProgram Plugin

Github License Npm version issue PRs Welcome star

云开发 CloudBase Framework 框架「小程序」插件: 通过云开发 CloudBase Framework 框架一键部署微信小程序应用。

功能特性

使用方法

步骤一. 准备工作

具体步骤请参照 准备云开发环境和 CloudBase CLI 命令工具

步骤二. 进入项目目录进行初始化

如果是目前已有的小程序应用项目

cloudbase

步骤三. 一键部署

cloudbase framework deploy

配置

默认情况下仅需要配置 appidprivateKeyPath 即可使用,以下配置参数针对有特殊需求的场景

配置示例

cloudbase init 之后会创建云开发的配置文件 cloudbaserc.json,可在配置文件的 plugins 里修改和写入插件配置

{
  "envId": "{{envId}}",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-mp",
        "inputs": {
          "appid": "",
          "privateKeyPath": "",
          "localPath": "./",
          "ignores": ["node_modules/**/*"],
          "deployMode": "preview",
          "previewOptions": {
            "desc": "CloudBase Framework 一键预览",
            "setting": {
              "es6": true
            },
            "qrcodeOutputPath": "./qrcode.jpg",
            "pagePath": "pages/index/index"
          }
        }
      }
    }
  }
}

默认模板的 appidprivateKeyPath 为空,需要开发者填入

配置参数说明

appid

必填,小程序应用的 appid

privateKey

选填,小程序应用的部署私钥内容,需要经过 base64 编码

可以使用 小程序部署密钥转换小工具 来转换为 Base64

privateKeyPath

选填,小程序应用的部署私钥的本地相对路径,默认值 "./private.key"

commands

选填,对象格式

自定义命令,声明应用安装/构建的自定义命令,会在当前项目目录下进行执行

commands.install

安装命令,如npm install,没有可不传

默认会在小程序目录执行 npm install --prefer-offline --no-audit --progress=false

commands.build

构建命令,如npm run build,没有可不传

localPath

选填,小程序项目 project.config.json 所在的本地路径,默认值 ./

ignores

选填,小程序应用部署时忽略的文件路径,支持通配符,默认值["node_modules/**/*"]

deployMode

选填,小程序应用的部署模式,支持 preview|upload 2 种部署模式

previewOptions

deployMode 填写为 preview 时需要填写previewOptions,类型是对象格式

| 属性名称 | 类型 | 是否必填 | 描述 | | ---------------- | ----------------------------- | -------- | -------------------------------- | | desc | String | 否 | 小程序应用的版本描述 | | setting | IMiniProgramBuildSetting 对象 | 否 | 小程序应用的编译设置 | | qrcodeOutputPath | String | 否 | 生成的预览二维码保存在本地的路径 | | pagePath | String | 否 | 小程序应用的预览页面地址 | | searchQuery | String | 否 | 小程序应用的预览页面参数 | | scene | Number | 否 | 小程序应用的预览页面场景值 |

例如

{
  "envId": "{{envId}}",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-mp",
        "inputs": {
          "appid": "",
          "privateKey": "",
          "localPath": "./",
          "ignores": ["node_modules/**/*"],
          "deployMode": "preview",
          "previewOptions": {
            "desc": "一键预览",
            "setting": {
              "es6": false
            },
            "qrcodeOutputPath": "./qrcode.jpg",
            "pagePath": "pages/index/index",
            "searchQuery": "",
            "scene": 1011
          }
        }
      }
    }
  }
}

uploadOptions

deployMode 填写为 upload 时需要填写uploadOptions,类型是对象格式

| 属性名称 | 类型 | 是否必填 | 描述 | | -------- | ----------------------------- | -------- | ---------------------- | | version | String 对象 | 否 | 小程序应用上传的版本号 | | desc | String 对象 | 否 | 小程序应用的版本描述 | | setting | IMiniProgramBuildSetting 对象 | 否 | 小程序应用的编译设置 |

例如

{
  "envId": "{{envId}}",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-mp",
        "inputs": {
          "appid": "",
          "privateKey": "",
          "localPath": "./",
          "ignores": ["node_modules/**/*"],
          "deployMode": "upload",
          "uploadOptions": {
            "version": "1.0.0",
            "desc": "CloudBase Framework 一键上传",
            "setting": {
              "es6": false
            }
          }
        }
      }
    }
  }
}

更多插件

请访问 CloudBase Framework 插件列表 搭配使用其他插件

文档资料