Skip to content

Commit

Permalink
fix: fix build script error (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwusanyu-c authored Apr 6, 2023
1 parent 275f1cb commit 2a7a2ff
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "ISC",
"author": "",
"scripts": {
"build": "cross-env tsup-node --config tsup-build.ts && pnpm run rewrite",
"build": "tsup-node --config tsup-build.ts && pnpm run rewrite",
"rewrite": "gulp -require sucrase/register/ts -f gulp-file.ts",
"clean": "rimraf dist"
},
Expand Down
6 changes: 3 additions & 3 deletions build/rewirte-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { relativeDir } from './utils'
import { CLI_DIR_MAP } from './contant'

const formatList = [
{ runPath: path.resolve(process.cwd(), 'dist/**/*.js'), format: '.js' },
{ runPath: path.resolve(process.cwd(), 'dist/**/*.cjs'), format: '.cjs' },
{ runPath: path.resolve(process.cwd(), '../dist/**/*.js'), format: '.js' },
{ runPath: path.resolve(process.cwd(), '../dist/**/*.cjs'), format: '.cjs' },
]

export const parallelTask = () => {
Expand Down Expand Up @@ -34,7 +34,7 @@ export const parallelTask = () => {
}
fileData.contents = Buffer.from(content)
})
.pipe(dest('dist'))
.pipe(dest('../dist'))
}))
})

Expand Down
1 change: 1 addition & 0 deletions build/tsup-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const baseConfig = {
external: ['ora', 'chalk', 'fs-extra'],
format: ['cjs', 'esm'],
clean: true,
minify: true,
outDir: '',

}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as process from 'process'
import { log } from '@pr-checker/utils'
import { getUserName, log } from '@pr-checker/utils'
import { cac } from 'cac'
import { getUserName } from '@pr-checker/utils/git-api'

import { version } from '../../../package.json'
import { loadStorage, saveStorage } from './store/storage'
import { handleSelect } from './select/handle-select'
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/core/select/handle-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GitApi, createRunList, isEmptyObj, log } from '@pr-checker/utils'
import { Table } from 'console-table-printer'
import chalk from 'chalk'
import { createPrOption, createRepoOption, promptsRun, typeOption } from './select-configure'
import type { IPRCheckRes, IPRInfo, IPRListItem } from '@pr-checker/utils/git-api'
import type { IPRCheckRes, IPRInfo, IPRListItem } from '@pr-checker/utils'
import type { Storage } from '../store/storage'
declare type IPRSelect = Record<string, IPRCheckRes[]>

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/core/select/select-configure.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chalk from 'chalk'
import { formatEllipsis, log } from '@pr-checker/utils'
import prompts from 'prompts'
import type { IPRCheckRes } from '@pr-checker/utils/git-api'
import type { IPRCheckRes } from '@pr-checker/utils'
import type * as promptsType from 'prompts'
export const typeOption = [{
type: 'select',
Expand Down

0 comments on commit 2a7a2ff

Please sign in to comment.