easyeda 0.0.55 → 0.0.57
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/dist/cli/main.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
convertEasyEdaJsonToVariousFormats,
|
|
4
4
|
fetchEasyEDAComponent
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-LLXDIHGV.js";
|
|
6
6
|
|
|
7
7
|
// cli/main.ts
|
|
8
8
|
import { Command } from "commander";
|
|
@@ -12,7 +12,7 @@ import fs from "fs/promises";
|
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "easyeda",
|
|
14
14
|
type: "module",
|
|
15
|
-
version: "0.0.
|
|
15
|
+
version: "0.0.56",
|
|
16
16
|
files: [
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
package/dist/cli/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../cli/main.ts","../../package.json"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\"\nimport { fetchEasyEDAComponent } from \"../lib/fetch-easyeda-json\"\nimport { convertEasyEdaJsonToTscircuitSoupJson } from \"../lib/convert-easyeda-json-to-tscircuit-soup-json\"\nimport fs from \"fs/promises\"\nimport packageJson from \"../package.json\"\nimport { EasyEdaJsonSchema } from \"lib/schemas/easy-eda-json-schema\"\nimport { convertRawEasyToTsx } from \"lib/convert-to-typescript-component\"\nimport * as path from \"path\"\nimport { normalizeManufacturerPartNumber } from \"lib\"\nimport { convertEasyEdaJsonToVariousFormats } from \"lib/convert-easyeda-json-to-various-formats\"\n\nconst program = new Command()\n\nprogram\n .name(\"easyeda\")\n .description(\"Convert EasyEDA JSON PCB footprints into various formats\")\n .version(packageJson.version)\n\nprogram\n .command(\"convert\")\n .description(\"Convert EasyEDA JSON to various formats\")\n .option(\"-i, --input <jlcpcbPartNumber>\", \"JLCPCB part number\")\n .option(\"-o, --output <filename>\", \"Output filename\")\n .option(\n \"--output-format <format>\",\n \"Output format (can be inferred from filename)\",\n )\n .action(async (options) => {\n await convertEasyEdaJsonToVariousFormats({\n jlcpcbPartNumberOrFilepath: options.input,\n outputFilename: options.output,\n outputFormat: options.outputFormat,\n })\n })\n\nprogram\n .command(\"download\")\n .description(\"Download JSON for footprint\")\n .requiredOption(\"-i, --input <jlcpcbPartNumber>\", \"JLCPCB part number\")\n .option(\"-o, --output <filename>\", \"Output filename\")\n .action(async (options) => {\n if (!options.output) {\n options.output = `${options.input}.raweasy.json`\n }\n try {\n const easyEdaJsonRes = await fetchEasyEDAComponent(options.input)\n await fs.writeFile(\n options.output,\n JSON.stringify(easyEdaJsonRes, null, 2),\n )\n console.log(`Downloaded JSON footprint: ${options.output}`)\n } catch (error: any) {\n console.error(\"Error:\", error.message)\n }\n })\n\nprogram.parse(process.argv)\n// perfectCli(program, process.argv)\n","{\n \"name\": \"easyeda\",\n \"type\": \"module\",\n \"version\": \"0.0.
|
|
1
|
+
{"version":3,"sources":["../../cli/main.ts","../../package.json"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\"\nimport { fetchEasyEDAComponent } from \"../lib/fetch-easyeda-json\"\nimport { convertEasyEdaJsonToTscircuitSoupJson } from \"../lib/convert-easyeda-json-to-tscircuit-soup-json\"\nimport fs from \"fs/promises\"\nimport packageJson from \"../package.json\"\nimport { EasyEdaJsonSchema } from \"lib/schemas/easy-eda-json-schema\"\nimport { convertRawEasyToTsx } from \"lib/convert-to-typescript-component\"\nimport * as path from \"path\"\nimport { normalizeManufacturerPartNumber } from \"lib\"\nimport { convertEasyEdaJsonToVariousFormats } from \"lib/convert-easyeda-json-to-various-formats\"\n\nconst program = new Command()\n\nprogram\n .name(\"easyeda\")\n .description(\"Convert EasyEDA JSON PCB footprints into various formats\")\n .version(packageJson.version)\n\nprogram\n .command(\"convert\")\n .description(\"Convert EasyEDA JSON to various formats\")\n .option(\"-i, --input <jlcpcbPartNumber>\", \"JLCPCB part number\")\n .option(\"-o, --output <filename>\", \"Output filename\")\n .option(\n \"--output-format <format>\",\n \"Output format (can be inferred from filename)\",\n )\n .action(async (options) => {\n await convertEasyEdaJsonToVariousFormats({\n jlcpcbPartNumberOrFilepath: options.input,\n outputFilename: options.output,\n outputFormat: options.outputFormat,\n })\n })\n\nprogram\n .command(\"download\")\n .description(\"Download JSON for footprint\")\n .requiredOption(\"-i, --input <jlcpcbPartNumber>\", \"JLCPCB part number\")\n .option(\"-o, --output <filename>\", \"Output filename\")\n .action(async (options) => {\n if (!options.output) {\n options.output = `${options.input}.raweasy.json`\n }\n try {\n const easyEdaJsonRes = await fetchEasyEDAComponent(options.input)\n await fs.writeFile(\n options.output,\n JSON.stringify(easyEdaJsonRes, null, 2),\n )\n console.log(`Downloaded JSON footprint: ${options.output}`)\n } catch (error: any) {\n console.error(\"Error:\", error.message)\n }\n })\n\nprogram.parse(process.argv)\n// perfectCli(program, process.argv)\n","{\n \"name\": \"easyeda\",\n \"type\": \"module\",\n \"version\": \"0.0.56\",\n \"files\": [\n \"dist\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/tscircuit/easyeda-converter\"\n },\n \"scripts\": {\n \"test\": \"bun test\",\n \"cli\": \"bun cli/main.ts\",\n \"build\": \"tsup lib/index.ts cli/main.ts --format esm --dts --sourcemap\",\n \"aider\": \"aider\",\n \"format:check\": \"biome format .\",\n \"format\": \"biome format . --write\"\n },\n \"main\": \"./dist/lib/index.js\",\n \"bin\": {\n \"easyeda-converter\": \"./dist/cli/main.js\",\n \"easyeda\": \"./dist/cli/main.js\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^1.8.3\",\n \"@tscircuit/log-soup\": \"1.0.2\",\n \"@tscircuit/props\": \"^0.0.75\",\n \"@tscircuit/soup-util\": \"^0.0.38\",\n \"@types/bun\": \"latest\",\n \"bun-match-svg\": \"^0.0.6\",\n \"circuit-json\": \"^0.0.83\",\n \"circuit-to-svg\": \"^0.0.40\",\n \"tsup\": \"^8.1.0\"\n },\n \"peerDependencies\": {\n \"typescript\": \"^5.5.2\"\n },\n \"dependencies\": {\n \"@tscircuit/mm\": \"^0.0.8\",\n \"commander\": \"^12.1.0\",\n \"transformation-matrix\": \"^2.16.1\",\n \"zod\": \"^3.23.8\"\n }\n}\n"],"mappings":";;;;;;;AAEA,SAAS,eAAe;AAGxB,OAAO,QAAQ;;;ACLf;AAAA,EACE,MAAQ;AAAA,EACR,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,OAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,OAAS;AAAA,IACT,OAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,QAAU;AAAA,EACZ;AAAA,EACA,MAAQ;AAAA,EACR,KAAO;AAAA,IACL,qBAAqB;AAAA,IACrB,SAAW;AAAA,EACb;AAAA,EACA,iBAAmB;AAAA,IACjB,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IACxB,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,MAAQ;AAAA,EACV;AAAA,EACA,kBAAoB;AAAA,IAClB,YAAc;AAAA,EAChB;AAAA,EACA,cAAgB;AAAA,IACd,iBAAiB;AAAA,IACjB,WAAa;AAAA,IACb,yBAAyB;AAAA,IACzB,KAAO;AAAA,EACT;AACF;;;AD/BA,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,SAAS,EACd,YAAY,0DAA0D,EACtE,QAAQ,gBAAY,OAAO;AAE9B,QACG,QAAQ,SAAS,EACjB,YAAY,yCAAyC,EACrD,OAAO,kCAAkC,oBAAoB,EAC7D,OAAO,2BAA2B,iBAAiB,EACnD;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,OAAO,YAAY;AACzB,QAAM,mCAAmC;AAAA,IACvC,4BAA4B,QAAQ;AAAA,IACpC,gBAAgB,QAAQ;AAAA,IACxB,cAAc,QAAQ;AAAA,EACxB,CAAC;AACH,CAAC;AAEH,QACG,QAAQ,UAAU,EAClB,YAAY,6BAA6B,EACzC,eAAe,kCAAkC,oBAAoB,EACrE,OAAO,2BAA2B,iBAAiB,EACnD,OAAO,OAAO,YAAY;AACzB,MAAI,CAAC,QAAQ,QAAQ;AACnB,YAAQ,SAAS,GAAG,QAAQ,KAAK;AAAA,EACnC;AACA,MAAI;AACF,UAAM,iBAAiB,MAAM,sBAAsB,QAAQ,KAAK;AAChE,UAAM,GAAG;AAAA,MACP,QAAQ;AAAA,MACR,KAAK,UAAU,gBAAgB,MAAM,CAAC;AAAA,IACxC;AACA,YAAQ,IAAI,8BAA8B,QAAQ,MAAM,EAAE;AAAA,EAC5D,SAAS,OAAY;AACnB,YAAQ,MAAM,UAAU,MAAM,OAAO;AAAA,EACvC;AACF,CAAC;AAEH,QAAQ,MAAM,QAAQ,IAAI;","names":[]}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -258,6 +258,23 @@ declare const DataStrSchema: z.ZodObject<{
|
|
|
258
258
|
fillColor: string;
|
|
259
259
|
strokeWidth: number;
|
|
260
260
|
strokeColor: string;
|
|
261
|
+
} | {
|
|
262
|
+
type: "TEXT";
|
|
263
|
+
x: number;
|
|
264
|
+
y: number;
|
|
265
|
+
id: string;
|
|
266
|
+
rotation: number;
|
|
267
|
+
visibility: "0" | "1";
|
|
268
|
+
alignment: "L" | "C" | "R";
|
|
269
|
+
fontColor: string;
|
|
270
|
+
fontSize: string;
|
|
271
|
+
fontWeight: "normal" | "bold";
|
|
272
|
+
fontStyle: "normal" | "italic";
|
|
273
|
+
fontDecoration: "" | "underline";
|
|
274
|
+
content: string;
|
|
275
|
+
textType: string;
|
|
276
|
+
mirror: string;
|
|
277
|
+
backgroundColor?: string | undefined;
|
|
261
278
|
}, string>, z.ZodUnion<[z.ZodObject<{
|
|
262
279
|
type: z.ZodLiteral<"RECTANGLE">;
|
|
263
280
|
position: z.ZodObject<{
|
|
@@ -462,6 +479,57 @@ declare const DataStrSchema: z.ZodObject<{
|
|
|
462
479
|
fillColor: string;
|
|
463
480
|
strokeWidth: number;
|
|
464
481
|
strokeColor: string;
|
|
482
|
+
}>, z.ZodObject<{
|
|
483
|
+
type: z.ZodLiteral<"TEXT">;
|
|
484
|
+
alignment: z.ZodEnum<["L", "C", "R"]>;
|
|
485
|
+
x: z.ZodNumber;
|
|
486
|
+
y: z.ZodNumber;
|
|
487
|
+
rotation: z.ZodNumber;
|
|
488
|
+
fontColor: z.ZodString;
|
|
489
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
490
|
+
fontSize: z.ZodString;
|
|
491
|
+
fontWeight: z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "bold"]>>>;
|
|
492
|
+
fontStyle: z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "italic"]>>>;
|
|
493
|
+
fontDecoration: z.ZodEnum<["", "underline"]>;
|
|
494
|
+
content: z.ZodString;
|
|
495
|
+
textType: z.ZodString;
|
|
496
|
+
visibility: z.ZodEnum<["0", "1"]>;
|
|
497
|
+
mirror: z.ZodString;
|
|
498
|
+
id: z.ZodString;
|
|
499
|
+
}, "strip", z.ZodTypeAny, {
|
|
500
|
+
type: "TEXT";
|
|
501
|
+
x: number;
|
|
502
|
+
y: number;
|
|
503
|
+
id: string;
|
|
504
|
+
rotation: number;
|
|
505
|
+
visibility: "0" | "1";
|
|
506
|
+
alignment: "L" | "C" | "R";
|
|
507
|
+
fontColor: string;
|
|
508
|
+
fontSize: string;
|
|
509
|
+
fontWeight: "normal" | "bold";
|
|
510
|
+
fontStyle: "normal" | "italic";
|
|
511
|
+
fontDecoration: "" | "underline";
|
|
512
|
+
content: string;
|
|
513
|
+
textType: string;
|
|
514
|
+
mirror: string;
|
|
515
|
+
backgroundColor?: string | undefined;
|
|
516
|
+
}, {
|
|
517
|
+
type: "TEXT";
|
|
518
|
+
x: number;
|
|
519
|
+
y: number;
|
|
520
|
+
id: string;
|
|
521
|
+
rotation: number;
|
|
522
|
+
visibility: "0" | "1";
|
|
523
|
+
alignment: "L" | "C" | "R";
|
|
524
|
+
fontColor: string;
|
|
525
|
+
fontSize: string;
|
|
526
|
+
fontDecoration: "" | "underline";
|
|
527
|
+
content: string;
|
|
528
|
+
textType: string;
|
|
529
|
+
mirror: string;
|
|
530
|
+
backgroundColor?: string | undefined;
|
|
531
|
+
fontWeight?: "normal" | "bold" | undefined;
|
|
532
|
+
fontStyle?: "normal" | "italic" | undefined;
|
|
465
533
|
}>]>>, "many">;
|
|
466
534
|
BBox: z.ZodObject<{
|
|
467
535
|
x: z.ZodNumber;
|
|
@@ -541,6 +609,23 @@ declare const DataStrSchema: z.ZodObject<{
|
|
|
541
609
|
fillColor: string;
|
|
542
610
|
strokeWidth: number;
|
|
543
611
|
strokeColor: string;
|
|
612
|
+
} | {
|
|
613
|
+
type: "TEXT";
|
|
614
|
+
x: number;
|
|
615
|
+
y: number;
|
|
616
|
+
id: string;
|
|
617
|
+
rotation: number;
|
|
618
|
+
visibility: "0" | "1";
|
|
619
|
+
alignment: "L" | "C" | "R";
|
|
620
|
+
fontColor: string;
|
|
621
|
+
fontSize: string;
|
|
622
|
+
fontWeight: "normal" | "bold";
|
|
623
|
+
fontStyle: "normal" | "italic";
|
|
624
|
+
fontDecoration: "" | "underline";
|
|
625
|
+
content: string;
|
|
626
|
+
textType: string;
|
|
627
|
+
mirror: string;
|
|
628
|
+
backgroundColor?: string | undefined;
|
|
544
629
|
})[];
|
|
545
630
|
head: {
|
|
546
631
|
x: number;
|
|
@@ -2344,6 +2429,23 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
2344
2429
|
fillColor: string;
|
|
2345
2430
|
strokeWidth: number;
|
|
2346
2431
|
strokeColor: string;
|
|
2432
|
+
} | {
|
|
2433
|
+
type: "TEXT";
|
|
2434
|
+
x: number;
|
|
2435
|
+
y: number;
|
|
2436
|
+
id: string;
|
|
2437
|
+
rotation: number;
|
|
2438
|
+
visibility: "0" | "1";
|
|
2439
|
+
alignment: "L" | "C" | "R";
|
|
2440
|
+
fontColor: string;
|
|
2441
|
+
fontSize: string;
|
|
2442
|
+
fontWeight: "normal" | "bold";
|
|
2443
|
+
fontStyle: "normal" | "italic";
|
|
2444
|
+
fontDecoration: "" | "underline";
|
|
2445
|
+
content: string;
|
|
2446
|
+
textType: string;
|
|
2447
|
+
mirror: string;
|
|
2448
|
+
backgroundColor?: string | undefined;
|
|
2347
2449
|
}, string>, z.ZodUnion<[z.ZodObject<{
|
|
2348
2450
|
type: z.ZodLiteral<"RECTANGLE">;
|
|
2349
2451
|
position: z.ZodObject<{
|
|
@@ -2548,6 +2650,57 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
2548
2650
|
fillColor: string;
|
|
2549
2651
|
strokeWidth: number;
|
|
2550
2652
|
strokeColor: string;
|
|
2653
|
+
}>, z.ZodObject<{
|
|
2654
|
+
type: z.ZodLiteral<"TEXT">;
|
|
2655
|
+
alignment: z.ZodEnum<["L", "C", "R"]>;
|
|
2656
|
+
x: z.ZodNumber;
|
|
2657
|
+
y: z.ZodNumber;
|
|
2658
|
+
rotation: z.ZodNumber;
|
|
2659
|
+
fontColor: z.ZodString;
|
|
2660
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
2661
|
+
fontSize: z.ZodString;
|
|
2662
|
+
fontWeight: z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "bold"]>>>;
|
|
2663
|
+
fontStyle: z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "italic"]>>>;
|
|
2664
|
+
fontDecoration: z.ZodEnum<["", "underline"]>;
|
|
2665
|
+
content: z.ZodString;
|
|
2666
|
+
textType: z.ZodString;
|
|
2667
|
+
visibility: z.ZodEnum<["0", "1"]>;
|
|
2668
|
+
mirror: z.ZodString;
|
|
2669
|
+
id: z.ZodString;
|
|
2670
|
+
}, "strip", z.ZodTypeAny, {
|
|
2671
|
+
type: "TEXT";
|
|
2672
|
+
x: number;
|
|
2673
|
+
y: number;
|
|
2674
|
+
id: string;
|
|
2675
|
+
rotation: number;
|
|
2676
|
+
visibility: "0" | "1";
|
|
2677
|
+
alignment: "L" | "C" | "R";
|
|
2678
|
+
fontColor: string;
|
|
2679
|
+
fontSize: string;
|
|
2680
|
+
fontWeight: "normal" | "bold";
|
|
2681
|
+
fontStyle: "normal" | "italic";
|
|
2682
|
+
fontDecoration: "" | "underline";
|
|
2683
|
+
content: string;
|
|
2684
|
+
textType: string;
|
|
2685
|
+
mirror: string;
|
|
2686
|
+
backgroundColor?: string | undefined;
|
|
2687
|
+
}, {
|
|
2688
|
+
type: "TEXT";
|
|
2689
|
+
x: number;
|
|
2690
|
+
y: number;
|
|
2691
|
+
id: string;
|
|
2692
|
+
rotation: number;
|
|
2693
|
+
visibility: "0" | "1";
|
|
2694
|
+
alignment: "L" | "C" | "R";
|
|
2695
|
+
fontColor: string;
|
|
2696
|
+
fontSize: string;
|
|
2697
|
+
fontDecoration: "" | "underline";
|
|
2698
|
+
content: string;
|
|
2699
|
+
textType: string;
|
|
2700
|
+
mirror: string;
|
|
2701
|
+
backgroundColor?: string | undefined;
|
|
2702
|
+
fontWeight?: "normal" | "bold" | undefined;
|
|
2703
|
+
fontStyle?: "normal" | "italic" | undefined;
|
|
2551
2704
|
}>]>>, "many">;
|
|
2552
2705
|
BBox: z.ZodObject<{
|
|
2553
2706
|
x: z.ZodNumber;
|
|
@@ -2627,6 +2780,23 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
2627
2780
|
fillColor: string;
|
|
2628
2781
|
strokeWidth: number;
|
|
2629
2782
|
strokeColor: string;
|
|
2783
|
+
} | {
|
|
2784
|
+
type: "TEXT";
|
|
2785
|
+
x: number;
|
|
2786
|
+
y: number;
|
|
2787
|
+
id: string;
|
|
2788
|
+
rotation: number;
|
|
2789
|
+
visibility: "0" | "1";
|
|
2790
|
+
alignment: "L" | "C" | "R";
|
|
2791
|
+
fontColor: string;
|
|
2792
|
+
fontSize: string;
|
|
2793
|
+
fontWeight: "normal" | "bold";
|
|
2794
|
+
fontStyle: "normal" | "italic";
|
|
2795
|
+
fontDecoration: "" | "underline";
|
|
2796
|
+
content: string;
|
|
2797
|
+
textType: string;
|
|
2798
|
+
mirror: string;
|
|
2799
|
+
backgroundColor?: string | undefined;
|
|
2630
2800
|
})[];
|
|
2631
2801
|
head: {
|
|
2632
2802
|
x: number;
|
|
@@ -3650,6 +3820,23 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
3650
3820
|
fillColor: string;
|
|
3651
3821
|
strokeWidth: number;
|
|
3652
3822
|
strokeColor: string;
|
|
3823
|
+
} | {
|
|
3824
|
+
type: "TEXT";
|
|
3825
|
+
x: number;
|
|
3826
|
+
y: number;
|
|
3827
|
+
id: string;
|
|
3828
|
+
rotation: number;
|
|
3829
|
+
visibility: "0" | "1";
|
|
3830
|
+
alignment: "L" | "C" | "R";
|
|
3831
|
+
fontColor: string;
|
|
3832
|
+
fontSize: string;
|
|
3833
|
+
fontWeight: "normal" | "bold";
|
|
3834
|
+
fontStyle: "normal" | "italic";
|
|
3835
|
+
fontDecoration: "" | "underline";
|
|
3836
|
+
content: string;
|
|
3837
|
+
textType: string;
|
|
3838
|
+
mirror: string;
|
|
3839
|
+
backgroundColor?: string | undefined;
|
|
3653
3840
|
})[];
|
|
3654
3841
|
head: {
|
|
3655
3842
|
x: number;
|
package/dist/lib/index.js
CHANGED