Skip to content

Commit 52d5eb7

Browse files
committed
Merge branch 'master' into next
# Conflicts: # yarn.lock
2 parents 6edeee9 + ec3fa8b commit 52d5eb7

File tree

469 files changed

+5997
-4602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

469 files changed

+5997
-4602
lines changed

.eslintrc.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
plugins: ["prettier", "node"],
3+
plugins: ["prettier", "node", "jest"],
44
extends: ["eslint:recommended", "plugin:node/recommended", "plugin:prettier/recommended"],
55
env: {
66
node: true,
@@ -13,7 +13,6 @@ module.exports = {
1313
"prettier/prettier": "error",
1414
"no-undef": "error",
1515
"no-extra-semi": "error",
16-
"semi": "error",
1716
"no-template-curly-in-string": "error",
1817
"no-caller": "error",
1918
"no-control-regex": "off",
@@ -56,7 +55,7 @@ module.exports = {
5655
{
5756
files: ["test/**/*.js"],
5857
env: {
59-
mocha: true,
58+
"jest/globals": true
6059
}
6160
}
6261
]

.travis.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@ cache:
1313
matrix:
1414
include:
1515
- os: linux
16-
node_js: "8"
16+
node_js: "10"
1717
env: NO_WATCH_TESTS=1 JOB_PART=lint
1818
- os: linux
19-
node_js: "8"
20-
env: NO_WATCH_TESTS=1 JOB_PART=integration
19+
node_js: "10"
20+
env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration
2121
- os: linux
2222
node_js: "8"
23+
env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration
24+
- os: linux
25+
node_js: "10"
2326
env: NO_WATCH_TESTS=1 JOB_PART=unit
2427
- os: linux
2528
node_js: "6"
26-
env: NO_WATCH_TESTS=1 JOB_PART=integration
29+
env: NO_WATCH_TESTS=1 JEST=--runInBand JOB_PART=integration
2730
- os: osx
28-
node_js: "8"
29-
env: NO_WATCH_TESTS=1 JOB_PART=integration
31+
node_js: "10"
32+
env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration
3033
allow_failures:
3134
- os: osx
3235
fast_finish: true
@@ -40,7 +43,7 @@ script: npm run travis:$JOB_PART
4043

4144
after_success:
4245
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
43-
- bash <(curl -s https://codecov.io/bash) -F $JOB_PART
46+
- bash <(curl -s https://codecov.io/bash) -F $JOB_PART --disable=gcov
4447
- rm -rf ./coverage
4548

4649
notifications:

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ environment:
1616
job_part: unit
1717
- nodejs_version: 8
1818
job_part: integration
19+
jest: --maxWorkers=2
1920
- nodejs_version: 6
2021
job_part: integration
22+
jest: --runInBand
2123

2224
install:
2325
- ps: Install-Product node $env:nodejs_version x64
@@ -35,5 +37,6 @@ test_script:
3537
- node --version
3638
- npm --version
3739
- yarn --version
40+
- cmd: set JEST=%jest%
3841
- cmd: npm run appveyor:%job_part%
39-
- cmd: npm install -g codecov && codecov -F %job_part%
42+
- cmd: npm install -g codecov && codecov -F %job_part% --disable=gcov

lib/Chunk.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Chunk {
5050
this.ids = null;
5151
this.debugId = debugId++;
5252
this.name = name;
53+
this.preventIntegration = false;
5354
this.entryModule = undefined;
5455
this._modules = new SortableSet(undefined, sortByIdentifier);
5556
this._groups = new SortableSet(undefined, sortById);
@@ -265,6 +266,9 @@ class Chunk {
265266
}
266267
return true;
267268
};
269+
270+
if (this.preventIntegration || otherChunk.preventIntegration) return false;
271+
268272
if (this.hasRuntime() !== otherChunk.hasRuntime()) {
269273
if (this.hasRuntime()) {
270274
return isAvailable(this, otherChunk);

lib/optimize/ConcatenatedModule.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,12 @@ class ConcatenatedModule extends Module {
576576
moduleToInfoMap
577577
)
578578
);
579+
580+
// Must use full identifier in our cache here to ensure that the source
581+
// is updated should our dependencies list change.
579582
innerDependencyTemplates.set(
580583
"hash",
581-
innerDependencyTemplates.get("hash") + this.rootModule.identifier()
584+
innerDependencyTemplates.get("hash") + this.identifier()
582585
);
583586

584587
// Generate source code and analyse scopes

lib/optimize/RuntimeChunkPlugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = class RuntimeChunkPlugin {
2525
name = name(entrypoint);
2626
}
2727
const newChunk = compilation.addChunk(name);
28+
newChunk.preventIntegration = true;
2829
entrypoint.unshiftChunk(newChunk);
2930
newChunk.addGroup(entrypoint);
3031
entrypoint.setRuntimeChunk(newChunk);

package.json

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"es6-promise-polyfill": "^1.1.1",
4242
"eslint": "^4.19.1",
4343
"eslint-config-prettier": "^2.9.0",
44+
"eslint-plugin-jest": "21.12.2",
4445
"eslint-plugin-node": "^6.0.1",
4546
"eslint-plugin-prettier": "^2.6.0",
4647
"express": "~4.13.1",
@@ -50,19 +51,18 @@
5051
"istanbul": "^0.4.5",
5152
"jade": "^1.11.0",
5253
"jade-loader": "~0.8.0",
54+
"jest": "23.0.0-alpha.5",
55+
"jest-silent-reporter": "0.0.4",
5356
"json-loader": "^0.5.7",
5457
"less": "^2.5.1",
5558
"less-loader": "^4.0.3",
5659
"lodash": "^4.17.4",
57-
"mocha": "^3.2.0",
58-
"mocha-lcov-reporter": "^1.0.0",
5960
"prettier": "^1.11.1",
6061
"raw-loader": "~0.5.0",
6162
"react": "^15.2.1",
6263
"react-dom": "^15.2.1",
6364
"rimraf": "^2.6.2",
6465
"script-loader": "~0.7.0",
65-
"should": "^11.1.1",
6666
"simple-git": "^1.65.0",
6767
"sinon": "^2.3.2",
6868
"style-loader": "^0.19.1",
@@ -96,18 +96,17 @@
9696
],
9797
"scripts": {
9898
"setup": "node ./setup/setup.js",
99-
"test": "npm run mocha",
100-
"mocha": "mocha test/*.test.js test/*.unittest.js --max-old-space-size=4096 --harmony --trace-deprecation",
101-
"test:integration": "mocha test/*.test.js --max-old-space-size=4096 --harmony --trace-deprecation",
102-
"test:unit": "mocha test/*.unittest.js --max-old-space-size=4096 --harmony --trace-deprecation",
103-
"travis:integration": "yarn cover:init && yarn cover:integration && yarn cover:report-min",
104-
"travis:unit": "yarn cover:init && yarn cover:unit && yarn cover:report-min",
99+
"test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest",
100+
"test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.test.js\"",
101+
"test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\"",
102+
"travis:integration": "yarn cover:init && yarn cover:integration --ci $JEST && yarn cover:report-min",
103+
"travis:unit": "yarn cover:init && yarn cover:unit --ci",
105104
"travis:lint": "yarn lint",
106-
"travis:benchmark": "yarn benchmark",
107-
"appveyor:integration": "yarn cover:init && yarn cover:integration && yarn cover:report-min",
108-
"appveyor:unit": "yarn cover:init && yarn cover:unit && yarn cover:report-min",
109-
"appveyor:benchmark": "yarn benchmark",
110-
"circleci:test": "node node_modules/mocha/bin/mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.test.js test/*.unittest.js",
105+
"travis:benchmark": "yarn benchmark --ci",
106+
"appveyor:integration": "yarn cover:init && yarn cover:integration --ci %JEST% && yarn cover:report-min",
107+
"appveyor:unit": "yarn cover:init && yarn cover:unit --ci && yarn cover:report-min",
108+
"appveyor:benchmark": "yarn benchmark --ci",
109+
"circleci:test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --ci",
111110
"circleci:lint": "yarn lint",
112111
"build:examples": "cd examples && node buildAll.js",
113112
"pretest": "yarn lint",
@@ -117,14 +116,54 @@
117116
"type-lint": "tsc --pretty",
118117
"fix": "yarn code-lint --fix",
119118
"pretty": "prettier \"setup/**/*.js\" \"lib/**/*.js\" \"bin/*.js\" \"hot/*.js\" \"buildin/*.js\" \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\" \"schemas/**/*.js\" \"declarations.d.ts\" --write",
120-
"schema-lint": "mocha test/*.lint.js --opts test/lint-mocha.opts",
121-
"benchmark": "mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.benchmark.js -R spec",
119+
"schema-lint": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.lint.js\"",
120+
"benchmark": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.benchmark.js\" --runInBand",
122121
"cover": "yarn cover:init && yarn cover:all && yarn cover:report",
123122
"cover:init": "rimraf coverage",
124-
"cover:all": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.test.js test/*.unittest.js",
125-
"cover:integration": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.test.js",
126-
"cover:unit": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.unittest.js",
123+
"cover:all": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --coverage",
124+
"cover:integration": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.test.js\" --coverage",
125+
"cover:unit": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\" --coverage",
127126
"cover:report": "istanbul report",
128127
"cover:report-min": "istanbul report --report lcovonly"
128+
},
129+
"jest": {
130+
"setupTestFrameworkScriptFile": "<rootDir>/test/setupTestFramework.js",
131+
"testMatch": [
132+
"<rootDir>/test/*.test.js",
133+
"<rootDir>/test/*.unittest.js"
134+
],
135+
"watchPathIgnorePatterns": [
136+
"<rootDir>/node_modules/webpack/node_modules/",
137+
"<rootDir>/test/js/",
138+
"<rootDir>/test/browsertest/js/",
139+
"<rootDir>/test/fixtures/temp-cache-fixture/",
140+
"<rootDir>/test/fixtures/temp-",
141+
"<rootDir>/benchmark/",
142+
"<rootDir>/examples/*/dist",
143+
"<rootDir>/coverage/"
144+
],
145+
"modulePathIgnorePatterns": [
146+
"<rootDir>/node_modules/webpack/node_modules/",
147+
"<rootDir>/test/js/",
148+
"<rootDir>/test/browsertest/js/",
149+
"<rootDir>/test/fixtures/temp-cache-fixture/",
150+
"<rootDir>/test/fixtures/temp-",
151+
"<rootDir>/benchmark/",
152+
"<rootDir>/examples/*/dist",
153+
"<rootDir>/coverage/"
154+
],
155+
"transformIgnorePatterns": [
156+
"<rootDir>/"
157+
],
158+
"coverageDirectory": "<rootDir>/coverage",
159+
"coveragePathIgnorePatterns": [
160+
"\\.runtime\\.js$",
161+
"<rootDir>/test/",
162+
"<rootDir>/schemas/"
163+
],
164+
"testEnvironment": "node",
165+
"coverageReporters": [
166+
"json"
167+
]
129168
}
130169
}

0 commit comments

Comments
 (0)