@lwrjs/server 0.7.0 → 0.8.0-alpha.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.
@@ -27,7 +27,6 @@ __export(exports, {
27
27
  default: () => express_server_default
28
28
  });
29
29
  var import_express = __toModule(require("express"));
30
- var import_spdy = __toModule(require("spdy"));
31
30
  var import_http = __toModule(require("http"));
32
31
  var import_compression = __toModule(require("../common/compression.cjs"));
33
32
  var import_abstract_internal_app_server = __toModule(require("../common/abstract-internal-app-server.cjs"));
@@ -54,10 +53,6 @@ var ExpressInternalServer = class extends import_abstract_internal_app_server.de
54
53
  }
55
54
  return this.httpServer;
56
55
  }
57
- createHttp2Server() {
58
- this.http2Server = import_spdy.default.createServer(this.expressApp);
59
- return this.http2Server;
60
- }
61
56
  use(middleware) {
62
57
  this.expressApp.use(async (req, res, next) => {
63
58
  const metadataRequest = this.isMetadataRequest(req.headers);
@@ -31,7 +31,6 @@ var import_koa = __toModule(require("koa"));
31
31
  var import_router = __toModule(require("@koa/router"));
32
32
  var import_koa_compose = __toModule(require("koa-compose"));
33
33
  var import_http = __toModule(require("http"));
34
- var import_http2 = __toModule(require("http2"));
35
34
  var import_fs_request = __toModule(require("./fs-request.cjs"));
36
35
  var import_fs_response = __toModule(require("./fs-response.cjs"));
37
36
  var import_fs_context = __toModule(require("./fs-context.cjs"));
@@ -66,9 +65,6 @@ var FsInternalServer = class extends import_abstract_internal_app_server.default
66
65
  createHttpServer() {
67
66
  return import_http.default.createServer();
68
67
  }
69
- createHttp2Server() {
70
- return import_http2.default.createServer();
71
- }
72
68
  use(middleware) {
73
69
  this.middlewares.push(async (ctx, next) => {
74
70
  const lwrReq = new import_fs_request.default(ctx);
@@ -29,7 +29,6 @@ __export(exports, {
29
29
  var import_koa = __toModule(require("koa"));
30
30
  var import_router = __toModule(require("@koa/router"));
31
31
  var import_http = __toModule(require("http"));
32
- var import_http2 = __toModule(require("http2"));
33
32
  var import_koa_compress = __toModule(require("koa-compress"));
34
33
  var import_abstract_internal_app_server = __toModule(require("../common/abstract-internal-app-server.cjs"));
35
34
  var import_koa_request = __toModule(require("./koa-request.cjs"));
@@ -47,10 +46,6 @@ var KoaInternalServer = class extends import_abstract_internal_app_server.defaul
47
46
  this.httpServer = import_http.default.createServer(this.koaApp.callback());
48
47
  return this.httpServer;
49
48
  }
50
- createHttp2Server() {
51
- this.http2Server = import_http2.default.createServer(this.koaApp.callback());
52
- return this.http2Server;
53
- }
54
49
  use(middleware) {
55
50
  this.koaApp.use(async (ctx, next) => {
56
51
  const metadataRequest = this.isMetadataRequest(ctx.request.headers);
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Application as ExpressApp } from 'express';
3
3
  import http from 'http';
4
- import http2 from 'http2';
5
4
  import { InternalAppServer, InternalAppServerOptions } from '@lwrjs/types';
6
5
  import AbstractInternalAppServer from '../common/abstract-internal-app-server.js';
7
6
  /**
@@ -10,12 +9,10 @@ import AbstractInternalAppServer from '../common/abstract-internal-app-server.js
10
9
  export default class ExpressInternalServer extends AbstractInternalAppServer implements InternalAppServer<'express'> {
11
10
  private expressApp;
12
11
  private httpServer?;
13
- private http2Server?;
14
12
  private basePath?;
15
13
  constructor(options: InternalAppServerOptions);
16
14
  getImpl(): ExpressApp;
17
15
  createHttpServer(): http.Server;
18
- createHttp2Server(): http2.Http2Server;
19
16
  use(middleware: Function): void;
20
17
  all(path: string | Array<string>, middleware: Function): void;
21
18
  get(path: string | Array<string>, middleware: Function): void;
@@ -1,5 +1,4 @@
1
1
  import express from 'express';
2
- import spdy from 'spdy';
3
2
  import http from 'http';
4
3
  import compression from '../common/compression.js';
5
4
  import AbstractInternalAppServer from '../common/abstract-internal-app-server.js';
@@ -30,11 +29,6 @@ export default class ExpressInternalServer extends AbstractInternalAppServer {
30
29
  }
31
30
  return this.httpServer;
32
31
  }
33
- createHttp2Server() {
34
- // HACK: spdy returns a server of type https.Server which does not satisfy http2.Http2Server
35
- this.http2Server = spdy.createServer(this.expressApp);
36
- return this.http2Server;
37
- }
38
32
  use(middleware) {
39
33
  this.expressApp.use(async (req, res, next) => {
40
34
  const metadataRequest = this.isMetadataRequest(req.headers);
@@ -4,7 +4,6 @@ import Koa from 'koa';
4
4
  import KoaRouter, { Middleware as KoaMiddleware } from '@koa/router';
5
5
  import { LwrDispatcher, FsContext, InternalAppServer, MiddlewareFunction } from '@lwrjs/types';
6
6
  import { Server as HttpServer } from 'http';
7
- import { Http2Server } from 'http2';
8
7
  import AbstractInternalAppServer from '../common/abstract-internal-app-server.js';
9
8
  export declare class LwrFsKoa extends Koa implements LwrDispatcher {
10
9
  private composedMiddleware?;
@@ -22,7 +21,6 @@ export declare class FsInternalServer extends AbstractInternalAppServer implemen
22
21
  private middlewares;
23
22
  constructor();
24
23
  createHttpServer(): HttpServer;
25
- createHttp2Server(): Http2Server;
26
24
  use(middleware: MiddlewareFunction): void;
27
25
  all(path: string | string[], middleware: MiddlewareFunction): void;
28
26
  get(path: string | string[], middleware: MiddlewareFunction): void;
@@ -2,7 +2,6 @@ import Koa from 'koa';
2
2
  import KoaRouter from '@koa/router';
3
3
  import compose from 'koa-compose';
4
4
  import http from 'http';
5
- import http2 from 'http2';
6
5
  import FsRequest from './fs-request.js';
7
6
  import FsResponse from './fs-response.js';
8
7
  import createFsContext from './fs-context.js';
@@ -41,10 +40,6 @@ export class FsInternalServer extends AbstractInternalAppServer {
41
40
  createHttpServer() {
42
41
  return http.createServer();
43
42
  }
44
- // TODO: mock this API as is not used for now
45
- createHttp2Server() {
46
- return http2.createServer();
47
- }
48
43
  use(middleware) {
49
44
  this.middlewares.push(async (ctx, next) => {
50
45
  const lwrReq = new FsRequest(ctx);
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import Koa from 'koa';
3
3
  import http from 'http';
4
- import http2 from 'http2';
5
4
  import { InternalAppServer } from '@lwrjs/types';
6
5
  import AbstractInternalAppServer from '../common/abstract-internal-app-server.js';
7
6
  /**
@@ -11,11 +10,9 @@ export default class KoaInternalServer extends AbstractInternalAppServer impleme
11
10
  private koaApp;
12
11
  private koaRouter;
13
12
  private httpServer?;
14
- private http2Server?;
15
13
  constructor();
16
14
  getImpl(): Koa;
17
15
  createHttpServer(): http.Server;
18
- createHttp2Server(): http2.Http2Server;
19
16
  use(middleware: Function): void;
20
17
  all(path: string | string[], middleware: Function): void;
21
18
  get(path: string | string[], middleware: Function): void;
@@ -1,7 +1,6 @@
1
1
  import Koa from 'koa';
2
2
  import KoaRouter from '@koa/router';
3
3
  import http from 'http';
4
- import http2 from 'http2';
5
4
  import compress from 'koa-compress';
6
5
  import AbstractInternalAppServer from '../common/abstract-internal-app-server.js';
7
6
  import KoaRequest from './koa-request.js';
@@ -22,10 +21,6 @@ export default class KoaInternalServer extends AbstractInternalAppServer {
22
21
  this.httpServer = http.createServer(this.koaApp.callback());
23
22
  return this.httpServer;
24
23
  }
25
- createHttp2Server() {
26
- this.http2Server = http2.createServer(this.koaApp.callback());
27
- return this.http2Server;
28
- }
29
24
  use(middleware) {
30
25
  this.koaApp.use(async (ctx, next) => {
31
26
  const metadataRequest = this.isMetadataRequest(ctx.request.headers);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.7.0",
7
+ "version": "0.8.0-alpha.1",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,15 +30,14 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "devDependencies": {
33
- "@lwrjs/types": "0.7.0",
33
+ "@lwrjs/types": "0.8.0-alpha.1",
34
34
  "@types/koa-compress": "^4.0.1",
35
35
  "@types/koa__router": "^8.0.4",
36
- "@types/spdy": "^3.4.4",
37
36
  "jest-express": "^1.12.0"
38
37
  },
39
38
  "dependencies": {
40
39
  "@koa/router": "^10.0.0",
41
- "@lwrjs/shared-utils": "0.7.0",
40
+ "@lwrjs/shared-utils": "0.8.0-alpha.1",
42
41
  "@types/compression": "^1.7.2",
43
42
  "@types/express": "^4.17.13",
44
43
  "@types/koa": "^2.11.7",
@@ -46,8 +45,7 @@
46
45
  "express": "^4.17.13",
47
46
  "koa": "^2.13.1",
48
47
  "koa-compose": "^4.1.0",
49
- "koa-compress": "^5.0.1",
50
- "spdy": "^4.0.2"
48
+ "koa-compress": "^5.0.1"
51
49
  },
52
50
  "optionalDependencies": {
53
51
  "shrink-ray-current": "^4.1.2"
@@ -55,5 +53,5 @@
55
53
  "engines": {
56
54
  "node": ">=14.15.4 <19"
57
55
  },
58
- "gitHead": "c6dcb52144a8da80170e30d49a87e29d2da30f9b"
56
+ "gitHead": "2718cc5abe11d0d6fd5375cf9205167b6f69e244"
59
57
  }