@ms-cloudpack/create-express-app 0.0.2 → 0.1.1

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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,67 @@
2
2
  "name": "@ms-cloudpack/create-express-app",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 09 May 2022 18:54:32 GMT",
5
+ "date": "Wed, 28 Sep 2022 08:14:45 GMT",
6
+ "tag": "@ms-cloudpack/create-express-app_v0.1.1",
7
+ "version": "0.1.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "elcraig@microsoft.com",
12
+ "package": "@ms-cloudpack/create-express-app",
13
+ "commit": "084168500b6320d6861a4c7e8f363fea9e4f831e",
14
+ "comment": "Remove unnecessary await"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 20 Sep 2022 08:13:46 GMT",
21
+ "tag": "@ms-cloudpack/create-express-app_v0.1.0",
22
+ "version": "0.1.0",
23
+ "comments": {
24
+ "none": [
25
+ {
26
+ "author": "email not defined",
27
+ "package": "@ms-cloudpack/create-express-app",
28
+ "commit": "f408318df04c9a3e4754975a28c39660abf32687",
29
+ "comment": "Update devDependency @types/express to v4.17.14"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Fri, 20 May 2022 04:26:15 GMT",
36
+ "tag": "@ms-cloudpack/create-express-app_v0.1.0",
37
+ "version": "0.1.0",
38
+ "comments": {
39
+ "minor": [
40
+ {
41
+ "author": "dzearing@microsoft.com",
42
+ "package": "@ms-cloudpack/create-express-app",
43
+ "commit": "b39bb143fc53e622c39f9e9fd349f71c9ebadd77",
44
+ "comment": "Exporting express typings."
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Sat, 14 May 2022 04:36:11 GMT",
51
+ "tag": "@ms-cloudpack/create-express-app_v0.0.2",
52
+ "version": "0.0.2",
53
+ "comments": {
54
+ "none": [
55
+ {
56
+ "author": "dzearing@microsoft.com",
57
+ "package": "@ms-cloudpack/create-express-app",
58
+ "commit": "cc0844a7d18790d69e59b16dbd6eef8fab5bc4e0",
59
+ "comment": "Updating package details."
60
+ }
61
+ ]
62
+ }
63
+ },
64
+ {
65
+ "date": "Mon, 09 May 2022 18:54:56 GMT",
6
66
  "tag": "@ms-cloudpack/create-express-app_v0.0.2",
7
67
  "version": "0.0.2",
8
68
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @ms-cloudpack/create-express-app
2
2
 
3
- This log was last generated on Mon, 09 May 2022 18:54:32 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 28 Sep 2022 08:14:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.1.1
8
+
9
+ Wed, 28 Sep 2022 08:14:45 GMT
10
+
11
+ ### Patches
12
+
13
+ - Remove unnecessary await (elcraig@microsoft.com)
14
+
15
+ ## 0.1.0
16
+
17
+ Fri, 20 May 2022 04:26:15 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - Exporting express typings. (dzearing@microsoft.com)
22
+
7
23
  ## 0.0.2
8
24
 
9
- Mon, 09 May 2022 18:54:32 GMT
25
+ Mon, 09 May 2022 18:54:56 GMT
10
26
 
11
27
  ### Patches
12
28
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ms-cloudpack/create-express-app
2
2
 
3
- Helper for creating an express app server with the right plugins.
3
+ Helper for creating an express app server, abstracting a common plugin setup.
4
4
 
5
5
  ## Usage
6
6
 
@@ -0,0 +1,8 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { type Express } from 'express';
3
+ import type { Server } from 'http';
4
+ export declare function createExpressApp(portRange: number[], setupCallback: (app: Express) => void): Promise<{
5
+ server: Server;
6
+ port: number;
7
+ }>;
8
+ export type { Express };
@@ -0,0 +1,24 @@
1
+ import express, {} from 'express';
2
+ import cors from 'cors';
3
+ import compression from 'compression';
4
+ import getPort from 'get-port';
5
+ export async function createExpressApp(portRange, setupCallback) {
6
+ // Get the available port.
7
+ const port = await getPort({
8
+ port: portRange,
9
+ });
10
+ const app = express();
11
+ // Use cors.
12
+ app.use(cors());
13
+ // Use compression.
14
+ app.use(compression());
15
+ // Call setup callback with the app.
16
+ setupCallback(app);
17
+ // Listen on port.
18
+ const server = app.listen(port);
19
+ return {
20
+ server,
21
+ port,
22
+ };
23
+ }
24
+ //# sourceMappingURL=createExpressApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createExpressApp.js","sourceRoot":"","sources":["../src/createExpressApp.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAgB,MAAM,SAAS,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,OAAO,MAAM,UAAU,CAAC;AAG/B,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,SAAmB,EACnB,aAAqC;IAKrC,0BAA0B;IAC1B,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC;QACzB,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IAEtB,YAAY;IACZ,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAEhB,mBAAmB;IACnB,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAEvB,oCAAoC;IACpC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEnB,kBAAkB;IAClB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO;QACL,MAAM;QACN,IAAI;KACL,CAAC;AACJ,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { createExpressApp } from './createExpressApp.js';
2
+ export type { Express, Request, Response } from 'express';
package/lib/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { createExpressApp } from './createExpressApp.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +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.31.2"
9
+ }
10
+ ]
11
+ }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/create-express-app",
3
- "version": "0.0.2",
4
- "description": "An abstraction to bundle source code.",
3
+ "version": "0.1.1",
4
+ "description": "Helper for creating an express app server, abstracting a common plugin setup.",
5
+ "license": "MIT",
5
6
  "type": "module",
6
7
  "types": "./lib/index.d.ts",
7
8
  "sideEffects": false,
@@ -22,14 +23,16 @@
22
23
  "@ms-cloudpack/eslint-config-base": "*",
23
24
  "@types/compression": "1.7.2",
24
25
  "@types/cors": "2.8.12",
25
- "@types/express": "4.17.13",
26
+ "@types/express": "4.17.14",
26
27
  "@types/get-port": "4.2.0"
27
28
  },
28
29
  "scripts": {
29
- "build": "just-scripts build",
30
- "build:watch": "just-scripts build:watch",
31
- "lint": "just-scripts lint",
32
- "lint:fix": "just-scripts lint:fix"
30
+ "api:update": "cloudpack-scripts api-update",
31
+ "api": "cloudpack-scripts api",
32
+ "build:watch": "cloudpack-scripts build-watch",
33
+ "build": "cloudpack-scripts build",
34
+ "lint:update": "cloudpack-scripts lint-update",
35
+ "lint": "cloudpack-scripts lint"
33
36
  },
34
37
  "files": [
35
38
  "/lib"