@helios-lang/contract-utils 0.2.74 → 0.2.75

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/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@helios-lang/contract-utils",
3
- "version": "0.2.74",
3
+ "version": "0.2.75",
4
4
  "description": "Convenience and type-safety utilities for using Helios validators from within Typescript",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
7
7
  "exports": {
8
+ ".": "./src/index.js",
8
9
  "./set-fs-build-cache": "./src/context/set-fs-build-cache.js"
9
10
  },
10
11
  "sideEffects": [
@@ -34,16 +34,23 @@ class FileSystemCache {
34
34
  cacheDir
35
35
 
36
36
  constructor() {
37
- this.fs = require("node:fs")
38
- this.os = require("node:os")
39
- this.path = require("node:path")
40
- this.cacheDir = this.path.join(this.os.tmpdir(), "helios-cache")
37
+ // hopefully this loads before starting the context build
38
+ Promise.all([
39
+ import("node:fs"),
40
+ import("node:os"),
41
+ import("node:path")
42
+ ]).then(([fs, os, path]) => {
43
+ this.fs = fs
44
+ this.os = os
45
+ this.path = path
46
+ this.cacheDir = this.path.join(this.os.tmpdir(), "helios-cache")
41
47
 
42
- if (!this.fs.existsSync(this.cacheDir)) {
43
- this.fs.mkdirSync(this.cacheDir, {
44
- recursive: true
45
- })
46
- }
48
+ if (!this.fs.existsSync(this.cacheDir)) {
49
+ this.fs.mkdirSync(this.cacheDir, {
50
+ recursive: true
51
+ })
52
+ }
53
+ })
47
54
  }
48
55
 
49
56
  /**