Skip to content

Commit

Permalink
Upgraded dependencies. Replaced deprecated awesome-typescript-loader …
Browse files Browse the repository at this point in the history
…with ts-loader. Fixed Terser build configuration. (#1391)
  • Loading branch information
azaslonov authored Jul 19, 2021
1 parent 8ce55ba commit a8dc8e8
Show file tree
Hide file tree
Showing 10 changed files with 1,445 additions and 1,487 deletions.
2,878 changes: 1,411 additions & 1,467 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apim-developer-portal",
"version": "2.0.0",
"version": "2.11.0",
"description": "API management developer portal",
"author": "Microsoft",
"license": "MIT",
Expand Down Expand Up @@ -29,12 +29,11 @@
"@types/knockout.mapping": "^2.0.35",
"@types/knockout.validation": "0.0.37",
"@types/lodash": "^4.14.162",
"@types/mime-types": "^2.1.0",
"@types/mime": "^2.0.3",
"@types/mocha": "8.0.3",
"@types/node": "^14.11.10",
"@types/puppeteer": "^3.0.2",
"autoprefixer": "^10.0.1",
"awesome-typescript-loader": "^5.2.1",
"azure-storage": "^2.10.3",
"chai": "^4.2.0",
"clean-webpack-plugin": "2.0.2",
Expand All @@ -52,6 +51,7 @@
"sass-loader": "^10.1.1",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.0.0",
"ts-loader": "^8.3.0",
"ts-node": "9.0.0",
"tslint": "^6.1.3",
"typescript": "^4.2.4",
Expand All @@ -62,11 +62,11 @@
"webpack-merge": "^5.2.0"
},
"dependencies": {
"@paperbits/azure": "0.1.424",
"@paperbits/common": "0.1.424",
"@paperbits/core": "0.1.424",
"@paperbits/prosemirror": "0.1.424",
"@paperbits/styles": "0.1.424",
"@paperbits/azure": "0.1.432",
"@paperbits/common": "0.1.432",
"@paperbits/core": "0.1.432",
"@paperbits/prosemirror": "0.1.432",
"@paperbits/styles": "0.1.432",
"@webcomponents/custom-elements": "1.4.2",
"@webcomponents/shadydom": "^1.7.4",
"adal-vanilla": "^1.0.18",
Expand All @@ -81,7 +81,7 @@
"knockout.validation": "^2.0.4",
"liquidjs": "^9.16.1",
"lunr": "^2.3.9",
"mime-types": "^2.1.27",
"mime": "^1.6.0",
"moment": "^2.29.1",
"msal": "^1.4.1",
"prismjs": "^1.22.0",
Expand Down
6 changes: 3 additions & 3 deletions scripts.v2/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require("path");
const https = require("https");
const { BlobServiceClient } = require("@azure/storage-blob");
const blobStorageContainer = "content";
const mime = require("mime-types");
const mime = require("mime");

process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

Expand Down Expand Up @@ -132,7 +132,7 @@ async function downloadBlobs(blobStorageUrl, snapshotMediaFolder) {

for await (const blob of blobs) {
const blockBlobClient = containerClient.getBlockBlobClient(blob.name);
const extension = mime.extension(blob.properties.contentType);
const extension = mime.getExtension(blob.properties.contentType);
let pathToFile;

if (extension != null) {
Expand Down Expand Up @@ -160,7 +160,7 @@ async function uploadBlobs(blobStorageUrl, localMediaFolder) {

for (const fileName of fileNames) {
const blobKey = fileName.replace(localMediaFolder + "/", "").split(".")[0];
const contentType = mime.lookup(fileName) || "application/octet-stream";
const contentType = mime.getType(fileName) || "application/octet-stream";
const blockBlobClient = containerClient.getBlockBlobClient(blobKey);

await blockBlobClient.uploadFile(fileName, {
Expand Down
4 changes: 2 additions & 2 deletions scripts.v3/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const https = require("https");
const { execSync } = require("child_process");
const { BlobServiceClient } = require("@azure/storage-blob");
const blobStorageContainer = "content";
const mime = require("mime-types");
const mime = require("mime");
const apiVersion = "2020-06-01-preview"; // "2021-01-01-preview";
const managementApiEndpoint = "management.azure.com";
const metadataFileExt = ".info";
Expand Down Expand Up @@ -243,7 +243,7 @@ class ImporterExporter {
}
else {
blobKey = blobKey.split(".")[0];
contentType = mime.lookup(fileName) || "application/octet-stream";
contentType = mime.getType(fileName) || "application/octet-stream";
}

const blockBlobClient = containerClient.getBlockBlobClient(blobKey);
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"sourceMap": true,
"incremental": true
},
"include": [
"./src/**/*",
"./node_modules/@paperbits/**/*"
],
"exclude": [
"./node_modules"
]
Expand Down
1 change: 0 additions & 1 deletion webpack.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const productionConfig = {
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: false,
terserOptions: {
mangle: false,
output: {
Expand Down
6 changes: 4 additions & 2 deletions webpack.designer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ const designerConfig = {
},
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
loader: "ts-loader",
options: {
allowTsInNodeModules: true
}
},
{
test: /\.html$/,
Expand Down Expand Up @@ -71,7 +74,6 @@ const designerConfig = {
{ from: `./src/themes/designer/assets/index.html`, to: "index.html" },
{ from: `./src/themes/designer/styles/fonts`, to: "editors/styles/fonts" },
{ from: `./src/libraries`, to: "data" },
{ from: `./scripts.v3/data.json`, to: "editors/themes/default.json" },
{ from: "./src/config.design.json", to: "config.json" }
]
})
Expand Down
5 changes: 4 additions & 1 deletion webpack.function.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ const functionConfig = {
},
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
loader: "ts-loader",
options: {
allowTsInNodeModules: true
}
},
{
test: /\.html$/,
Expand Down
5 changes: 4 additions & 1 deletion webpack.publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ const publisherConfig = {
},
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
loader: "ts-loader",
options: {
allowTsInNodeModules: true
}
},
{
test: /\.html$/,
Expand Down
5 changes: 4 additions & 1 deletion webpack.runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const runtimeConfig = {
},
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
loader: "ts-loader",
options: {
allowTsInNodeModules: true
}
},
{
test: /\.html$/,
Expand Down

0 comments on commit a8dc8e8

Please sign in to comment.