-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wtto00
committed
Mar 23, 2023
1 parent
7f482e3
commit fdb23f1
Showing
10 changed files
with
1,642 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
label: 'chore' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## 更新 | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Package Version Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
version-check: | ||
runs-on: ubuntu-latest | ||
name: Version Check | ||
steps: | ||
- uses: actions/[email protected] | ||
# 检查npm包的版本号和本地packages.json的版本号是否重复 | ||
# https://github.com/marketplace/actions/version-check | ||
- id: cpv | ||
uses: PostHog/check-package-version@v2 | ||
|
||
- name: cpv false output | ||
if: steps.cpv.outputs.is-new-version == 'false' || steps.cpv.outputs.committed-version < steps.cpv.outputs.published-version | ||
run: | | ||
echo "Committed version: ${{ steps.cpv.outputs.committed-version }}" | ||
echo "Published version: ${{ steps.cpv.outputs.published-version }}" | ||
echo "Is new version: ${{ steps.cpv.outputs.is-new-version }}" | ||
exit 1 | ||
- name: cpv output | ||
if: steps.cpv.outputs.is-new-version == 'true' | ||
run: | | ||
echo "Committed version: ${{ steps.cpv.outputs.committed-version }}" | ||
echo "Published version: ${{ steps.cpv.outputs.published-version }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: Node.js Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-gpr: | ||
runs-on: ubuntu-latest | ||
name: Publish Github Package | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'pnpm' | ||
registry-url: https://npm.pkg.github.com/ | ||
- run: npm pkg set publishConfig.registry=https://npm.pkg.github.com | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
public-npm: | ||
runs-on: ubuntu-latest | ||
name: Publish Npm Package | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: git config --global user.name "GitHub CD bot" | ||
- run: git config --global user.email "[email protected]" | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"arrowParens": "always", | ||
"semi": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,44 @@ | ||
# jweixin-module | ||
微信jssdk 附带ts类型 | ||
# jweixin-esm | ||
|
||
微信 JSSDK, ESM 模块, 附带 TS 类型以及详细注释 | ||
|
||
    | ||
|
||
## Install | ||
|
||
```shell | ||
pnpm add jweixin-esm | ||
# npm i jweixin-esm | ||
# yarn add jweixin-esm | ||
``` | ||
|
||
## Useage | ||
|
||
```typescript | ||
import weixin from 'jweixin-esm' | ||
// or: | ||
// import 'jweixin-esm' | ||
|
||
// weixin的类型是WX,已全局声明 | ||
|
||
console.log(weixin) // 导入的名称 | ||
console.log(window.wx) // wx已全局暴露 | ||
console.log(window.jWeixin) // jWeixin已全局暴露 | ||
|
||
// 这里 weixin=window.wx=window.jWeixin | ||
// 所有的类型全部在WX中,可以直接使用,不用额外导入或配置。已全局声明。 | ||
|
||
const configData: WX.ConfigOptions = { | ||
debug: true, | ||
appId: '', | ||
timestamp: '', | ||
nonceStr: '', | ||
signature: '', | ||
jsApiList: [] // WX.JsApi[] | ||
} | ||
weixin.config(configData) | ||
``` | ||
|
||
## About | ||
|
||
基于微信官方的 JSSDK [jweixin-1.6.0.js](http://res.wx.qq.com/open/js/jweixin-1.6.0.js) 改造。[官方文档](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"jsx": "preserve", | ||
"checkJs": true, | ||
"lib": ["DOM", "ESNext"] | ||
} | ||
} |
Oops, something went wrong.