@rulecad/cad 0.7.60 → 0.7.61

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/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ print (a hole's diameter, a seat's depth, a part's outline). Each release lists
5
5
  its reason. A **fasten** is an entry in an assembly's `"fasten"` list: one screwed joint, naming the screw by thread
6
6
  and head, the parts it passes through and the part it ends in.
7
7
 
8
+ ## 0.7.61: a board rebuilt when its finish changes
9
+
10
+ ### Fixed
11
+
12
+ - A board's cached build now misses when @rulecad/smooth changes, not only @rulecad/pcb: its build runs smooth's
13
+ smoothing and finish, so a change there could leave a board built by the old code (the engine id hashes both).
14
+
15
+ ### Printed sizes that moved
16
+
17
+ None. Boards build again once (their cache key changed); what they build is the same unless @rulecad/smooth changed.
18
+
8
19
  ## 0.7.60: pins, magnets and printed bolts in assemblies, and the holds coupon (Fixings 4)
9
20
 
10
21
  ### Added
@@ -54,6 +65,7 @@ they are found, checked and counted.
54
65
  ### Printed sizes that moved
55
66
 
56
67
  None.
68
+
57
69
  ## 0.7.58: frame checks (Frames 3)
58
70
 
59
71
  ### Added
package/lib/versions.mjs CHANGED
@@ -82,9 +82,13 @@ export function packageVersion(name, from = import.meta.url) {
82
82
  const ENGINE_LIBS = ['@tscircuit/capacity-autorouter', '@tscircuit/footprinter', '@tscircuit/checks', 'schematic-symbols'];
83
83
  const engineLibs = () => ENGINE_LIBS.map((n) => `${n}@${packageVersion(n, import.meta.resolve('@rulecad/pcb'))}`).join(' ');
84
84
  const engineHash = (code) => crypto.createHash('sha256').update(`${code.trimEnd()}\n${engineLibs()}`).digest('hex').slice(0, 16);
85
+ // The board engine's code: @rulecad/pcb's modules, and @rulecad/smooth's, which a board's build runs too (smoothing its
86
+ // tracks, finishing them): a change to either is a change to what a board builds, so it must miss the cache
87
+ const sources = (dir) => fs.readdirSync(dir).filter((f) => f.endsWith('.mjs') && f !== 'test.mjs').sort().map((f) => fs.readFileSync(path.join(dir, f), 'utf8')).join('\n');
85
88
  export const engineId = () => {
86
- const dir = path.dirname(fileURLToPath(import.meta.resolve('@rulecad/pcb')));
87
- return engineHash(fs.readdirSync(dir).filter((f) => f.endsWith('.mjs') && f !== 'test.mjs').sort().map((f) => fs.readFileSync(path.join(dir, f), 'utf8')).join('\n'));
89
+ const pcb = import.meta.resolve('@rulecad/pcb'), dir = path.dirname(fileURLToPath(pcb));
90
+ const smooth = path.dirname(createRequire(pcb).resolve('@rulecad/smooth'));
91
+ return engineHash(`${sources(dir)}\n${sources(smooth)}`);
88
92
  };
89
93
  // From a tag's message, or for releases before tags recorded it, from the engine's code in the repo at the tag
90
94
  function taggedEngine(tag) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulecad/cad",
3
- "version": "0.7.60",
3
+ "version": "0.7.61",
4
4
  "description": "The cad command: JSCAD designs from traceable rules, checked for printing and fit, versioned by what fits, shared as links and exported as Bambu 3MF.",
5
5
  "type": "module",
6
6
  "bin": {