@vessel-dsp/compiler 0.7.0 → 0.8.1

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 (37) hide show
  1. package/dist/compile.d.ts.map +1 -1
  2. package/dist/compile.js +36 -0
  3. package/dist/compile.js.map +1 -1
  4. package/dist/device-laws.d.ts.map +1 -1
  5. package/dist/device-laws.js +37 -10
  6. package/dist/device-laws.js.map +1 -1
  7. package/dist/netlist.d.ts.map +1 -1
  8. package/dist/netlist.js +12 -0
  9. package/dist/netlist.js.map +1 -1
  10. package/dist/part-catalog.d.ts +12 -0
  11. package/dist/part-catalog.d.ts.map +1 -1
  12. package/dist/part-catalog.js +52 -2
  13. package/dist/part-catalog.js.map +1 -1
  14. package/dist/registry-data/bjt.d.ts.map +1 -1
  15. package/dist/registry-data/bjt.js +318 -1
  16. package/dist/registry-data/bjt.js.map +1 -1
  17. package/dist/registry-data/diode.d.ts.map +1 -1
  18. package/dist/registry-data/diode.js +78 -64
  19. package/dist/registry-data/diode.js.map +1 -1
  20. package/dist/registry-data/index.d.ts +1 -0
  21. package/dist/registry-data/index.d.ts.map +1 -1
  22. package/dist/registry-data/index.js +20 -7
  23. package/dist/registry-data/index.js.map +1 -1
  24. package/dist/registry-data/jfet.d.ts.map +1 -1
  25. package/dist/registry-data/jfet.js +163 -0
  26. package/dist/registry-data/jfet.js.map +1 -1
  27. package/dist/registry-data/led.d.ts +20 -0
  28. package/dist/registry-data/led.d.ts.map +1 -0
  29. package/dist/registry-data/led.js +415 -0
  30. package/dist/registry-data/led.js.map +1 -0
  31. package/dist/registry-data/schema.d.ts +7 -3
  32. package/dist/registry-data/schema.d.ts.map +1 -1
  33. package/dist/registry-data/schema.js +11 -4
  34. package/dist/registry-data/schema.js.map +1 -1
  35. package/dist/types.d.ts +24 -1
  36. package/dist/types.d.ts.map +1 -1
  37. package/package.json +2 -2
@@ -13,6 +13,18 @@ export declare function bjtLawEntry(record: PartDataEntry): PartEntry;
13
13
  * stamps (a zener knee belongs to class `zener` and the existing `zenerLaw` path, not here).
14
14
  */
15
15
  export declare function diodeLawEntry(record: PartDataEntry): PartEntry;
16
+ /**
17
+ * An LED colour-default record's law entry. Requires the forward pair together, like
18
+ * `diodeLawEntry`: the only admitted LED derivation (four fitted (I, Vf) points, or two
19
+ * with Rs fixed) yields IS and n as one working, so a lone IS without n is a broken
20
+ * derivation and throws rather than shipping half a knee. Gap-fills are the LED class
21
+ * defaults the unregistered path stamps (`device-laws.ts` diode case with `isLed`):
22
+ * thermalVoltage 0.05, seriesResistance 2.0 -- every shipped LED record states both
23
+ * explicitly (the fits were referred to VT 0.025852 V with fitted Rs), so the gap-fill
24
+ * only fires for a future sparse record, and the sparse-record test pins it to the live
25
+ * class defaults. breakdownVolts 0 keeps the no-knee reading; isLed true marks the law.
26
+ */
27
+ export declare function ledLawEntry(record: PartDataEntry): PartEntry;
16
28
  /**
17
29
  * A JFET- or MOSFET-channel record's law entry. The class selects the gap-fill constants
18
30
  * (JFET depletion defaults with the silicon gate; MOSFET enhancement defaults with the
@@ -1 +1 @@
1
- {"version":3,"file":"part-catalog.d.ts","sourceRoot":"","sources":["../src/part-catalog.ts"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,EAcN,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,OAAO,EACN,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAoIzD,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,C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Aa,EAAE,CAAC;AAoIzD,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CA+B5D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAkC9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAkC5D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,GAAG,QAAQ,GACpB,SAAS,CAkEX;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CA6B5D;AA+BD,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAInD,CAAC;AA02QF;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACvC,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,IAAI,GAAE,SAAS,mBAAmB,EAAyB,EAC3D,UAAU,GAAE,aAAa,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAA0B,GAClH,SAAS,SAAS,EAAE,CAgHtB;AAeD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAUlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAE9B,CAAC"}
@@ -52,7 +52,7 @@
52
52
  // runs at 9 V, so the carry is a named choice, and `opamp-law-default-parameters` names
53
53
  // every device it was carried for.
54
54
  import { foldPartId, opampOutputSwingOf } from "./registry.js";
55
- import { bjtRegistryRecords, chargePumpRegistryRecords, diodeRegistryRecords, findPartRegistryData, jfetRegistryRecords, mosfetRegistryRecords, opampGainBandwidthAbsent, opampOutputSwingAbsent, opampRegistryRecords, regulatorRegistryRecords, ujtRegistryRecords, zenerRegistryRecords, communityProvenanceOf, } from "./registry-data/index.js";
55
+ import { bjtRegistryRecords, chargePumpRegistryRecords, diodeRegistryRecords, findPartRegistryData, jfetRegistryRecords, ledRegistryRecords, mosfetRegistryRecords, opampGainBandwidthAbsent, opampOutputSwingAbsent, opampRegistryRecords, regulatorRegistryRecords, ujtRegistryRecords, zenerRegistryRecords, communityProvenanceOf, } from "./registry-data/index.js";
56
56
  // The absent lists and the merged op-amp records live in `registry-data/opamp.ts` and are
57
57
  // re-exported here so their existing import sites keep working.
58
58
  export { opampGainBandwidthAbsent, opampOutputSwingAbsent, opampRegistryRecords, } from "./registry-data/index.js";
@@ -239,6 +239,48 @@ export function diodeLawEntry(record) {
239
239
  },
240
240
  };
241
241
  }
242
+ /**
243
+ * An LED colour-default record's law entry. Requires the forward pair together, like
244
+ * `diodeLawEntry`: the only admitted LED derivation (four fitted (I, Vf) points, or two
245
+ * with Rs fixed) yields IS and n as one working, so a lone IS without n is a broken
246
+ * derivation and throws rather than shipping half a knee. Gap-fills are the LED class
247
+ * defaults the unregistered path stamps (`device-laws.ts` diode case with `isLed`):
248
+ * thermalVoltage 0.05, seriesResistance 2.0 -- every shipped LED record states both
249
+ * explicitly (the fits were referred to VT 0.025852 V with fitted Rs), so the gap-fill
250
+ * only fires for a future sparse record, and the sparse-record test pins it to the live
251
+ * class defaults. breakdownVolts 0 keeps the no-knee reading; isLed true marks the law.
252
+ */
253
+ export function ledLawEntry(record) {
254
+ if (record.class !== "led") {
255
+ throw new Error(`${record.partIds.join(",")}: a led entry needs class "led", not "${record.class}"`);
256
+ }
257
+ const saturationCurrent = citedValueOf(record, "saturationCurrent");
258
+ const emissionCoefficient = citedValueOf(record, "emissionCoefficient");
259
+ if (saturationCurrent === undefined || emissionCoefficient === undefined) {
260
+ throw new Error(`${record.partIds.join(",")}: a led record states no forward pair ` +
261
+ `(saturationCurrent ${saturationCurrent === undefined ? "absent" : "present"}, ` +
262
+ `emissionCoefficient ${emissionCoefficient === undefined ? "absent" : "present"})`);
263
+ }
264
+ return {
265
+ partIds: entryIdsOf(record),
266
+ declaredTypes: [],
267
+ terminalRoleGroups: [],
268
+ ...provisionalArmOf(record),
269
+ ...citedArmOf(record),
270
+ model: {
271
+ kind: "law",
272
+ law: {
273
+ kind: "diode",
274
+ saturationCurrent,
275
+ emissionCoefficient,
276
+ thermalVoltage: citedValueOf(record, "thermalVoltage") ?? 0.05,
277
+ breakdownVolts: citedValueOf(record, "breakdownVolts") ?? 0,
278
+ seriesResistance: citedValueOf(record, "seriesResistance") ?? 2.0,
279
+ isLed: true,
280
+ },
281
+ },
282
+ };
283
+ }
242
284
  /**
243
285
  * A JFET- or MOSFET-channel record's law entry. The class selects the gap-fill constants
244
286
  * (JFET depletion defaults with the silicon gate; MOSFET enhancement defaults with the
@@ -5007,10 +5049,17 @@ const entries = [
5007
5049
  }
5008
5050
  },
5009
5051
  // --- Light-Emitting Diodes / LED Indicators (SLP24B, SLP-24B, general LEDs) --------------------------------------------------
5052
+ // The `red-led` spelling this row carried is gone: the owner's measured red colour
5053
+ // default keys "RED LED" (same fold, "redled"), and one fold must resolve to one law.
5054
+ // This row never served the stamping path (`registryLawFor` only matches `law` models,
5055
+ // never `sections`), so nothing stamped changes for it; what it still serves is
5056
+ // `registryEntryFor` exact-part evidence queries (the custom-override guard, the
5057
+ // supply-amps reads) for LED, green-led, yellow-led and IndicatorLED. Bare "LED"
5058
+ // devices keep stamping the LED class defaults -- the colour is unknown, so no colour
5059
+ // record keys it.
5010
5060
  {
5011
5061
  "partIds": [
5012
5062
  "LED",
5013
- "red-led",
5014
5063
  "green-led",
5015
5064
  "yellow-led",
5016
5065
  "IndicatorLED"
@@ -8609,6 +8658,7 @@ const entries = [
8609
8658
  // and the stamp is byte-identical to the bespoke mapping this replaces.
8610
8659
  ...bjtRegistryRecords.map((record) => bjtLawEntry(record)),
8611
8660
  ...diodeRegistryRecords.map((record) => diodeLawEntry(record)),
8661
+ ...ledRegistryRecords.map((record) => ledLawEntry(record)),
8612
8662
  ...mosfetRegistryRecords.map((record) => fetLawEntry(record, "mosfet")),
8613
8663
  ...jfetRegistryRecords.map((record) => fetLawEntry(record, "jfet")),
8614
8664
  ...ujtRegistryRecords.map((record) => ujtLawEntry(record)),