Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: publish utils and snapshot .d.ts files for typescript #3172

Merged
merged 2 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}