Skip to content

Commit

Permalink
fix: publish utils and snapshot .d.ts files for typescript (#3172)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Apr 11, 2023
1 parent 000bca9 commit 7af6444
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 0 deletions packages/snapshot/environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dist/environment.js'
1 change: 1 addition & 0 deletions packages/snapshot/manager.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dist/manager.js'
3 changes: 2 additions & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
"dist",
"*.d.ts"
],
"scripts": {
"build": "rimraf dist && rollup -c",
Expand Down
11 changes: 6 additions & 5 deletions packages/utils/src/descriptors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import concordance, { type DisplayOptions } from 'concordance'
import concordance from 'concordance'
import { getColors } from './colors'

interface DisplayOptions {
theme?: any
maxDepth?: number
}

export function getConcordanceTheme() {
const c = getColors()

Expand Down Expand Up @@ -87,7 +92,3 @@ export function getConcordanceTheme() {
export function diffDescriptors(actual: unknown, expected: unknown, options: DisplayOptions) {
return concordance.diff(expected, actual, options)
}

export function formatDescriptor(value: unknown, options: DisplayOptions) {
return concordance.formatDescriptor(value, options)
}
2 changes: 0 additions & 2 deletions packages/utils/src/diff.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { getColors } from './colors'
import { diffDescriptors, getConcordanceTheme } from './descriptors'

export * from './descriptors'

export interface DiffOptions {
showLegend?: boolean
}
Expand Down
8 changes: 1 addition & 7 deletions packages/utils/src/external.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
declare module 'concordance' {
interface DisplayOptions {
theme?: any
maxDepth?: number
}

export function diff(expected: unknown, actual: unknown, options?: DisplayOptions): string
export function formatDescriptor(descriptor: unknown, options?: DisplayOptions): string
export function diff(expected: unknown, actual: unknown, options?: any): string
}

0 comments on commit 7af6444

Please sign in to comment.