@tscircuit/cli 0.1.1514 → 0.1.1516

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
@@ -97799,6 +97799,12 @@ var require_papaparse = __commonJS((exports2, module2) => {
97799
97799
  if (IS_PAPA_WORKER) {
97800
97800
  global2.onmessage = workerThreadReceivedMessage;
97801
97801
  }
97802
+ function stripBom(string) {
97803
+ if (string.charCodeAt(0) === 65279) {
97804
+ return string.slice(1);
97805
+ }
97806
+ return string;
97807
+ }
97802
97808
  function CsvToJson(_input, _config) {
97803
97809
  _config = _config || {};
97804
97810
  var dynamicTyping = _config.dynamicTyping || false;
@@ -97841,12 +97847,6 @@ var require_papaparse = __commonJS((exports2, module2) => {
97841
97847
  } else if (global2.File && _input instanceof File || _input instanceof Object)
97842
97848
  streamer = new FileStreamer(_config);
97843
97849
  return streamer.stream(_input);
97844
- function stripBom(string) {
97845
- if (string.charCodeAt(0) === 65279) {
97846
- return string.slice(1);
97847
- }
97848
- return string;
97849
- }
97850
97850
  }
97851
97851
  function JsonToCsv(_input, _config) {
97852
97852
  var _quotes = false;
@@ -97896,8 +97896,10 @@ var require_papaparse = __commonJS((exports2, module2) => {
97896
97896
  _skipEmptyLines = _config.skipEmptyLines;
97897
97897
  if (typeof _config.newline === "string")
97898
97898
  _newline = _config.newline;
97899
- if (typeof _config.quoteChar === "string")
97899
+ if (typeof _config.quoteChar === "string") {
97900
97900
  _quoteChar = _config.quoteChar;
97901
+ _escapedQuote = _quoteChar + _quoteChar;
97902
+ }
97901
97903
  if (typeof _config.header === "boolean")
97902
97904
  _writeHeader = _config.header;
97903
97905
  if (Array.isArray(_config.columns)) {
@@ -97970,8 +97972,9 @@ var require_papaparse = __commonJS((exports2, module2) => {
97970
97972
  str = "'" + str;
97971
97973
  needsQuotes = true;
97972
97974
  }
97973
- var escapedQuoteStr = str.toString().replace(quoteCharRegex, _escapedQuote);
97974
- needsQuotes = needsQuotes || _quotes === true || typeof _quotes === "function" && _quotes(str, col) || Array.isArray(_quotes) && _quotes[col] || hasAny(escapedQuoteStr, Papa.BAD_DELIMITERS) || escapedQuoteStr.indexOf(_delimiter) > -1 || escapedQuoteStr.charAt(0) === " " || escapedQuoteStr.charAt(escapedQuoteStr.length - 1) === " ";
97975
+ var strValue = str.toString();
97976
+ var escapedQuoteStr = strValue.replace(quoteCharRegex, _escapedQuote);
97977
+ needsQuotes = needsQuotes || _quotes === true || typeof _quotes === "function" && _quotes(str, col) || Array.isArray(_quotes) && _quotes[col] || hasAny(escapedQuoteStr, Papa.BAD_DELIMITERS) || escapedQuoteStr.indexOf(_delimiter) > -1 || strValue.indexOf(_quoteChar) > -1 || escapedQuoteStr.charAt(0) === " " || escapedQuoteStr.charAt(escapedQuoteStr.length - 1) === " ";
97975
97978
  return needsQuotes ? _quoteChar + escapedQuoteStr + _quoteChar : escapedQuoteStr;
97976
97979
  }
97977
97980
  function hasAny(str, substrings) {
@@ -98503,6 +98506,7 @@ var require_papaparse = __commonJS((exports2, module2) => {
98503
98506
  if (!_results)
98504
98507
  return;
98505
98508
  function addHeader(header, i3) {
98509
+ header = stripBom(header);
98506
98510
  if (isFunction2(_config.transformHeader))
98507
98511
  header = _config.transformHeader(header, i3);
98508
98512
  _fields.push(header);
@@ -98847,7 +98851,7 @@ var require_papaparse = __commonJS((exports2, module2) => {
98847
98851
  const usedHeaders = new Set(result);
98848
98852
  let duplicateHeaders = false;
98849
98853
  for (let i3 = 0;i3 < result.length; i3++) {
98850
- let header = result[i3];
98854
+ let header = stripBom(result[i3]);
98851
98855
  if (isFunction2(config.transformHeader))
98852
98856
  header = config.transformHeader(header, i3);
98853
98857
  if (!headerCount[header]) {
@@ -100825,9 +100829,8 @@ var package_default = {
100825
100829
  jsonwebtoken: "^9.0.2",
100826
100830
  jszip: "^3.10.1",
100827
100831
  "jwt-decode": "^4.0.0",
100828
- "kicad-component-converter": "^0.1.40",
100829
- "kicad-to-circuit-json": "^0.0.96",
100830
- kicadts: "^0.0.45",
100832
+ "kicad-to-circuit-json": "^0.0.98",
100833
+ kicadts: "^0.0.47",
100831
100834
  kleur: "^4.1.5",
100832
100835
  ky: "^1.7.4",
100833
100836
  "make-vfs": "^1.0.15",
@@ -247392,7 +247395,7 @@ var registerConfigSet = (program2) => {
247392
247395
  // cli/convert/register.ts
247393
247396
  import fs46 from "node:fs/promises";
247394
247397
  import path49 from "node:path";
247395
- import { parseKicadModToCircuitJson } from "kicad-component-converter";
247398
+ import { KicadFootprintToCircuitJsonConverter } from "kicad-to-circuit-json";
247396
247399
 
247397
247400
  // node_modules/circuit-json-to-tscircuit/dist/chunk-WC7XDXUV.js
247398
247401
  import { su as su6 } from "@tscircuit/soup-util";
@@ -248146,7 +248149,10 @@ var registerConvert = (program2) => {
248146
248149
  try {
248147
248150
  const inputPath = path49.resolve(file);
248148
248151
  const modContent = await fs46.readFile(inputPath, "utf-8");
248149
- const circuitJson = await parseKicadModToCircuitJson(modContent);
248152
+ const converter = new KicadFootprintToCircuitJsonConverter;
248153
+ converter.addFile(path49.basename(inputPath), modContent);
248154
+ converter.runUntilFinished();
248155
+ const circuitJson = converter.getOutput();
248150
248156
  const componentName = options.name ?? path49.basename(inputPath, ".kicad_mod");
248151
248157
  const tsx = convertCircuitJsonToTscircuit(circuitJson, {
248152
248158
  componentName
@@ -277828,7 +277834,7 @@ function isRecord2(value) {
277828
277834
  }
277829
277835
  // node_modules/@tscircuit/ti-parts-engine/lib/ti-parts-engine/createTiFootprintLibrary.ts
277830
277836
  import {
277831
- KicadFootprintToCircuitJsonConverter,
277837
+ KicadFootprintToCircuitJsonConverter as KicadFootprintToCircuitJsonConverter2,
277832
277838
  KicadSymbolToCircuitJsonConverter
277833
277839
  } from "kicad-to-circuit-json";
277834
277840
  // cli/search/register.ts
package/dist/lib/index.js CHANGED
@@ -65426,9 +65426,8 @@ var package_default = {
65426
65426
  jsonwebtoken: "^9.0.2",
65427
65427
  jszip: "^3.10.1",
65428
65428
  "jwt-decode": "^4.0.0",
65429
- "kicad-component-converter": "^0.1.40",
65430
- "kicad-to-circuit-json": "^0.0.96",
65431
- kicadts: "^0.0.45",
65429
+ "kicad-to-circuit-json": "^0.0.98",
65430
+ kicadts: "^0.0.47",
65432
65431
  kleur: "^4.1.5",
65433
65432
  ky: "^1.7.4",
65434
65433
  "make-vfs": "^1.0.15",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1514",
3
+ "version": "0.1.1516",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",
@@ -59,9 +59,8 @@
59
59
  "jsonwebtoken": "^9.0.2",
60
60
  "jszip": "^3.10.1",
61
61
  "jwt-decode": "^4.0.0",
62
- "kicad-component-converter": "^0.1.40",
63
- "kicad-to-circuit-json": "^0.0.96",
64
- "kicadts": "^0.0.45",
62
+ "kicad-to-circuit-json": "^0.0.98",
63
+ "kicadts": "^0.0.47",
65
64
  "kleur": "^4.1.5",
66
65
  "ky": "^1.7.4",
67
66
  "make-vfs": "^1.0.15",