Skip to content

Commit

Permalink
fix: change the build config to bundle deps correctly, fix #111 (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW authored Apr 16, 2024
1 parent 6a15bcc commit ed12bc6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
11 changes: 11 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ export default defineBuildConfig({
],
rollup: {
inlineDependencies: true,
json: {
compact: true,
namedExports: false,
preferConst: false,
},
commonjs: {
requireReturnsDefault: 'auto',
},
dts: {
respectExternal: false,
},
},
clean: true,
declaration: true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"typecheck": "tsc",
"prepublishOnly": "nr build",
"release": "bumpp && pnpm publish --no-git-checks",
"test": "vitest"
"test": "unbuild && vitest"
},
"dependencies": {
"@antfu/ni": "^0.21.12",
Expand All @@ -41,7 +41,6 @@
"execa": "^8.0.1",
"picocolors": "^1.0.0",
"prompts": "^2.4.2",
"semver": "^7.6.0",
"ufo": "^1.5.3",
"unconfig": "^0.3.13",
"yargs": "^17.7.2"
Expand All @@ -67,6 +66,7 @@
"npm-package-arg": "^11.0.2",
"npm-registry-fetch": "^16.2.1",
"rimraf": "^5.0.5",
"semver": "^7.6.0",
"taze": "workspace:*",
"typescript": "^5.4.5",
"unbuild": "^2.0.0",
Expand Down
9 changes: 6 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Argv } from 'yargs'
import yargs from 'yargs'
import { hideBin } from 'yargs/helpers'
import c from 'picocolors'
import { version } from '../package.json'
import pkgJson from '../package.json'
import { check } from './commands/check'
import { usage } from './commands/usage'
import { resolveConfig } from './config'
Expand Down Expand Up @@ -142,7 +142,7 @@ yargs(hideBin(process.argv))
)
.showHelpOnFail(false)
.alias('h', 'help')
.version('version', version)
.version('version', pkgJson.version)
.alias('v', 'version')
.help()
.argv
11 changes: 11 additions & 0 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import path from 'node:path'
import { expect, it } from 'vitest'
import { execa } from 'execa'

it('taze cli should just works', async () => {
const binPath = path.resolve(__dirname, '../bin/taze.mjs')

const proc = await execa(process.execPath, [binPath], { stdio: 'pipe' })

expect(proc.stderr).toBe('')
})

0 comments on commit ed12bc6

Please sign in to comment.