Skip to content

Commit ad61d7a

Browse files
Merge pull request #605 from serverless-heaven/release/5.3.3
Release/5.3.3
2 parents 8043a30 + 6ec16e2 commit ad61d7a

16 files changed

+609
-261
lines changed

.appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
environment:
22
matrix:
3-
- NODEJS_VERSION: "10"
3+
- nodejs_version: "10"
4+
- nodejs_version: "12"
45

56
install:
67
# Get the version of Node.js
7-
- ps: Install-Product node $Env:NODEJS_VERSION
8+
- ps: Install-Product node $env:nodejs_version
89
# install modules
910
- npm install
1011
- node --version
File renamed without changes.

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
os: linux
2+
dist: xenial
13
language: node_js
24

3-
matrix:
5+
jobs:
46
include:
57
- node_js: '10'
68
- node_js: '12'
79

8-
sudo: false
9-
1010
install:
1111
- travis_retry npm install
1212

CHANGELOG.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Change Log
2+
3+
* 5.3.3
4+
* default webpackConfig.node should be false #502
5+
* Fix yarn list --json stdOut parsing. fixes #388 #516
6+
* Updated release notes #585
7+
* Updated Node versions in CI #587
8+
* Remove optional peer dependencies #542
9+
* Check for node runtimes first #579
10+
* Bumps lodash from 4.17.15 to 4.17.19 #602
11+
12+
* 5.3.2
13+
* Fix eslint prettier #518
14+
* Add TypeScript definition #520
15+
* Project dependencies updated #524
16+
* fix typescript example lockfile #526
17+
* Typescript example babel loader #527
18+
* Bump tar from 2.2.1 to 2.2.2 in /examples/babel #544
19+
* Bump acorn from 6.3.0 to 6.4.1 in /examples/typescript #562
20+
* Bump eslint-utils from 1.4.0 to 1.4.3 #567
21+
* Bump handlebars from 4.1.2 to 4.7.6 #568
22+
* Addressed npm security vulnerabilities #569
23+
* Bump https-proxy-agent from 2.2.2 to 2.2.4 #572
24+
* Bump https-proxy-agent from 2.2.2 to 2.2.4 in /examples/typescript #573
25+
* Bump extend from 3.0.1 to 3.0.2 in /examples/babel #574
26+
* Bump stringstream from 0.0.5 to 0.0.6 in /examples/babel #575
27+
* Bump tough-cookie from 2.3.2 to 2.3.4 in /examples/babel #576
28+
* Bump sshpk from 1.13.1 to 1.16.1 in /examples/babel #577
29+
* Bump debug from 2.6.8 to 2.6.9 in /examples/babel #578
30+
31+
* 5.3.1
32+
* Fixed bug that prevented to use handlers using import [#505][link-505]
33+
* Do not print empty lines in webpack stats [#499][link-499]
34+
* Added git hooks to improved code quality and developer experience [#496][link-496]
35+
36+
* 5.3.0
37+
* Restore compatibility with TypeScript [#449][link-449] [#465][link-465]
38+
* Allow glob for excludeFiles [#471][link-471]
39+
* Support Webpack 5 [#472][link-472]
40+
* Use colored output depending on tty [#480][link-480]
41+
* Allow to keep webpack folder [#453][link-453] [#467][link-467]
42+
* Add ability to exclude files from handler lookup [#433][link-433]
43+
* Documentation fixes [#429][link-429]
44+
45+
* 5.2.0
46+
* Show info message in verbose mode if aws-sdk has been excluded automatically [#393][link-393]
47+
* Added support for asynchronous webpack configuration [#412][link-412]
48+
* Better error message if handlers are not found [#418][link-418]
49+
50+
* 5.1.5
51+
* Re-publish of 5.1.4 without yarn.lock
52+
53+
* 5.1.4
54+
* Fix support for Yarn resolutions definitions [#379][link-379]
55+
* Better debugging for "Unable to import module ..." errors: Detect runtime dependencies that are only declared as devDependencies [#384][link-384]
56+
* Documentation updates [#382][link-382]
57+
58+
* 5.1.3
59+
* Fixed issue with Yarn and file references as dependencies [#370][link-370]
60+
61+
* 5.1.2
62+
* Fixed issue that leads to `Unexpected end of JSON` in projects with lots of dependencies [#309][link-309][#373][link-373]
63+
* Update webpack-4 example with VSCode debugging configuration [#365][link-365]
64+
65+
* 5.1.1
66+
* Fixed local invoke watch mode not executing changed files [#349][link-349]
67+
* Added Webpack 4 example [#355][link-355]
68+
* Documentation updates [#354][link-354]
69+
70+
* 5.1.0
71+
* Support Yarn [#286][link-286]
72+
* Allow local invoke to use existing compiled output [#341][link-341] [#275][link-275]
73+
* Support custom packager scripts [#343][link-343] [#342][link-342]
74+
75+
* 5.0.0
76+
* Support Webpack 4 [#331][link-331] [#328][link-328]
77+
* BREAKING: Drop support for Webpack 2
78+
* Allow to check for local invocation in the webpack configuration [#232][link-232]
79+
* New centralized configuration with fallback to the old one [#336][link-336]
80+
* Improved unit tests and actual coverage calculation [#337][link-337]
81+
82+
* 4.4.0
83+
* Support serverless-step-functions-offline [#313][link-313]
84+
* Fixed webpack documentation links [#326][link-326]
85+
* Abstracted packager interface [#329][link-329]
86+
87+
* 4.3.0
88+
* Add new `webpack:compile:watch:compile` event [#315][link-315]
89+
* Added note to README about using yarn [#316][link-316]
90+
* Made babel dynamic example the default babel example [#253][link-253]
91+
* Documentation fixes [#317][link-317] [#321][link-321]
92+
93+
* 4.2.0
94+
* Support local file references in package.json [#263][link-263]
95+
* Updated used tools (dev dependencies)
96+
97+
* 4.1.0
98+
* Prohibit manual entry configuration with individual packaging [#272][link-272]
99+
* Fixed bug with stats in webpack config for individual packaging [#278][link-278]
100+
* Fixed bug with startup order in combination with serverless-offline [#279][link-279]
101+
* Default target to "node" if not set [#276][link-276]
102+
* Support `serverless run` including watch mode [#269][link-269]
103+
104+
* 4.0.0
105+
* BREAKING: Expose lifecycle events for plugin authors [#254][link-254]
106+
* Fixed deprecated hook warning [#126][link-126]
107+
* Support forceExclude option for external modules [#247][link-247]
108+
* Support stats output configuration in webpack config [#260][link-260]
109+
* Google: Only integrate package.json but not node modules into artifact [#264][link-264]
110+
* Documentation fixes and updates [#265][link-265]
111+
* Updated examples [#250][link-250]
112+
113+
* 3.1.2
114+
* Fix issue where dependencies with dots in their names would not be installed [#251][link-251]
115+
116+
* 3.1.1
117+
* Fix issue where locked dependencies (package-lock.json) were ignored [#245][link-245]
118+
119+
* 3.1.0
120+
* Allow filesystem polling in watch mode (`--webpack-use-polling`) [#215][link-215]
121+
* Allow forced include of not referenced modules [#217][link-217]
122+
* Automatically include peer dependencies of used modules [#223][link-223]
123+
* Show explicit message if the provided webpack config can not be loaded [#234][link-234]
124+
* Improve examples [#227][link-227]
125+
* Update 3rd party provider compatibility table [#221][link-221]
126+
* Added automatic Travis and Coveralls builds to increase stability
127+
128+
* 3.0.0
129+
* Integrate with `serverless invoke local` [#151][link-151]
130+
* Support watch mode with `serverless invoke local --watch`
131+
* Stabilized and improved the bundling of node modules [#116][link-116], [#117][link-117]
132+
* Improved interoperability with Serverless and 3rd party plugins [#173][link-173]
133+
* Support individual packaging of the functions in a service [#120][link-120]
134+
* Allow setting stdio max buffers for NPM operations [#185][link-185]
135+
* Support bundling of node modules via node-externals whitelist [#186][link-186]
136+
* Removed the `webpack serve` command in favor of [`serverless-offline`][link-serverless-offline] [#152][link-152]
137+
* Updated examples [#179][link-179]
138+
* Added missing unit tests to improve code stability
139+
* Fixed unit tests to run on Windows [#145][link-145]
140+
141+
* 2.2.2
142+
* Reverted breaking change introduced in default output config [#202][link-202]
143+
144+
* 2.2.1
145+
* Restore functionality for Google provider [#193][link-193]
146+
147+
* 2.2.0
148+
* Allow full dynamic configurations [#158][link-158]
149+
* Fix a bug that prevented the entries lib export to work with TypeScript [#165][link-165]
150+
151+
* 2.1.0
152+
* Added support for webpack configuration in TypeScript format [#129][link-129]
153+
* Fixed bug with serverless-offline exec [#154][link-154]
154+
* Added unit tests for cleanup. Updated test framework [#11][link-11]
155+
* Support single function deploy and packaging [#107][link-107]
156+
* Fixed path exception bug with individual packaging and SLS 1.18 [#159][link-159]
157+
158+
* 2.0.0
159+
* Support arbitrary Webpack versions as peer dependency [#83][link-83]
160+
* Support `serverless offline start` invocation [#131][link-131]
161+
* Documentation updates [#88][link-88], [#132][link-132], [#140][link-140], [#141][link-141], [#144][link-144]
162+
* Print Webpack stats on recompile [#127][link-127]

README.md

Lines changed: 1 addition & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -756,138 +756,7 @@ me to take it over and continue working on the project. That helped to revive it
756756
757757
## Release Notes
758758
759-
* 5.3.1
760-
* Fixed bug that prevented to use handlers using import [#505][link-505]
761-
* Do not print empty lines in webpack stats [#499][link-499]
762-
* Added git hooks to improved code quality and developer experience [#496][link-496]
763-
764-
* 5.3.0
765-
* Restore compatibility with TypeScript [#449][link-449] [#465][link-465]
766-
* Allow glob for excludeFiles [#471][link-471]
767-
* Support Webpack 5 [#472][link-472]
768-
* Use colored output depending on tty [#480][link-480]
769-
* Allow to keep webpack folder [#453][link-453] [#467][link-467]
770-
* Add ability to exclude files from handler lookup [#433][link-433]
771-
* Documentation fixes [#429][link-429]
772-
773-
* 5.2.0
774-
* Show info message in verbose mode if aws-sdk has been excluded automatically [#393][link-393]
775-
* Added support for asynchronous webpack configuration [#412][link-412]
776-
* Better error message if handlers are not found [#418][link-418]
777-
778-
* 5.1.5
779-
* Re-publish of 5.1.4 without yarn.lock
780-
781-
* 5.1.4
782-
* Fix support for Yarn resolutions definitions [#379][link-379]
783-
* Better debugging for "Unable to import module ..." errors: Detect runtime dependencies that are only declared as devDependencies [#384][link-384]
784-
* Documentation updates [#382][link-382]
785-
786-
* 5.1.3
787-
* Fixed issue with Yarn and file references as dependencies [#370][link-370]
788-
789-
* 5.1.2
790-
* Fixed issue that leads to `Unexpected end of JSON` in projects with lots of dependencies [#309][link-309][#373][link-373]
791-
* Update webpack-4 example with VSCode debugging configuration [#365][link-365]
792-
793-
* 5.1.1
794-
* Fixed local invoke watch mode not executing changed files [#349][link-349]
795-
* Added Webpack 4 example [#355][link-355]
796-
* Documentation updates [#354][link-354]
797-
798-
* 5.1.0
799-
* Support Yarn [#286][link-286]
800-
* Allow local invoke to use existing compiled output [#341][link-341] [#275][link-275]
801-
* Support custom packager scripts [#343][link-343] [#342][link-342]
802-
803-
* 5.0.0
804-
* Support Webpack 4 [#331][link-331] [#328][link-328]
805-
* BREAKING: Drop support for Webpack 2
806-
* Allow to check for local invocation in the webpack configuration [#232][link-232]
807-
* New centralized configuration with fallback to the old one [#336][link-336]
808-
* Improved unit tests and actual coverage calculation [#337][link-337]
809-
810-
* 4.4.0
811-
* Support serverless-step-functions-offline [#313][link-313]
812-
* Fixed webpack documentation links [#326][link-326]
813-
* Abstracted packager interface [#329][link-329]
814-
815-
* 4.3.0
816-
* Add new `webpack:compile:watch:compile` event [#315][link-315]
817-
* Added note to README about using yarn [#316][link-316]
818-
* Made babel dynamic example the default babel example [#253][link-253]
819-
* Documentation fixes [#317][link-317] [#321][link-321]
820-
821-
* 4.2.0
822-
* Support local file references in package.json [#263][link-263]
823-
* Updated used tools (dev dependencies)
824-
825-
* 4.1.0
826-
* Prohibit manual entry configuration with individual packaging [#272][link-272]
827-
* Fixed bug with stats in webpack config for individual packaging [#278][link-278]
828-
* Fixed bug with startup order in combination with serverless-offline [#279][link-279]
829-
* Default target to "node" if not set [#276][link-276]
830-
* Support `serverless run` including watch mode [#269][link-269]
831-
832-
* 4.0.0
833-
* BREAKING: Expose lifecycle events for plugin authors [#254][link-254]
834-
* Fixed deprecated hook warning [#126][link-126]
835-
* Support forceExclude option for external modules [#247][link-247]
836-
* Support stats output configuration in webpack config [#260][link-260]
837-
* Google: Only integrate package.json but not node modules into artifact [#264][link-264]
838-
* Documentation fixes and updates [#265][link-265]
839-
* Updated examples [#250][link-250]
840-
841-
* 3.1.2
842-
* Fix issue where dependencies with dots in their names would not be installed [#251][link-251]
843-
844-
* 3.1.1
845-
* Fix issue where locked dependencies (package-lock.json) were ignored [#245][link-245]
846-
847-
* 3.1.0
848-
* Allow filesystem polling in watch mode (`--webpack-use-polling`) [#215][link-215]
849-
* Allow forced include of not referenced modules [#217][link-217]
850-
* Automatically include peer dependencies of used modules [#223][link-223]
851-
* Show explicit message if the provided webpack config can not be loaded [#234][link-234]
852-
* Improve examples [#227][link-227]
853-
* Update 3rd party provider compatibility table [#221][link-221]
854-
* Added automatic Travis and Coveralls builds to increase stability
855-
856-
* 3.0.0
857-
* Integrate with `serverless invoke local` [#151][link-151]
858-
* Support watch mode with `serverless invoke local --watch`
859-
* Stabilized and improved the bundling of node modules [#116][link-116], [#117][link-117]
860-
* Improved interoperability with Serverless and 3rd party plugins [#173][link-173]
861-
* Support individual packaging of the functions in a service [#120][link-120]
862-
* Allow setting stdio max buffers for NPM operations [#185][link-185]
863-
* Support bundling of node modules via node-externals whitelist [#186][link-186]
864-
* Removed the `webpack serve` command in favor of [`serverless-offline`][link-serverless-offline] [#152][link-152]
865-
* Updated examples [#179][link-179]
866-
* Added missing unit tests to improve code stability
867-
* Fixed unit tests to run on Windows [#145][link-145]
868-
869-
* 2.2.2
870-
* Reverted breaking change introduced in default output config [#202][link-202]
871-
872-
* 2.2.1
873-
* Restore functionality for Google provider [#193][link-193]
874-
875-
* 2.2.0
876-
* Allow full dynamic configurations [#158][link-158]
877-
* Fix a bug that prevented the entries lib export to work with TypeScript [#165][link-165]
878-
879-
* 2.1.0
880-
* Added support for webpack configuration in TypeScript format [#129][link-129]
881-
* Fixed bug with serverless-offline exec [#154][link-154]
882-
* Added unit tests for cleanup. Updated test framework [#11][link-11]
883-
* Support single function deploy and packaging [#107][link-107]
884-
* Fixed path exception bug with individual packaging and SLS 1.18 [#159][link-159]
885-
886-
* 2.0.0
887-
* Support arbitrary Webpack versions as peer dependency [#83][link-83]
888-
* Support `serverless offline start` invocation [#131][link-131]
889-
* Documentation updates [#88][link-88], [#132][link-132], [#140][link-140], [#141][link-141], [#144][link-144]
890-
* Print Webpack stats on recompile [#127][link-127]
759+
See [CHANGELOG.md](./CHANGELOG.md)
891760
892761
[ico-serverless]: http://public.serverless.com/badges/v3.svg
893762
[ico-license]: https://img.shields.io/github/license/serverless-heaven/serverless-webpack.svg

lib/packExternalModules.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,32 @@ function getProdModules(externalModules, packagePath, dependencyGraph, forceExcl
9494
const peerDependencies = require(modulePackagePath).peerDependencies;
9595
if (!_.isEmpty(peerDependencies)) {
9696
this.options.verbose && this.serverless.cli.log(`Adding explicit peers for dependency ${module.external}`);
97-
const peerModules = getProdModules.call(
98-
this,
99-
_.map(peerDependencies, (value, key) => ({ external: key })),
100-
packagePath,
101-
dependencyGraph,
102-
forceExcludes
103-
);
104-
Array.prototype.push.apply(prodModules, peerModules);
97+
98+
const peerDependenciesMeta = require(modulePackagePath).peerDependenciesMeta;
99+
100+
if (!_.isEmpty(peerDependenciesMeta)) {
101+
_.forEach(peerDependencies, (value, key) => {
102+
if (peerDependenciesMeta[key] && peerDependenciesMeta[key].optional === true) {
103+
this.options.verbose &&
104+
this.serverless.cli.log(
105+
`Skipping peers dependency ${key} for dependency ${module.external} because it's optional`
106+
);
107+
108+
_.unset(peerDependencies, key);
109+
}
110+
});
111+
}
112+
113+
if (!_.isEmpty(peerDependencies)) {
114+
const peerModules = getProdModules.call(
115+
this,
116+
_.map(peerDependencies, (value, key) => ({ external: key })),
117+
packagePath,
118+
dependencyGraph,
119+
forceExcludes
120+
);
121+
Array.prototype.push.apply(prodModules, peerModules);
122+
}
105123
}
106124
} catch (e) {
107125
this.serverless.cli.log(`WARNING: Could not check for peer dependencies of ${module.external}`);
@@ -424,3 +442,4 @@ module.exports = {
424442
});
425443
}
426444
};
445+

lib/packagers/yarn.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ class Yarn {
6262
return BbPromise.reject(err);
6363
})
6464
.then(processOutput => processOutput.stdout)
65-
.then(depJson => BbPromise.try(() => JSON.parse(depJson)))
65+
.then(stdout =>
66+
BbPromise.try(() => {
67+
const lines = Utils.splitLines(stdout);
68+
const parsedLines = _.map(lines, Utils.safeJsonParse);
69+
return _.find(parsedLines, line => line && line.type === 'tree');
70+
})
71+
)
6672
.then(parsedTree => {
6773
const convertTrees = trees =>
6874
_.reduce(

0 commit comments

Comments
 (0)