Skip to content

Commit 04ad051

Browse files
authored
chore: Weekly dependency upgrade (salesforce#2003)
1 parent 32eb059 commit 04ad051

File tree

10 files changed

+475
-511
lines changed

10 files changed

+475
-511
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"@commitlint/cli": "^9.1.1",
2828
"@rollup/plugin-replace": "^2.3.3",
2929
"@types/acorn": "^4.0.5",
30-
"@types/jest": "^26.0.9",
30+
"@types/jest": "^26.0.10",
3131
"@types/node": "^14.0.27",
3232
"@typescript-eslint/eslint-plugin": "^3.9.0",
3333
"@typescript-eslint/parser": "^3.9.0",
34-
"aws-sdk": "^2.731.0",
34+
"aws-sdk": "^2.734.0",
3535
"babel-plugin-tester": "^9.2.0",
3636
"concurrently": "^5.3.0",
3737
"es5-proxy-compat": "^0.22.1",
38-
"eslint": "^7.6.0",
38+
"eslint": "^7.7.0",
3939
"eslint-plugin-jest": "^23.20.0",
4040
"eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
4141
"execa": "^4.0.3",
@@ -44,16 +44,16 @@
4444
"husky": "^4.2.5",
4545
"is-ci": "^2.0.0",
4646
"isbinaryfile": "^4.0.6",
47-
"jest": "^26.3.0",
47+
"jest": "^26.4.0",
4848
"lerna": "^3.22.1",
4949
"lint-staged": "^10.2.11",
5050
"mime-types": "^2.1.27",
5151
"prettier": "^2.0.5",
52-
"rollup": "^2.23.1",
52+
"rollup": "^2.26.3",
5353
"rollup-plugin-cleanup": "^3.1.1",
5454
"rollup-plugin-compat": "^0.22.1",
5555
"rollup-plugin-node-resolve": "^5.2.0",
56-
"rollup-plugin-terser": "^6.1.0",
56+
"rollup-plugin-terser": "^7.0.0",
5757
"rollup-plugin-typescript": "^1.0.1",
5858
"semver": "^7.3.2",
5959
"tslib": "^2.0.1",
@@ -63,7 +63,7 @@
6363
"husky": {
6464
"hooks": {
6565
"pre-commit": "lint-staged",
66-
"commit-msg": "commitlint -e $GIT_PARAMS"
66+
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
6767
}
6868
},
6969
"lint-staged": {

packages/@lwc/compiler/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
"@lwc/style-compiler": "1.7.11",
3232
"@lwc/template-compiler": "1.7.11",
3333
"@rollup/plugin-replace": "~2.3.3",
34-
"babel-preset-compat": "~0.22.0",
35-
"rollup": "~2.22.1",
36-
"terser": "~4.8.0"
34+
"babel-preset-compat": "~0.22.1",
35+
"rollup": "~2.26.3",
36+
"terser": "~5.1.0"
3737
},
3838
"devDependencies": {
3939
"source-map": "^0.7.3"

packages/@lwc/compiler/src/__tests__/fixtures/expected-prod_compat-mode.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@lwc/compiler/src/rollup-plugins/__tests__/minify.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ const codeFixture = `
1515
const minifiedCode = 'var a=1;console.log(a);';
1616

1717
describe('rollup plugin lwc-minify', () => {
18-
test('lwc-minify should not output sourcemaps', () => {
18+
test('lwc-minify should not output sourcemaps', async () => {
1919
const lwcMinifier = lwcMinifierFactory({ sourcemap: false });
20-
const result = lwcMinifier.renderChunk(codeFixture);
20+
const { code, map } = await lwcMinifier.renderChunk(codeFixture);
2121

22-
expect(result).toBe(minifiedCode);
22+
expect(code).toBe(minifiedCode);
23+
expect(map).toBeUndefined();
2324
});
2425
test('should output a correct sourcemap', async () => {
2526
const lwcMinifier = lwcMinifierFactory({ sourcemap: true });
26-
const result = lwcMinifier.renderChunk(codeFixture);
27+
const { map } = await lwcMinifier.renderChunk(codeFixture);
2728

28-
expect(result.map).not.toBeNull();
29+
expect(map).not.toBeUndefined();
2930

30-
await SourceMapConsumer.with(result!.map, null, (sourceMapConsumer) => {
31+
await SourceMapConsumer.with(map, null, (sourceMapConsumer) => {
3132
const commentInOutputPosition = sourceMapConsumer.generatedPositionFor({
3233
line: 2,
3334
column: 0,

packages/@lwc/compiler/src/rollup-plugins/minify.ts

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,29 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77
import { Plugin } from 'rollup';
8-
9-
import { NormalizedOutputConfig } from '../options';
8+
import { minify } from 'terser';
109

1110
/**
1211
* Rollup plugin applying minification to the generated bundle.
1312
*/
14-
export default function ({ sourcemap }: NormalizedOutputConfig): Plugin {
15-
// Inlining the `terser` module require to only pay the parsing and evaluation cost for needed
16-
// modules
17-
const { minify } = require('terser');
18-
13+
export default function ({ sourcemap }: { sourcemap: boolean }): Plugin {
1914
return {
2015
name: 'lwc-minify',
2116

22-
renderChunk(src: string) {
23-
const { code, map, error } = minify(src, {
17+
async renderChunk(src: string): Promise<{ code: string; map?: any }> {
18+
const { code, map } = await minify(src, {
2419
sourceMap: sourcemap,
25-
output: {
20+
format: {
2621
// Wrapping function expressions in parenthesis can be harmful for performance.
2722
// Details: https://v8.dev/blog/preparser#pife
2823
wrap_func_args: false,
2924
},
3025
});
3126

32-
if (error) {
33-
throw error;
34-
}
35-
36-
if (map) {
37-
return {
38-
code: code!,
39-
map: map as any,
40-
};
41-
} else {
42-
return code!;
43-
}
27+
return {
28+
code: code!,
29+
map,
30+
};
4431
},
4532
};
4633
}

packages/@lwc/rollup-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@lwc/module-resolver": "1.7.11",
28-
"@rollup/pluginutils": "~3.1.0"
28+
"@rollup/pluginutils": "~4.0.0"
2929
},
3030
"peerDependencies": {
3131
"rollup": "^1.2.0||^2.0.0"
Lines changed: 121 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,124 @@
1-
(function(lwc, varResolver) {
2-
'use strict';
3-
4-
varResolver =
5-
varResolver && Object.prototype.hasOwnProperty.call(varResolver, "default")
6-
? varResolver["default"]
7-
: varResolver;
8-
9-
function stylesheet(hostSelector, shadowSelector, nativeShadow) {
10-
return [
11-
"\n",
12-
(nativeShadow
13-
? [":host {color: ", varResolver("--lwc-my-color"), ";}"].join('')
14-
: [hostSelector, " {color: ", varResolver("--lwc-my-color"), ";}" ].join('')),
15-
"\n"
16-
].join('');
17-
}
18-
var _implicitStylesheets = [stylesheet];
19-
20-
function tmpl($api, $cmp, $slotset, $ctx) {
21-
const {
22-
d: api_dynamic,
23-
h: api_element
24-
} = $api;
25-
return [api_element("div", {
26-
key: 0
27-
}, [api_dynamic($cmp.x)])];
28-
}
29-
30-
var _tmpl = lwc.registerTemplate(tmpl);
31-
tmpl.stylesheets = [];
32-
33-
if (_implicitStylesheets) {
34-
tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitStylesheets);
35-
}
36-
tmpl.stylesheetTokens = {
37-
hostAttribute: "x-foo_foo-host",
38-
shadowAttribute: "x-foo_foo"
39-
};
40-
41-
class Foo extends lwc.LightningElement {
42-
constructor(...args) {
43-
super(...args);
44-
this.x = void 0;
45-
}
46-
47-
}
48-
49-
lwc.registerDecorators(Foo, {
50-
publicProps: {
51-
x: {
52-
config: 0
53-
}
54-
}
55-
});
56-
57-
var _xFoo = lwc.registerComponent(Foo, {
58-
tmpl: _tmpl
59-
});
60-
61-
function tmpl$1($api, $cmp, $slotset, $ctx) {
62-
const {
63-
c: api_custom_element,
64-
h: api_element
65-
} = $api;
66-
return [api_element("div", {
67-
classMap: {
68-
"container": true
69-
},
70-
key: 1
71-
}, [api_custom_element("x-foo", _xFoo, {
72-
props: {
73-
"x": "1"
1+
(function (lwc, varResolver) {
2+
"use strict";
3+
4+
function _interopDefaultLegacy(e) {
5+
return e && typeof e === "object" && "default" in e ? e : { default: e };
6+
}
7+
8+
var varResolver__default = /*#__PURE__*/ _interopDefaultLegacy(varResolver);
9+
10+
function stylesheet(hostSelector, shadowSelector, nativeShadow) {
11+
return [
12+
"\n",
13+
nativeShadow
14+
? [
15+
":host {color: ",
16+
varResolver__default["default"]("--lwc-my-color"),
17+
";}",
18+
].join("")
19+
: [
20+
hostSelector,
21+
" {color: ",
22+
varResolver__default["default"]("--lwc-my-color"),
23+
";}",
24+
].join(""),
25+
"\n",
26+
].join("");
27+
}
28+
var _implicitStylesheets = [stylesheet];
29+
30+
function tmpl($api, $cmp, $slotset, $ctx) {
31+
const { d: api_dynamic, h: api_element } = $api;
32+
return [
33+
api_element(
34+
"div",
35+
{
36+
key: 0,
7437
},
75-
key: 0
76-
}, [])])];
38+
[api_dynamic($cmp.x)]
39+
),
40+
];
41+
}
42+
43+
var _tmpl = lwc.registerTemplate(tmpl);
44+
tmpl.stylesheets = [];
45+
46+
if (_implicitStylesheets) {
47+
tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitStylesheets);
48+
}
49+
tmpl.stylesheetTokens = {
50+
hostAttribute: "x-foo_foo-host",
51+
shadowAttribute: "x-foo_foo",
52+
};
53+
54+
class Foo extends lwc.LightningElement {
55+
constructor(...args) {
56+
super(...args);
57+
this.x = void 0;
7758
}
78-
79-
var _tmpl$1 = lwc.registerTemplate(tmpl$1);
80-
tmpl$1.stylesheets = [];
81-
tmpl$1.stylesheetTokens = {
82-
hostAttribute: "x-app_app-host",
83-
shadowAttribute: "x-app_app"
84-
};
85-
86-
class App extends lwc.LightningElement {
87-
constructor() {
88-
super();
89-
this.list = [];
90-
}
91-
59+
}
60+
61+
lwc.registerDecorators(Foo, {
62+
publicProps: {
63+
x: {
64+
config: 0,
65+
},
66+
},
67+
});
68+
69+
var _xFoo = lwc.registerComponent(Foo, {
70+
tmpl: _tmpl,
71+
});
72+
73+
function tmpl$1($api, $cmp, $slotset, $ctx) {
74+
const { c: api_custom_element, h: api_element } = $api;
75+
return [
76+
api_element(
77+
"div",
78+
{
79+
classMap: {
80+
container: true,
81+
},
82+
key: 1,
83+
},
84+
[
85+
api_custom_element(
86+
"x-foo",
87+
_xFoo,
88+
{
89+
props: {
90+
x: "1",
91+
},
92+
key: 0,
93+
},
94+
[]
95+
),
96+
]
97+
),
98+
];
99+
}
100+
101+
var _tmpl$1 = lwc.registerTemplate(tmpl$1);
102+
tmpl$1.stylesheets = [];
103+
tmpl$1.stylesheetTokens = {
104+
hostAttribute: "x-app_app-host",
105+
shadowAttribute: "x-app_app",
106+
};
107+
108+
class App extends lwc.LightningElement {
109+
constructor() {
110+
super();
111+
this.list = [];
92112
}
93-
94-
var App$1 = lwc.registerComponent(App, {
95-
tmpl: _tmpl$1
96-
});
97-
98-
const container = document.getElementById('main');
99-
const element = lwc.createElement('x-app', {
100-
is: App$1
101-
});
102-
container.appendChild(element);
103-
104-
})(LWC, resolveCss);
113+
}
114+
115+
var App$1 = lwc.registerComponent(App, {
116+
tmpl: _tmpl$1,
117+
});
118+
119+
const container = document.getElementById("main");
120+
const element = lwc.createElement("x-app", {
121+
is: App$1,
122+
});
123+
container.appendChild(element);
124+
})(LWC, resolveCss);

packages/integration-karma/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"karma": "^5.1.1",
2121
"karma-chrome-launcher": "^3.1.0",
2222
"karma-coverage": "^2.0.3",
23-
"karma-jasmine": "^3.3.1",
24-
"karma-sauce-launcher": "^4.1.4"
23+
"karma-jasmine": "^4.0.1",
24+
"karma-sauce-launcher": "4.1.4"
2525
}
2626
}

0 commit comments

Comments
 (0)