Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Update pack dependencies (#2039)
Browse files Browse the repository at this point in the history
HARP-13369: update package dependencies of harp.gl

Signed-off-by: Daniele Bacarella <daniele.bacarella@here.com>
  • Loading branch information
dbacarel committed Jan 12, 2021
1 parent 28e9afd commit 44b5a42
Show file tree
Hide file tree
Showing 14 changed files with 346 additions and 438 deletions.
2 changes: 1 addition & 1 deletion @here/harp-atlas-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"spritesmith": "^3.3.0"
},
"devDependencies": {
"ts-node": "^8.10.1",
"ts-node": "^9.1.1",
"typescript": "^4.1.2"
},
"publishConfig": {
Expand Down
12 changes: 6 additions & 6 deletions @here/harp-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@
"@here/harp-webtile-datasource": "^0.21.1",
"@types/dat.gui": "^0.7.1",
"@types/long": "^4.0.1",
"copy-webpack-plugin": "^6.3.2",
"copy-webpack-plugin": "^7.0.0",
"cross-env": "^7.0.2",
"css-loader": "^3.5.3",
"css-loader": "^5.0.1",
"dat.gui": "^0.7.7",
"highlight.js": "^10.4.1",
"html-webpack-plugin": "^5.0.0-alpha.14",
"ncp": "^2.0.0",
"stats.js": "^0.17.0",
"style-loader": "^1.2.1",
"style-loader": "^2.0.0",
"suncalc": "^1.8.0",
"three": "^0.124.0",
"ts-loader": "^8.0.7",
"typescript": "^4.1.2",
"webpack-cli": "^4.2.0",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.1.1",
"webpack": "^5.9.0"
"webpack-merge": "^5.7.3",
"webpack": "^5.12.3"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-examples/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//@ts-check

const webpack = require("webpack");
const merge = require("webpack-merge");
const { merge } = require("webpack-merge");
const path = require("path");
const glob = require("glob");
const HtmlWebpackPlugin = require("html-webpack-plugin");
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-map-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"ncp": "^2.0.0",
"source-map-support": "^0.5.19",
"tmp": "^0.2.1",
"ts-node": "^8.10.1",
"ts-node": "^9.1.1",
"typescript": "^4.1.2"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-text-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"three": "^0.124.0",
"ts-node": "^8.10.1",
"ts-node": "^9.1.1",
"typescript": "^4.1.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-theme-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"path": "^0.12.7"
},
"devDependencies": {
"ts-node": "^8.10.1",
"ts-node": "^9.1.1",
"typescript": "^4.1.2"
},
"publishConfig": {
Expand Down
8 changes: 4 additions & 4 deletions @here/harp-webpack-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
"harpgl"
],
"dependencies": {
"copy-webpack-plugin": "^6.3.2",
"copy-webpack-plugin": "^7.0.0",
"html-webpack-plugin": "^5.0.0-alpha.14",
"webpack-merge": "^4.2.2"
"webpack-merge": "^5.7.3"
},
"peerDependencies": {
"webpack": "^5.9.0"
"webpack": "^5.12.3"
},
"devDependencies": {
"cross-env": "^7.0.2",
"ts-node": "^8.10.1",
"ts-node": "^9.1.1",
"typescript": "^4.1.2"
},
"publishConfig": {
Expand Down
32 changes: 23 additions & 9 deletions @here/harp-webpack-utils/scripts/HarpWebpackConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
// see: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/49528
const CopyWebpackPlugin: any = require("copy-webpack-plugin");
// Uncomment this when the above issue is fixed.
//import * as CopyWebpackPlugin from "copy-webpack-plugin";
// import * as CopyWebpackPlugin from "copy-webpack-plugin";

import * as HtmlWebpackPlugin from "html-webpack-plugin";
import { Configuration, WebpackPluginInstance } from "webpack";

// As above, the typings don't work for webpack-merge, see:
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/49757
const WebpackMerge: any = require("webpack-merge");
// const WebpackMerge: any = require("webpack-merge");
// Uncomment this when the above issue is fixed.
//import * as WebpackMerge from "webpack-merge";
// import * as WebpackMerge from "webpack-merge";
import { CustomizeRule, mergeWithRules } from "webpack-merge";

export interface HarpWebpackConfig {
mainEntry?: string;
Expand All @@ -32,6 +32,17 @@ export function addHarpWebpackConfig(config?: Configuration, harpConfig?: HarpWe
const userConfig = config !== undefined ? config : {};
const mode = process.env.NODE_ENV === "production" ? "production" : "development";
const mainEntry = harpConfig === undefined ? undefined : harpConfig.mainEntry;
const WebpackMergeMatchLoader = mergeWithRules({
module: {
rules: {
test: CustomizeRule.Match,
use: {
loader: CustomizeRule.Match,
options: CustomizeRule.Merge
}
}
}
});
const baseConfig: Configuration = {
output: {
filename: "[name].bundle.js"
Expand All @@ -56,11 +67,13 @@ export function addHarpWebpackConfig(config?: Configuration, harpConfig?: HarpWe
rules: [{ test: /\.tsx?$/, loader: "ts-loader" }]
}
};

const mainConfig = mainEntry?.match(/\.tsx?$/)
? WebpackMerge.smart(baseConfig, typescriptConfig)
? WebpackMergeMatchLoader(baseConfig, typescriptConfig)
: baseConfig;

const bundles = [
WebpackMerge.smart(
WebpackMergeMatchLoader(
{
...mainConfig,
plugins: createPlugins(
Expand All @@ -78,8 +91,9 @@ export function addHarpWebpackConfig(config?: Configuration, harpConfig?: HarpWe
userConfig
)
];

if (mainEntry !== undefined) {
bundles[0] = WebpackMerge.smart(
bundles[0] = WebpackMergeMatchLoader(
{
entry: {
mapview: mainEntry
Expand All @@ -90,10 +104,10 @@ export function addHarpWebpackConfig(config?: Configuration, harpConfig?: HarpWe
}
if (harpConfig !== undefined && harpConfig.decoderEntry !== undefined) {
const decoderConfig = harpConfig.decoderEntry.endsWith(".ts")
? WebpackMerge.smart(baseConfig, typescriptConfig)
? WebpackMergeMatchLoader(baseConfig, typescriptConfig)
: baseConfig;
bundles.push(
WebpackMerge.smart(
WebpackMergeMatchLoader(
{
target: "webworker",
entry: {
Expand Down
6 changes: 3 additions & 3 deletions @here/harp.gl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"@microsoft/api-extractor": "^7.8.10",
"ts-loader": "^8.0.7",
"typescript": "^4.1.2",
"webpack": "^5.9.0",
"webpack-cli": "^4.2.0",
"webpack-merge": "^4.1.1"
"webpack": "^5.12.3",
"webpack-cli": "^4.3.1",
"webpack-merge": "^5.7.3"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp.gl/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fs = require("fs");
const webpack = require("webpack");

const path = require("path");
const merge = require("webpack-merge");
const { merge } = require("webpack-merge");

const isProduction = process.env.NODE_ENV === "production";
const bundleSuffix = isProduction ? ".min" : "";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"ts-mocha": "^7.0.0",
"typedoc": "^0.17.7",
"typescript": "^4.1.2",
"webpack": "^5.9.0",
"webpack-cli": "^4.2.0",
"webpack": "^5.12.3",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.0"
},
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"@here/harp-mapview": "^0.21.1",
"@here/harp-utils": "^0.21.0",
"@here/harp-vectortile-datasource": "^0.21.1",
"copy-webpack-plugin": "^6.3.2",
"css-loader": "^3.5.3",
"copy-webpack-plugin": "^7.0.0",
"css-loader": "^5.0.1",
"file-loader": "^6.0.0",
"html-inline-css-webpack-plugin": "^1.8.0",
"mini-css-extract-plugin": "^1.3.2",
Expand All @@ -32,8 +32,8 @@
"three": "^0.124.0",
"ts-loader": "^8.0.7",
"typescript": "^4.1.2",
"webpack": "^5.9.0",
"webpack-cli": "^4.2.0",
"webpack": "^5.12.3",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.0"
}
}
2 changes: 1 addition & 1 deletion www/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fetch = require("node-fetch");
const webpack = require("webpack");
const merge = require("webpack-merge");
const { merge } = require("webpack-merge");
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
Expand Down
Loading

0 comments on commit 44b5a42

Please sign in to comment.