easyeda 0.0.2 → 0.0.4

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.
Files changed (33) hide show
  1. package/dist/cli/main.cjs +17 -5
  2. package/dist/cli/main.cjs.map +1 -1
  3. package/dist/lib/index.cjs +1 -1
  4. package/dist/lib/index.cjs.map +1 -1
  5. package/package.json +10 -3
  6. package/ai-assist-docs/soup-reference.md +0 -1325
  7. package/bun.lockb +0 -0
  8. package/cli/main.ts +0 -67
  9. package/dist/index.cjs +0 -29196
  10. package/dist/index.cjs.map +0 -1
  11. package/dist/index.d.cts +0 -1553
  12. package/lib/convert-easyeda-json-to-tscircuit-soup-json.ts +0 -204
  13. package/lib/fetch-easyeda-json.ts +0 -66
  14. package/lib/index.ts +0 -2
  15. package/lib/math/arc-utils.ts +0 -170
  16. package/lib/schemas/easy-eda-json-schema.ts +0 -158
  17. package/lib/schemas/package-detail-shape-schema.ts +0 -251
  18. package/lib/schemas/single-letter-shape-schema.ts +0 -201
  19. package/renovate.json +0 -6
  20. package/scripts/get-easyeda-json.ts +0 -12
  21. package/tests/assets/a555-timer-dip.raweasy.json +0 -244
  22. package/tests/assets/a555-timer-smd.raweasy.json +0 -226
  23. package/tests/assets/esp32.raweasy.json +0 -333
  24. package/tests/assets/usb-c.raweasy.json +0 -263
  25. package/tests/convert-to-soup-tests/a555timer-smd.test.ts +0 -18
  26. package/tests/convert-to-soup-tests/convert-easyeda-to-tscircuit-soup.test.ts +0 -49
  27. package/tests/convert-to-soup-tests/convert-usb-c-to-soup.test.ts +0 -18
  28. package/tests/convert-to-soup-tests/esp32-to-soup.test.ts +0 -13
  29. package/tests/parse-tests/parse-555-timer-json.test.ts +0 -9
  30. package/tests/parse-tests/parse-esp32.test.ts +0 -9
  31. package/tests/parse-tests/parse-usb-c.test.ts +0 -9
  32. package/tests/parse-tests/single-letter-shape-schema.test.ts +0 -30
  33. package/tsconfig.json +0 -28
package/bun.lockb DELETED
Binary file
package/cli/main.ts DELETED
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from "commander"
4
- import { fetchEasyEDAComponent } from "../lib/fetch-easyeda-json"
5
- import { convertEasyEdaJsonToTscircuitSoupJson } from "../lib/convert-easyeda-json-to-tscircuit-soup-json"
6
- import fs from "fs/promises"
7
- import packageJson from "../package.json"
8
-
9
- const program = new Command()
10
-
11
- program
12
- .name("easyeda-converter")
13
- .description("Convert EasyEDA JSON PCB footprints into tscircuit json soup")
14
- .version(packageJson.version)
15
-
16
- program
17
- .command("convert")
18
- .description("Convert EasyEDA JSON to various formats")
19
- .requiredOption("-i, --input <jlcpcbPartNumber>", "JLCPCB part number")
20
- .requiredOption("-o, --output <filename>", "Output filename")
21
- .action(async (options) => {
22
- try {
23
- const easyEdaJson = await fetchEasyEDAComponent(options.input)
24
- const tscircuitSoup = convertEasyEdaJsonToTscircuitSoupJson(easyEdaJson)
25
-
26
- if (options.output.endsWith(".ts")) {
27
- // TODO: Implement conversion to tscircuit component
28
- console.log("Conversion to tscircuit component not yet implemented")
29
- } else if (options.output.endsWith(".soup.json")) {
30
- await fs.writeFile(
31
- options.output,
32
- JSON.stringify(tscircuitSoup, null, 2)
33
- )
34
- console.log(`Converted to tscircuit soup JSON: ${options.output}`)
35
- } else if (options.output.endsWith(".kicad_mod")) {
36
- // TODO: Implement conversion to KiCad footprint
37
- console.log("Conversion to KiCad footprint not yet implemented")
38
- } else {
39
- console.error("Unsupported output format")
40
- }
41
- } catch (error: any) {
42
- console.error("Error:", error.message)
43
- }
44
- })
45
-
46
- program
47
- .command("download")
48
- .description("Download JSON for footprint")
49
- .requiredOption("-i, --input <jlcpcbPartNumber>", "JLCPCB part number")
50
- .option("-o, --output <filename>", "Output filename")
51
- .action(async (options) => {
52
- if (!options.output) {
53
- options.output = `${options.input}.raweasy.json`
54
- }
55
- try {
56
- const easyEdaJsonRes = await fetchEasyEDAComponent(options.input)
57
- await fs.writeFile(
58
- options.output,
59
- JSON.stringify(easyEdaJsonRes.result, null, 2)
60
- )
61
- console.log(`Downloaded JSON footprint: ${options.output}`)
62
- } catch (error: any) {
63
- console.error("Error:", error.message)
64
- }
65
- })
66
-
67
- program.parse(process.argv)