@rulecad/cad 0.5.0 → 0.5.1

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/lib/sandbox.mjs +3 -3
  2. package/package.json +1 -1
package/lib/sandbox.mjs CHANGED
@@ -8,7 +8,7 @@
8
8
  import fs from 'node:fs';
9
9
  import path from 'node:path';
10
10
  import { spawn } from 'node:child_process';
11
- import { createRequire, registerHooks } from 'node:module';
11
+ import * as nodeModule from 'node:module';
12
12
  import { pathToFileURL, fileURLToPath } from 'node:url';
13
13
  import { WS, TOOL, config } from './workspace.mjs';
14
14
  import { fromFaces } from './parts.mjs';
@@ -19,7 +19,7 @@ const flag = (() => {
19
19
  return f.has('--permission') ? '--permission' : f.has('--experimental-permission') ? '--experimental-permission' : null;
20
20
  })();
21
21
 
22
- const inThread = typeof registerHooks === 'function'; // import hooks in this thread; older Node needs a worker for them
22
+ const inThread = typeof nodeModule.registerHooks === 'function'; // import hooks in this thread; older Node needs a worker for them
23
23
 
24
24
  /** Whether designs run sandboxed here. */
25
25
  export const sandboxed = () => !!flag && process.env.CAD_TRUST !== '1' && config.sandbox !== false;
@@ -28,7 +28,7 @@ export const sandboxed = () => !!flag && process.env.CAD_TRUST !== '1' && config
28
28
  function readable() {
29
29
  const real = (p) => { try { return fs.realpathSync(p); } catch { return null; } };
30
30
  const pkgDir = (name, from) => { // the package's folder: from its entry up to its package.json (exports may hide that file)
31
- try { let d = path.dirname(createRequire(from).resolve(name)); while (!fs.existsSync(path.join(d, 'package.json')) && path.dirname(d) !== d) d = path.dirname(d); return d; } catch { return null; }
31
+ try { let d = path.dirname(nodeModule.createRequire(from).resolve(name)); while (!fs.existsSync(path.join(d, 'package.json')) && path.dirname(d) !== d) d = path.dirname(d); return d; } catch { return null; }
32
32
  };
33
33
  const fromWs = path.join(WS, 'package.json'), fromTool = path.join(TOOL, 'package.json');
34
34
  // Every node_modules above the workspace and the tool (package lookups read their links), and where links lead
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulecad/cad",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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": {