create-rulecad 0.1.2 → 0.2.0

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/index.mjs CHANGED
@@ -16,7 +16,7 @@ fs.renameSync(path.join(dir, 'gitignore'), path.join(dir, '.gitignore')); // npm
16
16
  const readme = path.join(dir, 'README.md');
17
17
  fs.writeFileSync(readme, fs.readFileSync(readme, 'utf8').replaceAll('NAME', name));
18
18
  // $RULECAD_LOCAL: a rulecad checkout to use instead of npm (to try unpublished changes)
19
- const from = (pkg) => (process.env.RULECAD_LOCAL ? `file:${path.join(path.resolve(process.env.RULECAD_LOCAL), 'packages', pkg)}` : '^0.1.0');
19
+ const from = (pkg) => (process.env.RULECAD_LOCAL ? `file:${path.join(path.resolve(process.env.RULECAD_LOCAL), 'packages', pkg)}` : '^0.2.0');
20
20
  fs.writeFileSync(path.join(dir, 'package.json'), `${JSON.stringify({
21
21
  name, private: true, type: 'module',
22
22
  scripts: { check: 'cad check home/soap-tray' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rulecad",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Start a rulecad project: npm create rulecad my-designs. A workspace with a soap tray to start from, ready to check, preview, export and share.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,6 +47,18 @@ variable says which rule it comes from. Follow these steps; they're what makes a
47
47
  with ranges from rules. An overlap or gap outside its range is a finding: report it with the numbers, and never
48
48
  widen a range to make it pass without saying why.
49
49
  - Build bigger things from checked assemblies used as items, rather than placing their objects again.
50
+ - A part is named in fits as `<item>.<part>`; an object that returns one unnamed shape has one part, `body`.
51
+ - A gap fit can't tell whether holes line up. Where a board screws into a part, add a holes fit
52
+ (`{ "holes": "pcb.board", "into": "case.body", "depth": "m2.insert_length" }`).
53
+ - A part built around another (a case around its board) reads it: `"uses": ["node/carrier"]`, then
54
+ `carrier.board_w` and `v.carrier.board_holes`. Never copy another object's numbers by hand.
55
+
56
+ ## Circuit boards
57
+ - `"engine": "pcb"` in the .json; `main(v)` returns a board built with `v.pcb` (see @rulecad/pcb's README).
58
+ - Parts come from rule sets where one exists (`v.pcb.xiao`, `qwiic`, `jstph`, `header`), or any standard footprint by
59
+ name (`v.pcb.part('U2', 'soic8', x, y)`). Turn parts in quarter turns with `rotation`, held in a variable.
60
+ - Join pins with `nets` (`GND: ['U1.GND', 'J1.GND']`) and let the autorouter draw them; `cad check` runs the fab's
61
+ design rules. Look at the copper preview: connectors should face the edge their plug comes from.
50
62
 
51
63
  ## Talking to the person
52
64
  - Give links as one labelled line (`npx cad link <project>/<object> --md`), never a raw URL. If it says