@tscircuit/core 0.0.865 → 0.0.866
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 +16 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -609,16 +609,19 @@ var cssSelectPrimitiveComponentAdapterOnlySubcircuits = {
|
|
|
609
609
|
};
|
|
610
610
|
|
|
611
611
|
// lib/components/base-components/PrimitiveComponent/preprocessSelector.ts
|
|
612
|
-
var
|
|
612
|
+
var buildPlusMinusNetErrorMessage = (selector, component) => {
|
|
613
|
+
const netName = selector.split("net.")[1]?.split(/[ >]/)[0] ?? selector;
|
|
614
|
+
const componentName = component?.componentName ?? "Unknown component";
|
|
615
|
+
return `Net names cannot contain "+" or "-" (component "${componentName}" received "${netName}" via "${selector}"). Try using underscores instead, e.g. VCC_P`;
|
|
616
|
+
};
|
|
617
|
+
var preprocessSelector = (selector, component) => {
|
|
613
618
|
if (/net\.[^\s>]*\./.test(selector)) {
|
|
614
619
|
throw new Error(
|
|
615
620
|
'Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3'
|
|
616
621
|
);
|
|
617
622
|
}
|
|
618
623
|
if (/net\.[^\s>]*[+-]/.test(selector)) {
|
|
619
|
-
throw new Error(
|
|
620
|
-
'Net names cannot contain "+" or "-", try using underscores instead, e.g. VCC_P'
|
|
621
|
-
);
|
|
624
|
+
throw new Error(buildPlusMinusNetErrorMessage(selector, component));
|
|
622
625
|
}
|
|
623
626
|
if (/net\.[0-9]/.test(selector)) {
|
|
624
627
|
const match = selector.match(/net\.([^ >]+)/);
|
|
@@ -1166,7 +1169,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1166
1169
|
if (this._cachedSelectAllQueries.has(selectorRaw)) {
|
|
1167
1170
|
return this._cachedSelectAllQueries.get(selectorRaw);
|
|
1168
1171
|
}
|
|
1169
|
-
const selector = preprocessSelector(selectorRaw);
|
|
1172
|
+
const selector = preprocessSelector(selectorRaw, this);
|
|
1170
1173
|
const result = selectAll(
|
|
1171
1174
|
selector,
|
|
1172
1175
|
this,
|
|
@@ -1190,7 +1193,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1190
1193
|
if (this._cachedSelectOneQueries.has(selectorRaw)) {
|
|
1191
1194
|
return this._cachedSelectOneQueries.get(selectorRaw);
|
|
1192
1195
|
}
|
|
1193
|
-
const selector = preprocessSelector(selectorRaw);
|
|
1196
|
+
const selector = preprocessSelector(selectorRaw, this);
|
|
1194
1197
|
if (options?.port) {
|
|
1195
1198
|
options.type = "port";
|
|
1196
1199
|
}
|
|
@@ -1649,7 +1652,9 @@ import { autoroute } from "@tscircuit/infgrid-ijump-astar";
|
|
|
1649
1652
|
var netProps = z4.object({
|
|
1650
1653
|
name: z4.string().refine(
|
|
1651
1654
|
(val) => !/[+-]/.test(val),
|
|
1652
|
-
|
|
1655
|
+
(val) => ({
|
|
1656
|
+
message: `Net names cannot contain "+" or "-" (component "Net" received "${val}"). Try using underscores instead, e.g. VCC_P`
|
|
1657
|
+
})
|
|
1653
1658
|
)
|
|
1654
1659
|
});
|
|
1655
1660
|
var Net = class extends PrimitiveComponent2 {
|
|
@@ -1840,9 +1845,9 @@ var createNetsFromProps = (component, props) => {
|
|
|
1840
1845
|
);
|
|
1841
1846
|
}
|
|
1842
1847
|
if (/net\.[^\s>]*[+-]/.test(prop)) {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
);
|
|
1848
|
+
const netName = prop.split("net.")[1];
|
|
1849
|
+
const message = `Net names cannot contain "+" or "-" (component "${component.componentName}" received "${netName}" via "${prop}"). Try using underscores instead, e.g. VCC_P`;
|
|
1850
|
+
throw new Error(message);
|
|
1846
1851
|
}
|
|
1847
1852
|
if (/net\.[0-9]/.test(prop)) {
|
|
1848
1853
|
const netName = prop.split("net.")[1];
|
|
@@ -17898,7 +17903,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17898
17903
|
var package_default = {
|
|
17899
17904
|
name: "@tscircuit/core",
|
|
17900
17905
|
type: "module",
|
|
17901
|
-
version: "0.0.
|
|
17906
|
+
version: "0.0.865",
|
|
17902
17907
|
types: "dist/index.d.ts",
|
|
17903
17908
|
main: "dist/index.js",
|
|
17904
17909
|
module: "dist/index.js",
|