@modular-circuit/perc 0.2.5 → 0.2.7

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/index.js CHANGED
@@ -1182,28 +1182,6 @@ var ParameterPropagationTester = class {
1182
1182
  this.has_passive_port = false;
1183
1183
  }
1184
1184
  run_test(CtorClass, ports) {
1185
- const valid_ports = [];
1186
- for (const p of ports) {
1187
- const id = this.port_id.get(p);
1188
- try {
1189
- const zod_schema = (0, import_electronics_model4.get_port_schema)(p);
1190
- if (!zod_schema) {
1191
- this.ctx.report.erc_errors.push(INVALID_INPUT(id ? [id] : [], `Unknown port type in ${JSON.stringify(p)}`));
1192
- continue;
1193
- }
1194
- valid_ports.push(zod_schema.parse(p));
1195
- } catch (err) {
1196
- if (err instanceof z.ZodError) {
1197
- this.ctx.report.erc_errors.push(
1198
- INVALID_INPUT(id ? [id] : [], {
1199
- input: p,
1200
- issues: err.issues
1201
- })
1202
- );
1203
- }
1204
- }
1205
- }
1206
- if (!valid_ports.length) return;
1207
1185
  return new CtorClass(
1208
1186
  {
1209
1187
  report: this.ctx.report,
@@ -1230,7 +1208,7 @@ var ParameterPropagationTester = class {
1230
1208
  );
1231
1209
  return;
1232
1210
  }
1233
- p.param = zod_schema.parse(p);
1211
+ p.param = zod_schema.parse(p.param);
1234
1212
  ports.push(p);
1235
1213
  } catch (err) {
1236
1214
  if (err instanceof z.ZodError) {
@@ -1271,7 +1249,12 @@ var ParameterPropagationTester = class {
1271
1249
  for (const v of ports) {
1272
1250
  const port = v.param;
1273
1251
  if (port.type === import_electronics_model4.PortType.Passive) this.has_passive_port = true;
1274
- const arr = this.link_map[(0, import_electronics_model4.get_port_link_type)(port)];
1252
+ const link_type = (0, import_electronics_model4.get_port_link_type)(port);
1253
+ if (link_type instanceof Error) {
1254
+ this.ctx.report.erc_errors.push(INVALID_INPUT([v.uuid], { error: link_type.message }));
1255
+ continue;
1256
+ }
1257
+ const arr = this.link_map[link_type];
1275
1258
  arr.push(port);
1276
1259
  }
1277
1260
  let link_t = 0;
package/dist/index.mjs CHANGED
@@ -1122,28 +1122,6 @@ var ParameterPropagationTester = class {
1122
1122
  this.has_passive_port = false;
1123
1123
  }
1124
1124
  run_test(CtorClass, ports) {
1125
- const valid_ports = [];
1126
- for (const p of ports) {
1127
- const id = this.port_id.get(p);
1128
- try {
1129
- const zod_schema = get_port_schema(p);
1130
- if (!zod_schema) {
1131
- this.ctx.report.erc_errors.push(INVALID_INPUT(id ? [id] : [], `Unknown port type in ${JSON.stringify(p)}`));
1132
- continue;
1133
- }
1134
- valid_ports.push(zod_schema.parse(p));
1135
- } catch (err) {
1136
- if (err instanceof z.ZodError) {
1137
- this.ctx.report.erc_errors.push(
1138
- INVALID_INPUT(id ? [id] : [], {
1139
- input: p,
1140
- issues: err.issues
1141
- })
1142
- );
1143
- }
1144
- }
1145
- }
1146
- if (!valid_ports.length) return;
1147
1125
  return new CtorClass(
1148
1126
  {
1149
1127
  report: this.ctx.report,
@@ -1170,7 +1148,7 @@ var ParameterPropagationTester = class {
1170
1148
  );
1171
1149
  return;
1172
1150
  }
1173
- p.param = zod_schema.parse(p);
1151
+ p.param = zod_schema.parse(p.param);
1174
1152
  ports.push(p);
1175
1153
  } catch (err) {
1176
1154
  if (err instanceof z.ZodError) {
@@ -1211,7 +1189,12 @@ var ParameterPropagationTester = class {
1211
1189
  for (const v of ports) {
1212
1190
  const port = v.param;
1213
1191
  if (port.type === PortType2.Passive) this.has_passive_port = true;
1214
- const arr = this.link_map[get_port_link_type(port)];
1192
+ const link_type = get_port_link_type(port);
1193
+ if (link_type instanceof Error) {
1194
+ this.ctx.report.erc_errors.push(INVALID_INPUT([v.uuid], { error: link_type.message }));
1195
+ continue;
1196
+ }
1197
+ const arr = this.link_map[link_type];
1215
1198
  arr.push(port);
1216
1199
  }
1217
1200
  let link_t = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-circuit/perc",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Programmable Electronic Circuit Check",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "zod": "^4.3.6",
30
- "@modular-circuit/electronics-model": "0.2.3",
31
- "@modular-circuit/ir": "0.2.1",
32
- "@modular-circuit/utils": "0.2.1"
30
+ "@modular-circuit/electronics-model": "0.2.4",
31
+ "@modular-circuit/ir": "0.2.2",
32
+ "@modular-circuit/utils": "0.2.2"
33
33
  },
34
34
  "scripts": {
35
35
  "clean": "rimraf dist",