@lionweb/utilities 0.9.0 → 0.10.0-beta.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0 — not yet released
4
+
5
+ * Deprecate the `readFileAsJson` and `writeJsonAsFile` functions in favor of the `readFileAsJsonSync` and `writeJsonAsFileSync` functions from `@lionweb/node-utils`.
6
+ (This change has been propagated throughout the entire codebase.)
7
+
8
+
3
9
  ## 0.9.0
4
10
 
5
11
  * Expose types associated with the `measure` function — m.n. `Metrics`.
@@ -1,3 +1,11 @@
1
+ /**
2
+ * @deprecated Use `writeJsonAsFileSync` from `@lionweb/node-utils` instead,
3
+ * so that the utilities package doesn’t need to depend on Node.js.
4
+ */
1
5
  export declare const writeJsonAsFile: (path: string, json: unknown) => void;
6
+ /**
7
+ * @deprecated Use `writeJsonAsFileSync` from `@lionweb/node-utils` instead.
8
+ * so that the utilities package doesn’t need to depend on Node.js.
9
+ */
2
10
  export declare const readFileAsJson: (path: string) => unknown;
3
11
  //# sourceMappingURL=json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,MAAM,OAAO,SAAkD,CAAA;AAE7G,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OAAoD,CAAA"}
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,MAAM,OAAO,SAAkD,CAAA;AAE7G;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OAAoD,CAAA"}
@@ -1,5 +1,13 @@
1
1
  import { asPrettyJsonString } from "@lionweb/ts-utils";
2
2
  import { readFileSync, writeFileSync } from "fs";
3
+ /**
4
+ * @deprecated Use `writeJsonAsFileSync` from `@lionweb/node-utils` instead,
5
+ * so that the utilities package doesn’t need to depend on Node.js.
6
+ */
3
7
  export const writeJsonAsFile = (path, json) => writeFileSync(path, asPrettyJsonString(json));
8
+ /**
9
+ * @deprecated Use `writeJsonAsFileSync` from `@lionweb/node-utils` instead.
10
+ * so that the utilities package doesn’t need to depend on Node.js.
11
+ */
4
12
  export const readFileAsJson = (path) => JSON.parse(readFileSync(path).toString());
5
13
  //# sourceMappingURL=json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAGhD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,IAAa,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAA;AAE7G,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAGhD;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,IAAa,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAA;AAE7G;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lionweb/utilities",
3
- "version": "0.9.0",
3
+ "version": "0.10.0-beta.0",
4
4
  "description": "LionWeb utilities",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,13 +15,16 @@
15
15
  "url": "https://github.com/LionWeb-io/lionweb-typescript/issues"
16
16
  },
17
17
  "dependencies": {
18
- "@lionweb/core": "0.9.0",
19
- "@lionweb/json": "0.9.0",
20
- "@lionweb/textgen-utils": "0.9.0",
21
- "@lionweb/ts-utils": "0.9.0",
18
+ "@lionweb/core": "0.10.0-beta.0",
19
+ "@lionweb/json": "0.10.0-beta.0",
20
+ "@lionweb/textgen-utils": "0.10.0-beta.0",
21
+ "@lionweb/ts-utils": "0.10.0-beta.0",
22
22
  "littoral-templates": "0.5.1",
23
23
  "nanoid": "5.1.6"
24
24
  },
25
+ "optionalDependencies": {
26
+ "@types/node": "25.2.2"
27
+ },
25
28
  "scripts": {
26
29
  "clean": "npx rimraf dist node_modules -g lionweb-utilities-*.tgz",
27
30
  "build": "tsc",
package/src/utils/json.ts CHANGED
@@ -2,7 +2,15 @@ import { asPrettyJsonString } from "@lionweb/ts-utils"
2
2
  import { readFileSync, writeFileSync } from "fs"
3
3
 
4
4
 
5
+ /**
6
+ * @deprecated Use `writeJsonAsFileSync` from `@lionweb/node-utils` instead,
7
+ * so that the utilities package doesn’t need to depend on Node.js.
8
+ */
5
9
  export const writeJsonAsFile = (path: string, json: unknown) => writeFileSync(path, asPrettyJsonString(json))
6
10
 
11
+ /**
12
+ * @deprecated Use `writeJsonAsFileSync` from `@lionweb/node-utils` instead.
13
+ * so that the utilities package doesn’t need to depend on Node.js.
14
+ */
7
15
  export const readFileAsJson = (path: string): unknown => JSON.parse(readFileSync(path).toString())
8
16