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

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,37 @@
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": "Fri, 20 May 2022 04:25:53 GMT",
6
+ "tag": "@ms-cloudpack/create-express-app_v0.1.0",
7
+ "version": "0.1.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "dzearing@microsoft.com",
12
+ "package": "@ms-cloudpack/create-express-app",
13
+ "commit": "b39bb143fc53e622c39f9e9fd349f71c9ebadd77",
14
+ "comment": "Exporting express typings."
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Sat, 14 May 2022 04:36:11 GMT",
21
+ "tag": "@ms-cloudpack/create-express-app_v0.0.2",
22
+ "version": "0.0.2",
23
+ "comments": {
24
+ "none": [
25
+ {
26
+ "author": "dzearing@microsoft.com",
27
+ "package": "@ms-cloudpack/create-express-app",
28
+ "commit": "cc0844a7d18790d69e59b16dbd6eef8fab5bc4e0",
29
+ "comment": "Updating package details."
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Mon, 09 May 2022 18:54:56 GMT",
6
36
  "tag": "@ms-cloudpack/create-express-app_v0.0.2",
7
37
  "version": "0.0.2",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
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 Fri, 20 May 2022 04:25:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.1.0
8
+
9
+ Fri, 20 May 2022 04:25:53 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Exporting express typings. (dzearing@microsoft.com)
14
+
7
15
  ## 0.0.2
8
16
 
9
- Mon, 09 May 2022 18:54:32 GMT
17
+ Mon, 09 May 2022 18:54:56 GMT
10
18
 
11
19
  ### Patches
12
20
 
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
+ await 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,OAAyB,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,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;IAEzB,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"}
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.0",
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,
@@ -26,10 +27,12 @@
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"