chore: add cloud function config (#2397)

This commit is contained in:
neverland 2019-11-27 10:19:00 +08:00 committed by GitHub
parent ef1e747869
commit 71b727bd69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 366 additions and 1 deletions

1
.gitignore vendored
View File

@ -4,7 +4,6 @@
.idea
.vscode
node_modules
project.config.json
docs/dist
example/dist
.history

View File

@ -0,0 +1,16 @@
// 这是一个测试用的云函数
const cloud = require('wx-server-sdk');
cloud.init();
// 云函数入口函数
exports.main = async event => {
const wxContext = cloud.getWXContext();
return {
event,
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID
};
};

View File

@ -0,0 +1,14 @@
{
"name": "foo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "latest"
}
}

336
example/project.config.json Normal file
View File

@ -0,0 +1,336 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"nodeModules": true
},
"compileType": "miniprogram",
"cloudfunctionRoot": "functions/",
"libVersion": "2.8.2",
"appid": "wx1c01b35002d3ba14",
"projectname": "vant-weapp",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": 42,
"list": [
{
"id": -1,
"name": "button",
"pathName": "pages/button/index",
"query": ""
},
{
"id": -1,
"name": "loading",
"pathName": "pages/loading/index",
"query": ""
},
{
"id": -1,
"name": "icon",
"pathName": "pages/icon/index",
"query": ""
},
{
"id": 3,
"name": "layout",
"pathName": "pages/col/index",
"query": ""
},
{
"id": -1,
"name": "cell",
"pathName": "pages/cell/index",
"query": ""
},
{
"id": -1,
"name": "card",
"pathName": "pages/card/index",
"query": ""
},
{
"id": -1,
"name": "stepper",
"pathName": "pages/stepper/index",
"query": ""
},
{
"id": -1,
"name": "switch",
"pathName": "pages/switch/index",
"query": ""
},
{
"id": -1,
"name": "tag",
"pathName": "pages/tag/index",
"query": ""
},
{
"id": -1,
"name": "notice-bar",
"pathName": "pages/notice-bar/index",
"query": ""
},
{
"id": -1,
"name": "tree-select",
"pathName": "pages/tree-select/index",
"query": ""
},
{
"id": -1,
"name": "select",
"pathName": "pages/select/index",
"query": ""
},
{
"id": -1,
"name": "field",
"pathName": "pages/field/index",
"query": ""
},
{
"id": 13,
"name": "sidebar",
"pathName": "pages/sidebar/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "panel",
"pathName": "pages/panel/index",
"query": ""
},
{
"id": -1,
"name": "popup",
"pathName": "pages/popup/index",
"query": ""
},
{
"id": 16,
"name": "action-sheet",
"pathName": "pages/action-sheet/index",
"query": ""
},
{
"id": -1,
"name": "steps",
"pathName": "pages/steps/index",
"query": ""
},
{
"id": -1,
"name": "search",
"pathName": "pages/search/index",
"query": ""
},
{
"id": -1,
"name": "nav-bar",
"pathName": "pages/nav-bar/index",
"query": ""
},
{
"id": -1,
"name": "notify",
"pathName": "pages/notify/index",
"query": ""
},
{
"id": -1,
"name": "toast",
"pathName": "pages/toast/index",
"query": ""
},
{
"id": -1,
"name": "tabbar",
"pathName": "pages/tabbar/index",
"query": ""
},
{
"id": -1,
"name": "transition",
"pathName": "pages/transition/index",
"query": ""
},
{
"id": -1,
"name": "slider",
"pathName": "pages/slider/index",
"query": ""
},
{
"id": -1,
"name": "switch-cell",
"pathName": "pages/switch-cell/index",
"query": ""
},
{
"id": -1,
"name": "progress",
"pathName": "pages/progress/index",
"query": ""
},
{
"id": -1,
"name": "area",
"pathName": "pages/area/index",
"query": ""
},
{
"id": -1,
"name": "tab",
"pathName": "pages/tab/index",
"query": ""
},
{
"id": -1,
"name": "dialog",
"pathName": "pages/dialog/index",
"query": ""
},
{
"id": -1,
"name": "submit-bar",
"pathName": "pages/submit-bar/index",
"query": ""
},
{
"id": -1,
"name": "checkbox",
"pathName": "pages/checkbox/index",
"query": ""
},
{
"id": -1,
"name": "goods-action",
"pathName": "pages/goods-action/index",
"query": ""
},
{
"id": -1,
"name": "radio",
"pathName": "pages/radio/index",
"query": ""
},
{
"id": -1,
"name": "swipe-cell",
"pathName": "pages/swipe-cell/index",
"query": ""
},
{
"id": -1,
"name": "rate",
"pathName": "pages/rate/index",
"query": ""
},
{
"id": -1,
"name": "collapse",
"pathName": "pages/collapse/index",
"query": ""
},
{
"id": -1,
"name": "datetime-picker",
"pathName": "pages/datetime-picker/index",
"query": ""
},
{
"id": -1,
"name": "sticky",
"pathName": "pages/sticky/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "picker",
"pathName": "pages/picker/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "overlay",
"pathName": "pages/overlay/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "circle",
"pathName": "pages/circle/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "grid",
"pathName": "pages/grid/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "count-down",
"pathName": "pages/count-down/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "image",
"pathName": "pages/image/index",
"query": "",
"scene": null
},
{
"id": 45,
"name": "skeleton",
"pathName": "pages/skeleton/index",
"query": "",
"scene": null
}
]
}
}
}