Skip to content

Commit 3ebec96

Browse files
author
Denis Bardadym
committed
Update dependencies
1 parent f70d2e5 commit 3ebec96

File tree

10 files changed

+97274
-140424
lines changed

10 files changed

+97274
-140424
lines changed

package-lock.json

Lines changed: 1058 additions & 6812 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
},
4343
"devDependencies": {
4444
"@jest/globals": "^29.3.1",
45-
"@rollup/plugin-alias": "^4.0.2",
46-
"@rollup/plugin-commonjs": "^24.0.0",
45+
"@rollup/plugin-alias": "^5.0.0",
46+
"@rollup/plugin-commonjs": "^25.0.1",
4747
"@rollup/plugin-node-resolve": "^15.0.0",
48-
"@rollup/plugin-typescript": "^10.0.1",
48+
"@rollup/plugin-typescript": "^11.1.1",
4949
"@types/bytes": "^3.1.1",
5050
"@types/d3-array": "^3.0.3",
5151
"@types/d3-color": "^3.1.0",
@@ -80,7 +80,7 @@
8080
"rollup-plugin-postcss": "^4.0.2",
8181
"sass": "^1.52.1",
8282
"ts-jest": "^29.0.3",
83-
"typescript": "~4.9.0"
83+
"typescript": "~5.1.3"
8484
},
8585
"engines": {
8686
"node": ">=14"

test/__snapshots__/e2e.test.ts.snap

Lines changed: 23969 additions & 33357 deletions
Large diffs are not rendered by default.

test/__snapshots__/gh59.test.ts.snap

Lines changed: 24174 additions & 33562 deletions
Large diffs are not rendered by default.

test/__snapshots__/gh69.test.ts.snap

Lines changed: 24081 additions & 33469 deletions
Large diffs are not rendered by default.

test/__snapshots__/gh93.test.ts.snap

Lines changed: 23832 additions & 33220 deletions
Large diffs are not rendered by default.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Sourcemap test 1`] = `
4+
"const text$1 = "😀wyjście😀";
5+
6+
// some text ü
7+
// with surrogate pairs 葛
8+
const text = "😀wyjście😀";
9+
console.log("" + text + text$1);
10+
//# sourceMappingURL=index.js.map
11+
"
12+
`;
13+
14+
exports[`Sourcemap test 2`] = `180`;
15+
16+
exports[`Sourcemap test 3`] = `
17+
"{
18+
"version": 2,
19+
"tree": {
20+
"name": "root",
21+
"children": [
22+
{
23+
"name": "index.js",
24+
"children": [
25+
{
26+
"name": "test/sourcemap",
27+
"children": [
28+
{
29+
"uid": "1111-1",
30+
"name": "input2.js"
31+
},
32+
{
33+
"uid": "1111-3",
34+
"name": "input.js"
35+
}
36+
]
37+
}
38+
]
39+
}
40+
],
41+
"isRoot": true
42+
},
43+
"nodeParts": {
44+
"1111-1": {
45+
"renderedLength": 34,
46+
"gzipLength": 0,
47+
"brotliLength": 0,
48+
"metaUid": "1111-0"
49+
},
50+
"1111-3": {
51+
"renderedLength": 109,
52+
"gzipLength": 0,
53+
"brotliLength": 0,
54+
"metaUid": "1111-2"
55+
}
56+
},
57+
"nodeMetas": {
58+
"1111-0": {
59+
"id": "/test/sourcemap/input2.js",
60+
"moduleParts": {
61+
"index.js": "1111-1"
62+
},
63+
"imported": [],
64+
"importedBy": [
65+
{
66+
"uid": "1111-2"
67+
}
68+
]
69+
},
70+
"1111-2": {
71+
"id": "/test/sourcemap/input.js",
72+
"moduleParts": {
73+
"index.js": "1111-3"
74+
},
75+
"imported": [
76+
{
77+
"uid": "1111-0"
78+
}
79+
],
80+
"importedBy": [],
81+
"isEntry": true
82+
}
83+
},
84+
"env": {
85+
"rollup": "3.24.1"
86+
},
87+
"options": {
88+
"gzip": false,
89+
"brotli": false,
90+
"sourcemap": true
91+
}
92+
}"
93+
`;

test/sourcemap/input.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import text2 from './input2.js';
2+
3+
// some text ü
4+
// with surrogate pairs 葛
5+
const text = "😀wyjście😀";
6+
console.log("" + text + text2);

test/sourcemap/input2.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const text = "😀wyjście😀";
2+
const text2 = "aaa";
3+
4+
export default text;

test/sourcemap/sourcemap.test.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { OutputAsset, OutputChunk, OutputOptions, rollup } from "rollup";
2+
import { describe, it, expect } from "@jest/globals";
3+
import { ALL_TEMPLATE } from "../util";
4+
5+
// mock random for stable id
6+
let randomCall = 0;
7+
Math.random = () => randomCall / 100;
8+
9+
import { visualizer } from "../../dist/plugin";
10+
11+
describe("Sourcemap", () => {
12+
const input = {
13+
index: "test/sourcemap/input.js",
14+
};
15+
16+
it("test", async () => {
17+
const inputOptions = {
18+
input,
19+
plugins: [
20+
visualizer({
21+
filename: `stats`,
22+
template: 'raw-data',
23+
emitFile: true,
24+
sourcemap: true,
25+
brotliSize: true,
26+
gzipSize: true
27+
}),
28+
],
29+
};
30+
const outputOptions: OutputOptions = {
31+
format: "es",
32+
dir: "./temp/",
33+
sourcemap: true
34+
};
35+
36+
const bundle = await rollup(inputOptions);
37+
38+
const result = await bundle.generate(outputOptions);
39+
40+
const bundleChunk = result.output.find(file => file.fileName === "index.js")
41+
42+
expect(bundleChunk).not.toBeNull();
43+
const bundleChunkCode = (bundleChunk as OutputChunk).code
44+
expect(bundleChunkCode).toMatchSnapshot();
45+
expect(Buffer.byteLength(bundleChunkCode)).toMatchSnapshot();
46+
47+
const generatedStats = result.output.find((file) => file.fileName === "stats");
48+
49+
expect(generatedStats).not.toBeNull();
50+
expect((generatedStats as OutputAsset).source).toMatchSnapshot();
51+
});
52+
});
53+

0 commit comments

Comments
 (0)