altium-toolkit 1.1.3 → 1.1.23

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 (125) hide show
  1. package/README.md +34 -5
  2. package/docs/api.md +171 -23
  3. package/docs/model-format.md +192 -20
  4. package/docs/schemas/altium_toolkit/embedded_assets_a1.schema.json +56 -0
  5. package/docs/schemas/altium_toolkit/fixture_coverage_matrix_a1.schema.json +89 -0
  6. package/docs/schemas/altium_toolkit/geometry_bounds_a1.schema.json +86 -0
  7. package/docs/schemas/altium_toolkit/library_catalog_a1.schema.json +65 -0
  8. package/docs/schemas/altium_toolkit/library_diff_a1.schema.json +54 -0
  9. package/docs/schemas/altium_toolkit/library_inspection_a1.schema.json +94 -0
  10. package/docs/schemas/altium_toolkit/library_qa_a1.schema.json +4 -0
  11. package/docs/schemas/altium_toolkit/native_stream_inventory_a1.schema.json +66 -0
  12. package/docs/schemas/altium_toolkit/normalized_model_a1.schema.json +513 -3
  13. package/docs/schemas/altium_toolkit/parameter_record_inventory_a1.schema.json +84 -0
  14. package/docs/schemas/altium_toolkit/parser_diagnostics_a1.schema.json +63 -0
  15. package/docs/schemas/altium_toolkit/parser_value_verification_a1.schema.json +74 -0
  16. package/docs/schemas/altium_toolkit/pcb_class_report_a1.schema.json +79 -0
  17. package/docs/schemas/altium_toolkit/pcb_inspection_a1.schema.json +65 -0
  18. package/docs/schemas/altium_toolkit/pcb_net_membership_a1.schema.json +98 -0
  19. package/docs/schemas/altium_toolkit/project_bundle_a1.schema.json +3 -0
  20. package/docs/schemas/altium_toolkit/project_hierarchy_a1.schema.json +79 -0
  21. package/docs/schemas/altium_toolkit/unsupported_features_a1.schema.json +212 -0
  22. package/docs/testing.md +7 -0
  23. package/examples/README.md +21 -0
  24. package/examples/cli-utils.mjs +148 -0
  25. package/examples/corpus-smoke.mjs +523 -0
  26. package/examples/extract-bom.mjs +47 -0
  27. package/examples/generate-pnp.mjs +59 -0
  28. package/examples/inspect-board.mjs +70 -0
  29. package/examples/inspect-schematic.mjs +406 -0
  30. package/examples/library-catalog.mjs +115 -0
  31. package/examples/net-report.mjs +61 -0
  32. package/examples/validate-library.mjs +59 -0
  33. package/package.json +1 -1
  34. package/spec/library-scope.md +5 -0
  35. package/src/core/BinaryReader.mjs +213 -2
  36. package/src/core/altium/AltiumLibraryBatchExporter.mjs +206 -0
  37. package/src/core/altium/AltiumLibraryRecordBuilder.mjs +293 -0
  38. package/src/core/altium/AltiumParser.mjs +357 -16
  39. package/src/core/altium/AltiumPcbLibExporter.mjs +101 -0
  40. package/src/core/altium/AltiumSchLibExporter.mjs +57 -0
  41. package/src/core/altium/AltiumUnits.mjs +205 -0
  42. package/src/core/altium/AsciiRecordParser.mjs +52 -11
  43. package/src/core/altium/EmbeddedAssetReportBuilder.mjs +383 -0
  44. package/src/core/altium/FixtureCoverageMatrixBuilder.mjs +304 -0
  45. package/src/core/altium/GeometryBoundsReportBuilder.mjs +935 -0
  46. package/src/core/altium/LibraryCatalogArtifactBuilder.mjs +296 -0
  47. package/src/core/altium/LibraryDiffReportBuilder.mjs +260 -0
  48. package/src/core/altium/LibraryInspectionReportBuilder.mjs +156 -0
  49. package/src/core/altium/LibraryQaReportBuilder.mjs +374 -1
  50. package/src/core/altium/NativeStreamInventoryBuilder.mjs +177 -0
  51. package/src/core/altium/NormalizedModelSchema.mjs +3 -31
  52. package/src/core/altium/ParameterCollection.mjs +431 -0
  53. package/src/core/altium/ParameterRecordInventoryBuilder.mjs +274 -0
  54. package/src/core/altium/ParserCompatibilityFuzzer.mjs +106 -2
  55. package/src/core/altium/ParserDiagnosticNormalizer.mjs +213 -0
  56. package/src/core/altium/ParserErrors.mjs +90 -0
  57. package/src/core/altium/ParserFieldCoverageReportBuilder.mjs +656 -0
  58. package/src/core/altium/ParserUtils.mjs +24 -0
  59. package/src/core/altium/ParserValueVerificationReportBuilder.mjs +323 -0
  60. package/src/core/altium/PcbClassReportBuilder.mjs +366 -0
  61. package/src/core/altium/PcbComponentKindPolicy.mjs +9 -9
  62. package/src/core/altium/PcbEmbeddedModelExtractor.mjs +22 -3
  63. package/src/core/altium/PcbInspectionReportBuilder.mjs +313 -0
  64. package/src/core/altium/PcbLayerGroups.mjs +308 -0
  65. package/src/core/altium/PcbLayerStackCustomDataParser.mjs +183 -0
  66. package/src/core/altium/PcbLayerStackInterchangeParser.mjs +473 -4
  67. package/src/core/altium/PcbLayerStackReadModelBuilder.mjs +83 -15
  68. package/src/core/altium/PcbLayerStackSourceMetadataParser.mjs +74 -4
  69. package/src/core/altium/PcbLibModelParser.mjs +20 -4
  70. package/src/core/altium/PcbLibStreamExtractor.mjs +49 -6
  71. package/src/core/altium/PcbModelParser.mjs +223 -4
  72. package/src/core/altium/PcbNetMembershipReportBuilder.mjs +270 -0
  73. package/src/core/altium/PcbOutlineRecovery.mjs +94 -0
  74. package/src/core/altium/PcbStreamExtractor.mjs +130 -6
  75. package/src/core/altium/PcbTrackPrimitiveParser.mjs +66 -2
  76. package/src/core/altium/ProjectDesignBundleBuilder.mjs +15 -0
  77. package/src/core/altium/ProjectHierarchyReportBuilder.mjs +660 -0
  78. package/src/core/altium/ProjectNetlistExporter.mjs +2 -0
  79. package/src/core/altium/RawDataPreservationReportBuilder.mjs +348 -0
  80. package/src/core/altium/SchLibModelParser.mjs +840 -0
  81. package/src/core/altium/SchLibStreamExtractor.mjs +586 -0
  82. package/src/core/altium/SchematicBusEntryParser.mjs +3 -2
  83. package/src/core/altium/SchematicCodeSymbolParser.mjs +663 -0
  84. package/src/core/altium/SchematicConnectivityQaBuilder.mjs +177 -2
  85. package/src/core/altium/SchematicDirectiveParser.mjs +5 -17
  86. package/src/core/altium/SchematicDisplayModeCatalogParser.mjs +10 -1
  87. package/src/core/altium/SchematicFieldCoverageReportBuilder.mjs +549 -0
  88. package/src/core/altium/SchematicHarnessParser.mjs +9 -3
  89. package/src/core/altium/SchematicHyperlinkParser.mjs +122 -0
  90. package/src/core/altium/SchematicNetlistBuilder.mjs +271 -8
  91. package/src/core/altium/SchematicNoErcSymbolResolver.mjs +36 -0
  92. package/src/core/altium/SchematicOwnershipGraphParser.mjs +102 -3
  93. package/src/core/altium/SchematicPinParser.mjs +99 -65
  94. package/src/core/altium/SchematicPrimitiveParser.mjs +125 -22
  95. package/src/core/altium/SchematicQaReportBuilder.mjs +2 -0
  96. package/src/core/altium/SchematicRecordStreamParser.mjs +183 -0
  97. package/src/core/altium/SchematicRecordTypeRegistry.mjs +6 -1
  98. package/src/core/altium/SchematicSheetParser.mjs +8 -2
  99. package/src/core/altium/SchematicStreamExtractor.mjs +107 -21
  100. package/src/core/altium/SchematicTextOrientationResolver.mjs +76 -0
  101. package/src/core/altium/SchematicTextParser.mjs +28 -12
  102. package/src/core/altium/SchematicTextRunParser.mjs +81 -0
  103. package/src/core/altium/SchematicThumbnailParser.mjs +425 -0
  104. package/src/core/altium/SourceBundleExporter.mjs +156 -0
  105. package/src/core/altium/SourceComponentBundleNormalizer.mjs +295 -0
  106. package/src/core/altium/SourceComponentClient.mjs +239 -0
  107. package/src/core/altium/UnsupportedFeatureReportBuilder.mjs +380 -0
  108. package/src/core/ole/OleCompoundDocumentWriter.mjs +449 -0
  109. package/src/parser.mjs +43 -1
  110. package/src/renderers.mjs +1 -0
  111. package/src/styles/altium-renderers.css +6 -6
  112. package/src/ui/PcbArcUtils.mjs +19 -2
  113. package/src/ui/PcbScene3dBuilder.mjs +202 -20
  114. package/src/ui/PcbScene3dModelRegistry.mjs +28 -18
  115. package/src/ui/PcbScene3dPlacementSideResolver.mjs +48 -6
  116. package/src/ui/SchematicColorResolver.mjs +185 -0
  117. package/src/ui/SchematicDirectiveRenderer.mjs +133 -22
  118. package/src/ui/SchematicLineColorResolver.mjs +88 -0
  119. package/src/ui/SchematicNoteRenderer.mjs +5 -1
  120. package/src/ui/SchematicOwnerPinLabelLayout.mjs +269 -8
  121. package/src/ui/SchematicOwnerPinMarkerLineThemer.mjs +155 -0
  122. package/src/ui/SchematicPinSvgRenderer.mjs +229 -62
  123. package/src/ui/SchematicShapeRenderer.mjs +86 -17
  124. package/src/ui/SchematicSvgRenderer.mjs +980 -58
  125. package/src/ui/SchematicTypography.mjs +4 -3
@@ -0,0 +1,56 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "altium-toolkit.embedded-assets.a1",
4
+ "title": "Altium Toolkit Embedded Assets A1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema", "summary", "assets"],
8
+ "properties": {
9
+ "schema": {
10
+ "const": "altium-toolkit.embedded-assets.a1"
11
+ },
12
+ "summary": {
13
+ "type": "object",
14
+ "additionalProperties": true
15
+ },
16
+ "assets": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "object",
20
+ "additionalProperties": true,
21
+ "required": [
22
+ "modelFileName",
23
+ "modelKind",
24
+ "kind",
25
+ "name",
26
+ "format",
27
+ "sourceStream",
28
+ "byteLength"
29
+ ],
30
+ "properties": {
31
+ "modelFileName": {
32
+ "type": "string"
33
+ },
34
+ "modelKind": {
35
+ "type": "string"
36
+ },
37
+ "kind": {
38
+ "type": "string"
39
+ },
40
+ "name": {
41
+ "type": "string"
42
+ },
43
+ "format": {
44
+ "type": "string"
45
+ },
46
+ "sourceStream": {
47
+ "type": "string"
48
+ },
49
+ "byteLength": {
50
+ "type": "number"
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "altium-toolkit.fixture-coverage-matrix.a1",
4
+ "title": "Altium Toolkit Fixture Coverage Matrix A1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": [
8
+ "schema",
9
+ "summary",
10
+ "policy",
11
+ "coverage",
12
+ "contracts",
13
+ "missingCoverage",
14
+ "missingContracts"
15
+ ],
16
+ "properties": {
17
+ "schema": {
18
+ "const": "altium-toolkit.fixture-coverage-matrix.a1"
19
+ },
20
+ "summary": {
21
+ "type": "object",
22
+ "additionalProperties": true,
23
+ "required": [
24
+ "fixtureCount",
25
+ "coverageTagCount",
26
+ "contractCount",
27
+ "missingCoverageCount",
28
+ "missingContractCount",
29
+ "status"
30
+ ],
31
+ "properties": {
32
+ "status": {
33
+ "enum": ["pass", "gap"]
34
+ }
35
+ }
36
+ },
37
+ "policy": {
38
+ "type": "object",
39
+ "additionalProperties": true,
40
+ "required": ["assetPolicy", "nativeAssetCount", "compliant"],
41
+ "properties": {
42
+ "assetPolicy": {
43
+ "type": "string"
44
+ },
45
+ "nativeAssetCount": {
46
+ "type": "number"
47
+ },
48
+ "compliant": {
49
+ "type": "boolean"
50
+ }
51
+ }
52
+ },
53
+ "coverage": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "additionalProperties": true,
58
+ "required": [
59
+ "tag",
60
+ "fixtureKeys",
61
+ "count",
62
+ "required",
63
+ "covered"
64
+ ]
65
+ }
66
+ },
67
+ "contracts": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "object",
71
+ "additionalProperties": true,
72
+ "required": [
73
+ "group",
74
+ "contract",
75
+ "fixtureKeys",
76
+ "count",
77
+ "required",
78
+ "covered"
79
+ ]
80
+ }
81
+ },
82
+ "missingCoverage": {
83
+ "type": "array"
84
+ },
85
+ "missingContracts": {
86
+ "type": "array"
87
+ }
88
+ }
89
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "altium-toolkit.geometry-bounds.a1",
4
+ "title": "Altium Toolkit Geometry Bounds A1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema", "summary", "entries"],
8
+ "properties": {
9
+ "schema": {
10
+ "const": "altium-toolkit.geometry-bounds.a1"
11
+ },
12
+ "summary": {
13
+ "type": "object",
14
+ "additionalProperties": true,
15
+ "required": ["documentCount", "entryCount", "missingBoundsCount"],
16
+ "properties": {
17
+ "documentCount": {
18
+ "type": "number"
19
+ },
20
+ "entryCount": {
21
+ "type": "number"
22
+ },
23
+ "missingBoundsCount": {
24
+ "type": "number"
25
+ },
26
+ "minX": {
27
+ "type": ["number", "null"]
28
+ },
29
+ "minY": {
30
+ "type": ["number", "null"]
31
+ },
32
+ "maxX": {
33
+ "type": ["number", "null"]
34
+ },
35
+ "maxY": {
36
+ "type": ["number", "null"]
37
+ },
38
+ "width": {
39
+ "type": "number"
40
+ },
41
+ "height": {
42
+ "type": "number"
43
+ }
44
+ }
45
+ },
46
+ "entries": {
47
+ "type": "array",
48
+ "items": {
49
+ "type": "object",
50
+ "additionalProperties": true,
51
+ "required": [
52
+ "documentIndex",
53
+ "domain",
54
+ "family",
55
+ "index",
56
+ "status",
57
+ "bounds"
58
+ ],
59
+ "properties": {
60
+ "documentIndex": {
61
+ "type": "number"
62
+ },
63
+ "fileName": {
64
+ "type": "string"
65
+ },
66
+ "domain": {
67
+ "enum": ["schematic", "pcb"]
68
+ },
69
+ "family": {
70
+ "type": "string"
71
+ },
72
+ "index": {
73
+ "type": "number"
74
+ },
75
+ "status": {
76
+ "enum": ["bounded", "missing"]
77
+ },
78
+ "bounds": {
79
+ "type": ["object", "null"],
80
+ "additionalProperties": true
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "altium-toolkit.library.catalog.a1",
4
+ "title": "Altium Toolkit Library Catalog A1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema", "summary", "entries", "searchIndex", "html"],
8
+ "properties": {
9
+ "schema": {
10
+ "const": "altium-toolkit.library.catalog.a1"
11
+ },
12
+ "summary": {
13
+ "type": "object",
14
+ "additionalProperties": true
15
+ },
16
+ "entries": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "object",
20
+ "required": [
21
+ "key",
22
+ "kind",
23
+ "name",
24
+ "libraryFileName",
25
+ "issueCodes",
26
+ "searchText"
27
+ ],
28
+ "properties": {
29
+ "key": {
30
+ "type": "string"
31
+ },
32
+ "kind": {
33
+ "enum": ["symbol", "footprint"]
34
+ },
35
+ "name": {
36
+ "type": "string"
37
+ },
38
+ "libraryFileName": {
39
+ "type": "string"
40
+ },
41
+ "outputSvgKey": {
42
+ "type": "string"
43
+ },
44
+ "issueCodes": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string"
48
+ }
49
+ },
50
+ "searchText": {
51
+ "type": "string"
52
+ }
53
+ },
54
+ "additionalProperties": true
55
+ }
56
+ },
57
+ "searchIndex": {
58
+ "type": "object",
59
+ "additionalProperties": true
60
+ },
61
+ "html": {
62
+ "type": "string"
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "altium-toolkit.library.diff.a1",
4
+ "title": "Altium Toolkit Library Diff A1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema", "summary", "symbols", "footprints"],
8
+ "properties": {
9
+ "schema": {
10
+ "const": "altium-toolkit.library.diff.a1"
11
+ },
12
+ "summary": {
13
+ "type": "object",
14
+ "additionalProperties": true
15
+ },
16
+ "symbols": {
17
+ "$ref": "#/$defs/diffCollection"
18
+ },
19
+ "footprints": {
20
+ "$ref": "#/$defs/diffCollection"
21
+ }
22
+ },
23
+ "$defs": {
24
+ "diffCollection": {
25
+ "type": "object",
26
+ "additionalProperties": true,
27
+ "required": ["added", "removed", "changed"],
28
+ "properties": {
29
+ "added": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "object",
33
+ "additionalProperties": true
34
+ }
35
+ },
36
+ "removed": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "additionalProperties": true
41
+ }
42
+ },
43
+ "changed": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "object",
47
+ "additionalProperties": true,
48
+ "required": ["name", "left", "right", "differences"]
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "altium-toolkit.library.inspection.a1",
4
+ "title": "Altium Toolkit Library Inspection A1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": [
8
+ "schema",
9
+ "summary",
10
+ "libraries",
11
+ "qa",
12
+ "duplicates",
13
+ "staleImplementations",
14
+ "missingModels",
15
+ "multipartMismatches",
16
+ "libraryLint",
17
+ "mergePlan",
18
+ "issues"
19
+ ],
20
+ "properties": {
21
+ "schema": {
22
+ "const": "altium-toolkit.library.inspection.a1"
23
+ },
24
+ "summary": {
25
+ "type": "object",
26
+ "additionalProperties": true
27
+ },
28
+ "libraries": {
29
+ "type": "array",
30
+ "items": {
31
+ "$ref": "#/$defs/libraryRow"
32
+ }
33
+ },
34
+ "qa": {
35
+ "type": "object",
36
+ "additionalProperties": true
37
+ },
38
+ "duplicates": {
39
+ "type": "object",
40
+ "additionalProperties": true
41
+ },
42
+ "staleImplementations": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "object",
46
+ "additionalProperties": true
47
+ }
48
+ },
49
+ "missingModels": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "object",
53
+ "additionalProperties": true
54
+ }
55
+ },
56
+ "multipartMismatches": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "additionalProperties": true
61
+ }
62
+ },
63
+ "libraryLint": {
64
+ "type": "object",
65
+ "additionalProperties": true
66
+ },
67
+ "mergePlan": {
68
+ "type": "object",
69
+ "additionalProperties": true
70
+ },
71
+ "issues": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "object",
75
+ "additionalProperties": true
76
+ }
77
+ }
78
+ },
79
+ "$defs": {
80
+ "libraryRow": {
81
+ "type": "object",
82
+ "additionalProperties": true,
83
+ "required": ["fileName", "kind"],
84
+ "properties": {
85
+ "fileName": {
86
+ "type": "string"
87
+ },
88
+ "kind": {
89
+ "enum": ["schematic-library", "pcb-library"]
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
@@ -59,6 +59,10 @@
59
59
  "mergePlan": {
60
60
  "$ref": "library_merge_plan_a1.schema.json"
61
61
  },
62
+ "libraryLint": {
63
+ "type": "object",
64
+ "additionalProperties": true
65
+ },
62
66
  "issues": {
63
67
  "type": "array",
64
68
  "items": {
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "altium-toolkit.native-stream-inventory.a1",
4
+ "title": "Altium Toolkit Native Stream Inventory A1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema", "summary", "streams"],
8
+ "properties": {
9
+ "schema": {
10
+ "const": "altium-toolkit.native-stream-inventory.a1"
11
+ },
12
+ "summary": {
13
+ "type": "object",
14
+ "additionalProperties": true
15
+ },
16
+ "streams": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "object",
20
+ "required": [
21
+ "sourceStream",
22
+ "leafName",
23
+ "byteLength",
24
+ "known",
25
+ "consumed",
26
+ "classification",
27
+ "checksum"
28
+ ],
29
+ "properties": {
30
+ "source": {
31
+ "type": "string"
32
+ },
33
+ "sourceStorage": {
34
+ "type": "string"
35
+ },
36
+ "sourceStream": {
37
+ "type": "string"
38
+ },
39
+ "leafName": {
40
+ "type": "string"
41
+ },
42
+ "byteLength": {
43
+ "type": "number"
44
+ },
45
+ "known": {
46
+ "type": "boolean"
47
+ },
48
+ "consumed": {
49
+ "type": "boolean"
50
+ },
51
+ "classification": {
52
+ "type": "string"
53
+ },
54
+ "consumedBy": {
55
+ "type": "string"
56
+ },
57
+ "checksum": {
58
+ "type": "object",
59
+ "additionalProperties": true
60
+ }
61
+ },
62
+ "additionalProperties": true
63
+ }
64
+ }
65
+ }
66
+ }