create-analog 3.0.0-beta.25 → 3.0.0-beta.27

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.
@@ -2,33 +2,29 @@ import 'reflect-metadata';
2
2
  import { NestFactory } from '@nestjs/core';
3
3
  import type { NestExpressApplication } from '@nestjs/platform-express';
4
4
  import { fileURLToPath } from 'node:url';
5
+ import { toFetchHandler } from 'srvx/node';
5
6
 
6
7
  import { AppModule } from './app.module';
7
8
 
8
- async function createNestApp() {
9
- // Keeps the request body for Analog after Nest's body parsers have run.
10
- const app = await NestFactory.create<NestExpressApplication>(AppModule, {
11
- rawBody: true,
12
- });
9
+ // Keeps the request body for Analog after Nest's body parsers have run.
10
+ const app = await NestFactory.create<NestExpressApplication>(AppModule, {
11
+ rawBody: true,
12
+ });
13
13
 
14
- // Vite serves client files in development.
15
- if (!import.meta.env.DEV) {
16
- const clientDir = fileURLToPath(new URL('../client', import.meta.url));
17
- app.useStaticAssets(clientDir, { index: false });
18
- }
19
-
20
- return app.init();
14
+ // Vite serves client files in development.
15
+ if (!import.meta.env.DEV) {
16
+ const clientDir = fileURLToPath(new URL('../client', import.meta.url));
17
+ app.useStaticAssets(clientDir, { index: false });
21
18
  }
22
19
 
23
- export async function createApp() {
24
- const app = await createNestApp();
25
- return {
26
- handle: app.getHttpAdapter().getInstance(),
27
- close: () => app.close(),
28
- };
29
- }
20
+ await app.init();
21
+ const server = app.getHttpAdapter().getInstance();
30
22
 
31
23
  if (!import.meta.env.DEV) {
32
- const app = await createNestApp();
33
24
  await app.listen(process.env['PORT'] ?? 3000);
34
25
  }
26
+
27
+ export default {
28
+ fetch: toFetchHandler((req, res) => server(req, res)),
29
+ close: () => app.close(),
30
+ };
package/index.js CHANGED
@@ -133,6 +133,7 @@ const NESTJS_DEPENDENCIES = {
133
133
  '@nestjs/platform-express': '^12.3.2',
134
134
  h3: '^1.13.0',
135
135
  'reflect-metadata': '^0.2.2',
136
+ srvx: '^1.0.8',
136
137
  };
137
138
 
138
139
  /** @type {Readonly<Record<string, string>>} */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-analog",
3
- "version": "3.0.0-beta.25",
3
+ "version": "3.0.0-beta.27",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Brandon Roberts",
@@ -39,9 +39,9 @@
39
39
  "prompts": "^2.4.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@analogjs/platform": "3.0.0-beta.25",
43
- "@analogjs/vite-plugin-angular": "3.0.0-beta.25",
44
- "@analogjs/vite-plugin-nitro": "3.0.0-beta.25",
42
+ "@analogjs/platform": "3.0.0-beta.27",
43
+ "@analogjs/vite-plugin-angular": "3.0.0-beta.27",
44
+ "@analogjs/vite-plugin-nitro": "3.0.0-beta.27",
45
45
  "h3": "^1.15.11"
46
46
  },
47
47
  "publishConfig": {
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "private": true,
18
18
  "dependencies": {
19
- "@analogjs/content": "^3.0.0-beta.25",
20
- "@analogjs/router": "^3.0.0-beta.25",
19
+ "@analogjs/content": "^3.0.0-beta.27",
20
+ "@analogjs/router": "^3.0.0-beta.27",
21
21
  "@angular/animations": "^20.0.0",
22
22
  "@angular/common": "^20.0.0",
23
23
  "@angular/compiler": "^20.0.0",
@@ -37,10 +37,10 @@
37
37
  "zone.js": "~0.15.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@analogjs/platform": "^3.0.0-beta.25",
41
- "@analogjs/vite-plugin-angular": "^3.0.0-beta.25",
42
- "@analogjs/vite-plugin-nitro": "^3.0.0-beta.25",
43
- "@analogjs/vitest-angular": "^3.0.0-beta.25",
40
+ "@analogjs/platform": "^3.0.0-beta.27",
41
+ "@analogjs/vite-plugin-angular": "^3.0.0-beta.27",
42
+ "@analogjs/vite-plugin-nitro": "^3.0.0-beta.27",
43
+ "@analogjs/vitest-angular": "^3.0.0-beta.27",
44
44
  "@angular-devkit/build-angular": "^20.0.0",
45
45
  "@angular/build": "^20.0.0",
46
46
  "@angular/cli": "^20.0.0",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "private": true,
18
18
  "dependencies": {
19
- "@analogjs/content": "^3.0.0-beta.25",
20
- "@analogjs/router": "^3.0.0-beta.25",
19
+ "@analogjs/content": "^3.0.0-beta.27",
20
+ "@analogjs/router": "^3.0.0-beta.27",
21
21
  "@angular/animations": "^21.0.0",
22
22
  "@angular/common": "^21.0.0",
23
23
  "@angular/compiler": "^21.0.0",
@@ -36,9 +36,9 @@
36
36
  "tslib": "^2.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@analogjs/platform": "^3.0.0-beta.25",
40
- "@analogjs/vite-plugin-angular": "^3.0.0-beta.25",
41
- "@analogjs/vitest-angular": "^3.0.0-beta.25",
39
+ "@analogjs/platform": "^3.0.0-beta.27",
40
+ "@analogjs/vite-plugin-angular": "^3.0.0-beta.27",
41
+ "@analogjs/vitest-angular": "^3.0.0-beta.27",
42
42
  "@angular/build": "^21.0.0",
43
43
  "@angular/cli": "^21.0.0",
44
44
  "@angular/compiler-cli": "^21.0.0",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "private": true,
18
18
  "dependencies": {
19
- "@analogjs/content": "^3.0.0-beta.25",
20
- "@analogjs/router": "^3.0.0-beta.25",
19
+ "@analogjs/content": "^3.0.0-beta.27",
20
+ "@analogjs/router": "^3.0.0-beta.27",
21
21
  "@angular/animations": "^22.0.0",
22
22
  "@angular/common": "^22.0.0",
23
23
  "@angular/compiler": "^22.0.0",
@@ -35,10 +35,10 @@
35
35
  "tslib": "^2.3.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@analogjs/platform": "^3.0.0-beta.25",
39
- "@analogjs/vite-plugin-angular": "^3.0.0-beta.25",
40
- "@analogjs/vite-plugin-nitro": "^3.0.0-beta.25",
41
- "@analogjs/vitest-angular": "^3.0.0-beta.25",
38
+ "@analogjs/platform": "^3.0.0-beta.27",
39
+ "@analogjs/vite-plugin-angular": "^3.0.0-beta.27",
40
+ "@analogjs/vite-plugin-nitro": "^3.0.0-beta.27",
41
+ "@analogjs/vitest-angular": "^3.0.0-beta.27",
42
42
  "@angular/build": "^22.0.0",
43
43
  "@angular/cli": "^22.0.0",
44
44
  "@angular/compiler-cli": "^22.0.0",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "private": true,
18
18
  "dependencies": {
19
- "@analogjs/content": "^3.0.0-beta.25",
20
- "@analogjs/router": "^3.0.0-beta.25",
19
+ "@analogjs/content": "^3.0.0-beta.27",
20
+ "@analogjs/router": "^3.0.0-beta.27",
21
21
  "@angular/animations": "^22.0.0",
22
22
  "@angular/common": "^22.0.0",
23
23
  "@angular/compiler": "^22.0.0",
@@ -36,10 +36,10 @@
36
36
  "tslib": "^2.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@analogjs/platform": "^3.0.0-beta.25",
40
- "@analogjs/vite-plugin-angular": "^3.0.0-beta.25",
41
- "@analogjs/vite-plugin-nitro": "^3.0.0-beta.25",
42
- "@analogjs/vitest-angular": "^3.0.0-beta.25",
39
+ "@analogjs/platform": "^3.0.0-beta.27",
40
+ "@analogjs/vite-plugin-angular": "^3.0.0-beta.27",
41
+ "@analogjs/vite-plugin-nitro": "^3.0.0-beta.27",
42
+ "@analogjs/vitest-angular": "^3.0.0-beta.27",
43
43
  "@angular/build": "^22.0.0",
44
44
  "@angular/cli": "^22.0.0",
45
45
  "@angular/compiler-cli": "^22.0.0",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "private": true,
18
18
  "dependencies": {
19
- "@analogjs/content": "^3.0.0-beta.25",
20
- "@analogjs/router": "^3.0.0-beta.25",
19
+ "@analogjs/content": "^3.0.0-beta.27",
20
+ "@analogjs/router": "^3.0.0-beta.27",
21
21
  "@angular/animations": "^22.0.0",
22
22
  "@angular/common": "^22.0.0",
23
23
  "@angular/compiler": "^22.0.0",
@@ -36,10 +36,10 @@
36
36
  "tslib": "^2.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@analogjs/platform": "^3.0.0-beta.25",
40
- "@analogjs/vite-plugin-angular": "^3.0.0-beta.25",
41
- "@analogjs/vite-plugin-nitro": "^3.0.0-beta.25",
42
- "@analogjs/vitest-angular": "^3.0.0-beta.25",
39
+ "@analogjs/platform": "^3.0.0-beta.27",
40
+ "@analogjs/vite-plugin-angular": "^3.0.0-beta.27",
41
+ "@analogjs/vite-plugin-nitro": "^3.0.0-beta.27",
42
+ "@analogjs/vitest-angular": "^3.0.0-beta.27",
43
43
  "@angular/build": "^22.0.0",
44
44
  "@angular/cli": "^22.0.0",
45
45
  "@angular/compiler-cli": "^22.0.0",