Skip to content

Commit

Permalink
Fix weird displayName issue
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpetryk committed Feb 19, 2024
1 parent e340434 commit 1f2d933
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .api-report/mafs.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ export interface VectorProps extends Stroked {
//
// src/debug/index.tsx:4:19 - (ae-forgotten-export) The symbol "ViewportInfo" needs to be exported by the entry point index.d.ts
// src/debug/index.tsx:4:19 - (ae-forgotten-export) The symbol "TransformWidget" needs to be exported by the entry point index.d.ts
// src/display/Coordinates/index.tsx:9:25 - (ae-forgotten-export) The symbol "Cartesian" needs to be exported by the entry point index.d.ts
// src/display/Coordinates/index.tsx:9:25 - (ae-forgotten-export) The symbol "PolarCoordinates" needs to be exported by the entry point index.d.ts
// src/display/Coordinates/index.tsx:4:25 - (ae-forgotten-export) The symbol "Cartesian" needs to be exported by the entry point index.d.ts
// src/display/Coordinates/index.tsx:4:25 - (ae-forgotten-export) The symbol "PolarCoordinates" needs to be exported by the entry point index.d.ts
// src/display/Line.tsx:6:18 - (ae-forgotten-export) The symbol "PointAngle" needs to be exported by the entry point index.d.ts
// src/display/Line.tsx:6:18 - (ae-forgotten-export) The symbol "PointSlope" needs to be exported by the entry point index.d.ts
// src/display/Line.tsx:6:18 - (ae-forgotten-export) The symbol "ThroughPoints" needs to be exported by the entry point index.d.ts
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"prepublishOnly": "pnpm test && pnpm lint && pnpm build"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.36.4",
"@microsoft/api-extractor": "7.40.2",
"@playwright/experimental-ct-react": "^1.37.0",
"@playwright/test": "^1.37.0",
"@swc/core": "^1.3.76",
Expand Down
46 changes: 23 additions & 23 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions src/debug/TransformWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ export function TransformWidget({ children }: TransformWidgetProps) {
</>
)
}

TransformWidget.displayName = "Debug.TransformWidget"
2 changes: 2 additions & 0 deletions src/debug/ViewportInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ export function ViewportInfo({ precision = 3 }: PaneVisualizerProps) {
</g>
)
}

ViewportInfo.displayName = "Debug.ViewportInfo"
6 changes: 0 additions & 6 deletions src/debug/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@ export const Debug = {
ViewportInfo,
TransformWidget,
}

// @ts-expect-error - setting these here to avoid invalid .d.ts output
Debug.ViewportInfo.displayName = "Debug.ViewportInfo"

// @ts-expect-error - setting these here to avoid invalid .d.ts output
Debug.TransformWidget.displayName = "Debug.TransformWidget"
2 changes: 2 additions & 0 deletions src/display/Coordinates/Cartesian.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export function Cartesian({
)
}

Cartesian.displayName = "Coordinates.Cartesian"

export function snappedRange(min: number, max: number, step: number) {
const roundMin = Math.floor(min / step) * step
const roundMax = Math.ceil(max / step) * step
Expand Down
2 changes: 2 additions & 0 deletions src/display/Coordinates/Polar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ export function PolarCoordinates({
</g>
)
}

PolarCoordinates.displayName = "Coordinates.Polar"
5 changes: 0 additions & 5 deletions src/display/Coordinates/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { Cartesian } from "./Cartesian"
import { PolarCoordinates as Polar } from "./Polar"

// @ts-expect-error - setting these here to avoid invalid .d.ts output
Polar.displayName = "Coordinates.Polar"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Cartesian.displayName = "Coordinates.Cartesian"

export const Coordinates = {
Cartesian,
Polar,
Expand Down
9 changes: 0 additions & 9 deletions src/display/Line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,3 @@ import type { PointSlopeProps } from "./Line/PointSlope"
import type { ThroughPointsProps } from "./Line/ThroughPoints"
import type { SegmentProps } from "./Line/Segment"
export type { PointAngleProps, PointSlopeProps, ThroughPointsProps, SegmentProps }

// @ts-expect-error - setting these here to avoid invalid .d.ts output
Line.PointAngle.displayName = "Line.PointAngle"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Line.PointSlope.displayName = "Line.PointSlope"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Line.Segment.displayName = "Line.Segment"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Line.ThroughPoints.displayName = "Line.ThroughPoints"
2 changes: 2 additions & 0 deletions src/display/Line/PointAngle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ export function PointAngle({ point, angle, ...rest }: PointAngleProps) {
const point2 = vec.add(point, vec.rotate([1, 0], angle))
return <ThroughPoints point1={point} point2={point2} {...rest} />
}

PointAngle.displayName = "Line.PointAngle"
2 changes: 2 additions & 0 deletions src/display/Line/PointSlope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export interface PointSlopeProps extends Stroked {
export function PointSlope({ point, slope, ...rest }: PointSlopeProps) {
return <PointAngle point={point} angle={Math.atan(slope)} {...rest} />
}

PointSlope.displayName = "Line.PointSlope"
2 changes: 1 addition & 1 deletion src/display/Line/Segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ export function Segment({
)
}

export default Segment
Segment.displayName = "Line.Segment"
2 changes: 2 additions & 0 deletions src/display/Line/ThroughPoints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ export function ThroughPoints({
/>
)
}

ThroughPoints.displayName = "Line.ThroughPoints"
11 changes: 0 additions & 11 deletions src/display/Plot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ export const Plot = {
Inequality,
}

// @ts-expect-error - setting these here to avoid invalid .d.ts output
Plot.OfX.displayName = "Plot.OfX"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Plot.OfY.displayName = "Plot.OfY"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Plot.Parametric.displayName = "Plot.Parametric"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Plot.VectorField.displayName = "Plot.VectorField"
// @ts-expect-error - setting these here to avoid invalid .d.ts output
Plot.Inequality.displayName = "Plot.Inequality"

import type { InequalityProps } from "./Plot/Inequality"
import type { OfXProps, OfYProps } from "./Plot/Simple"
import type { ParametricProps } from "./Plot/Parametric"
Expand Down
2 changes: 2 additions & 0 deletions src/display/Plot/Inequality.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,5 @@ export function Inequality({
</g>
)
}

Inequality.displayName = "Plot.Inequality"
2 changes: 2 additions & 0 deletions src/display/Plot/Parametric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ export function Parametric({
/>
)
}

Parametric.displayName = "Plot.Parametric"
4 changes: 4 additions & 0 deletions src/display/Plot/Simple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export function OfX({ y, ...props }: OfXProps) {
return <Parametric xy={xy} t={t} {...props} />
}

OfX.displayName = "Plot.OfX"

export interface OfYProps extends Omit<ParametricProps, "xy" | "t"> {
x: (y: number) => number
svgPathProps?: React.SVGProps<SVGPathElement>
Expand All @@ -34,3 +36,5 @@ export function OfY({ x, ...props }: OfYProps) {

return <Parametric xy={xy} t={t} {...props} />
}

OfY.displayName = "Plot.OfY"
2 changes: 2 additions & 0 deletions src/display/Plot/VectorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export function VectorField({
)
}

VectorField.displayName = "Plot.VectorField"

interface Layer {
d: string
opacity: number
Expand Down

0 comments on commit 1f2d933

Please sign in to comment.