@modern-js/server-generator 2.4.10 → 3.0.0-beta.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/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.4.10",
14
+ "version": "3.0.0-beta.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./src/index.ts",
17
17
  "main": "./dist/index.js",
@@ -21,17 +21,17 @@
21
21
  ],
22
22
  "devDependencies": {
23
23
  "@babel/runtime": "^7.18.0",
24
- "@modern-js/codesmith": "1.6.3",
25
- "@modern-js/codesmith-api-app": "1.6.3",
26
- "@modern-js/codesmith-api-json": "1.6.3",
24
+ "@modern-js/codesmith": "2.0.0",
25
+ "@modern-js/codesmith-api-app": "2.0.0",
26
+ "@modern-js/codesmith-api-json": "2.0.0",
27
27
  "@types/jest": "^27",
28
28
  "@types/node": "^14",
29
29
  "jest": "^27",
30
30
  "typescript": "^4",
31
- "@modern-js/generator-common": "2.4.10",
32
- "@modern-js/generator-utils": "2.4.10",
33
- "@scripts/build": "1.21.5",
34
- "@scripts/jest-config": "1.21.5"
31
+ "@modern-js/generator-common": "3.0.0-beta.1",
32
+ "@modern-js/generator-utils": "3.0.0-beta.1",
33
+ "@scripts/build": "2.0.0-beta.1",
34
+ "@scripts/jest-config": "2.0.0-beta.1"
35
35
  },
36
36
  "sideEffects": false,
37
37
  "modernConfig": {
@@ -44,34 +44,9 @@
44
44
  "registry": "https://registry.npmjs.org/",
45
45
  "access": "public"
46
46
  },
47
- "wireit": {
48
- "build": {
49
- "command": "modern build",
50
- "files": [
51
- "src/**/*",
52
- "tsconfig.json",
53
- "package.json",
54
- "modern.config.js"
55
- ],
56
- "output": [
57
- "dist/**/*",
58
- "!dist/node/main.js"
59
- ]
60
- },
61
- "test": {
62
- "command": "jest --passWithNoTests",
63
- "files": [
64
- "src/**/*",
65
- "tsconfig.json",
66
- "package.json",
67
- "tests/**/*"
68
- ],
69
- "output": []
70
- }
71
- },
72
47
  "scripts": {
73
48
  "new": "modern new",
74
- "build": "wireit",
75
- "test": "wireit"
49
+ "build": "modern build",
50
+ "test": "jest --passWithNoTests"
76
51
  }
77
52
  }
@@ -1,8 +0,0 @@
1
- import { hook } from '@modern-js/runtime/server';
2
-
3
- export default hook(({ addMiddleware }) => {
4
- addMiddleware(() => async (ctx, next) => {
5
- console.info(`access url: ${ctx.url}`);
6
- await next();
7
- });
8
- });
@@ -1,9 +0,0 @@
1
- import { hook } from '@modern-js/runtime/server';
2
- import { Context } from 'egg';
3
-
4
- export default hook(({ addMiddleware }) => {
5
- addMiddleware(() => async (ctx: Context, next: any) => {
6
- console.info(`access url: ${ctx.url}`);
7
- await next();
8
- });
9
- });
@@ -1,27 +0,0 @@
1
- import { hook } from '@modern-js/runtime/server';
2
- import {
3
- Injectable,
4
- MiddlewareConsumer,
5
- Module,
6
- NestMiddleware,
7
- } from '@nestjs/common';
8
- import { Request, Response, NextFunction } from 'express';
9
-
10
- @Injectable()
11
- export class LoggerMiddleware implements NestMiddleware {
12
- use(req: Request, res: Response, next: NextFunction) {
13
- console.info(`access url: ${req.url}`);
14
- next();
15
- }
16
- }
17
-
18
- @Module({})
19
- export class AppModule {
20
- configure(consumer: MiddlewareConsumer) {
21
- consumer.apply(LoggerMiddleware).forRoutes('*');
22
- }
23
- }
24
-
25
- export default hook(({ addMiddleware }) => {
26
- addMiddleware(AppModule);
27
- });