Skip to content

Commit

Permalink
chore: meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
zce committed Sep 21, 2023
1 parent 6d74537 commit 529b37f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"src/cli.ts"
],
"clean": true,
"minify": true,
"minify": false,
"splitting": true,
"dts": {
"entry": "src/index.ts",
Expand All @@ -67,32 +67,32 @@
]
},
"devDependencies": {
"@commitlint/cli": "17.6.7",
"@commitlint/config-conventional": "17.6.7",
"@types/adm-zip": "0.5.0",
"@commitlint/cli": "17.7.1",
"@commitlint/config-conventional": "17.7.0",
"@types/adm-zip": "0.5.1",
"@types/ini": "1.3.31",
"@types/lodash": "4.14.196",
"@types/node": "20.4.5",
"@types/semver": "7.5.0",
"@types/lodash": "4.14.198",
"@types/node": "20.6.3",
"@types/semver": "7.5.2",
"@types/validate-npm-package-name": "4.0.0",
"adm-zip": "0.5.10",
"cac": "6.7.14",
"env-paths": "3.0.0",
"fast-glob": "3.3.1",
"husky": "8.0.3",
"ini": "4.1.1",
"lint-staged": "13.2.3",
"lint-staged": "14.0.1",
"lodash": "4.17.21",
"node-fetch": "3.3.2",
"ora": "6.3.1",
"ora": "7.0.1",
"prompts": "2.4.2",
"semver": "7.5.4",
"socks-proxy-agent": "8.0.1",
"socks-proxy-agent": "8.0.2",
"ts-standard": "12.0.2",
"tsup": "7.1.0",
"typescript": "5.1.6",
"tsup": "7.2.0",
"typescript": "5.2.2",
"validate-npm-package-name": "5.0.0",
"vitest": "0.33.0"
"vitest": "0.34.4"
},
"engines": {
"node": ">=16"
Expand Down
6 changes: 3 additions & 3 deletions src/complete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ test('unit:complete:string', async () => {
})

test('unit:complete:callback', async () => {
const callback = vi.fn<(ctx: Context) => string | Promise<string> | Promise<void>>()
const callback = vi.fn<[ctx: Context], string | Promise<string> | Promise<void>>()
const ctx = context({}, { complete: callback })
await complete(ctx)
expect(callback.mock.calls[0][0]).toBe(ctx)
})

test('unit:complete:callback-return', async () => {
// eslint-disable-next-line @typescript-eslint/no-extra-parens
const callback = vi.fn<(ctx: Context) => string | Promise<string> | Promise<void>>(() => 'completed')
const callback = vi.fn<[ctx: Context], string | Promise<string> | Promise<void>>(() => 'completed')
const ctx = context({}, { complete: callback })
await complete(ctx)
expect(callback).toHaveBeenCalled()
Expand All @@ -55,7 +55,7 @@ test('unit:complete:callback-return', async () => {

test('unit:complete:callback-promise', async () => {
// eslint-disable-next-line @typescript-eslint/no-extra-parens
const callback = vi.fn<(ctx: Context) => string | Promise<string> | Promise<void>>(async () => 'completed')
const callback = vi.fn<[ctx: Context], string | Promise<string> | Promise<void>>(async () => 'completed')
const ctx = context({}, { complete: callback })
await complete(ctx)
expect(callback).toHaveBeenCalled()
Expand Down
1 change: 0 additions & 1 deletion src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const config = parseIni(path.join(os.homedir(), `.${name}rc`)) ?? {}
// env proxy config
const envProxy = process.env.http_proxy ?? process.env.HTTP_PROXY ?? process.env.https_proxy ?? process.env.HTTPS_PROXY ?? process.env.ALL_PROXY
config.proxy = envProxy ?? config.proxy

if (process.env.no_proxy != null || process.env.NO_PROXY != null) {
delete config.proxy // disable proxy
}
Expand Down
2 changes: 1 addition & 1 deletion src/prepare.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test('unit:prepare:custom', async () => {
})

test('unit:prepare:hook', async () => {
const callback = vi.fn<(ctx: Context) => Promise<void>>()
const callback = vi.fn<[ctx: Context], Promise<void>>()
const ctx = context({}, { prepare: callback })
await prepare(ctx)
expect(callback.mock.calls[0][0]).toBe(ctx)
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"esModuleInterop": true,
"allowJs": true,
"strict": true
}
}

0 comments on commit 529b37f

Please sign in to comment.