@tscircuit/footprinter 0.0.4 → 0.0.5

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 CHANGED
@@ -43,3 +43,20 @@ should always confirm these footprints against the datasheet.
43
43
 
44
44
  - Pins are CCW starting at the top left
45
45
  - Y is upward-positive, X is rightward-positive
46
+
47
+ ## Slop
48
+
49
+ Slop is a "sloppy" definition, it really doesn't have enough
50
+ information to draw a footprint, i.e. it's missing critical dimensions.
51
+
52
+ footprinter is extremely tolerant to Slop, because it's useful
53
+ when you're iterating incrementally towards a fully constrained
54
+ design, or when you're using footprinter strings as an output format
55
+ for an AI.
56
+
57
+ Generally when footprinter is interpreting a sloppy definition, it will use
58
+ industry best practices or otherwise "reasonable" defaults. In theory, upgrading
59
+ footprinter could cause the defaults to change, which is why sloppy definitions
60
+ are generally not desirable.
61
+
62
+ Currently it's not possible to see if a given definition is sloppy.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/footprinter",
3
3
  "type": "module",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "description": "",
6
6
  "main": "dist/index.cjs",
7
7
  "scripts": {
@@ -12,7 +12,10 @@
12
12
  "author": "",
13
13
  "license": "ISC",
14
14
  "devDependencies": {
15
+ "@tscircuit/log-soup": "^1.0.1",
15
16
  "@tscircuit/soup": "^0.0.17",
17
+ "@tscircuit/soup-util": "^0.0.11",
18
+ "@types/node": "^20.12.13",
16
19
  "ava": "^6.1.3",
17
20
  "esbuild": "^0.21.4",
18
21
  "esbuild-register": "^3.5.0",
package/tests/dip.test.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import test from "ava"
2
2
  import { fp } from "../src/footprinter"
3
- import { AnySoupElement } from "@tscircuit/soup"
3
+ import type { AnySoupElement } from "@tscircuit/soup"
4
4
  import { toPinPositionString } from "./fixtures"
5
5
 
6
6
  test("dip params", (t) => {
@@ -0,0 +1,14 @@
1
+ import type { ExecutionContext } from "ava"
2
+ import { fp } from "../../src"
3
+ import { logSoup } from "@tscircuit/log-soup"
4
+ import type { AnySoupElement } from "@tscircuit/soup"
5
+
6
+ export const getTestFixture = async (t: ExecutionContext) => {
7
+ return {
8
+ fp,
9
+ logSoup: (soup: AnySoupElement[]) => {
10
+ if (process.env.CI) return
11
+ return logSoup(`footprinter: ${t.title}`, soup)
12
+ },
13
+ }
14
+ }
@@ -1,5 +1,7 @@
1
1
  import type { AnySoupElement } from "@tscircuit/soup"
2
2
 
3
+ export { getTestFixture } from "./get-test-fixture"
4
+
3
5
  export const toPinPositionString = (soup: AnySoupElement[]) => {
4
6
  return soup
5
7
  .map((e: AnySoupElement) => {
@@ -0,0 +1,18 @@
1
+ import test from "ava"
2
+ import { getTestFixture } from "../fixtures"
3
+ import type { AnySoupElement } from "@tscircuit/soup"
4
+
5
+ export const SLOP_LIST = ["dip3"]
6
+
7
+ test("slop1", async (t) => {
8
+ const { fp, logSoup } = await getTestFixture(t)
9
+
10
+ const soups: AnySoupElement[][] = []
11
+
12
+ for (const slop of SLOP_LIST) {
13
+ const soup = fp.string(slop).soup()
14
+ soups.push(soup)
15
+ }
16
+
17
+ await logSoup(soups[0]!)
18
+ })