@tsed/vike 8.0.0-alpha.5 → 8.0.0-alpha.7

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.
Files changed (39) hide show
  1. package/lib/esm/ViteModule.js +1 -2
  2. package/lib/esm/ViteModule.js.map +1 -1
  3. package/lib/esm/middlewares/ViteRendererMiddleware.js.map +1 -1
  4. package/lib/esm/services/ViteServer.js.map +1 -1
  5. package/lib/esm/services/ViteService.js +2 -1
  6. package/lib/esm/services/ViteService.js.map +1 -1
  7. package/lib/types/interfaces/ViteRenderContext.d.ts +1 -1
  8. package/lib/types/services/ViteService.d.ts +1 -1
  9. package/package.json +12 -13
  10. package/vitest.config.mts +4 -4
  11. package/lib/cjs/ViteModule.js +0 -51
  12. package/lib/cjs/ViteModule.js.map +0 -1
  13. package/lib/cjs/decorators/vite.js +0 -9
  14. package/lib/cjs/decorators/vite.js.map +0 -1
  15. package/lib/cjs/index.js +0 -15
  16. package/lib/cjs/index.js.map +0 -1
  17. package/lib/cjs/interfaces/ViteConfig.js +0 -3
  18. package/lib/cjs/interfaces/ViteConfig.js.map +0 -1
  19. package/lib/cjs/interfaces/ViteRenderContext.js +0 -3
  20. package/lib/cjs/interfaces/ViteRenderContext.js.map +0 -1
  21. package/lib/cjs/interfaces/interfaces.js +0 -3
  22. package/lib/cjs/interfaces/interfaces.js.map +0 -1
  23. package/lib/cjs/middlewares/ViteRendererMiddleware.js +0 -28
  24. package/lib/cjs/middlewares/ViteRendererMiddleware.js.map +0 -1
  25. package/lib/cjs/package.json +0 -3
  26. package/lib/cjs/services/ViteServer.js +0 -43
  27. package/lib/cjs/services/ViteServer.js.map +0 -1
  28. package/lib/cjs/services/ViteService.js +0 -67
  29. package/lib/cjs/services/ViteService.js.map +0 -1
  30. package/lib/esm/package.json +0 -3
  31. package/lib/types-esm/ViteModule.d.ts +0 -13
  32. package/lib/types-esm/decorators/vite.d.ts +0 -1
  33. package/lib/types-esm/index.d.ts +0 -11
  34. package/lib/types-esm/interfaces/ViteConfig.d.ts +0 -7
  35. package/lib/types-esm/interfaces/ViteRenderContext.d.ts +0 -14
  36. package/lib/types-esm/interfaces/interfaces.d.ts +0 -8
  37. package/lib/types-esm/middlewares/ViteRendererMiddleware.d.ts +0 -6
  38. package/lib/types-esm/services/ViteServer.d.ts +0 -3
  39. package/lib/types-esm/services/ViteService.d.ts +0 -14
@@ -1,4 +1,3 @@
1
- var _a;
2
1
  import { __decorate, __metadata } from "tslib";
3
2
  import { PlatformApplication } from "@tsed/common";
4
3
  import { Inject, Module } from "@tsed/di";
@@ -37,7 +36,7 @@ __decorate([
37
36
  ], ViteModule.prototype, "viteService", void 0);
38
37
  __decorate([
39
38
  Inject(VITE_SERVER),
40
- __metadata("design:type", typeof (_a = typeof VITE_SERVER !== "undefined" && VITE_SERVER) === "function" ? _a : Object)
39
+ __metadata("design:type", Object)
41
40
  ], ViteModule.prototype, "viteServer", void 0);
42
41
  ViteModule = __decorate([
43
42
  Module({
@@ -1 +1 @@
1
- {"version":3,"file":"ViteModule.js","sourceRoot":"","sources":["../../src/ViteModule.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EAAwB,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAC1E,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAC,sBAAsB,EAAC,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAK/C,IAAM,UAAU,GAAhB,MAAM,UAAU;IAarB,OAAO;QACL,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,EAAE;YACvC,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,KAAK,EAAE,IAAY,EAAE,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QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AARC;IAAC,MAAM,EAAE;8BACc,WAAW;2DAAC;AAE7B;IAAK,WAAA,OAAO,EAAE,CAAA;;;;iDAInB;AARU,sBAAsB;IADlC,UAAU,EAAE;GACA,sBAAsB,CASlC;SATY,sBAAsB"}
1
+ {"version":3,"file":"ViteRendererMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/ViteRendererMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAGhD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAI3B,AAAN,KAAK,CAAC,GAAG,CAAY,IAAa;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;QAE5D,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AAPW;IADT,MAAM,EAAE;8BACc,WAAW;2DAAC;AAE7B;IAAK,WAAA,OAAO,EAAE,CAAA;;;;iDAInB;AARU,sBAAsB;IADlC,UAAU,EAAE;GACA,sBAAsB,CASlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ViteServer.js","sourceRoot":"","sources":["../../../src/services/ViteServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAC/B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QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAQ;aAClD,CAAC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QACnD,MAAM,EAAC,OAAO,EAAE,IAAI,EAAC,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,WAAW,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,cAAc,EAAE;gBACpD,QAAQ,EAAE,KAAK;gBACf,GAAG,WAAW;gBACd,GAAG,EAAE,KAAK;aACX,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IACD,KAAK,EAAE;QACL,UAAU,CAAC,aAAqC;YAC9C,OAAO,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;QACtD,CAAC;KACF;CACF,CAAC,CAAC"}
@@ -2,7 +2,8 @@ var ViteService_1;
2
2
  import { __decorate, __metadata } from "tslib";
3
3
  import { Constant } from "@tsed/common";
4
4
  import { Injectable } from "@tsed/di";
5
- let ViteService = ViteService_1 = class ViteService {
5
+ let ViteService = class ViteService {
6
+ static { ViteService_1 = this; }
6
7
  static { this.moduleName = "vike/server"; }
7
8
  async render(viewPath, { $ctx, ...opts }) {
8
9
  const urlOriginal = $ctx.request.url;
@@ -1 +1 @@
1
- {"version":3,"file":"ViteService.js","sourceRoot":"","sources":["../../../src/services/ViteService.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,QAAQ,EAAkB,MAAM,cAAc,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAM7B,IAAM,WAAW,mBAAjB,MAAM,WAAW;aACf,eAAU,GAAG,aAAa,CAAC;IAQlC,KAAK,CAAC,MAAM,CACV,QAAgB,EAChB,EAAC,IAAI,EAAE,GAAG,IAAI,EAAgD;QAE9D,MAAM,WAAW,GAAG,IAAI,CA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AAM,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;YAElF,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,OAAO,YAAY,CAAC;YACtB,CAAC;YAED,OAAO,YAAY,CAAC,IAAI,CAAC;QAC3B,CAAC;IACH,CAAC;;AA5DS;IADT,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;;2CACQ;AAGrB;IADP,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC;;iDACP;AAPnB,WAAW;IADvB,UAAU,EAAE;GACA,WAAW,CAiEvB"}
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import type { IncomingHttpHeaders } from "http";
3
3
  export type VitePageProps<Data = Record<string, unknown>> = Data & {
4
4
  view: string;
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { PlatformContext } from "@tsed/common";
3
3
  import { Writable } from "stream";
4
4
  import { ViteConfig } from "../interfaces/ViteConfig.js";
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "@tsed/vike",
3
3
  "description": "Vike package for Ts.ED framework",
4
- "type": "commonjs",
5
- "version": "8.0.0-alpha.5",
4
+ "type": "module",
5
+ "version": "8.0.0-alpha.7",
6
6
  "source": "./src/index.ts",
7
- "main": "./lib/cjs/index.js",
7
+ "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
9
9
  "typings": "./lib/types/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./lib/types/index.d.ts",
13
13
  "import": "./lib/esm/index.js",
14
- "require": "./lib/cjs/index.js",
15
14
  "default": "./lib/cjs/index.js"
16
15
  }
17
16
  },
@@ -26,20 +25,20 @@
26
25
  "sirv": "^2.0.4"
27
26
  },
28
27
  "devDependencies": {
29
- "@tsed/barrels": "8.0.0-alpha.5",
30
- "@tsed/common": "8.0.0-alpha.5",
31
- "@tsed/core": "8.0.0-alpha.5",
32
- "@tsed/di": "8.0.0-alpha.5",
33
- "@tsed/exceptions": "8.0.0-alpha.5",
34
- "@tsed/typescript": "8.0.0-alpha.5",
35
- "eslint": "^8.57.0",
36
- "typescript": "4.9.5",
28
+ "@tsed/barrels": "8.0.0-alpha.7",
29
+ "@tsed/common": "8.0.0-alpha.7",
30
+ "@tsed/core": "8.0.0-alpha.7",
31
+ "@tsed/di": "8.0.0-alpha.7",
32
+ "@tsed/exceptions": "8.0.0-alpha.7",
33
+ "@tsed/typescript": "8.0.0-alpha.7",
34
+ "eslint": "9.11.1",
35
+ "typescript": "5.4.5",
37
36
  "vike": "0.4.160",
38
37
  "vite": "5.4.1",
39
38
  "vitest": "2.0.4"
40
39
  },
41
40
  "peerDependencies": {
42
- "@tsed/common": "8.0.0-alpha.5",
41
+ "@tsed/common": "8.0.0-alpha.7",
43
42
  "vike": ">=0.4.160",
44
43
  "vite": ">=4"
45
44
  },
package/vitest.config.mts CHANGED
@@ -10,10 +10,10 @@ export default defineConfig(
10
10
  coverage: {
11
11
  ...presets.test.coverage,
12
12
  thresholds: {
13
- statements: 98.65,
14
- branches: 78.12,
15
- functions: 100,
16
- lines: 98.65
13
+ statements: 98.48,
14
+ branches: 96,
15
+ functions: 90.9,
16
+ lines: 98.48
17
17
  }
18
18
  }
19
19
  }
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ViteModule = void 0;
5
- const tslib_1 = require("tslib");
6
- const common_1 = require("@tsed/common");
7
- const di_1 = require("@tsed/di");
8
- const platform_views_1 = require("@tsed/platform-views");
9
- const compression_1 = tslib_1.__importDefault(require("compression"));
10
- const ViteRendererMiddleware_js_1 = require("./middlewares/ViteRendererMiddleware.js");
11
- const ViteServer_js_1 = require("./services/ViteServer.js");
12
- const ViteService_js_1 = require("./services/ViteService.js");
13
- let ViteModule = class ViteModule {
14
- $onInit() {
15
- this.platformView.registerEngine("vite", {
16
- options: {},
17
- render: async (path, options) => {
18
- return (await this.viteService.render(path, options)) || "";
19
- }
20
- });
21
- }
22
- $afterInit() {
23
- this.app.use((0, compression_1.default)(), this.viteServer.middlewares);
24
- }
25
- $afterRoutesInit() {
26
- return this.app.get("*", ViteRendererMiddleware_js_1.ViteRendererMiddleware);
27
- }
28
- };
29
- tslib_1.__decorate([
30
- (0, di_1.Inject)(),
31
- tslib_1.__metadata("design:type", common_1.PlatformApplication)
32
- ], ViteModule.prototype, "app", void 0);
33
- tslib_1.__decorate([
34
- (0, di_1.Inject)(),
35
- tslib_1.__metadata("design:type", platform_views_1.PlatformViews)
36
- ], ViteModule.prototype, "platformView", void 0);
37
- tslib_1.__decorate([
38
- (0, di_1.Inject)(),
39
- tslib_1.__metadata("design:type", ViteService_js_1.ViteService)
40
- ], ViteModule.prototype, "viteService", void 0);
41
- tslib_1.__decorate([
42
- (0, di_1.Inject)(ViteServer_js_1.VITE_SERVER),
43
- tslib_1.__metadata("design:type", typeof (_a = typeof ViteServer_js_1.VITE_SERVER !== "undefined" && ViteServer_js_1.VITE_SERVER) === "function" ? _a : Object)
44
- ], ViteModule.prototype, "viteServer", void 0);
45
- ViteModule = tslib_1.__decorate([
46
- (0, di_1.Module)({
47
- imports: []
48
- })
49
- ], ViteModule);
50
- exports.ViteModule = ViteModule;
51
- //# sourceMappingURL=ViteModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViteModule.js","sourceRoot":"","sources":["../../src/ViteModule.ts"],"names":[],"mappings":";;;;;AAAA,yCAAiD;AACjD,iCAAwC;AACxC,yDAA0E;AAC1E,sEAAmC;AAEnC,uFAA+E;AAC/E,4DAAqD;AACrD,8DAAsD;AAK/C,IAAM,UAAU,GAAhB,MAAM,UAAU;IAarB,OAAO;QACL,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,EAAE;YACvC,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,KAAK,EAAE,IAAY,EAAE,OAA8B,EAAE,EAAE;gBAC7D,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;YAC9D,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAA,qBAAQ,GAAE,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,kDAAsB,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AA5BC;IAAC,IAAA,WAAM,GAAE;sCACM,4BAAmB;uCAAC;AAEnC;IAAC,IAAA,WAAM,GAAE;sCACe,8BAAa;gDAAC;AAEtC;IAAC,IAAA,WAAM,GAAE;sCACc,4BAAW;+CAAC;AAEnC;IAAC,IAAA,WAAM,EAAC,2BAAW,CAAC;0DACE,2BAAW,oBAAX,2BAAW;8CAAC;AAXvB,UAAU;IAHtB,IAAA,WAAM,EAAC;QACN,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,UAAU,CA6BtB;AA7BY,gCAAU"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Vite = void 0;
4
- const schema_1 = require("@tsed/schema");
5
- function Vite(path) {
6
- return (0, schema_1.View)(`${path || "*"}.vite`);
7
- }
8
- exports.Vite = Vite;
9
- //# sourceMappingURL=vite.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../../src/decorators/vite.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAElC,SAAgB,IAAI,CAAC,IAAa;IAChC,OAAO,IAAA,aAAI,EAAC,GAAG,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;AACrC,CAAC;AAFD,oBAEC"}
package/lib/cjs/index.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /**
5
- * @file Automatically generated by @tsed/barrels.
6
- */
7
- tslib_1.__exportStar(require("./decorators/vite.js"), exports);
8
- tslib_1.__exportStar(require("./interfaces/interfaces.js"), exports);
9
- tslib_1.__exportStar(require("./interfaces/ViteConfig.js"), exports);
10
- tslib_1.__exportStar(require("./interfaces/ViteRenderContext.js"), exports);
11
- tslib_1.__exportStar(require("./middlewares/ViteRendererMiddleware.js"), exports);
12
- tslib_1.__exportStar(require("./services/ViteServer.js"), exports);
13
- tslib_1.__exportStar(require("./services/ViteService.js"), exports);
14
- tslib_1.__exportStar(require("./ViteModule.js"), exports);
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAqC;AACrC,qEAA2C;AAC3C,qEAA2C;AAC3C,4EAAkD;AAClD,kFAAwD;AACxD,mEAAyC;AACzC,oEAA0C;AAC1C,0DAAgC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ViteConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViteConfig.js","sourceRoot":"","sources":["../../../src/interfaces/ViteConfig.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ViteRenderContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViteRenderContext.js","sourceRoot":"","sources":["../../../src/interfaces/ViteRenderContext.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=interfaces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/interfaces.ts"],"names":[],"mappings":""}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ViteRendererMiddleware = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@tsed/common");
6
- const di_1 = require("@tsed/di");
7
- const ViteService_js_1 = require("../services/ViteService.js");
8
- let ViteRendererMiddleware = class ViteRendererMiddleware {
9
- async use($ctx) {
10
- const response = await this.viteService.render("*", { $ctx });
11
- response && !$ctx.response.isDone() && $ctx.response.body(response);
12
- }
13
- };
14
- tslib_1.__decorate([
15
- (0, di_1.Inject)(),
16
- tslib_1.__metadata("design:type", ViteService_js_1.ViteService)
17
- ], ViteRendererMiddleware.prototype, "viteService", void 0);
18
- tslib_1.__decorate([
19
- tslib_1.__param(0, (0, common_1.Context)()),
20
- tslib_1.__metadata("design:type", Function),
21
- tslib_1.__metadata("design:paramtypes", [Object]),
22
- tslib_1.__metadata("design:returntype", Promise)
23
- ], ViteRendererMiddleware.prototype, "use", null);
24
- ViteRendererMiddleware = tslib_1.__decorate([
25
- (0, common_1.Middleware)()
26
- ], ViteRendererMiddleware);
27
- exports.ViteRendererMiddleware = ViteRendererMiddleware;
28
- //# sourceMappingURL=ViteRendererMiddleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViteRendererMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/ViteRendererMiddleware.ts"],"names":[],"mappings":";;;;AAAA,yCAAiD;AACjD,iCAAgC;AAEhC,+DAAuD;AAGhD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAI3B,AAAN,KAAK,CAAC,GAAG,CAAY,IAAa;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;QAE5D,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AARC;IAAC,IAAA,WAAM,GAAE;sCACc,4BAAW;2DAAC;AAE7B;IAAK,mBAAA,IAAA,gBAAO,GAAE,CAAA;;;;iDAInB;AARU,sBAAsB;IADlC,IAAA,mBAAU,GAAE;GACA,sBAAsB,CASlC;AATY,wDAAsB"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VITE_SERVER = void 0;
4
- const common_1 = require("@tsed/common");
5
- const core_1 = require("@tsed/core");
6
- const di_1 = require("@tsed/di");
7
- exports.VITE_SERVER = Symbol.for("VITE_DEV_SERVER");
8
- (0, di_1.registerProvider)({
9
- provide: exports.VITE_SERVER,
10
- deps: [di_1.Configuration, common_1.Logger],
11
- async useAsyncFactory(settings, logger) {
12
- const { enableStream, statics: staticsOpts = {}, ...config } = settings.get("vite", {});
13
- const level = settings.logger.level;
14
- if (settings.env !== core_1.Env.PROD) {
15
- logger.info("Start Vite Dev Server 🚀...");
16
- // @ts-ignore
17
- const { createServer } = await import("vite");
18
- return createServer({
19
- ...config,
20
- server: {
21
- ...(config?.server || {}),
22
- middlewareMode: true
23
- },
24
- logLevel: String(config.logLevel || level)
25
- });
26
- }
27
- logger.info("Initialize statics vite application");
28
- const { default: sirv } = await import("sirv");
29
- return Promise.resolve({
30
- middlewares: sirv(`${config.root || ""}/dist/client`, {
31
- dotfiles: false,
32
- ...staticsOpts,
33
- dev: false
34
- })
35
- });
36
- },
37
- hooks: {
38
- $onDestroy(viteDevServer) {
39
- return viteDevServer.close && viteDevServer.close();
40
- }
41
- }
42
- });
43
- //# sourceMappingURL=ViteServer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViteServer.js","sourceRoot":"","sources":["../../../src/services/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WAAW;gBACd,GAAG,EAAE,KAAK;aACX,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IACD,KAAK,EAAE;QACL,UAAU,CAAC,aAAqC;YAC9C,OAAO,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;QACtD,CAAC;KACF;CACF,CAAC,CAAC"}
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var ViteService_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ViteService = void 0;
5
- const tslib_1 = require("tslib");
6
- const common_1 = require("@tsed/common");
7
- const di_1 = require("@tsed/di");
8
- let ViteService = ViteService_1 = class ViteService {
9
- static { this.moduleName = "vike/server"; }
10
- async render(viewPath, { $ctx, ...opts }) {
11
- const urlOriginal = $ctx.request.url;
12
- const { data } = $ctx;
13
- const view = viewPath.replace(".vite", "");
14
- const pageProps = {
15
- view,
16
- ...$ctx.response.locals,
17
- ...opts,
18
- ...data
19
- };
20
- const contextProps = {
21
- host: $ctx.request.host,
22
- protocol: $ctx.request.protocol,
23
- method: $ctx.request.method,
24
- url: urlOriginal,
25
- secure: $ctx.request.secure,
26
- headers: $ctx.request.headers,
27
- session: $ctx.request.session,
28
- stateSnapshot: this.config.stateSnapshot && this.config.stateSnapshot()
29
- };
30
- const { renderPage } = await import(ViteService_1.moduleName);
31
- const pageContext = await renderPage({
32
- view,
33
- urlOriginal,
34
- pageProps,
35
- contextProps,
36
- userAgent: $ctx.request.headers["user-agent"]
37
- });
38
- if (pageContext.errorWhileRendering) {
39
- $ctx.logger.error({
40
- event: "VITE_RENDER_ERROR",
41
- error: pageContext.errorWhileRendering
42
- });
43
- }
44
- if (pageContext.httpResponse) {
45
- const { httpResponse } = pageContext;
46
- httpResponse.headers?.forEach(([name, value]) => $ctx.response.setHeader(name, value));
47
- $ctx.response.status(Math.max(httpResponse.statusCode, $ctx.response.statusCode));
48
- if (this.enableStream) {
49
- return httpResponse;
50
- }
51
- return httpResponse.body;
52
- }
53
- }
54
- };
55
- tslib_1.__decorate([
56
- (0, common_1.Constant)("vite", {}),
57
- tslib_1.__metadata("design:type", Object)
58
- ], ViteService.prototype, "config", void 0);
59
- tslib_1.__decorate([
60
- (0, common_1.Constant)("vite.enableStream", false),
61
- tslib_1.__metadata("design:type", Boolean)
62
- ], ViteService.prototype, "enableStream", void 0);
63
- ViteService = ViteService_1 = tslib_1.__decorate([
64
- (0, di_1.Injectable)()
65
- ], ViteService);
66
- exports.ViteService = ViteService;
67
- //# sourceMappingURL=ViteService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViteService.js","sourceRoot":"","sources":["../../../src/services/ViteService.ts"],"names":[],"mappings":";;;;;AAAA,yCAAuD;AACvD,iCAAoC;AAM7B,IAAM,WAAW,mBAAjB,MAAM,WAAW;aACf,eAAU,GAAG,aAAa,CAAC;IAQlC,KAAK,CAAC,MAAM,CACV,QAAgB,EAChB,EAAC,IAAI,EAAE,GAAG,IAAI,EAAgD;QAE9D,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;QAErC,MAAM,EAAC,IAAI,EAAC,GAAG,IAAI,CAAC;QACpB,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAE3C,MAAM,SAAS,GAAG;YAChB,IAAI;YACJ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM;YACvB,GAAG,IAAI;YACP,GAAG,IAAI;SACR,CAAC;QAEF,MAAM,YAAY,GAAsB;YACtC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,GAAG,EAAE,WAAW;YAChB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,OAAO,EAAE,IAAI,C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A,eAAU,GAAE;GACA,WAAW,CAiEvB;AAjEY,kCAAW"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,13 +0,0 @@
1
- import { PlatformApplication } from "@tsed/common";
2
- import { PlatformViews } from "@tsed/platform-views";
3
- import { VITE_SERVER } from "./services/ViteServer.js";
4
- import { ViteService } from "./services/ViteService.js";
5
- export declare class ViteModule {
6
- protected app: PlatformApplication;
7
- protected platformView: PlatformViews;
8
- protected viteService: ViteService;
9
- protected viteServer: VITE_SERVER;
10
- $onInit(): void;
11
- $afterInit(): void;
12
- $afterRoutesInit(): PlatformApplication<TsED.Application>;
13
- }
@@ -1 +0,0 @@
1
- export declare function Vite(path?: string): MethodDecorator;
@@ -1,11 +0,0 @@
1
- /**
2
- * @file Automatically generated by @tsed/barrels.
3
- */
4
- export * from "./decorators/vite.js";
5
- export * from "./interfaces/interfaces.js";
6
- export * from "./interfaces/ViteConfig.js";
7
- export * from "./interfaces/ViteRenderContext.js";
8
- export * from "./middlewares/ViteRendererMiddleware.js";
9
- export * from "./services/ViteServer.js";
10
- export * from "./services/ViteService.js";
11
- export * from "./ViteModule.js";
@@ -1,7 +0,0 @@
1
- import { Options } from "sirv";
2
- import type { InlineConfig } from "vite";
3
- export type ViteConfig = InlineConfig & {
4
- enableStream?: boolean;
5
- statics?: Omit<Options, "dev">;
6
- stateSnapshot?(): unknown;
7
- };
@@ -1,14 +0,0 @@
1
- /// <reference types="node" />
2
- import type { IncomingHttpHeaders } from "http";
3
- export type VitePageProps<Data = Record<string, unknown>> = Data & {
4
- view: string;
5
- };
6
- export interface ViteRenderContext<Data = Record<string, unknown>, Session = Record<string, unknown>> extends Record<string, unknown> {
7
- host: string;
8
- protocol: string;
9
- method: string;
10
- url: string;
11
- secure: boolean;
12
- headers: IncomingHttpHeaders;
13
- session?: Session;
14
- }
@@ -1,8 +0,0 @@
1
- import { ViteConfig } from "./ViteConfig.js";
2
- declare global {
3
- namespace TsED {
4
- interface Configuration {
5
- vite: ViteConfig;
6
- }
7
- }
8
- }
@@ -1,6 +0,0 @@
1
- import { Context } from "@tsed/common";
2
- import { ViteService } from "../services/ViteService.js";
3
- export declare class ViteRendererMiddleware {
4
- protected viteService: ViteService;
5
- use($ctx: Context): Promise<void>;
6
- }
@@ -1,3 +0,0 @@
1
- import type { ViteDevServer } from "vite";
2
- export declare const VITE_SERVER: unique symbol;
3
- export type VITE_SERVER = ViteDevServer;
@@ -1,14 +0,0 @@
1
- /// <reference types="node" />
2
- import { PlatformContext } from "@tsed/common";
3
- import { Writable } from "stream";
4
- import { ViteConfig } from "../interfaces/ViteConfig.js";
5
- export declare class ViteService {
6
- static moduleName: string;
7
- protected config: ViteConfig;
8
- private enableStream;
9
- render(viewPath: string, { $ctx, ...opts }: {
10
- $ctx: PlatformContext;
11
- } & Record<string, any>): Promise<string | {
12
- pipe(stream: Writable): void;
13
- } | undefined>;
14
- }