easyeda 0.0.42 → 0.0.44

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-XV5WFS5P.js";
5
+ } from "../chunk-NFQCYU34.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.41",
15
+ version: "0.0.43",
16
16
  files: [
17
17
  "dist"
18
18
  ],
@@ -50,14 +50,12 @@ var package_default = {
50
50
  dependencies: {
51
51
  "@tscircuit/mm": "^0.0.8",
52
52
  commander: "^12.1.0",
53
- "perfect-cli": "^1.0.20",
54
53
  "transformation-matrix": "^2.16.1",
55
54
  zod: "^3.23.8"
56
55
  }
57
56
  };
58
57
 
59
58
  // cli/main.ts
60
- import { perfectCli } from "perfect-cli";
61
59
  var program = new Command();
62
60
  program.name("easyeda").description("Convert EasyEDA JSON PCB footprints into various formats").version(package_default.version);
63
61
  program.command("convert").description("Convert EasyEDA JSON to various formats").option("-i, --input <jlcpcbPartNumber>", "JLCPCB part number").option("-o, --output <filename>", "Output filename").option(
@@ -85,5 +83,5 @@ program.command("download").description("Download JSON for footprint").requiredO
85
83
  console.error("Error:", error.message);
86
84
  }
87
85
  });
88
- perfectCli(program, process.argv);
86
+ program.parse(process.argv);
89
87
  //# sourceMappingURL=main.js.map
@@ -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 { convertRawEasyEdaToTs } 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\"\nimport { perfectCli } from \"perfect-cli\"\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\n// program.parse(process.argv)\nperfectCli(program, process.argv)\n","{\n \"name\": \"easyeda\",\n \"type\": \"module\",\n \"version\": \"0.0.41\",\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.68\",\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 \"perfect-cli\": \"^1.0.20\",\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,IAC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#!/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.43\",\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.68\",\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,kB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AAM,QAAQ,IAAI;","names":[]}
@@ -3890,7 +3890,7 @@ declare const convertEasyEdaJsonToTscircuitSoupJson: (easyEdaJson: BetterEasyEda
3890
3890
 
3891
3891
  declare function fetchEasyEDAComponent(jlcpcbPartNumber: string): Promise<RawEasyEdaJson>;
3892
3892
 
3893
- declare const convertRawEasyEdaToTs: (rawEasy: any) => Promise<string>;
3893
+ declare const convertRawEasyToTsx: (rawEasy: any) => Promise<string>;
3894
3894
 
3895
3895
  declare function normalizeManufacturerPartNumber(partNumber: string): string;
3896
3896
 
@@ -3900,4 +3900,4 @@ declare const convertEasyEdaJsonToVariousFormats: ({ jlcpcbPartNumberOrFilepath,
3900
3900
  outputFormat: string;
3901
3901
  }) => Promise<void>;
3902
3902
 
3903
- export { BBoxSchema, type BetterEasyEdaJson, DataStrSchema, EasyEdaJsonSchema, HeadSchema, LayerItemSchema, LcscSchema, ObjectItemSchema, OwnerSchema, PackageDetailDataStrSchema, PackageDetailSchema, type RawEasyEdaJson, SzlcscSchema, convertEasyEdaJsonToCircuitJson, convertEasyEdaJsonToTscircuitSoupJson, convertEasyEdaJsonToVariousFormats, convertRawEasyEdaToTs, fetchEasyEDAComponent, maybeNumber, normalizeManufacturerPartNumber };
3903
+ export { BBoxSchema, type BetterEasyEdaJson, DataStrSchema, EasyEdaJsonSchema, HeadSchema, LayerItemSchema, LcscSchema, ObjectItemSchema, OwnerSchema, PackageDetailDataStrSchema, PackageDetailSchema, type RawEasyEdaJson, SzlcscSchema, convertEasyEdaJsonToCircuitJson, convertEasyEdaJsonToTscircuitSoupJson, convertEasyEdaJsonToVariousFormats, convertRawEasyToTsx as convertRawEasyEdaToTs, fetchEasyEDAComponent, maybeNumber, normalizeManufacturerPartNumber };
package/dist/lib/index.js CHANGED
@@ -13,11 +13,11 @@ import {
13
13
  convertEasyEdaJsonToCircuitJson,
14
14
  convertEasyEdaJsonToTscircuitSoupJson,
15
15
  convertEasyEdaJsonToVariousFormats,
16
- convertRawEasyEdaToTs,
16
+ convertRawEasyToTsx,
17
17
  fetchEasyEDAComponent,
18
18
  maybeNumber,
19
19
  normalizeManufacturerPartNumber
20
- } from "../chunk-XV5WFS5P.js";
20
+ } from "../chunk-NFQCYU34.js";
21
21
  export {
22
22
  BBoxSchema,
23
23
  DataStrSchema,
@@ -33,7 +33,7 @@ export {
33
33
  convertEasyEdaJsonToCircuitJson,
34
34
  convertEasyEdaJsonToTscircuitSoupJson,
35
35
  convertEasyEdaJsonToVariousFormats,
36
- convertRawEasyEdaToTs,
36
+ convertRawEasyToTsx as convertRawEasyEdaToTs,
37
37
  fetchEasyEDAComponent,
38
38
  maybeNumber,
39
39
  normalizeManufacturerPartNumber
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "easyeda",
3
3
  "type": "module",
4
- "version": "0.0.42",
4
+ "version": "0.0.44",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
@@ -39,7 +39,6 @@
39
39
  "dependencies": {
40
40
  "@tscircuit/mm": "^0.0.8",
41
41
  "commander": "^12.1.0",
42
- "perfect-cli": "^1.0.20",
43
42
  "transformation-matrix": "^2.16.1",
44
43
  "zod": "^3.23.8"
45
44
  }