@parcel/utils 2.0.0-nightly.941 → 2.0.0-nightly.942

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/lib/config.js CHANGED
@@ -112,7 +112,6 @@ async function loadConfig(fs, filepath, filenames, projectRoot, opts) {
112
112
  }
113
113
 
114
114
  let configContent = await fs.readFile(configFile, 'utf8');
115
- if (!configContent) return null;
116
115
  let config;
117
116
 
118
117
  if (parse === false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/utils",
3
- "version": "2.0.0-nightly.941+17404e9a",
3
+ "version": "2.0.0-nightly.942+b27515ec",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -21,11 +21,11 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@iarna/toml": "^2.2.0",
24
- "@parcel/codeframe": "2.0.0-nightly.941+17404e9a",
25
- "@parcel/diagnostic": "2.0.0-nightly.941+17404e9a",
26
- "@parcel/hash": "2.0.2-nightly.2563+17404e9a",
27
- "@parcel/logger": "2.0.0-nightly.941+17404e9a",
28
- "@parcel/markdown-ansi": "2.0.0-nightly.941+17404e9a",
24
+ "@parcel/codeframe": "2.0.0-nightly.942+b27515ec",
25
+ "@parcel/diagnostic": "2.0.0-nightly.942+b27515ec",
26
+ "@parcel/hash": "2.0.2-nightly.2564+b27515ec",
27
+ "@parcel/logger": "2.0.0-nightly.942+b27515ec",
28
+ "@parcel/markdown-ansi": "2.0.0-nightly.942+b27515ec",
29
29
  "@parcel/source-map": "^2.0.0",
30
30
  "ansi-html-community": "0.0.8",
31
31
  "chalk": "^4.1.0",
@@ -51,5 +51,5 @@
51
51
  "./src/http-server.js": false,
52
52
  "./src/openInBrowser.js": false
53
53
  },
54
- "gitHead": "17404e9a9ee6323b973a681017937a4bc6966277"
54
+ "gitHead": "b27515ec0eb557971dfe83ad3692fd208a9ee397"
55
55
  }
package/src/config.js CHANGED
@@ -82,7 +82,6 @@ export async function loadConfig(
82
82
  }
83
83
 
84
84
  let configContent = await fs.readFile(configFile, 'utf8');
85
- if (!configContent) return null;
86
85
 
87
86
  let config;
88
87
  if (parse === false) {
@@ -0,0 +1,50 @@
1
+ // @flow strict-local
2
+
3
+ import assert from 'assert';
4
+ import {loadConfig} from '../src/config';
5
+ import {inputFS as fs} from '@parcel/test-utils';
6
+ import path from 'path';
7
+
8
+ describe('loadConfig', () => {
9
+ it('load config with json', async () => {
10
+ assert.deepEqual(
11
+ (
12
+ await loadConfig(
13
+ fs,
14
+ path.join(__dirname, './input/config/config.json'),
15
+ ['config.json'],
16
+ path.join(__dirname, './input/config/'),
17
+ )
18
+ )?.config,
19
+ {
20
+ hoge: 'fuga',
21
+ },
22
+ );
23
+ });
24
+
25
+ it('should throw error with empty string json', async () => {
26
+ // $FlowFixMe[prop-missing]
27
+ await assert.rejects(async () => {
28
+ await loadConfig(
29
+ fs,
30
+ path.join(__dirname, './input/config/empty.json'),
31
+ ['empty.json'],
32
+ path.join(__dirname, './input/config/'),
33
+ );
34
+ });
35
+ });
36
+
37
+ it('should load with empty string config toml', async () => {
38
+ assert.deepEqual(
39
+ (
40
+ await loadConfig(
41
+ fs,
42
+ path.join(__dirname, './input/config/empty.toml'),
43
+ ['empty.toml'],
44
+ path.join(__dirname, './input/config/'),
45
+ )
46
+ )?.config,
47
+ {},
48
+ );
49
+ });
50
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "hoge": "fuga"
3
+ }
File without changes
File without changes