circuit-json-to-kicad 0.0.34 → 0.0.35

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 (2) hide show
  1. package/dist/index.js +5 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2691,7 +2691,7 @@ var ExtractFootprintsStage = class extends ConverterStage {
2691
2691
  for (const model of models) {
2692
2692
  if (model.path) {
2693
2693
  const modelFilename = getBasename(model.path);
2694
- const newPath = `\${KIPRJMOD}/${fpLibraryName}.3dshapes/${modelFilename}`;
2694
+ const newPath = `../../3dmodels/${fpLibraryName}.3dshapes/${modelFilename}`;
2695
2695
  const newModel = new FootprintModel2(newPath);
2696
2696
  if (model.offset) newModel.offset = model.offset;
2697
2697
  if (model.scale) newModel.scale = model.scale;
@@ -2870,9 +2870,10 @@ function renameKicadFootprint(params) {
2870
2870
  footprint.libraryLink = newKicadFootprintName;
2871
2871
  for (const model of footprint.models) {
2872
2872
  const currentPath = model.path;
2873
- if (currentPath.includes("${KIPRJMOD}/")) {
2874
- const filename = currentPath.split("/").pop() ?? "";
2875
- model.path = `\${KIPRJMOD}/3dmodels/${kicadLibraryName}.3dshapes/${filename}`;
2873
+ const usesProjectPath = currentPath.includes("${KIPRJMOD}/") || /3dmodels[\\/]/.test(currentPath);
2874
+ if (usesProjectPath) {
2875
+ const filename = currentPath.split(/[\\/]/).pop() ?? "";
2876
+ model.path = `../../3dmodels/${kicadLibraryName}.3dshapes/${filename}`;
2876
2877
  }
2877
2878
  }
2878
2879
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "circuit-json-to-kicad",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.34",
4
+ "version": "0.0.35",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"