@tscircuit/core 0.0.441 → 0.0.443

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 (2) hide show
  1. package/dist/index.js +21 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -476,6 +476,16 @@ var cssSelectPrimitiveComponentAdapterOnlySubcircuits = {
476
476
 
477
477
  // lib/components/base-components/PrimitiveComponent/preprocessSelector.ts
478
478
  var preprocessSelector = (selector) => {
479
+ if (/net\.[^\s>]*\./.test(selector)) {
480
+ throw new Error(
481
+ 'Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3'
482
+ );
483
+ }
484
+ if (/net\.[0-9]/.test(selector)) {
485
+ throw new Error(
486
+ 'Net names cannot start with a number, try using a prefix like "VBUS1"'
487
+ );
488
+ }
479
489
  return selector.replace(/ pin/g, " port").replace(/ subcircuit\./g, " group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g, "$1 > $2").replace(
480
490
  /(^|[ >])(?!pin\.)(?!port\.)(?!net\.)([A-Z][A-Za-z0-9_-]*)\.([A-Za-z0-9_-]+)/g,
481
491
  (_, sep, name, pin) => {
@@ -1597,6 +1607,16 @@ var Net = class extends PrimitiveComponent2 {
1597
1607
  var createNetsFromProps = (component, props) => {
1598
1608
  for (const prop of props) {
1599
1609
  if (typeof prop === "string" && prop.startsWith("net.")) {
1610
+ if (/net\.[^\s>]*\./.test(prop)) {
1611
+ throw new Error(
1612
+ 'Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3'
1613
+ );
1614
+ }
1615
+ if (/net\.[0-9]/.test(prop)) {
1616
+ throw new Error(
1617
+ 'Net names cannot start with a number, try using a prefix like "VBUS1"'
1618
+ );
1619
+ }
1600
1620
  const subcircuit = component.getSubcircuit();
1601
1621
  if (!subcircuit.selectOne(prop)) {
1602
1622
  const net = new Net({
@@ -9387,7 +9407,7 @@ import { identity as identity4 } from "transformation-matrix";
9387
9407
  var package_default = {
9388
9408
  name: "@tscircuit/core",
9389
9409
  type: "module",
9390
- version: "0.0.440",
9410
+ version: "0.0.442",
9391
9411
  types: "dist/index.d.ts",
9392
9412
  main: "dist/index.js",
9393
9413
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.441",
4
+ "version": "0.0.443",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",