@parcel/utils 2.0.0-nightly.898 → 2.0.0-nightly.907
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 +7 -7
- package/src/collection.js +2 -2
- package/src/debounce.js +1 -1
- package/src/getExisting.js +1 -4
- package/src/hash.js +1 -1
- package/src/replaceBundleReferences.js +4 -3
- package/src/schema.js +1 -1
- package/src/sourcemap.js +2 -1
- package/test/DefaultMap.test.js +7 -4
- package/test/throttle.test.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/utils",
|
|
3
|
-
"version": "2.0.0-nightly.
|
|
3
|
+
"version": "2.0.0-nightly.907+d2a9b6bd",
|
|
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.
|
|
25
|
-
"@parcel/diagnostic": "2.0.0-nightly.
|
|
26
|
-
"@parcel/hash": "2.0.1-nightly.
|
|
27
|
-
"@parcel/logger": "2.0.0-nightly.
|
|
28
|
-
"@parcel/markdown-ansi": "2.0.0-nightly.
|
|
24
|
+
"@parcel/codeframe": "2.0.0-nightly.907+d2a9b6bd",
|
|
25
|
+
"@parcel/diagnostic": "2.0.0-nightly.907+d2a9b6bd",
|
|
26
|
+
"@parcel/hash": "2.0.1-nightly.2529+d2a9b6bd",
|
|
27
|
+
"@parcel/logger": "2.0.0-nightly.907+d2a9b6bd",
|
|
28
|
+
"@parcel/markdown-ansi": "2.0.0-nightly.907+d2a9b6bd",
|
|
29
29
|
"@parcel/source-map": "^2.0.0",
|
|
30
30
|
"ansi-html-community": "0.0.8",
|
|
31
31
|
"chalk": "^4.1.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@babel/plugin-transform-flow-strip-types": "^7.2.0",
|
|
47
47
|
"random-int": "^1.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "d2a9b6bdd93855b468fa9911dad27a49e54e9557"
|
|
50
50
|
}
|
package/src/collection.js
CHANGED
|
@@ -6,14 +6,14 @@ export function unique<T>(array: Array<T>): Array<T> {
|
|
|
6
6
|
|
|
7
7
|
export function objectSortedEntries(obj: {
|
|
8
8
|
+[string]: mixed,
|
|
9
|
-
|
|
9
|
+
...
|
|
10
10
|
}): Array<[string, mixed]> {
|
|
11
11
|
return Object.entries(obj).sort(([keyA], [keyB]) => keyA.localeCompare(keyB));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function objectSortedEntriesDeep(object: {
|
|
15
15
|
+[string]: mixed,
|
|
16
|
-
|
|
16
|
+
...
|
|
17
17
|
}): Array<[string, mixed]> {
|
|
18
18
|
let sortedEntries = objectSortedEntries(object);
|
|
19
19
|
for (let i = 0; i < sortedEntries.length; i++) {
|
package/src/debounce.js
CHANGED
package/src/getExisting.js
CHANGED
|
@@ -14,10 +14,7 @@ export default function getExisting(
|
|
|
14
14
|
return {
|
|
15
15
|
source,
|
|
16
16
|
minified: fs.existsSync(minifiedPath)
|
|
17
|
-
? fs
|
|
18
|
-
.readFileSync(minifiedPath, 'utf8')
|
|
19
|
-
.trim()
|
|
20
|
-
.replace(/;$/, '')
|
|
17
|
+
? fs.readFileSync(minifiedPath, 'utf8').trim().replace(/;$/, '')
|
|
21
18
|
: source,
|
|
22
19
|
};
|
|
23
20
|
}
|
package/src/hash.js
CHANGED
|
@@ -131,9 +131,10 @@ export async function replaceInlineReferences({
|
|
|
131
131
|
entryBundle,
|
|
132
132
|
bundleGraph,
|
|
133
133
|
);
|
|
134
|
-
let packagedContents = (
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
let packagedContents = (
|
|
135
|
+
packagedBundle.contents instanceof Readable
|
|
136
|
+
? await bufferStream(packagedBundle.contents)
|
|
137
|
+
: packagedBundle.contents
|
|
137
138
|
).toString();
|
|
138
139
|
|
|
139
140
|
let inlineType = nullthrows(entryBundle.getMainEntry()).meta.inlineType;
|
package/src/schema.js
CHANGED
package/src/sourcemap.js
CHANGED
|
@@ -5,7 +5,8 @@ import SourceMap from '@parcel/source-map';
|
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import {normalizeSeparators, isAbsolute} from './path';
|
|
7
7
|
|
|
8
|
-
export const SOURCEMAP_RE: RegExp =
|
|
8
|
+
export const SOURCEMAP_RE: RegExp =
|
|
9
|
+
/(?:\/\*|\/\/)\s*[@#]\s*sourceMappingURL\s*=\s*([^\s*]+)(?:\s*\*\/)?\s*$/;
|
|
9
10
|
const DATA_URL_RE = /^data:[^;]+(?:;charset=[^;]+)?;base64,(.*)/;
|
|
10
11
|
export const SOURCEMAP_EXTENSIONS: Set<string> = new Set<string>([
|
|
11
12
|
'css',
|
package/test/DefaultMap.test.js
CHANGED
|
@@ -5,10 +5,13 @@ import {DefaultMap} from '../src/DefaultMap';
|
|
|
5
5
|
|
|
6
6
|
describe('DefaultMap', () => {
|
|
7
7
|
it('constructs with entries just like Map', () => {
|
|
8
|
-
let map = new DefaultMap(
|
|
9
|
-
|
|
10
|
-
[
|
|
11
|
-
|
|
8
|
+
let map = new DefaultMap(
|
|
9
|
+
k => k,
|
|
10
|
+
[
|
|
11
|
+
[1, 3],
|
|
12
|
+
[2, 27],
|
|
13
|
+
],
|
|
14
|
+
);
|
|
12
15
|
assert.equal(map.get(1), 3);
|
|
13
16
|
assert.deepEqual(Array.from(map.entries()), [
|
|
14
17
|
[1, 3],
|
package/test/throttle.test.js
CHANGED