Skip to content

Commit

Permalink
release 7.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Aug 2, 2024
1 parent 1fabd46 commit 7cd51fd
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## 2024.08.02 v7.3.0

1. 修复 `miniprogramToken` `miniprogramSession` 参数必填问题

## 2024.07.17 v7.2.0

1. `miniprogramToken` `miniprogramSession` 参数从git配置中取
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/monorepo",
"description": "这是一个git工作流工具",
"version": "7.2.0",
"version": "7.3.0",
"packageManager": "[email protected]",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/api",
"description": "gitmars api",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/api/src/request/miniprogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ let buildConfig: ApolloConfigType
export const post = async <P = unknown>(options: RequestConfig): Promise<P> => {
if (!buildConfig) buildConfig = (await getBuildConfig()) as ApolloConfigType
if (!options.url.startsWith('http')) options.url = buildConfig.miniprogramDomain + options.url
const miniprogramToken = getGitMiniprogramToken() || buildConfig.miniprogramToken
const miniprogramSession = getGitMiniprogramSession() || buildConfig.miniprogramSession
const miniprogramToken = getGitMiniprogramToken(false) || buildConfig.miniprogramToken
const miniprogramSession = getGitMiniprogramSession(false) || buildConfig.miniprogramSession
options.headers = Object.assign(options.headers || {}, {
Authorization: miniprogramToken,
cookie: `kop=${miniprogramSession}`
Expand All @@ -38,8 +38,8 @@ export const post = async <P = unknown>(options: RequestConfig): Promise<P> => {
export const get = async <P = unknown>(options: RequestConfig): Promise<P> => {
if (!buildConfig) buildConfig = (await getBuildConfig()) as ApolloConfigType
if (!options.url.startsWith('http')) options.url = buildConfig.miniprogramDomain + options.url
const miniprogramToken = getGitMiniprogramToken() || buildConfig.miniprogramToken
const miniprogramSession = getGitMiniprogramSession() || buildConfig.miniprogramSession
const miniprogramToken = getGitMiniprogramToken(false) || buildConfig.miniprogramToken
const miniprogramSession = getGitMiniprogramSession(false) || buildConfig.miniprogramSession
options.headers = Object.assign(options.headers || {}, {
Authorization: miniprogramToken,
cookie: `kop=${miniprogramSession}`
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/build",
"description": "gitmars build",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/cache/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/cache",
"description": "gitmars cache",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/core",
"description": "gitmars核心程序",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/docs",
"description": "gitmars文档库",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/git/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/git",
"description": "gitmars git",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/git/src/getGitUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export function getGitEmail(): string {
* @returns - token
*/
export function getGitMiniprogramToken(throwOnError = true): string {
const { stdout } = spawnSync('git', ['config', 'user.miniprogramToken'])
const { stdout = '' } = spawnSync('git', ['config', 'user.miniprogramToken'])
debug('git.miniprogramToken', stdout)

if (!stdout) {
if (!stdout.trim() && throwOnError) {
sh.echo(chalk.red(t('Please set git miniprogram token')))
process.exit(1)
}
Expand All @@ -68,10 +68,10 @@ export function getGitMiniprogramToken(throwOnError = true): string {
* @returns - session
*/
export function getGitMiniprogramSession(throwOnError = true): string {
const { stdout } = spawnSync('git', ['config', 'user.miniprogramSession'])
const { stdout = '' } = spawnSync('git', ['config', 'user.miniprogramSession'])
debug('git.miniprogramSession', stdout)

if (!stdout) {
if (!stdout.trim() && throwOnError) {
sh.echo(chalk.red(t('Please set git miniprogram session')))
process.exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/gitmars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gitmars",
"description": "这是一个git工作流工具",
"type": "module",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"bin": {
"gitm": "lib/gitm.mjs"
Expand Down
2 changes: 1 addition & 1 deletion packages/go/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/go",
"description": "gitmars go",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/hook/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/hook",
"description": "gitmars hook",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/utils",
"description": "gitmars utils",
"version": "7.2.0",
"version": "7.3.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down

0 comments on commit 7cd51fd

Please sign in to comment.