Skip to content

Commit

Permalink
chore: fix a build break in a test file (microsoft#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
janechu authored Feb 6, 2019
1 parent 4bcd591 commit 5926db7
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 71 deletions.
2 changes: 1 addition & 1 deletion packages/fast-animation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "npm run unit-tests && npm run build:app",
"tslint": "tslint -c ./tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts{,x}'",
"unit-tests": "jest",
"unit-tests": "jest --maxWorkers=2",
"watch": "npm run build -- -w --preserveWatchOutput"
},
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-application-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c ./tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-breakpoint-tracker-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"tslint": "tslint -c tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c tslint.json '**/*.ts{,x}' --fix",
"tslint:watch": "node build/tslint-watch.js",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch && npm-watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c ./tslint.json '**/*.ts'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-components-foundation-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c ./tslint.json 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4 --env=jsdom",
"unit-tests": "jest --maxWorkers=2 --env=jsdom",
"unit-tests:watch": "jest --watch",
"watch": "tsc -p ./tsconfig -w --preserveWatchOutput"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json && npm run copy:all",
"build:app": "webpack --progress",
"build:app": "webpack --progress --mode=production",
"clean:dist": "node ../../build/clean.js dist",
"convert:readme": "node ../../build/convert-readme.js .tmp",
"copy:all": "npm run copy:json-schema && npm run copy:readme",
Expand All @@ -32,7 +32,7 @@
"test": "npm run convert:readme && npm run tslint && npm run unit-tests && npm run build:app",
"tslint": "tslint -c ./tslint.json 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4 --env=jsdom --setupTestFrameworkScriptFile=raf/polyfill",
"unit-tests": "jest --maxWorkers=2 --env=jsdom --setupTestFrameworkScriptFile=raf/polyfill",
"unit-tests:watch": "jest --watch",
"watch": "tsc -p ./tsconfig.json -w --preserveWatchOutput"
},
Expand Down
98 changes: 56 additions & 42 deletions packages/fast-components-react-base/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,63 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
const appDir = path.resolve(__dirname, "./app");
const outDir = path.resolve(__dirname, "./www");

module.exports = {
entry: path.resolve(appDir, "index.tsx"),
output: {
path: outDir,
publicPath: "/",
filename: "[name].js"
},
mode: process.env.NODE_ENV || "development",
resolve: {
extensions: ['.js', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /.tsx?$/,
use: [
{
loader: "ts-loader"
}
],
exclude: /node_modules/
module.exports = (env, args) => {
const isProduction = args.mode === "production";

return {
entry: path.resolve(appDir, "index.tsx"),
output: {
path: outDir,
publicPath: "/",
filename: isProduction ? "[name]-[contenthash].js" : "[name].js"
},
mode: args.mode || "development",
optimization: {
splitChunks: {
chunks: "all",
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
},
},
}
]
},
plugins: [
new HtmlWebpackPlugin({
contentBase: outDir,
}),
new WebpackShellPlugin({
onBuildStart: [
`npm run convert:readme`
},
resolve: {
extensions: ['.js', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /.tsx?$/,
use: [
{
loader: "ts-loader"
}
],
exclude: /node_modules/
}
]
}),
new BundleAnalyzerPlugin({
// Remove this to inspect bundle sizes.
analyzerMode: "disabled"
})
],
devServer: {
compress: false,
historyApiFallback: true,
open: true,
overlay: true,
port: 7000,
},
plugins: [
new HtmlWebpackPlugin({
contentBase: outDir,
}),
new WebpackShellPlugin({
onBuildStart: [
`npm run convert:readme`
]
}),
new BundleAnalyzerPlugin({
// Remove this to inspect bundle sizes.
analyzerMode: "disabled"
})
],
devServer: {
compress: false,
historyApiFallback: true,
open: true,
overlay: true,
port: 7000,
}
}
}
2 changes: 1 addition & 1 deletion packages/fast-components-react-msft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"test": "npm run convert:readme && npm run tslint && npm run unit-tests && npm run build:app",
"tslint": "tslint -c ./tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "tsc -p ./tsconfig.json -w --preserveWatchOutput"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/fast-css-editor-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json && npm run copy:all",
"build:app": "webpack --progress",
"build:app": "webpack --progress --mode=production",
"clean:dist": "node ../../build/clean.js dist",
"copy:all": "npm run copy:json-schema",
"copy:json-schema": "node ../../build/copy-schemas.js",
"prepare": "npm run clean:dist && npm run build",
"prettier": "prettier --config ../../.prettierrc --write \"**/*.{ts,tsx}\"",
"prettier:diff": "prettier --config ../../.prettierrc \"**/*.{ts,tsx}\" --list-different",
"start": "webpack-dev-server",
"test": "npm run unit-tests && npm run tslint && npm run build:app",
"test": "npm run tslint && npm run unit-tests && npm run build:app",
"tslint": "tslint -c ./tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "tsc -p ./tsconfig.json -w --preserveWatchOutput"
},
Expand Down
1 change: 0 additions & 1 deletion packages/fast-css-editor-react/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
const appDir = path.resolve(__dirname, "./app");
const outDir = path.resolve(__dirname, "./www");


module.exports = (env, args) => {
const isProduction = args.mode === "production";

Expand Down
2 changes: 1 addition & 1 deletion packages/fast-data-utilities-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c ./tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"watch": "npm run build -- -w --preserveWatchOutput"
},
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-development-site-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json",
"build:app": "webpack --progress",
"build:app": "webpack --progress --mode=production",
"clean:dist": "node ../../build/clean.js dist",
"convert:readme": "node ../../build/convert-readme.js --src=app/**/README.md .tmp",
"prepare": "npm run clean:dist && npm run build",
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-form-generator-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json",
"build:app": "webpack --progress",
"build:app": "webpack --progress --mode=production",
"clean:dist": "node ../../build/clean.js dist",
"prepare": "npm run clean:dist && npm run build",
"prettier": "prettier --config ../../.prettierrc --write \"**/*.{ts,tsx}\"",
Expand All @@ -28,7 +28,7 @@
"test": "npm run tslint && npm run unit-tests && npm run build:app",
"tslint": "tslint -c ./tslint.json 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-jss-manager-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"tslint": "tslint -c ./tslint.json '**/*.ts'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts'",
"tslint:watch": "node build/tslint-watch.js",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-jss-manager-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"tslint": "tslint -c tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c tslint.json '**/*.ts{,x}' --fix",
"tslint:watch": "node build/tslint-watch.js",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch && npm-watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-jss-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c ./tslint.json '**/*.ts'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"watch": "npm run build -- -w --preserveWatchOutput"
},
"jest": {
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-layouts-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"type": "dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json",
"build:app": "webpack --progress",
"build:app": "webpack --progress --mode=production",
"clean:dist": "node ../../build/clean.js dist",
"prepare": "npm run clean:dist && npm run build",
"prettier": "prettier --config ../../.prettierrc --write \"**/*.{ts,tsx}\"",
Expand All @@ -28,7 +28,7 @@
"test": "npm run tslint && npm run unit-tests && npm run build:app",
"tslint": "tslint -c ./tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:update": "jest --updateSnapshot",
"unit-tests:watch": "jest --watch",
"watch": "npm run build -- -w --preserveWatchOutput"
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-markdown-msft-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c tslint.json '**/*.ts{,x}' --fix",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch && npm-watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-navigation-generator-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json",
"build:app": "webpack --progress",
"build:app": "webpack --progress --mode=production",
"clean:dist": "node ../../build/clean.js dist",
"prepare": "npm run clean:dist && npm run build",
"prettier": "prettier --config ../../.prettierrc --write \"**/*.{ts,tsx}\"",
Expand All @@ -28,7 +28,7 @@
"test": "npm run tslint && npm run unit-tests && npm run build:app",
"tslint": "tslint -c ./tslint.json 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix 'src/**/*.ts{,x}' '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-permutator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"prettier:diff": "prettier --config ../../.prettierrc \"**/*.js\" --list-different",
"test": "npm run eslint && npm run unit-tests",
"eslint": "eslint src/**",
"unit-tests": "jest --maxWorkers=4"
"unit-tests": "jest --maxWorkers=2"
},
"jest": {
"verbose": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-viewer-react/src/viewer/viewer.base.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe("Viewer", (): void => {
});
test("should fire the `onUpdateHeight` callback if the responsive buttons are dragged", () => {
jest.spyOn(window, "requestAnimationFrame").mockImplementation(
(callback: () => void): void => {
(callback: any): any => {
callback();
}
);
Expand Down Expand Up @@ -123,7 +123,7 @@ describe("Viewer", (): void => {
});
test("should fire the `onUpdateWidth` callback if the responsive buttons are dragged", () => {
jest.spyOn(window, "requestAnimationFrame").mockImplementation(
(callback: () => void): void => {
(callback: any): any => {
callback();
}
);
Expand Down
11 changes: 10 additions & 1 deletion packages/fast-viewer-react/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const appDir = path.resolve(__dirname, "./app");
const outDir = path.resolve(__dirname, "./www");

module.exports = (env, args) => {

const isProduction = args.mode === "production";

return {
Expand All @@ -18,6 +17,16 @@ module.exports = (env, args) => {
devtool: isProduction ? "none" : "inline-source-map",
entry: path.resolve(appDir, "index.tsx"),
mode: args.mode || "development",
optimization: {
splitChunks: {
chunks: "all",
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
},
},
}
},
module: {
rules: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-web-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c ./tslint.json '**/*.ts{,x}'",
"tslint:fix": "tslint -c ./tslint.json --fix '**/*.ts{,x}'",
"unit-tests": "jest --maxWorkers=4",
"unit-tests": "jest --maxWorkers=2",
"unit-tests:watch": "jest --watch",
"watch": "npm run build -- -w --preserveWatchOutput"
},
Expand Down

0 comments on commit 5926db7

Please sign in to comment.