altium-toolkit 1.1.25 → 1.1.26
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/README.md +5 -3
- package/docs/api.md +9 -4
- package/docs/model-format.md +15 -4
- package/docs/schemas/altium_toolkit/library_compatibility_a1.schema.json +116 -0
- package/docs/schemas/altium_toolkit/library_qa_a1.schema.json +3 -0
- package/package.json +1 -1
- package/spec/library-compatibility.md +65 -0
- package/src/core/altium/LibraryCompatibilityGeometry.mjs +618 -0
- package/src/core/altium/LibraryCompatibilityModelHintBuilder.mjs +296 -0
- package/src/core/altium/LibraryCompatibilityReportBuilder.mjs +930 -0
- package/src/core/altium/LibraryQaReportBuilder.mjs +29 -1
- package/src/core/altium/PcbLibModelParser.mjs +24 -2
- package/src/core/altium/PcbLibStorageNameResolver.mjs +171 -0
- package/src/core/altium/PcbLibStreamExtractor.mjs +15 -93
- package/src/parser.mjs +1 -0
package/README.md
CHANGED
|
@@ -43,9 +43,9 @@ browser or Node-based tools.
|
|
|
43
43
|
- Build deterministic parser field-coverage matrix, raw-data preservation,
|
|
44
44
|
parameter-record inventory, parser value-verification, normalized
|
|
45
45
|
diagnostics, geometry-bounds, fixture-coverage, embedded-asset,
|
|
46
|
-
library-diff, library-QA lint, project-hierarchy, and
|
|
47
|
-
library-catalog reports, classify PCB layer ids, and convert common
|
|
48
|
-
length units for downstream QA tooling
|
|
46
|
+
library-diff, library-compatibility, library-QA lint, project-hierarchy, and
|
|
47
|
+
static library-catalog reports, classify PCB layer ids, and convert common
|
|
48
|
+
Altium length units for downstream QA tooling
|
|
49
49
|
- Emit Circuit JSON arrays from parser roots, with non-serialized
|
|
50
50
|
renderer-compatibility fields for existing consumers
|
|
51
51
|
- Render semantically annotated schematic SVG, semantically annotated PCB SVG,
|
|
@@ -114,8 +114,10 @@ import 'altium-toolkit/styles/altium-renderers.css'
|
|
|
114
114
|
- [Geometry Bounds Schema](docs/schemas/altium_toolkit/geometry_bounds_a1.schema.json)
|
|
115
115
|
- [Fixture Coverage Matrix Schema](docs/schemas/altium_toolkit/fixture_coverage_matrix_a1.schema.json)
|
|
116
116
|
- [Unsupported Features Schema](docs/schemas/altium_toolkit/unsupported_features_a1.schema.json)
|
|
117
|
+
- [Library Compatibility Schema](docs/schemas/altium_toolkit/library_compatibility_a1.schema.json)
|
|
117
118
|
- [Testing](docs/testing.md)
|
|
118
119
|
- [Scope](spec/library-scope.md)
|
|
120
|
+
- [Library Compatibility Reports](spec/library-compatibility.md)
|
|
119
121
|
|
|
120
122
|
## Examples
|
|
121
123
|
|
package/docs/api.md
CHANGED
|
@@ -73,8 +73,8 @@ Specialized parser helpers are exported for lower-level integrations, including
|
|
|
73
73
|
`ParserFieldCoverageReportBuilder`, `ParserValueVerificationReportBuilder`,
|
|
74
74
|
`ParserCompatibilityFuzzer`, `NativeStreamInventoryBuilder`,
|
|
75
75
|
`RawDataPreservationReportBuilder`, `UnsupportedFeatureReportBuilder`,
|
|
76
|
-
`EmbeddedAssetReportBuilder`, `
|
|
77
|
-
`LibraryInspectionReportBuilder`,
|
|
76
|
+
`EmbeddedAssetReportBuilder`, `LibraryCompatibilityReportBuilder`,
|
|
77
|
+
`LibraryDiffReportBuilder`, `LibraryInspectionReportBuilder`,
|
|
78
78
|
`PcbBoardRegionSemanticsParser`, `PcbComponentPrimitiveIndexer`,
|
|
79
79
|
`PcbCustomPadShapeParser`, `PcbDimensionParser`,
|
|
80
80
|
`PcbDimensionReportBuilder`, `PcbEmbeddedFontExtractor`,
|
|
@@ -192,8 +192,13 @@ opaque-frame preservation for lower-level extractors.
|
|
|
192
192
|
`ParserCompatibilityFuzzer` runs deterministic malformed,
|
|
193
193
|
wrong-reader, and sparse-input cases against parser entrypoints for parser QA.
|
|
194
194
|
`EmbeddedAssetReportBuilder` emits unified embedded-asset inventories across
|
|
195
|
-
parser roots
|
|
196
|
-
|
|
195
|
+
parser roots. `LibraryCompatibilityReportBuilder` emits source-neutral
|
|
196
|
+
schematic-library pin compatibility rows, symbol bounds, field-placement risk
|
|
197
|
+
rows, footprint bounds, pad diagnostics, custom pad outline diagnostics, and
|
|
198
|
+
package-key suggestions with pin-one rotation hints for footprints without
|
|
199
|
+
embedded or body-level model references. `LibraryDiffReportBuilder` compares
|
|
200
|
+
parsed symbol and footprint
|
|
201
|
+
libraries by name, counts, and parameters.
|
|
197
202
|
`LibraryInspectionReportBuilder` composes library inventory and QA findings
|
|
198
203
|
into one stable artifact. `SchLibStreamExtractor` and `SchLibModelParser`
|
|
199
204
|
expose native schematic-symbol library recovery, including section keys,
|
package/docs/model-format.md
CHANGED
|
@@ -154,9 +154,17 @@ known/unknown classification, and consumed status.
|
|
|
154
154
|
`EmbeddedAssetReportBuilder.build()` emits
|
|
155
155
|
`altium-toolkit.embedded-assets.a1` reports that normalize schematic images,
|
|
156
156
|
embedded file inventories, PCB font/model payloads, and integrated-library
|
|
157
|
-
source entries into one stable asset table.
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
source entries into one stable asset table.
|
|
158
|
+
`LibraryCompatibilityReportBuilder.build()` emits
|
|
159
|
+
`altium-toolkit.library.compatibility.a1` reports for schematic-library pin
|
|
160
|
+
roles and edge markers, hidden-pin hints, symbol bounds, field-placement risk
|
|
161
|
+
rows, footprint bounds, pad diagnostics, custom pad outline diagnostics, and
|
|
162
|
+
package-key suggestions with pin-one rotation hints for missing model
|
|
163
|
+
references. The report is read-only and is also composed into library QA when
|
|
164
|
+
it emits issues.
|
|
165
|
+
`LibraryDiffReportBuilder.build()` emits `altium-toolkit.library.diff.a1`
|
|
166
|
+
reports comparing parsed symbol and footprint libraries by item name, counts,
|
|
167
|
+
and parameter values.
|
|
160
168
|
`LibraryInspectionReportBuilder.build()` emits
|
|
161
169
|
`altium-toolkit.library.inspection.a1` reports that combine library inventory
|
|
162
170
|
rows with duplicate, stale-link, missing-model, lint, and merge-plan QA
|
|
@@ -478,7 +486,10 @@ preserves raw mixed-format primitive records with the same registry metadata
|
|
|
478
486
|
shape used by PcbDoc raw records. Library-level `embeddedFonts` uses the same
|
|
479
487
|
payload and metric shape as PCB documents. Library-level `embeddedModels` and
|
|
480
488
|
`componentBodies` preserve embedded 3D payloads and body references when
|
|
481
|
-
present.
|
|
489
|
+
present. When declared footprint names cannot be resolved to storage names,
|
|
490
|
+
`pcbLibrary.storageDiagnostics.missingFootprints` lists the declared name,
|
|
491
|
+
attempted storage candidates, and reason. Shape-based component bodies may
|
|
492
|
+
include `staticGeometry` for
|
|
482
493
|
extruded-polygon, cone, cylinder, and sphere bodies, with dimensions and
|
|
483
494
|
vertices expressed in mils when native evidence is available.
|
|
484
495
|
`pcbLibrary.indexes.footprintsByName` provides read-only footprint lookup and
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "altium-toolkit.library.compatibility.a1",
|
|
4
|
+
"title": "Altium Toolkit Library Compatibility A1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"required": [
|
|
8
|
+
"schema",
|
|
9
|
+
"summary",
|
|
10
|
+
"symbolPins",
|
|
11
|
+
"hiddenPins",
|
|
12
|
+
"symbolBounds",
|
|
13
|
+
"fieldPlacementRisks",
|
|
14
|
+
"footprintBounds",
|
|
15
|
+
"padDiagnostics",
|
|
16
|
+
"modelSuggestions",
|
|
17
|
+
"issues"
|
|
18
|
+
],
|
|
19
|
+
"properties": {
|
|
20
|
+
"schema": {
|
|
21
|
+
"const": "altium-toolkit.library.compatibility.a1"
|
|
22
|
+
},
|
|
23
|
+
"summary": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": true,
|
|
26
|
+
"properties": {
|
|
27
|
+
"schematicLibraryCount": {
|
|
28
|
+
"type": "number"
|
|
29
|
+
},
|
|
30
|
+
"pcbLibraryCount": {
|
|
31
|
+
"type": "number"
|
|
32
|
+
},
|
|
33
|
+
"symbolPinCount": {
|
|
34
|
+
"type": "number"
|
|
35
|
+
},
|
|
36
|
+
"hiddenPinCount": {
|
|
37
|
+
"type": "number"
|
|
38
|
+
},
|
|
39
|
+
"symbolBoundsCount": {
|
|
40
|
+
"type": "number"
|
|
41
|
+
},
|
|
42
|
+
"fieldPlacementRiskCount": {
|
|
43
|
+
"type": "number"
|
|
44
|
+
},
|
|
45
|
+
"footprintBoundsCount": {
|
|
46
|
+
"type": "number"
|
|
47
|
+
},
|
|
48
|
+
"padDiagnosticCount": {
|
|
49
|
+
"type": "number"
|
|
50
|
+
},
|
|
51
|
+
"modelSuggestionCount": {
|
|
52
|
+
"type": "number"
|
|
53
|
+
},
|
|
54
|
+
"issueCount": {
|
|
55
|
+
"type": "number"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"symbolPins": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"hiddenPins": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"symbolBounds": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"fieldPlacementRisks": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"footprintBounds": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"items": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"padDiagnostics": {
|
|
95
|
+
"type": "array",
|
|
96
|
+
"items": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"modelSuggestions": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": true
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"issues": {
|
|
109
|
+
"type": "array",
|
|
110
|
+
"items": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": true
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-FileCopyrightText: 2026 André Fiedler
|
|
3
|
+
|
|
4
|
+
SPDX-License-Identifier: CC-BY-SA-4.0
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
# Library Compatibility Reports
|
|
8
|
+
|
|
9
|
+
Library compatibility reports provide deterministic, source-neutral QA over
|
|
10
|
+
parsed schematic symbol libraries and PCB footprint libraries. The report is
|
|
11
|
+
read-only: it never rewrites symbols, footprints, model references, or rendered
|
|
12
|
+
output.
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
The report focuses on compatibility signals that are useful across importer,
|
|
17
|
+
renderer, catalog, and review workflows:
|
|
18
|
+
|
|
19
|
+
- schematic pin electrical roles, decorative edge markers, hidden state, and
|
|
20
|
+
hidden-pin placement hints
|
|
21
|
+
- schematic symbol bounds, pin/body bounds, deterministic field anchor hints,
|
|
22
|
+
and visible field-placement risk rows
|
|
23
|
+
- PCB footprint bounds and padded courtyard-like bounds derived from recovered
|
|
24
|
+
pad and primitive geometry
|
|
25
|
+
- PCB pad diagnostics for top/bottom size mismatches, explicit zero-size pads,
|
|
26
|
+
unknown pad shapes, unresolved pad layers, and custom pad outline geometry
|
|
27
|
+
- package-name keys and pin-one rotation hints that can help downstream tools
|
|
28
|
+
suggest model matches when a footprint has no embedded or body-level model
|
|
29
|
+
reference
|
|
30
|
+
|
|
31
|
+
The report does not perform format conversion, file writing, model download,
|
|
32
|
+
interactive model binding, or application UI work.
|
|
33
|
+
|
|
34
|
+
## Contract
|
|
35
|
+
|
|
36
|
+
`LibraryCompatibilityReportBuilder.build()` emits
|
|
37
|
+
`altium-toolkit.library.compatibility.a1` with these top-level arrays:
|
|
38
|
+
|
|
39
|
+
- `symbolPins`: normalized schematic-library pin compatibility rows
|
|
40
|
+
- `hiddenPins`: hidden pins with placement hints and source location metadata
|
|
41
|
+
- `symbolBounds`: per-symbol bounds, body bounds, pin bounds, source counts,
|
|
42
|
+
and deterministic field anchor hints
|
|
43
|
+
- `fieldPlacementRisks`: warning rows for visible designator/comment/value
|
|
44
|
+
fields placed inside symbol bounds
|
|
45
|
+
- `footprintBounds`: footprint-level bounds, courtyard bounds, and primitive
|
|
46
|
+
source counts
|
|
47
|
+
- `padDiagnostics`: warning rows for pad geometry and mapping problems
|
|
48
|
+
- `modelSuggestions`: package-key and rotation-hint rows for model matching by
|
|
49
|
+
host tools
|
|
50
|
+
- `issues`: flattened warning/info rows suitable for library QA summaries
|
|
51
|
+
|
|
52
|
+
PcbLib extraction also exposes `diagnostics.missingFootprints` rows when a
|
|
53
|
+
declared footprint name cannot be resolved to a compound-document storage. Each
|
|
54
|
+
row lists the declared name, attempted storage candidates, and reason. Parsed
|
|
55
|
+
PcbLib models surface the same rows at
|
|
56
|
+
`pcbLibrary.storageDiagnostics.missingFootprints`.
|
|
57
|
+
|
|
58
|
+
`LibraryQaReportBuilder.build()` composes compatibility issues into its
|
|
59
|
+
top-level `issues` array when the compatibility report finds non-empty issue
|
|
60
|
+
rows. Clean inputs keep the existing QA summary shape.
|
|
61
|
+
|
|
62
|
+
## Testing Policy
|
|
63
|
+
|
|
64
|
+
Tests for this report use synthetic library objects only. They must not rely on
|
|
65
|
+
native library files or real project, customer, vendor, or product identifiers.
|