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/dist/cli/main.cjs CHANGED
@@ -28751,7 +28751,7 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber) {
28751
28751
  throw new Error("Failed to fetch the component details");
28752
28752
  }
28753
28753
  const componentResult = await componentResponse.json();
28754
- return componentResult;
28754
+ return componentResult.result;
28755
28755
  }
28756
28756
 
28757
28757
  // lib/schemas/package-detail-shape-schema.ts
@@ -29168,7 +29168,14 @@ var import_promises = __toESM(require("fs/promises"), 1);
29168
29168
  var package_default = {
29169
29169
  name: "easyeda",
29170
29170
  type: "module",
29171
- version: "0.0.2",
29171
+ version: "0.0.4",
29172
+ files: [
29173
+ "dist"
29174
+ ],
29175
+ repository: {
29176
+ type: "git",
29177
+ url: "https://github.com/tscircuit/easyeda-converter"
29178
+ },
29172
29179
  scripts: {
29173
29180
  test: "bun test",
29174
29181
  build: "tsup lib/index.ts cli/main.ts --dts --sourcemap",
@@ -29176,8 +29183,8 @@ var package_default = {
29176
29183
  },
29177
29184
  main: "./dist/lib/index.cjs",
29178
29185
  bin: {
29179
- "easyeda-converter": "./dist/lib/cli/main.cjs",
29180
- easyeda: "./dist/lib/cli/main.cjs"
29186
+ "easyeda-converter": "./dist/cli/main.cjs",
29187
+ easyeda: "./dist/cli/main.cjs"
29181
29188
  },
29182
29189
  devDependencies: {
29183
29190
  "@tscircuit/builder": "^1.5.131",
@@ -29201,8 +29208,13 @@ var package_default = {
29201
29208
  var program = new import_commander.Command();
29202
29209
  program.name("easyeda-converter").description("Convert EasyEDA JSON PCB footprints into tscircuit json soup").version(package_default.version);
29203
29210
  program.command("convert").description("Convert EasyEDA JSON to various formats").requiredOption("-i, --input <jlcpcbPartNumber>", "JLCPCB part number").requiredOption("-o, --output <filename>", "Output filename").action(async (options) => {
29211
+ let easyEdaJson;
29212
+ if (options.input.includes(".") || options.input.includes("/")) {
29213
+ easyEdaJson = JSON.parse(await import_promises.default.readFile(options.input, "utf-8"));
29214
+ } else {
29215
+ easyEdaJson = await fetchEasyEDAComponent(options.input);
29216
+ }
29204
29217
  try {
29205
- const easyEdaJson = await fetchEasyEDAComponent(options.input);
29206
29218
  const tscircuitSoup = convertEasyEdaJsonToTscircuitSoupJson(easyEdaJson);
29207
29219
  if (options.output.endsWith(".ts")) {
29208
29220
  console.log("Conversion to tscircuit component not yet implemented");