@tsed/cli 6.1.13 → 6.2.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/lib/esm/bin/tsed.js +1 -1
- package/lib/esm/commands/generate/GenerateCmd.js +19 -17
- package/lib/esm/commands/init/InitCmd.js +1 -1
- package/lib/esm/commands/init/config/FeaturesPrompt.js +12 -7
- package/lib/esm/commands/init/prompts/getFeaturesPrompt.js +14 -2
- package/lib/esm/commands/run/RunCmd.js +2 -1
- package/lib/esm/constants/index.js +1 -1
- package/lib/esm/interfaces/PlatformType.js +1 -0
- package/lib/esm/platforms/InitPlatformsModule.js +3 -2
- package/lib/esm/platforms/supports/InitFastifyPlatform.js +31 -0
- package/lib/esm/utils/fillImports.js +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/commands/generate/GenerateCmd.d.ts +3 -6
- package/lib/types/commands/init/config/FeaturesPrompt.d.ts +7 -0
- package/lib/types/commands/init/prompts/getFeaturesPrompt.d.ts +6 -0
- package/lib/types/constants/index.d.ts +1 -1
- package/lib/types/interfaces/PlatformType.d.ts +2 -1
- package/lib/types/platforms/supports/InitFastifyPlatform.d.ts +18 -0
- package/package.json +7 -4
- package/templates/generate/server/_partials/server-footer.hbs +10 -0
- package/templates/generate/{server.hbs → server/_partials/server-header.hbs} +0 -29
- package/templates/generate/server/express/server.hbs +10 -0
- package/templates/generate/server/fastify/server.hbs +14 -0
- package/templates/generate/server/koa/server.hbs +8 -0
- package/templates/init/src/config/index.ts.hbs +3 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CliDefaultOptions, type CommandProvider, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
|
|
2
|
+
import type { PlatformType } from "../../interfaces/index.js";
|
|
2
3
|
import { ProjectConvention } from "../../interfaces/ProjectConvention.js";
|
|
3
4
|
import { ClassNamePipe } from "../../pipes/ClassNamePipe.js";
|
|
4
5
|
import { OutputFilePathPipe } from "../../pipes/OutputFilePathPipe.js";
|
|
@@ -9,7 +10,7 @@ export interface GenerateCmdContext extends CliDefaultOptions {
|
|
|
9
10
|
name: string;
|
|
10
11
|
route: string;
|
|
11
12
|
directory: string;
|
|
12
|
-
platform:
|
|
13
|
+
platform: PlatformType;
|
|
13
14
|
templateType: string;
|
|
14
15
|
middlewarePosition: "before" | "after";
|
|
15
16
|
symbolName: string;
|
|
@@ -46,11 +47,7 @@ export declare class GenerateCmd implements CommandProvider {
|
|
|
46
47
|
type: string;
|
|
47
48
|
name: string;
|
|
48
49
|
when(state: any): boolean;
|
|
49
|
-
choices:
|
|
50
|
-
name: string;
|
|
51
|
-
checked: boolean;
|
|
52
|
-
value: string;
|
|
53
|
-
}[];
|
|
50
|
+
choices: any[];
|
|
54
51
|
default?: undefined;
|
|
55
52
|
source?: undefined;
|
|
56
53
|
} | {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PlatformType } from "../../../interfaces/index.js";
|
|
1
2
|
import type { InitOptions } from "../interfaces/InitOptions.js";
|
|
2
3
|
export interface Feature {
|
|
3
4
|
name: string;
|
|
@@ -43,6 +44,12 @@ export declare enum FeatureType {
|
|
|
43
44
|
PRETTIER = "prettier"
|
|
44
45
|
}
|
|
45
46
|
export declare const FeaturesMap: Record<string, Feature>;
|
|
47
|
+
export declare const FrameworksPrompt: {
|
|
48
|
+
message: string;
|
|
49
|
+
type: string;
|
|
50
|
+
name: string;
|
|
51
|
+
choices: PlatformType[];
|
|
52
|
+
};
|
|
46
53
|
export declare const FeaturesPrompt: (availableRuntimes: string[], availablePackageManagers: string[]) => ({
|
|
47
54
|
message: string;
|
|
48
55
|
name: string;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { InitOptions } from "../interfaces/InitOptions.js";
|
|
2
2
|
export declare function getFeaturesPrompt(runtimes: string[], availablePackageManagers: string[], options: Partial<InitOptions>): any[];
|
|
3
|
+
export declare function getFrameworksPrompt(): {
|
|
4
|
+
choices: any[];
|
|
5
|
+
message: string;
|
|
6
|
+
type: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const PKG: import("read-pkg-up").NormalizedPackageJson;
|
|
2
2
|
export declare const MINIMAL_TSED_VERSION = "8";
|
|
3
|
-
export declare const DEFAULT_TSED_TAGS = "
|
|
3
|
+
export declare const DEFAULT_TSED_TAGS = "beta";
|
|
4
4
|
export declare const IGNORE_VERSIONS: string[];
|
|
5
5
|
export declare const IGNORE_TAGS: false | RegExp;
|
|
6
6
|
export declare const TEMPLATE_DIR: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { InitBasePlatform } from "./InitBasePlatform.js";
|
|
2
|
+
export declare class InitFastifyPlatform implements InitBasePlatform {
|
|
3
|
+
readonly name = "fastify";
|
|
4
|
+
dependencies(ctx: any): {
|
|
5
|
+
"@tsed/platform-fastify": any;
|
|
6
|
+
"@fastify/accepts": string;
|
|
7
|
+
"@fastify/middie": string;
|
|
8
|
+
"@fastify/static": string;
|
|
9
|
+
"@fastify/cookie": string;
|
|
10
|
+
"@fastify/formbody": string;
|
|
11
|
+
"@fastify/session": string;
|
|
12
|
+
fastify: string;
|
|
13
|
+
"fastify-raw-body": string;
|
|
14
|
+
};
|
|
15
|
+
devDependencies(ctx: any): {
|
|
16
|
+
"@types/content-disposition": string;
|
|
17
|
+
};
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli",
|
|
3
3
|
"description": "CLI to bootstrap your Ts.ED project",
|
|
4
|
-
"version": "6.1
|
|
4
|
+
"version": "6.2.0-beta.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"source": "./src/index.ts",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@swc-node/register": "^1.10.9",
|
|
67
67
|
"@swc/core": "1.7.26",
|
|
68
68
|
"@swc/helpers": "^0.5.13",
|
|
69
|
-
"@tsed/cli-core": "6.1
|
|
69
|
+
"@tsed/cli-core": "6.2.0-beta.1",
|
|
70
70
|
"@tsed/core": ">=8.0.0",
|
|
71
71
|
"@tsed/di": ">=8.0.0",
|
|
72
72
|
"@tsed/hooks": ">=8.0.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"tslib": "^2.7.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@tsed/typescript": "6.1
|
|
84
|
+
"@tsed/typescript": "6.2.0-beta.1",
|
|
85
85
|
"@types/change-case": "^2.3.1",
|
|
86
86
|
"cross-env": "7.0.3",
|
|
87
87
|
"typescript": "5.6.2",
|
|
@@ -121,5 +121,8 @@
|
|
|
121
121
|
},
|
|
122
122
|
"homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli",
|
|
123
123
|
"author": "Romain Lenzotti",
|
|
124
|
-
"license": "MIT"
|
|
124
|
+
"license": "MIT",
|
|
125
|
+
"publishConfig": {
|
|
126
|
+
"tag": "beta"
|
|
127
|
+
}
|
|
125
128
|
}
|
|
@@ -11,10 +11,6 @@ import {application} from "@tsed/platform-http";
|
|
|
11
11
|
acceptMimes: ["application/json"],
|
|
12
12
|
httpPort: process.env.PORT || 8083,
|
|
13
13
|
httpsPort: false, // CHANGE
|
|
14
|
-
disableComponentsScan: true,
|
|
15
|
-
ajv: {
|
|
16
|
-
returnsCoercedValues: true
|
|
17
|
-
},
|
|
18
14
|
mount: {
|
|
19
15
|
"{{route}}": [
|
|
20
16
|
...Object.values(rest)
|
|
@@ -36,28 +32,3 @@ import {application} from "@tsed/platform-http";
|
|
|
36
32
|
specVersion: "3.0.1"
|
|
37
33
|
}
|
|
38
34
|
],{{/if}}
|
|
39
|
-
middlewares: [{{#if express}}
|
|
40
|
-
"cors",
|
|
41
|
-
"cookie-parser",
|
|
42
|
-
"compression",
|
|
43
|
-
"method-override",
|
|
44
|
-
"json-parser",
|
|
45
|
-
{ use: "urlencoded-parser", options: { extended: true }}{{/if}}{{#if koa}}
|
|
46
|
-
"@koa/cors",
|
|
47
|
-
"koa-compress",
|
|
48
|
-
"koa-override",
|
|
49
|
-
"koa-bodyparser"{{/if}}
|
|
50
|
-
],
|
|
51
|
-
views: {
|
|
52
|
-
root: join(process.cwd(), "../views"),
|
|
53
|
-
extensions: {
|
|
54
|
-
ejs: "ejs"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
exclude: [
|
|
58
|
-
"**/*.spec.ts"
|
|
59
|
-
]
|
|
60
|
-
})
|
|
61
|
-
export class {{symbolName}} {
|
|
62
|
-
protected app = application();
|
|
63
|
-
}
|
|
@@ -12,6 +12,9 @@ const pkg = JSON.parse(readFileSync("./package.json", {encoding: "utf8"}));
|
|
|
12
12
|
export const config: Partial<TsED.Configuration> = {
|
|
13
13
|
version: pkg.version,
|
|
14
14
|
envs,
|
|
15
|
+
ajv: {
|
|
16
|
+
returnsCoercedValues: true
|
|
17
|
+
},
|
|
15
18
|
logger: loggerConfig,
|
|
16
19
|
{{#if mongoose}}
|
|
17
20
|
mongoose: mongooseConfig,
|