@tscircuit/rectdiff 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/bun-pver-release.yml +45 -24
- package/dist/index.d.ts +46 -0
- package/dist/index.js +778 -220
- package/lib/RectDiffPipeline.ts +46 -0
- package/lib/solvers/AdjacentLayerContainmentMergeSolver/AdjacentLayerContainmentMergeSolver.ts +456 -0
- package/lib/solvers/OuterLayerContainmentMergeSolver/OuterLayerContainmentMergeSolver.ts +311 -0
- package/lib/types/srj-types.ts +1 -0
- package/package.json +2 -1
- package/pages/bugreports/bugreport50-multi-support-layer-merge.page.tsx +19 -0
- package/pages/pour.page.tsx +18 -0
- package/test-assets/bugreport49-634662.json +412 -0
- package/tests/__snapshots__/board-outline.snap.svg +2 -2
- package/tests/solver/__snapshots__/rectDiffGridSolverPipeline.snap.svg +1 -1
- package/tests/solver/both-points-equivalent/__snapshots__/both-points-equivalent.snap.svg +1 -1
- package/tests/solver/bugreport01-be84eb/__snapshots__/bugreport01-be84eb.snap.svg +1 -1
- package/tests/solver/bugreport02-bc4361/__snapshots__/bugreport02-bc4361.snap.svg +1 -1
- package/tests/solver/bugreport03-fe4a17/__snapshots__/bugreport03-fe4a17.snap.svg +1 -1
- package/tests/solver/bugreport07-d3f3be/__snapshots__/bugreport07-d3f3be.snap.svg +1 -1
- package/tests/solver/bugreport08-e3ec95/__snapshots__/bugreport08-e3ec95.snap.svg +1 -1
- package/tests/solver/bugreport09-618e09/__snapshots__/bugreport09-618e09.snap.svg +1 -1
- package/tests/solver/bugreport10-71239a/__snapshots__/bugreport10-71239a.snap.svg +1 -1
- package/tests/solver/bugreport11-b2de3c/__snapshots__/bugreport11-b2de3c.snap.svg +1 -1
- package/tests/solver/bugreport12-35ce1c/__snapshots__/bugreport12-35ce1c.snap.svg +1 -1
- package/tests/solver/bugreport13-b9a758/__snapshots__/bugreport13-b9a758.snap.svg +1 -1
- package/tests/solver/bugreport16-d95f38/__snapshots__/bugreport16-d95f38.snap.svg +1 -1
- package/tests/solver/bugreport19/__snapshots__/bugreport19.snap.svg +1 -1
- package/tests/solver/bugreport20-obstacle-clipping/__snapshots__/bugreport20-obstacle-clipping.snap.svg +1 -1
- package/tests/solver/bugreport21-board-outline/__snapshots__/bugreport21-board-outline.snap.svg +2 -2
- package/tests/solver/bugreport22-2a75ce/__snapshots__/bugreport22-2a75ce.snap.svg +1 -1
- package/tests/solver/bugreport23-LGA15x4/__snapshots__/bugreport23-LGA15x4.snap.svg +1 -1
- package/tests/solver/bugreport24-05597c/__snapshots__/bugreport24-05597c.snap.svg +1 -1
- package/tests/solver/bugreport25-4b1d55/__snapshots__/bugreport25-4b1d55.snap.svg +1 -1
- package/tests/solver/bugreport36-bf8303/__snapshots__/bugreport36-bf8303.snap.svg +1 -1
- package/tests/solver/bugreport49-634662/__snapshots__/bugreport49-634662.snap.svg +44 -0
- package/tests/solver/bugreport49-634662/bugreport49-634662.test.ts +134 -0
- package/tests/solver/bugreport50-multi-support-layer-merge/__snapshots__/bugreport50-multi-support-layer-merge.snap.svg +44 -0
- package/tests/solver/bugreport50-multi-support-layer-merge/bugreport50-multi-support-layer-merge.json +972 -0
- package/tests/solver/bugreport50-multi-support-layer-merge/bugreport50-multi-support-layer-merge.test.ts +125 -0
- package/tests/solver/interaction/__snapshots__/interaction.snap.svg +1 -1
- package/tests/solver/multi-point/__snapshots__/multi-point.snap.svg +1 -1
- package/tests/solver/no-better-path/__snapshots__/no-better-path.snap.svg +1 -1
- package/tests/solver/transitivity/__snapshots__/transitivity.snap.svg +2 -2
|
@@ -4,6 +4,7 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
|
+
- '!version-bumps/**'
|
|
7
8
|
workflow_dispatch:
|
|
8
9
|
|
|
9
10
|
env:
|
|
@@ -13,35 +14,39 @@ env:
|
|
|
13
14
|
jobs:
|
|
14
15
|
publish:
|
|
15
16
|
runs-on: ubuntu-latest
|
|
16
|
-
if: ${{ !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'v')) }}
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v4
|
|
19
|
-
with:
|
|
20
|
-
token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
|
|
21
19
|
- name: Setup bun
|
|
22
20
|
uses: oven-sh/setup-bun@v2
|
|
23
21
|
with:
|
|
24
|
-
bun-version:
|
|
25
|
-
- uses: actions/setup-node@
|
|
22
|
+
bun-version: latest
|
|
23
|
+
- uses: actions/setup-node@v4
|
|
26
24
|
with:
|
|
27
25
|
node-version: 20
|
|
28
26
|
registry-url: https://registry.npmjs.org/
|
|
29
27
|
- run: npm install -g pver
|
|
30
|
-
- run: bun install
|
|
28
|
+
- run: bun install --frozen-lockfile
|
|
31
29
|
- run: bun run build
|
|
32
30
|
- run: pver release --no-push-main
|
|
33
31
|
env:
|
|
34
32
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
35
33
|
GITHUB_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
|
|
36
34
|
|
|
35
|
+
- name: Get package version
|
|
36
|
+
id: package-version
|
|
37
|
+
run: |
|
|
38
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
39
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
40
|
+
|
|
41
|
+
|
|
37
42
|
- name: Create Pull Request
|
|
38
43
|
id: create-pr
|
|
39
|
-
uses: peter-evans/create-pull-request@
|
|
44
|
+
uses: peter-evans/create-pull-request@v6
|
|
40
45
|
with:
|
|
41
46
|
commit-message: "chore: bump version"
|
|
42
|
-
title: "chore: bump version"
|
|
47
|
+
title: "chore: bump version to v${{ steps.package-version.outputs.version }}"
|
|
43
48
|
body: "Automated package update"
|
|
44
|
-
branch:
|
|
49
|
+
branch: version-bumps/v${{ steps.package-version.outputs.version }}
|
|
45
50
|
base: main
|
|
46
51
|
token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
|
|
47
52
|
committer: tscircuitbot <githubbot@tscircuit.com>
|
|
@@ -54,18 +59,34 @@ jobs:
|
|
|
54
59
|
env:
|
|
55
60
|
GH_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
- name: Trigger upstream repo updates
|
|
63
|
+
if: env.UPSTREAM_REPOS && env.UPSTREAM_PACKAGES_TO_UPDATE
|
|
64
|
+
run: |
|
|
65
|
+
IFS=',' read -ra REPOS <<< "${{ env.UPSTREAM_REPOS }}"
|
|
66
|
+
for repo in "${REPOS[@]}"; do
|
|
67
|
+
if [[ -n "$repo" ]]; then
|
|
68
|
+
echo "Triggering update for repo: $repo"
|
|
69
|
+
curl -X POST \
|
|
70
|
+
-H "Accept: application/vnd.github.v3+json" \
|
|
71
|
+
-H "Authorization: token ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}" \
|
|
72
|
+
-H "Content-Type: application/json" \
|
|
73
|
+
"https://api.github.com/repos/tscircuit/$repo/actions/workflows/update-package.yml/dispatches" \
|
|
74
|
+
-d "{\"ref\":\"main\",\"inputs\":{\"package_names\":\"${{ env.UPSTREAM_PACKAGES_TO_UPDATE }}\"}}"
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
77
|
+
- name: Notify release-tracker of version update
|
|
78
|
+
# Continue-on-error just in case the tracker is down
|
|
79
|
+
continue-on-error: true
|
|
80
|
+
run: |
|
|
81
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
82
|
+
PACKAGE_JSON=$(cat package.json)
|
|
83
|
+
curl -X POST https://release-tracker.tscircuit.com/release_events/create \
|
|
84
|
+
-H "Content-Type: application/json" \
|
|
85
|
+
-d "{
|
|
86
|
+
\"event\": {
|
|
87
|
+
\"event_type\": \"versions_updated\",
|
|
88
|
+
\"repo\": \"tscircuit/circuit-json-to-kicad\",
|
|
89
|
+
\"version\": \"$VERSION\",
|
|
90
|
+
\"package_json\": $PACKAGE_JSON
|
|
91
|
+
}
|
|
92
|
+
}"
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ interface Obstacle {
|
|
|
34
34
|
height: number;
|
|
35
35
|
connectedTo: TraceId[];
|
|
36
36
|
netIsAssignable?: boolean;
|
|
37
|
+
isCopperPour?: boolean;
|
|
37
38
|
offBoardConnectsTo?: TraceId[];
|
|
38
39
|
}
|
|
39
40
|
interface SimpleRouteConnection {
|
|
@@ -116,6 +117,26 @@ type RTreeRect = XYRect & {
|
|
|
116
117
|
zLayers: number[];
|
|
117
118
|
};
|
|
118
119
|
|
|
120
|
+
type AdjacentLayerContainmentMergeSolverInput = {
|
|
121
|
+
meshNodes: CapacityMeshNode[];
|
|
122
|
+
simpleRouteJson: SimpleRouteJson;
|
|
123
|
+
minFragmentArea?: number;
|
|
124
|
+
};
|
|
125
|
+
declare class AdjacentLayerContainmentMergeSolver extends BaseSolver {
|
|
126
|
+
private input;
|
|
127
|
+
private outputNodes;
|
|
128
|
+
private promotedNodeIds;
|
|
129
|
+
private residualNodeIds;
|
|
130
|
+
constructor(input: AdjacentLayerContainmentMergeSolverInput);
|
|
131
|
+
_setup(): void;
|
|
132
|
+
_step(): void;
|
|
133
|
+
private processAdjacentLayerContainmentMerges;
|
|
134
|
+
getOutput(): {
|
|
135
|
+
outputNodes: CapacityMeshNode[];
|
|
136
|
+
};
|
|
137
|
+
visualize(): GraphicsObject;
|
|
138
|
+
}
|
|
139
|
+
|
|
119
140
|
interface SegmentWithAdjacentEmptySpace {
|
|
120
141
|
parent: CapacityMeshNode;
|
|
121
142
|
start: {
|
|
@@ -215,6 +236,29 @@ declare class GapFillSolverPipeline extends BasePipelineSolver<GapFillSolverInpu
|
|
|
215
236
|
finalVisualize(): GraphicsObject;
|
|
216
237
|
}
|
|
217
238
|
|
|
239
|
+
type OuterLayerContainmentMergeSolverInput = {
|
|
240
|
+
meshNodes: CapacityMeshNode[];
|
|
241
|
+
simpleRouteJson: SimpleRouteJson;
|
|
242
|
+
zIndexByName: Map<string, number>;
|
|
243
|
+
obstacleClearance?: number;
|
|
244
|
+
};
|
|
245
|
+
declare class OuterLayerContainmentMergeSolver extends BaseSolver {
|
|
246
|
+
private input;
|
|
247
|
+
private outputNodes;
|
|
248
|
+
private promotedNodeIds;
|
|
249
|
+
private residualNodeIds;
|
|
250
|
+
constructor(input: OuterLayerContainmentMergeSolverInput);
|
|
251
|
+
_setup(): void;
|
|
252
|
+
_step(): void;
|
|
253
|
+
private processOuterLayerContainmentMerges;
|
|
254
|
+
private buildObstaclesByLayer;
|
|
255
|
+
private isTransitCompatibleAcrossIntermediateLayers;
|
|
256
|
+
getOutput(): {
|
|
257
|
+
outputNodes: CapacityMeshNode[];
|
|
258
|
+
};
|
|
259
|
+
visualize(): GraphicsObject;
|
|
260
|
+
}
|
|
261
|
+
|
|
218
262
|
type RectDiffSeedingSolverInput = {
|
|
219
263
|
simpleRouteJson: SimpleRouteJson;
|
|
220
264
|
obstacleIndexByLayer: Array<RBush<RTreeRect>>;
|
|
@@ -365,6 +409,8 @@ interface RectDiffPipelineInput {
|
|
|
365
409
|
declare class RectDiffPipeline extends BasePipelineSolver<RectDiffPipelineInput> {
|
|
366
410
|
rectDiffGridSolverPipeline?: RectDiffGridSolverPipeline;
|
|
367
411
|
gapFillSolver?: GapFillSolverPipeline;
|
|
412
|
+
outerLayerContainmentMergeSolver?: OuterLayerContainmentMergeSolver;
|
|
413
|
+
adjacentLayerContainmentMergeSolver?: AdjacentLayerContainmentMergeSolver;
|
|
368
414
|
boardVoidRects: XYRect[] | undefined;
|
|
369
415
|
zIndexByName?: Map<string, number>;
|
|
370
416
|
layerNames?: string[];
|