chore: type args
This commit is contained in:
parent
6e5f03f14c
commit
da7571fba5
2 changed files with 7 additions and 4 deletions
5
src/index.d.ts
vendored
5
src/index.d.ts
vendored
|
@ -1,3 +1,8 @@
|
||||||
|
export type PackwatchArguments = {
|
||||||
|
cwd?: string
|
||||||
|
isUpdatingManifest?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export type Report = {
|
export type Report = {
|
||||||
packageSize: string
|
packageSize: string
|
||||||
unpackedSize?: string
|
unpackedSize?: string
|
||||||
|
|
|
@ -6,16 +6,14 @@ import {
|
||||||
getCurrentPackageStats,
|
getCurrentPackageStats,
|
||||||
getPreviousPackageStats,
|
getPreviousPackageStats,
|
||||||
} from './utils'
|
} from './utils'
|
||||||
|
import type { PackwatchArguments } from './index.d'
|
||||||
|
|
||||||
const MANIFEST_FILENAME = '.packwatch.json'
|
const MANIFEST_FILENAME = '.packwatch.json'
|
||||||
|
|
||||||
export default async function packwatch({
|
export default async function packwatch({
|
||||||
cwd,
|
cwd,
|
||||||
isUpdatingManifest,
|
isUpdatingManifest,
|
||||||
}: {
|
}: PackwatchArguments): Promise<void> {
|
||||||
cwd?: string
|
|
||||||
isUpdatingManifest?: boolean
|
|
||||||
}): Promise<void> {
|
|
||||||
const packageJsonPath = resolve(join(cwd, 'package.json'))
|
const packageJsonPath = resolve(join(cwd, 'package.json'))
|
||||||
const manifestPath = resolve(join(cwd, MANIFEST_FILENAME))
|
const manifestPath = resolve(join(cwd, MANIFEST_FILENAME))
|
||||||
|
|
||||||
|
|
Reference in a new issue