
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@finclip/applet-builder-ci
Advanced tools
`@finclip/applet-builder-ci` 是一个 Node.js 库,提供了与编译、上传、审核和发布小程序相关的功能。该库的目标是简化小程序开发和部署的流程。
@finclip/applet-builder-ci
是一个 Node.js 库,提供了与编译、上传、审核和发布小程序相关的功能。该库的目标是简化小程序开发和部署的流程。
首先,确保你的 Node.js 环境已经安装了所需的依赖,包括 @finclip/applet-builder-ci
库。你可以使用以下命令来安装这个库:
npm install @finclip/applet-builder-ci
然后,你可以使用 @finclip/applet-builder-ci 提供的功能。
const { Project } = require("@finclip/applet-builder-ci");
(async () => {
// 项目配置
const projectConfig = {
appid: "your_app_id", // 你的小程序AppID
projectPath: "your_project_path", // 你的小程序项目路径
type: 'miniprogram', // 项目类型,可选值有:miniprogram 小程序、game 小游戏、offlineweb h5应用
output: "output_directory", // 编译结果的输出目录
userInfo: {
openAPISecret: "your_api_secret", // 你的OpenAPI密钥
url: "your_server_url", // 你的服务器URL
},
};
const myProject = new Project(projectConfig);
// 编译配置
const buildOptions = {
zip: true, // 是否输出 zip 包
obfuscate: true, // 是否做代码混淆
DSL: {
// 控制文件后缀名与前缀
alias: [],
prefix: "ft", // wx.修改为ft
wxml: "fxml", // .wxml为.fxml
wxss: "ftss",
wxs: "fts",
finClipConf: "FinClipConf.js",
},
modifyCss: {
// 替换全局样式: modifyCss.md
builtCss: [],
},
exclude: [], //打包时需要忽略的目录与文件 支持glob与正则
trimText: false, //单行文本内容不换行
compileSettings: {
es6: true, // es6转es5
minify: true, // 上传时自动压缩脚本
minifyWXSS: true, // 上传时自动压缩样式
autoPrefixWXSS: true, // 上传时样式自动补全
sourceMap: true, // 开启 sourceMap
},
};
// 编译小程序
await myProject.build(buildOptions);
console.log("build success");
/**
* 一键发布
* @param {string} version 版本号
* @param {string} versionDesc 版本描述 不能为空,否则会造成签名失败
*/
const response = await myProject.publish("0.0.1", "version_desc");
console.log("publish success:", response);
})();
一键发布主要做了三个事情:上传代码 -> 提交审核 -> 审核并发布
一般推荐使用上面代码的myProject.publish
接口直接发布,如果需要对每个步骤进行分别操作,则可以参考下面的示例:
(async () => {
const myProject = new Project(projectConfig);
/**
* 上传小程序
* @param {string} version 版本号
* @param {string} desc 版本描述 不能为空,否则会造成签名失败
* @param {string} distPath 编译好的小程序路径,默认为空
* @param {string} ext 拓展说明字段,可选填入,默认为空
*/
const uploadData = await myProject.upload("0.0.1", "version_desc");
// const uploadData2 = await myProject.upload("0.0.1", "version_desc", "", "");
/**
* 提交审核
* @param {string} miniAppCompiledPackageId 小程序编译包ID,由上传接口返回
* @param {boolean} autoPub 审核通过后是否自动发布
*/
const submitAuditData = await myProject.submitAudit(uploadData.miniAppCompiledPackageId, true);
/**
* 审核并发布
* @param {string} miniAppAuditId 小程序审核ID,由提交审核接口返回
* @param {boolean} pass 是否通过
* @param {string} reason 驳回原因
*/
await myProject.audit(submitAuditData.miniAppAuditId, pass, reason);
})();
const { Project } = require("@finclip/applet-builder-ci");
(async () => {
// 项目配置
const projectConfig = {
projectPath: "your_project_path", // 插件项目路径
output: "output_directory", // 编译结果的输出目录
pluginInfo: {
id: "your_plugin_id", // 插件ID
version: "your_plugin_version", // 插件版本
desc: "your_plugin_desc", // 插件描述
},
userInfo: {
openAPISecret: "your_api_secret", // 你的OpenAPI密钥
url: "your_server_url", // 你的服务器URL
},
};
const myProject = new Project(projectConfig);
// 编译配置
const buildOptions = {
zip: true, // 是否输出 zip 包
obfuscate: true, // 是否做代码混淆
DSL: {
// 控制文件后缀名与前缀
alias: [],
prefix: "ft", // wx.修改为ft
wxml: "fxml", // .wxml为.fxml
wxss: "ftss",
wxs: "fts",
finClipConf: "FinClipConf.js",
},
modifyCss: {
// 替换全局样式: modifyCss.md
builtCss: [],
},
exclude: [], //打包时需要忽略的目录与文件 支持glob与正则
trimText: false, //单行文本内容不换行
compileSettings: {
es6: true, // es6转es5
minify: true, // 上传时自动压缩脚本
minifyWXSS: true, // 上传时自动压缩样式
autoPrefixWXSS: true, // 上传时样式自动补全
sourceMap: true, // 开启 sourceMap
},
};
// 编译插件
await myProject.buildPlugin(buildOptions);
/**
* 上传插件
* @param {*} distPath 编译好的插件路径
* @param {*} ext 拓展说明字段,可选填入,默认为空
* @returns
*/
await myProject.uploadPlugin()
// await myProject.uploadPlugin('', 'ext说明')
console.log('plugin upload success')
})();
(async () => {
/**
*
* @param {string} project - 小程序路径
* @param {Object} options - 编译参数
* @param {[string]} options.ignores - 指定构建npm需要排除的规则
* @param {string} options.reporter - 构建回调信息
* @returns Promise
*/
// 在有需要的时候构建npm
await packNpm(project, {
ignores: ["pack_npm_ignore_list"],
reporter: (infos) => {
console.log(infos);
},
});
})();
const { Project } = require("@finclip/applet-builder-ci");
(async () => {
// 项目配置
const projectConfig = {
appid: "your_app_id", // 你的小程序AppID
userInfo: {
openAPISecret: "your_api_secret", // 你的OpenAPI密钥
url: "your_server_url", // 你的服务器URL
},
};
const myProject = new Project(projectConfig);
/**
* 获取小程序最新的版本号
* @returns {object} 包含线上版本、审核版本、体验版本和最新上传代码包的信息
*/
const versionInfo = await myProject.getAppVersion();
console.log("线上版本:", versionInfo.onlineVersion);
console.log("审核版本:", versionInfo.reviewVersion);
console.log("体验版本:", versionInfo.trialVersion);
console.log("最新上传的代码包信息:", versionInfo.latestCompiledPackage);
})();
const { packNpmManually } = require("@finclip/applet-builder-ci");
(async () => {
/**
*
* @param {Object} options - 编译参数
* @param {string} options.packageJsonPath - 希望被构建的node_modules 对应的 package.json 的路径
* @param {string} options.miniprogramNpmDistDir - 被构建 miniprogram_npm 的输出目标位置
* @param {[string]} options.ignores - 指定需要排除的规则
* @returns Promise
*/
// 在有需要的时候构建npm
await packNpmManually({
packageJsonPath: "./lib/package.json",
miniprogramNpmDistDir: "./miniprogram-project/miniprogram/",
});
})();
FAQs
`@finclip/applet-builder-ci` 是一个 Node.js 库,提供了与编译、上传、审核和发布小程序相关的功能。该库的目标是简化小程序开发和部署的流程。
The npm package @finclip/applet-builder-ci receives a total of 46 weekly downloads. As such, @finclip/applet-builder-ci popularity was classified as not popular.
We found that @finclip/applet-builder-ci demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.