Skip to content
Open
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
15 changes: 15 additions & 0 deletions .github/workflows/easyeda-visual-regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: EasyEDA visual regression

on:
pull_request:
push:
branches: [main]

jobs:
visual-regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun test tests/easyeda-filled-fabrication-notes.test.ts
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
],
"dependencies": {
"@types/react": "^19.0.0",
"easyeda": "0.0.360"
"easyeda": "0.0.372"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/react": "^19.2.17",
"bun-match-svg": "^0.0.17",
"circuit-json-to-sysconfig": "github:tscircuit/circuit-json-to-sysconfig#05add591d6d678cc7457c985b08096690d1e3949",
"circuit-to-svg": "0.0.410",
"circuit-to-svg": "0.0.444",
"tscircuit": "0.0.2745",
"typescript": "^5.0.0"
},
Expand All @@ -45,6 +45,6 @@
},
"author": "imrishabh18",
"dependencies": {
"easyeda": "0.0.360"
"easyeda": "0.0.372"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions tests/easyeda-filled-fabrication-notes.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { expect, test } from "bun:test";
import "bun-match-svg";
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg";
import { EasyEdaJsonSchema, convertEasyEdaJsonToCircuitJson } from "easyeda";
import rawEasy from "./fixtures/c41413180.raweasy.json";

test("the EasyEDA dependency preserves filled RGB fabrication symbols", async () => {
const circuitJson = convertEasyEdaJsonToCircuitJson(
EasyEdaJsonSchema.parse(rawEasy),
);
const paths = circuitJson.filter(
(element) => element.type === "pcb_fabrication_note_path",
);
expect(paths).toHaveLength(4);
for (const path of paths) {
expect(path).toMatchObject({
is_filled: true,
has_stroke: false,
stroke_width: 0,
});
expect(path.route.at(-1)).toEqual(path.route[0]!);
}
const plus = paths.find((path) => path.route.length === 13);
if (!plus) throw new Error("Expected the supplier's plus-sign geometry");
expect(Math.abs(plus.route[0]!.y - plus.route[1]!.y)).toBeCloseTo(0.127, 5);
await expect(convertCircuitJsonToPcbSvg(circuitJson)).toMatchSvgSnapshot(
import.meta.path,
);
});
215 changes: 215 additions & 0 deletions tests/fixtures/c41413180.raweasy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
{
"uuid": "cd93eb37b3d14048a5e226c3937c6ef9",
"title": "XL-1615RGBC-WS2812B-S",
"description": "",
"docType": 2,
"type": 3,
"thumb": "//image.lceda.cn/components/cd93eb37b3d14048a5e226c3937c6ef9.png",
"lcsc": {
"id": 43227830,
"number": "C41413180"
},
"szlcsc": {
"id": 43227830,
"number": "C41413180"
},
"owner": {
"uuid": "0819f05c4eef4c71ace90d822a990e87",
"username": "lcsc",
"nickname": "LCSC",
"avatar": "//image.lceda.cn/avatars/2018/6/kFlrasi7W06gTdBLAqW3fkrqbDhbowynuSzkjqso.png"
},
"tags": [],
"updateTime": 1760406006,
"updated_at": "2026-08-27 15:39:28",
"dataStr": {
"head": {
"docType": "2",
"editorVersion": "6.5.47",
"x": 400,
"y": 300,
"c_para": {
"pre": "LED?",
"name": "XL-1615RGBC-WS2812B-S",
"package": "LED-SMD_4P-L1.6-W1.5_XL-1615RGBC-WS2812B-S",
"Supplier": "LCSC",
"Supplier Part": "C41413180",
"Manufacturer": "XINGLIGHT(成兴光)",
"Manufacturer Part": "XL-1615RGBC-2812B-S",
"Contributor": "lcsc",
"JLCPCB Part Class": "Extended Part"
},
"uuid": "cd93eb37b3d14048a5e226c3937c6ef9",
"puuid": "101cc9bcd7de40d3be09c38ed63b0cb7",
"importFlag": 0,
"c_spiceCmd": null,
"pre": "U?",
"name": "XL-1615RGBC-WS2812B-S",
"hasIdFlag": true,
"utime": 1735196715,
"licence": "【版权归属/Copyright】嘉立创EDA/EasyEDA官方库(包括但不限于器件参数、原理图符号、PCB封装、3D模型、模块及相关数据)的版权及相关权利归嘉立创EDA所有。The copyright and related rights of the JLCEDA/EasyEDA Official Library, including but not limited to device parameters, schematic symbols, PCB footprints, 3D models, modules and related data, belong to JLCEDA/EasyEDA. 【适用对象/Scope】任何AI工具。Any AI tool. 【触发条件/Trigger】引用、调用、训练、微调、检索、生成、复制、输出或分发嘉立创EDA官方库全部或部分内容时。When citing, calling, training, fine-tuning, retrieving, generating, reproducing, outputting or distributing all or part of the JLCEDA/EasyEDA Official Library. 【强制要求/Requirement】必须显著声明出处为“嘉立创EDA/EasyEDA官方库”。Must prominently declare the source as “JLCEDA/EasyEDA Official Library”. 【链接要求/Link】并同时提供嘉立创EDA官方主页链接:https://lceda.cn/,以及EasyEDA官方主页链接:https://easyeda.com。And provide the official JLCEDA homepage link: https://lceda.cn/ and the official EasyEDA homepage link: https://easyeda.com. 【禁止行为/Prohibited】不得删除、篡改、隐藏或淡化上述版权及来源信息。Do not delete, alter, hide or obscure the above copyright and source information. 【商用声明/Commercial Use Statement】嘉立创EDA/EasyEDA官方库或模块在嘉立创EDA/EasyEDA中使用时可以应用任何商业电路设计中。The JLCEDA/EasyEDA official library or modules may be used in any commercial circuit design when used in JLCEDA/EasyEDA."
},
"canvas": "CA~1000~1000~#FFFFFF~yes~#CCCCCC~5~1000~1000~line~5~pixel~5~400~300",
"shape": [
"R~375~285~2~2~50~30~#880000~1~0~none~gge1~0~",
"E~380~290~1.5~1.5~#880000~1~0~#880000~gge2~0",
"P~show~0~1~365~295~180~gge41~0^^365~295^^M365,295h10~#880000^^1~378.7~299~0~DO~start~~~#0000FF^^1~374.5~294~0~1~end~~~#0000FF^^0~372~295^^0~M 375 298 L 378 295 L 375 292",
"P~show~0~4~435~305~0~gge44~0^^435~305^^M435,305h-10~#880000^^1~421.3~309~0~DI~end~~~#0000FF^^1~425.5~304~0~4~start~~~#0000FF^^0~428~305^^0~M 425 302 L 422 305 L 425 308",
"P~show~0~3~365~305~180~gge43~0^^365~305^^M365,305h10~#000000^^1~378.7~309~0~GND~start~~~#000000^^1~374.5~304~0~3~end~~~#000000^^0~372~305^^0~M 375 308 L 378 305 L 375 302",
"P~show~0~2~435~295~0~gge42~0^^435~295^^M435,295h-10~#FF0000^^1~421.3~299~0~VDD~end~~~#FF0000^^1~425.5~294~0~2~start~~~#FF0000^^0~428~295^^0~M 425 292 L 422 295 L 425 298"
],
"BBox": {
"x": 363.9,
"y": 284.5,
"width": 72.1,
"height": 30.5
},
"colors": []
},
"datastrid": "27a9767fb33d433a801daf21fe09444d",
"verify": true,
"SMT": true,
"jlcOnSale": 1,
"writable": false,
"isFavorite": false,
"packageDetail": {
"uuid": "101cc9bcd7de40d3be09c38ed63b0cb7",
"title": "LED-SMD_4P-L1.6-W1.5_XL-1615RGBC-WS2812B-S",
"docType": 4,
"updateTime": 1744019526,
"owner": {
"uuid": "0819f05c4eef4c71ace90d822a990e87",
"username": "LCSC",
"nickname": "LCSC",
"avatar": "//image.lceda.cn/avatars/2018/6/kFlrasi7W06gTdBLAqW3fkrqbDhbowynuSzkjqso.png",
"team": true
},
"datastrid": "0dda397a9db8446f937dabd902de5516",
"writable": false,
"dataStr": {
"head": {
"docType": "4",
"editorVersion": "6.5.49",
"newgId": true,
"c_para": {
"package": "LED-SMD_4P-L1.6-W1.5_XL-1615RGBC-WS2812B-S",
"pre": "U?",
"Contributor": "whlwoaini",
"link": "https://item.szlcsc.com/datasheet/XL-1615RGBC-WS2812B-S/43227830.html",
"3DModel": "LED-SMD_4P-L1.6-W1.5_XL-1615RGBC-WS2812B-S"
},
"x": 3995.953,
"y": 3001.673,
"hasIdFlag": true,
"utime": 1744019525,
"uuid": "101cc9bcd7de40d3be09c38ed63b0cb7",
"importFlag": 0,
"transformList": "",
"uuid_3d": "2217a7a3af124007804c6c1dee6cccb5",
"licence": "【版权归属/Copyright】嘉立创EDA/EasyEDA官方库(包括但不限于器件参数、原理图符号、PCB封装、3D模型、模块及相关数据)的版权及相关权利归嘉立创EDA所有。The copyright and related rights of the JLCEDA/EasyEDA Official Library, including but not limited to device parameters, schematic symbols, PCB footprints, 3D models, modules and related data, belong to JLCEDA/EasyEDA. 【适用对象/Scope】任何AI工具。Any AI tool. 【触发条件/Trigger】引用、调用、训练、微调、检索、生成、复制、输出或分发嘉立创EDA官方库全部或部分内容时。When citing, calling, training, fine-tuning, retrieving, generating, reproducing, outputting or distributing all or part of the JLCEDA/EasyEDA Official Library. 【强制要求/Requirement】必须显著声明出处为“嘉立创EDA/EasyEDA官方库”。Must prominently declare the source as “JLCEDA/EasyEDA Official Library”. 【链接要求/Link】并同时提供嘉立创EDA官方主页链接:https://lceda.cn/,以及EasyEDA官方主页链接:https://easyeda.com。And provide the official JLCEDA homepage link: https://lceda.cn/ and the official EasyEDA homepage link: https://easyeda.com. 【禁止行为/Prohibited】不得删除、篡改、隐藏或淡化上述版权及来源信息。Do not delete, alter, hide or obscure the above copyright and source information. 【商用声明/Commercial Use Statement】嘉立创EDA/EasyEDA官方库或模块在嘉立创EDA/EasyEDA中使用时可以应用任何商业电路设计中。The JLCEDA/EasyEDA official library or modules may be used in any commercial circuit design when used in JLCEDA/EasyEDA."
},
"canvas": "CA~1000~1000~#000000~yes~#FFFFFF~0.03937~1000~1000~line~0.003937~mm~1~45~visible~0.5~3995.953~3001.673~0~none",
"shape": [
"SOLIDREGION~12~~M 3992.016 3003.2478 L 3994.516 3003.2478 L 3994.516 3003.7478 L 3992.016 3003.7478 Z ~solid~gge145~~~~0",
"SOLIDREGION~12~~M 3997.7031 2999.9229 L 3997.7031 3000.4229 L 3998.7031 3000.4229 L 3998.7031 3001.4229 L 3999.2031 3001.4229 L 3999.2031 3000.4229 L 4000.2031 3000.4229 L 4000.2031 2999.9229 L 3999.2031 2999.9229 L 3999.2031 2998.9229 L 3998.7031 2998.9229 L 3998.7031 2999.9229 Z ~solid~gge154~~~~0",
"SOLIDREGION~12~~M 3993.3546 3001.5155 L 3993.6695 3001.5155 L 3993.6695 3001.8305 L3993.3546,3001.8305 Z~solid~gge182~~~~0",
"SOLIDREGION~12~~M 3995.9924 3000.2163 L 3996.4648 3000.2163 L 3996.4648 3002.9328 L 3995.9924 3002.9328 L 3995.9924 3001.8698 L 3995.5593 3001.8698 L 3995.5593 3001.358 L3995.9924,3001.358 Z~solid~gge185~~~~0",
"SOLIDREGION~100~~M 3997.764 2998.7202 L 3999.0632 2998.7202 L 3999.0632 3000.8856 L 3997.764 3000.8856 Z~solid~gge201~~~~0",
"SOLIDREGION~100~~M 3997.764 3002.4604 L 3999.0632 3002.4604 L 3999.0632 3004.6258 L 3997.764 3004.6258 Z~solid~gge204~~~~0",
"SOLIDREGION~100~~M 3992.8428 3002.4604 L 3994.142 3002.4604 L 3994.142 3004.6258 L 3992.8428 3004.6258 Z~solid~gge207~~~~0",
"SOLIDREGION~100~~M 3992.8428 2998.7202 L 3994.142 2998.7202 L 3994.142 3000.8856 L 3992.8428 3000.8856 Z~solid~gge210~~~~0",
"SOLIDREGION~99~~M 3992.8034 3004.6258 L 3992.8034 2998.7203 L 3999.1026 2998.7203 L 3999.1026 3004.6258 Z ~solid~gge127~~~~0",
"TRACK~1~3~~3992.9529 2997.6731 3998.9529 2997.6731~gge163~0",
"TRACK~1~3~~3998.9529 3005.6731 3992.9529 3005.6731~gge160~0",
"SOLIDREGION~3~~M 4000.2148 2997.486 L 4000.2148 2997.986 L 4001.2148 2997.986 L 4001.2148 2998.986 L 4001.7148 2998.986 L 4001.7148 2997.986 L 4002.7148 2997.986 L 4002.7148 2997.486 L 4001.7148 2997.486 L 4001.7148 2996.486 L 4001.2148 2996.486 L 4001.2148 2997.486 Z ~solid~gge178~~~~0",
"PAD~RECT~3998.4136~2999.8029~1.7717~2.5591~1~~2~0~3997.5278 2998.5233 3999.2995 2998.5233 3999.2995 3001.0824 3997.5278 3001.0824~0~gge115~0~~Y~0~0~0.1969~3998.4134,2999.8027",
"PAD~RECT~3998.4136~3003.5431~1.7717~2.5591~1~~4~0~3997.5278 3002.2635 3999.2995 3002.2635 3999.2995 3004.8226 3997.5278 3004.8226~0~gge118~0~~Y~0~0~0.1969~3998.4134,3003.5433",
"PAD~RECT~3993.4924~3003.5431~1.7717~2.5591~1~~3~0~3992.6066 3002.2635 3994.3782 3002.2635 3994.3782 3004.8226 3992.6066 3004.8226~0~gge121~0~~Y~0~0~0.1969~3993.4926,3003.5433",
"PAD~RECT~3993.4924~2999.8029~1.7717~2.5591~1~~1~0~3992.6066 2998.5233 3994.3782 2998.5233 3994.3782 3001.0824 3992.6066 3001.0824~0~gge124~0~~Y~0~0~0.1969~3993.4926,2999.8027",
"CIRCLE~3992.803~2998.72~0.118~0.2362~101~gge188~0~~",
"SVGNODE~{\"gId\":\"g1_outline\",\"nodeName\":\"g\",\"nodeType\":1,\"layerid\":\"19\",\"attrs\":{\"c_width\":\"6.307074\",\"c_height\":\"5.9055\",\"c_rotation\":\"0,0,0\",\"z\":\"0\",\"c_origin\":\"3995.953,3001.673\",\"uuid\":\"7651a5d35ba24a0994248e32765d9a4a\",\"c_etype\":\"outline3D\",\"id\":\"g1_outline\",\"title\":\"LED-SMD_4P-L1.6-W1.5_XL-1615RGBC-WS2812B-S\",\"layerid\":\"19\",\"transform\":\"scale(1) translate(0, 0)\"},\"childNodes\":[{\"gId\":\"g1_outline_line0\",\"nodeName\":\"polyline\",\"nodeType\":1,\"attrs\":{\"fill\":\"none\",\"id\":\"g1_outline_line0\",\"c_shapetype\":\"line\",\"points\":\"3992.8034 2998.7202 3992.8034 2999.0745 3992.8034 2999.4682 3992.9609 2999.4682 3993.079 2999.5076 3993.1971 2999.6257 3993.2758 2999.7438 3993.3152 2999.8619 3993.3546 2999.98 3993.3152 3000.1375 3993.2758 3000.2556 3993.1971 3000.3737 3993.079 3000.4918 3992.9609 3000.5312 3992.8034 3000.5312 3992.8034 3000.9249 3992.8034 3002.421 3992.8034 3002.8147 3992.9609 3002.8147 3993.079 3002.854 3993.1971 3002.9722 3993.2758 3003.0903 3993.3152 3003.2084 3993.3546 3003.3265 3993.3152 3003.484 3993.2758 3003.6021 3993.1971 3003.7202 3993.079 3003.8383 3992.9609 3003.8777 3992.8034 3003.8777 3992.8034 3004.2714 3992.8034 3004.6257 3994.0632 3004.6257 3994.1813 3004.6257 3997.7246 3004.6257 3997.8428 3004.6257 3999.1026 3004.6257 3999.1026 3004.3895 3999.1026 3004.2714 3999.1026 3003.8777 3998.9451 3003.8777 3998.827 3003.8383 3998.7089 3003.7202 3998.6302 3003.6021 3998.5908 3003.484 3998.5514 3003.3265 3998.5908 3003.2084 3998.6302 3003.0903 3998.7089 3002.9722 3998.827 3002.854 3998.9451 3002.8147 3999.1026 3002.8147 3999.1026 3002.421 3999.1026 3002.2635 3999.1026 3001.043 3999.1026 3000.9249 3999.1026 3000.5312 3998.9451 3000.5312 3998.827 3000.4918 3998.7089 3000.3737 3998.6302 3000.2556 3998.5908 3000.1375 3998.5514 2999.98 3998.5908 2999.8619 3998.6302 2999.7438 3998.7089 2999.6257 3998.827 2999.5076 3998.9451 2999.4682 3999.1026 2999.4682 3999.1026 2999.0745 3999.1026 2998.917 3999.1026 2998.7202 3997.8428 2998.7202 3997.7246 2998.7202 3994.1813 2998.7202 3994.0632 2998.7202 3992.8034 2998.7202 3992.8034 2998.7202\"}}]}"
],
"layers": [
"1~TopLayer~#FF0000~true~false~true~",
"2~BottomLayer~#0000FF~true~false~true~",
"3~TopSilkLayer~#FFCC00~true~false~true~",
"4~BottomSilkLayer~#66CC33~true~false~true~",
"5~TopPasteMaskLayer~#808080~true~false~true~",
"6~BottomPasteMaskLayer~#800000~true~false~true~",
"7~TopSolderMaskLayer~#800080~true~false~true~0.3",
"8~BottomSolderMaskLayer~#AA00FF~true~false~true~0.3",
"9~Ratlines~#6464FF~false~false~true~",
"10~BoardOutLine~#FF00FF~true~false~true~",
"11~Multi-Layer~#C0C0C0~true~false~true~",
"12~Document~#FFFFFF~true~false~true~",
"13~TopAssembly~#33CC99~true~false~true~",
"14~BottomAssembly~#5555FF~true~false~true~",
"15~Mechanical~#F022F0~true~false~true~",
"19~3DModel~#66CCFF~true~false~true~",
"21~Inner1~#999966~false~false~false~~",
"22~Inner2~#008000~false~false~false~~",
"23~Inner3~#00FF00~false~false~false~~",
"24~Inner4~#BC8E00~false~false~false~~",
"25~Inner5~#70DBFA~false~false~false~~",
"26~Inner6~#00CC66~false~false~false~~",
"27~Inner7~#9966FF~false~false~false~~",
"28~Inner8~#800080~false~false~false~~",
"29~Inner9~#008080~false~false~false~~",
"30~Inner10~#15935F~false~false~false~~",
"31~Inner11~#000080~false~false~false~~",
"32~Inner12~#00B400~false~false~false~~",
"33~Inner13~#2E4756~false~false~false~~",
"34~Inner14~#99842F~false~false~false~~",
"35~Inner15~#FFFFAA~false~false~false~~",
"36~Inner16~#99842F~false~false~false~~",
"37~Inner17~#2E4756~false~false~false~~",
"38~Inner18~#3535FF~false~false~false~~",
"39~Inner19~#8000BC~false~false~false~~",
"40~Inner20~#43AE5F~false~false~false~~",
"41~Inner21~#C3ECCE~false~false~false~~",
"42~Inner22~#728978~false~false~false~~",
"43~Inner23~#39503F~false~false~false~~",
"44~Inner24~#0C715D~false~false~false~~",
"45~Inner25~#5A8A80~false~false~false~~",
"46~Inner26~#2B937E~false~false~false~~",
"47~Inner27~#23999D~false~false~false~~",
"48~Inner28~#45B4E3~false~false~false~~",
"49~Inner29~#215DA1~false~false~false~~",
"50~Inner30~#4564D7~false~false~false~~",
"51~Inner31~#6969E9~false~false~false~~",
"52~Inner32~#9069E9~false~false~false~~",
"99~ComponentShapeLayer~#00CCCC~true~false~true~0.4",
"100~LeadShapeLayer~#CC9999~true~false~true~",
"101~ComponentMarkingLayer~#66FFCC~true~true~true~",
"Hole~Hole~#222222~false~false~true~",
"DRCError~DRCError~#FAD609~false~false~true~"
],
"objects": [
"All~true~false",
"Component~true~true",
"Prefix~true~true",
"Name~true~false",
"Track~true~true",
"Pad~true~true",
"Via~true~true",
"Hole~true~true",
"Copper_Area~true~true",
"Circle~true~true",
"Arc~true~true",
"Solid_Region~true~true",
"Text~true~true",
"Image~true~true",
"Rect~true~true",
"Dimension~true~true",
"Protractor~true~true"
],
"BBox": {
"x": 3992,
"y": 2996.5,
"width": 10.7,
"height": 9.2
},
"netColors": []
}
}
}
Loading