@ms-cloudpack/create-express-app 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"parseHttpsConfig.d.ts","sourceRoot":"","sources":["../src/parseHttpsConfig.ts"],"names":[],"mappings":";;AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAI5D,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC,OAAO,eAAe,EAAE,OAAO,cAAc,CAAC,CAAC;AAKvF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAmBjE"}
1
+ {"version":3,"file":"parseHttpsConfig.d.ts","sourceRoot":"","sources":["../src/parseHttpsConfig.ts"],"names":[],"mappings":";;AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAI5D,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC,OAAO,eAAe,EAAE,OAAO,cAAc,CAAC,CAAC;AAKvF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAqBjE"}
@@ -14,7 +14,7 @@ export function parseHttpsConfig(config) {
14
14
  sslOptions[key] = fs.readFileSync(certFilePath);
15
15
  }
16
16
  else {
17
- throw 'Certificate file not found: ' + certFilePath;
17
+ throw new Error(`The specified certificate to be used for the web server is missing at "${certFilePath}". Make sure the path is correct, the file exists, and try starting again.`);
18
18
  }
19
19
  }
20
20
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"parseHttpsConfig.js","sourceRoot":"","sources":["../src/parseHttpsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,MAAM,UAAU,GAAyC,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACjD,+CAA+C;QAC/C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC3E,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;YAClD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;gBAC/B,gDAAgD;gBAChD,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;aACjD;iBAAM;gBACL,MAAM,8BAA8B,GAAG,YAAY,CAAC;aACrD;SACF;aAAM;YACL,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAyB,KAAK,CAAC;SAC/C;KACF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import fs from 'fs';\nimport { pathSymbolReplacement } from '@ms-cloudpack/path-utilities';\nimport type { ServerOptions } from 'https';\nimport type { IncomingMessage, ServerResponse } from 'http';\n\ntype ValueOf<T> = T[keyof T];\n\nexport type HttpsConfig = ServerOptions<typeof IncomingMessage, typeof ServerResponse>;\n\n/*\n * Read certificates files in Https Config and return the contents.\n */\nexport function parseHttpsConfig(config: HttpsConfig): HttpsConfig {\n const sslOptions: Record<string, ValueOf<HttpsConfig>> = {};\n\n for (const [key, value] of Object.entries(config)) {\n // Read the file contents for the certificates.\n if (['ca', 'cert', 'key', 'pfx'].includes(key) && typeof value === 'string') {\n const certFilePath = pathSymbolReplacement(value);\n if (fs.existsSync(certFilePath)) {\n // eslint-disable-next-line no-restricted-syntax\n sslOptions[key] = fs.readFileSync(certFilePath);\n } else {\n throw 'Certificate file not found: ' + certFilePath;\n }\n } else {\n // If not a certificate, just use the value.\n sslOptions[key] = <ValueOf<HttpsConfig>>value;\n }\n }\n return sslOptions;\n}\n"]}
1
+ {"version":3,"file":"parseHttpsConfig.js","sourceRoot":"","sources":["../src/parseHttpsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,MAAM,UAAU,GAAyC,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACjD,+CAA+C;QAC/C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC3E,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;YAClD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;gBAC/B,gDAAgD;gBAChD,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;aACjD;iBAAM;gBACL,MAAM,IAAI,KAAK,CACb,0EAA0E,YAAY,4EAA4E,CACnK,CAAC;aACH;SACF;aAAM;YACL,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAyB,KAAK,CAAC;SAC/C;KACF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import fs from 'fs';\nimport { pathSymbolReplacement } from '@ms-cloudpack/path-utilities';\nimport type { ServerOptions } from 'https';\nimport type { IncomingMessage, ServerResponse } from 'http';\n\ntype ValueOf<T> = T[keyof T];\n\nexport type HttpsConfig = ServerOptions<typeof IncomingMessage, typeof ServerResponse>;\n\n/*\n * Read certificates files in Https Config and return the contents.\n */\nexport function parseHttpsConfig(config: HttpsConfig): HttpsConfig {\n const sslOptions: Record<string, ValueOf<HttpsConfig>> = {};\n\n for (const [key, value] of Object.entries(config)) {\n // Read the file contents for the certificates.\n if (['ca', 'cert', 'key', 'pfx'].includes(key) && typeof value === 'string') {\n const certFilePath = pathSymbolReplacement(value);\n if (fs.existsSync(certFilePath)) {\n // eslint-disable-next-line no-restricted-syntax\n sslOptions[key] = fs.readFileSync(certFilePath);\n } else {\n throw new Error(\n `The specified certificate to be used for the web server is missing at \"${certFilePath}\". Make sure the path is correct, the file exists, and try starting again.`,\n );\n }\n } else {\n // If not a certificate, just use the value.\n sslOptions[key] = <ValueOf<HttpsConfig>>value;\n }\n }\n return sslOptions;\n}\n"]}
@@ -1,11 +1,11 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.4"
9
- }
10
- ]
11
- }
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.35.2"
9
+ }
10
+ ]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/create-express-app",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Helper for creating an express app server, abstracting a common plugin setup.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,22 +13,21 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@ms-cloudpack/path-utilities": "^2.2.2",
16
+ "@ms-cloudpack/path-utilities": "^2.2.3",
17
17
  "@types/express": "^4.17.16",
18
18
  "compression": "^1.7.4",
19
19
  "cors": "^2.8.5",
20
20
  "express": "^4.17.3",
21
- "get-port": "^6.1.2"
21
+ "get-port": "^7.0.0"
22
22
  },
23
23
  "devDependencies": {
24
+ "@ms-cloudpack/eslint-plugin-internal": "*",
24
25
  "@ms-cloudpack/scripts": "*",
25
- "@ms-cloudpack/eslint-config-base": "*",
26
26
  "@ms-cloudpack/test-utilities": "*",
27
- "@types/compression": "1.7.2",
28
- "@types/cors": "2.8.13"
27
+ "@types/compression": "^1.7.2",
28
+ "@types/cors": "^2.8.13"
29
29
  },
30
30
  "scripts": {
31
- "api:update": "cloudpack-scripts api-update",
32
31
  "api": "cloudpack-scripts api",
33
32
  "build:watch": "cloudpack-scripts build-watch",
34
33
  "build": "cloudpack-scripts build",