@tsed/cli 3.25.0 → 3.26.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.
Files changed (80) hide show
  1. package/lib/cjs/Cli.js.map +1 -1
  2. package/lib/cjs/commands/init/InitCmd.js +58 -34
  3. package/lib/cjs/commands/init/InitCmd.js.map +1 -1
  4. package/lib/cjs/commands/init/config/FeaturesPrompt.js +406 -0
  5. package/lib/cjs/commands/init/config/FeaturesPrompt.js.map +1 -0
  6. package/lib/cjs/commands/init/config/InitFileSchema.js +49 -0
  7. package/lib/cjs/commands/init/config/InitFileSchema.js.map +1 -0
  8. package/lib/cjs/commands/init/interfaces/InitCmdContext.js +3 -0
  9. package/lib/cjs/commands/init/interfaces/InitCmdContext.js.map +1 -0
  10. package/lib/cjs/commands/init/interfaces/InitOptions.js +3 -0
  11. package/lib/cjs/commands/init/interfaces/InitOptions.js.map +1 -0
  12. package/lib/cjs/commands/init/interfaces/InitPromptAnswers.js +3 -0
  13. package/lib/cjs/commands/init/interfaces/InitPromptAnswers.js.map +1 -0
  14. package/lib/cjs/commands/init/mappers/mapToContext.js +16 -0
  15. package/lib/cjs/commands/init/mappers/mapToContext.js.map +1 -0
  16. package/lib/cjs/commands/init/mappers/mapUniqFeatures.js +18 -0
  17. package/lib/cjs/commands/init/mappers/mapUniqFeatures.js.map +1 -0
  18. package/lib/cjs/commands/init/prompts/getFeaturesPrompt.js +25 -0
  19. package/lib/cjs/commands/init/prompts/getFeaturesPrompt.js.map +1 -0
  20. package/lib/cjs/commands/init/utils/hasFeature.js +13 -0
  21. package/lib/cjs/commands/init/utils/hasFeature.js.map +1 -0
  22. package/lib/cjs/commands/init/utils/isPlatform.js +8 -0
  23. package/lib/cjs/commands/init/utils/isPlatform.js.map +1 -0
  24. package/lib/cjs/index.js +5 -1
  25. package/lib/cjs/index.js.map +1 -1
  26. package/lib/cjs/interfaces/PlatformType.js +9 -0
  27. package/lib/cjs/interfaces/PlatformType.js.map +1 -0
  28. package/lib/cjs/interfaces/index.js +1 -0
  29. package/lib/cjs/interfaces/index.js.map +1 -1
  30. package/lib/cjs/services/Features.js +118 -133
  31. package/lib/cjs/services/Features.js.map +1 -1
  32. package/lib/esm/Cli.js.map +1 -1
  33. package/lib/esm/commands/init/InitCmd.js +61 -37
  34. package/lib/esm/commands/init/InitCmd.js.map +1 -1
  35. package/lib/esm/commands/init/config/FeaturesPrompt.js +402 -0
  36. package/lib/esm/commands/init/config/FeaturesPrompt.js.map +1 -0
  37. package/lib/esm/commands/init/config/InitFileSchema.js +46 -0
  38. package/lib/esm/commands/init/config/InitFileSchema.js.map +1 -0
  39. package/lib/esm/commands/init/interfaces/InitCmdContext.js +2 -0
  40. package/lib/esm/commands/init/interfaces/InitCmdContext.js.map +1 -0
  41. package/lib/esm/commands/init/interfaces/InitOptions.js +2 -0
  42. package/lib/esm/commands/init/interfaces/InitOptions.js.map +1 -0
  43. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js +2 -0
  44. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js.map +1 -0
  45. package/lib/esm/commands/init/mappers/mapToContext.js +12 -0
  46. package/lib/esm/commands/init/mappers/mapToContext.js.map +1 -0
  47. package/lib/esm/commands/init/mappers/mapUniqFeatures.js +14 -0
  48. package/lib/esm/commands/init/mappers/mapUniqFeatures.js.map +1 -0
  49. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js +21 -0
  50. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js.map +1 -0
  51. package/lib/esm/commands/init/utils/hasFeature.js +8 -0
  52. package/lib/esm/commands/init/utils/hasFeature.js.map +1 -0
  53. package/lib/esm/commands/init/utils/isPlatform.js +4 -0
  54. package/lib/esm/commands/init/utils/isPlatform.js.map +1 -0
  55. package/lib/esm/index.js +5 -1
  56. package/lib/esm/index.js.map +1 -1
  57. package/lib/esm/interfaces/PlatformType.js +6 -0
  58. package/lib/esm/interfaces/PlatformType.js.map +1 -0
  59. package/lib/esm/interfaces/index.js +1 -0
  60. package/lib/esm/interfaces/index.js.map +1 -1
  61. package/lib/esm/services/Features.js +117 -128
  62. package/lib/esm/services/Features.js.map +1 -1
  63. package/lib/types/Cli.d.ts +2 -2
  64. package/lib/types/commands/init/InitCmd.d.ts +8 -24
  65. package/lib/types/commands/init/config/FeaturesPrompt.d.ts +98 -0
  66. package/lib/types/commands/init/config/InitFileSchema.d.ts +45 -0
  67. package/lib/types/commands/init/interfaces/InitCmdContext.d.ts +6 -0
  68. package/lib/types/commands/init/interfaces/InitOptions.d.ts +19 -0
  69. package/lib/types/commands/init/interfaces/InitPromptAnswers.d.ts +16 -0
  70. package/lib/types/commands/init/mappers/mapToContext.d.ts +2 -0
  71. package/lib/types/commands/init/mappers/mapUniqFeatures.d.ts +3 -0
  72. package/lib/types/commands/init/prompts/getFeaturesPrompt.d.ts +2 -0
  73. package/lib/types/commands/init/utils/hasFeature.d.ts +2 -0
  74. package/lib/types/commands/init/utils/isPlatform.d.ts +1 -0
  75. package/lib/types/index.d.ts +5 -1
  76. package/lib/types/interfaces/PlatformType.d.ts +4 -0
  77. package/lib/types/interfaces/index.d.ts +1 -0
  78. package/lib/types/services/Features.d.ts +0 -18
  79. package/package.json +7 -4
  80. package/readme.md +6 -0
@@ -0,0 +1,16 @@
1
+ import { PackageManager } from "@tsed/cli-core";
2
+ import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces";
3
+ export interface InitPromptAnswers {
4
+ projectName: string;
5
+ platform: PlatformType;
6
+ architecture: ArchitectureConvention;
7
+ convention: ProjectConvention;
8
+ features: string[];
9
+ featuresDB: string[];
10
+ featuresTypeORM: string;
11
+ featuresTesting: string;
12
+ featuresExtraLinter: string[];
13
+ featuresBundler: string;
14
+ oidcBasePath: string;
15
+ packageManager: PackageManager;
16
+ }
@@ -0,0 +1,2 @@
1
+ import { InitCmdContext } from "../interfaces/InitCmdContext";
2
+ export declare function mapToContext(options: any): InitCmdContext;
@@ -0,0 +1,3 @@
1
+ import { InitPromptAnswers } from "../interfaces/InitPromptAnswers";
2
+ import { InitOptions } from "../interfaces/InitOptions";
3
+ export declare function mapUniqFeatures(answers: InitPromptAnswers & any): InitOptions;
@@ -0,0 +1,2 @@
1
+ import { InitOptions } from "../interfaces/InitOptions";
2
+ export declare function getFeaturesPrompt(options: Partial<InitOptions>): any[];
@@ -0,0 +1,2 @@
1
+ export declare function hasValue(expression: string, value: any): (ctx: any) => boolean;
2
+ export declare function hasFeature(feature: string): (ctx: any) => boolean;
@@ -0,0 +1 @@
1
+ export declare function isPlatform(...types: string[]): (ctx: any) => boolean;
@@ -1,10 +1,14 @@
1
1
  export * from "./commands/add/AddCmd";
2
2
  export * from "./commands/init/InitCmd";
3
+ export * from "./commands/init/interfaces/InitCmdContext";
4
+ export * from "./commands/init/interfaces/InitOptions";
5
+ export * from "./commands/init/config/FeaturesPrompt";
6
+ export * from "./commands/init/config/FeaturesPrompt";
3
7
  export * from "./commands/generate/GenerateCmd";
4
8
  export * from "./commands/update/UpdateCmd";
9
+ export * from "./commands/init/prompts/getFeaturesPrompt";
5
10
  export * from "./interfaces";
6
11
  export * from "./services/ProvidersInfoService";
7
- export * from "./services/Features";
8
12
  export * from "./pipes";
9
13
  export * from "./constants";
10
14
  export * from "./Cli";
@@ -0,0 +1,4 @@
1
+ export declare enum PlatformType {
2
+ EXPRESS = "express",
3
+ KOA = "koa"
4
+ }
@@ -1,2 +1,3 @@
1
1
  export * from "./ProjectConvention";
2
+ export * from "./PlatformType";
2
3
  export * from "./ArchitectureConvention";
@@ -1,22 +1,4 @@
1
1
  import { ProjectConvention } from "../interfaces";
2
- export interface FeatureValue {
3
- type: string;
4
- dependencies?: {
5
- [key: string]: string | undefined;
6
- };
7
- devDependencies?: {
8
- [key: string]: string | undefined;
9
- };
10
- }
11
- export interface Feature {
12
- name: string;
13
- value: FeatureValue;
14
- }
15
- export declare type Features = Feature[];
16
- export declare function Features(): Function;
17
- export declare function hasFeature(feature: string): (ctx: any) => boolean;
18
- export declare function hasValue(expression: string, value: any): (ctx: any) => boolean;
19
- export declare function isPlatform(...types: string[]): (ctx: any) => boolean;
20
2
  export declare const FEATURES_TYPEORM_CONNECTION_TYPES: ({
21
3
  name: string;
22
4
  value: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/cli",
3
- "version": "3.25.0",
3
+ "version": "3.26.0-beta.1",
4
4
  "source": "./src/index.ts",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -56,7 +56,7 @@
56
56
  "node": ">=14"
57
57
  },
58
58
  "dependencies": {
59
- "@tsed/cli-core": "3.25.0",
59
+ "@tsed/cli-core": "3.26.0-beta.1",
60
60
  "@tsed/core": ">=6.114.14",
61
61
  "@tsed/di": ">=6.114.14",
62
62
  "@tsed/logger": ">=6.0.0",
@@ -80,7 +80,10 @@
80
80
  "bugs": {
81
81
  "url": "https://github.com/tsedio/tsed-cli/issues"
82
82
  },
83
- "homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli",
83
+ "homepage": "https://github.com/tsedio/tsed-cli/tree/beta/packages/cli",
84
84
  "author": "Romain Lenzotti",
85
- "license": "MIT"
85
+ "license": "MIT",
86
+ "publishConfig": {
87
+ "tag": "beta"
88
+ }
86
89
  }
package/readme.md CHANGED
@@ -48,6 +48,12 @@ https_proxy=http://username:password@host:port
48
48
  > Note: The following environment variables can be also used to configure the proxy `HTTPS_PROXY`, `HTTP_PROXY`
49
49
  > and `NODE_TLS_REJECT_UNAUTHORIZED`.
50
50
 
51
+ ## Init project
52
+
53
+ ```typescript
54
+
55
+ ```
56
+
51
57
  ## Run Cli from code
52
58
 
53
59
  ```typescript