@webiny/global-config 0.0.0-unstable.df7a8bb475 → 0.0.0-unstable.e2758ee1cf

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/index.js +5 -5
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import os from "os";
2
2
  import path from "path";
3
3
  import { v4 as uuidv4 } from "uuid";
4
- import readJson from "load-json-file";
5
- import writeJson from "write-json-file";
4
+ import { loadJsonFileSync } from "load-json-file";
5
+ import { writeJsonFileSync } from "write-json-file";
6
6
  import { isCI } from "ci-info";
7
7
 
8
8
  const GLOBAL_CONFIG_PATH = path.join(os.homedir(), ".webiny", "config");
@@ -12,7 +12,7 @@ export const globalConfig = {
12
12
  get(key) {
13
13
  try {
14
14
  if (!this.__globalConfig) {
15
- this.__globalConfig = readJson.sync(GLOBAL_CONFIG_PATH);
15
+ this.__globalConfig = loadJsonFileSync(GLOBAL_CONFIG_PATH);
16
16
  if (!this.__globalConfig.id) {
17
17
  throw Error("Invalid Webiny config!");
18
18
  }
@@ -29,7 +29,7 @@ export const globalConfig = {
29
29
  // Also, in CI environments, we always set this to `false`.
30
30
  newUser: isCI ? false : true
31
31
  };
32
- writeJson.sync(GLOBAL_CONFIG_PATH, this.__globalConfig);
32
+ writeJsonFileSync(GLOBAL_CONFIG_PATH, this.__globalConfig);
33
33
  }
34
34
 
35
35
  return key ? this.__globalConfig[key] : this.__globalConfig;
@@ -37,7 +37,7 @@ export const globalConfig = {
37
37
  set(key, value) {
38
38
  const globalConfig = this.get();
39
39
  globalConfig[key] = value;
40
- writeJson.sync(GLOBAL_CONFIG_PATH, globalConfig);
40
+ writeJsonFileSync(GLOBAL_CONFIG_PATH, globalConfig);
41
41
  return globalConfig;
42
42
  }
43
43
  };
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@webiny/global-config",
3
- "version": "0.0.0-unstable.df7a8bb475",
3
+ "version": "0.0.0-unstable.e2758ee1cf",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
8
  "ci-info": "4.4.0",
9
- "load-json-file": "6.2.0",
9
+ "load-json-file": "7.0.1",
10
10
  "uuid": "13.0.0",
11
- "write-json-file": "4.3.0"
11
+ "write-json-file": "7.0.0"
12
12
  },
13
13
  "publishConfig": {
14
14
  "access": "public",
15
15
  "directory": "."
16
16
  },
17
- "gitHead": "df7a8bb4755a1da047f0af8c56bdb649cc81bf7d"
17
+ "gitHead": "e2758ee1cfa3b9a7152e9bb995a90ccabd33266f"
18
18
  }