@tsed/cli 6.2.0-beta.2 → 6.2.0

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.
@@ -1,5 +1,4 @@
1
1
  import { type CliDefaultOptions, type CommandProvider, ProjectPackageJson } from "@tsed/cli-core";
2
- import type { PlatformType } from "../../interfaces/index.js";
3
2
  import { ProjectConvention } from "../../interfaces/ProjectConvention.js";
4
3
  import { ClassNamePipe } from "../../pipes/ClassNamePipe.js";
5
4
  import { OutputFilePathPipe } from "../../pipes/OutputFilePathPipe.js";
@@ -11,7 +10,7 @@ export interface GenerateCmdContext extends CliDefaultOptions {
11
10
  name: string;
12
11
  route: string;
13
12
  directory: string;
14
- platform: PlatformType;
13
+ platform: string;
15
14
  templateType: string;
16
15
  middlewarePosition: "before" | "after";
17
16
  symbolName: string;
@@ -48,7 +47,11 @@ export declare class GenerateCmd implements CommandProvider {
48
47
  type: string;
49
48
  name: string;
50
49
  when(state: any): boolean;
51
- choices: any[];
50
+ choices: {
51
+ name: string;
52
+ checked: boolean;
53
+ value: string;
54
+ }[];
52
55
  default?: undefined;
53
56
  source?: undefined;
54
57
  } | {
@@ -1,4 +1,3 @@
1
- import { PlatformType } from "../../../interfaces/index.js";
2
1
  import type { InitOptions } from "../interfaces/InitOptions.js";
3
2
  export interface Feature {
4
3
  name: string;
@@ -44,12 +43,6 @@ export declare enum FeatureType {
44
43
  PRETTIER = "prettier"
45
44
  }
46
45
  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
- };
53
46
  export declare const FeaturesPrompt: (availableRuntimes: string[], availablePackageManagers: string[]) => ({
54
47
  message: string;
55
48
  name: string;
@@ -1,8 +1,2 @@
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 = "beta";
3
+ export declare const DEFAULT_TSED_TAGS = "latest";
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;
@@ -1,5 +1,4 @@
1
1
  export declare enum PlatformType {
2
2
  EXPRESS = "express",
3
- KOA = "koa",
4
- FASTIFY = "fastify"
3
+ KOA = "koa"
5
4
  }
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.2.0-beta.2",
4
+ "version": "6.2.0",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -67,7 +67,7 @@
67
67
  "@swc-node/register": "^1.10.9",
68
68
  "@swc/core": "1.7.26",
69
69
  "@swc/helpers": "^0.5.13",
70
- "@tsed/cli-core": "6.2.0-beta.2",
70
+ "@tsed/cli-core": "6.2.0",
71
71
  "@tsed/core": ">=8.0.0",
72
72
  "@tsed/di": ">=8.0.0",
73
73
  "@tsed/hooks": ">=8.0.0",
@@ -86,7 +86,7 @@
86
86
  "tslib": "^2.7.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@tsed/typescript": "6.2.0-beta.2",
89
+ "@tsed/typescript": "6.2.0",
90
90
  "@types/change-case": "^2.3.1",
91
91
  "@types/consolidate": "0.14.4",
92
92
  "cross-env": "7.0.3",
@@ -127,8 +127,5 @@
127
127
  },
128
128
  "homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli",
129
129
  "author": "Romain Lenzotti",
130
- "license": "MIT",
131
- "publishConfig": {
132
- "tag": "beta"
133
- }
130
+ "license": "MIT"
134
131
  }
@@ -11,6 +11,10 @@ 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
+ },
14
18
  mount: {
15
19
  "{{route}}": [
16
20
  ...Object.values(rest)
@@ -32,3 +36,28 @@ import {application} from "@tsed/platform-http";
32
36
  specVersion: "3.0.1"
33
37
  }
34
38
  ],{{/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,9 +12,6 @@ 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
- },
18
15
  logger: loggerConfig,
19
16
  {{#if mongoose}}
20
17
  mongoose: mongooseConfig,
@@ -1,31 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { Injectable } from "@tsed/cli-core";
3
- let InitFastifyPlatform = class InitFastifyPlatform {
4
- constructor() {
5
- this.name = "fastify";
6
- }
7
- dependencies(ctx) {
8
- return {
9
- "@tsed/platform-fastify": ctx.tsedVersion,
10
- "@fastify/accepts": "latest",
11
- "@fastify/middie": "latest",
12
- "@fastify/static": "latest",
13
- "@fastify/cookie": "latest",
14
- "@fastify/formbody": "latest",
15
- "@fastify/session": "latest",
16
- fastify: "latest",
17
- "fastify-raw-body": "latest"
18
- };
19
- }
20
- devDependencies(ctx) {
21
- return {
22
- "@types/content-disposition": "latest"
23
- };
24
- }
25
- };
26
- InitFastifyPlatform = __decorate([
27
- Injectable({
28
- type: "platform:init"
29
- })
30
- ], InitFastifyPlatform);
31
- export { InitFastifyPlatform };
@@ -1,18 +0,0 @@
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
- }
@@ -1,10 +0,0 @@
1
- views: {
2
- root: join(process.cwd(), "../views"),
3
- extensions: {
4
- ejs: "ejs"
5
- }
6
- }
7
- })
8
- export class {{symbolName}} {
9
- protected app = application();
10
- }
@@ -1,10 +0,0 @@
1
- {{> server-header }}
2
- middlewares: [
3
- "cors",
4
- "cookie-parser",
5
- "compression",
6
- "method-override",
7
- "json-parser",
8
- { use: "urlencoded-parser", options: { extended: true }}
9
- ],
10
- {{> server-footer }}
@@ -1,14 +0,0 @@
1
- {{> server-header }}
2
- plugins: [
3
- "@fastify/accepts",
4
- "@fastify/cookie",
5
- {
6
- use: "fastify-raw-body",
7
- options: {
8
- global: false,
9
- runFirst: true
10
- }
11
- },
12
- "@fastify/formbody"
13
- ],
14
- {{> server-footer }}
@@ -1,8 +0,0 @@
1
- {{> server-header }}
2
- middlewares: [
3
- "@koa/cors",
4
- "koa-compress",
5
- "koa-override",
6
- "koa-bodyparser"
7
- ],
8
- {{> server-footer }}