@tsed/cli-core 7.0.0-beta.1 → 7.0.0-beta.11

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 (61) hide show
  1. package/lib/esm/CliCore.js +24 -38
  2. package/lib/esm/decorators/command.js +1 -1
  3. package/lib/esm/decorators/index.js +0 -4
  4. package/lib/esm/fn/command.js +31 -3
  5. package/lib/esm/index.js +1 -2
  6. package/lib/esm/interfaces/CommandProvider.js +1 -2
  7. package/lib/esm/interfaces/ProjectPreferences.js +1 -0
  8. package/lib/esm/interfaces/index.js +1 -2
  9. package/lib/esm/packageManagers/PackageManagersModule.js +11 -19
  10. package/lib/esm/packageManagers/index.js +1 -0
  11. package/lib/esm/packageManagers/supports/BaseManager.js +2 -6
  12. package/lib/esm/packageManagers/supports/YarnBerryManager.js +4 -1
  13. package/lib/esm/services/CliFs.js +3 -1
  14. package/lib/esm/services/CliHttpClient.js +3 -2
  15. package/lib/esm/services/CliHttpLogClient.js +1 -1
  16. package/lib/esm/services/CliLoadFile.js +5 -18
  17. package/lib/esm/services/CliPlugins.js +2 -3
  18. package/lib/esm/services/CliService.js +65 -76
  19. package/lib/esm/services/ProjectPackageJson.js +17 -4
  20. package/lib/esm/utils/createInjector.js +1 -1
  21. package/lib/esm/utils/getCommandMetadata.js +34 -7
  22. package/lib/esm/utils/index.js +1 -0
  23. package/lib/esm/utils/loadPlugins.js +5 -18
  24. package/lib/esm/utils/validate.js +23 -0
  25. package/lib/types/CliCore.d.ts +2 -9
  26. package/lib/types/decorators/command.d.ts +2 -2
  27. package/lib/types/decorators/index.d.ts +0 -4
  28. package/lib/types/fn/command.d.ts +58 -3
  29. package/lib/types/index.d.ts +1 -2
  30. package/lib/types/interfaces/CommandData.d.ts +1 -0
  31. package/lib/types/interfaces/CommandMetadata.d.ts +17 -15
  32. package/lib/types/interfaces/{CommandParameters.d.ts → CommandOptions.d.ts} +20 -3
  33. package/lib/types/interfaces/CommandProvider.d.ts +4 -22
  34. package/lib/types/interfaces/ProjectPreferences.d.ts +2 -1
  35. package/lib/types/interfaces/index.d.ts +3 -3
  36. package/lib/types/packageManagers/PackageManagersModule.d.ts +1 -2
  37. package/lib/types/packageManagers/index.d.ts +1 -0
  38. package/lib/types/services/CliHttpLogClient.d.ts +1 -1
  39. package/lib/types/services/CliLoadFile.d.ts +2 -4
  40. package/lib/types/services/CliPlugins.d.ts +0 -1
  41. package/lib/types/services/CliService.d.ts +6 -10
  42. package/lib/types/services/ProjectPackageJson.d.ts +9 -0
  43. package/lib/types/utils/index.d.ts +1 -0
  44. package/lib/types/utils/mapCommanderArgs.d.ts +1 -1
  45. package/lib/types/utils/resolveConfiguration.d.ts +1 -1
  46. package/lib/types/utils/validate.d.ts +14 -0
  47. package/package.json +4 -7
  48. package/readme.md +2 -2
  49. package/lib/esm/decorators/on.js +0 -8
  50. package/lib/esm/decorators/onAdd.js +0 -5
  51. package/lib/esm/decorators/onExec.js +0 -5
  52. package/lib/esm/decorators/onPostInstall.js +0 -5
  53. package/lib/esm/decorators/onPrompt.js +0 -5
  54. package/lib/esm/domains/CommandStoreKeys.js +0 -8
  55. package/lib/types/decorators/on.d.ts +0 -1
  56. package/lib/types/decorators/onAdd.d.ts +0 -1
  57. package/lib/types/decorators/onExec.d.ts +0 -1
  58. package/lib/types/decorators/onPostInstall.d.ts +0 -1
  59. package/lib/types/decorators/onPrompt.d.ts +0 -1
  60. package/lib/types/domains/CommandStoreKeys.d.ts +0 -7
  61. /package/lib/esm/interfaces/{CommandParameters.js → CommandOptions.js} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsed/cli-core",
3
3
  "description": "Build your CLI with TypeScript and Decorators",
4
- "version": "7.0.0-beta.1",
4
+ "version": "7.0.0-beta.11",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -28,28 +28,25 @@
28
28
  "api",
29
29
  "decorators",
30
30
  "commander.js",
31
- "inquirer.js",
31
+ "prompts",
32
32
  "listr"
33
33
  ],
34
34
  "dependencies": {
35
35
  "@ts-morph/common": "0.28.0",
36
+ "@tsed/cli-prompts": "7.0.0-beta.11",
36
37
  "@tsed/logger": ">=8.0.3",
37
38
  "@tsed/logger-pattern-layout": ">=8.0.3",
38
39
  "@tsed/logger-std": ">=8.0.3",
39
40
  "@tsed/normalize-path": ">=8.0.0",
40
- "@types/inquirer": "^9.0.7",
41
41
  "ajv": "^8.17.1",
42
42
  "axios": "^1.7.7",
43
43
  "chalk": "^5.3.0",
44
44
  "change-case": "^5.4.4",
45
45
  "commander": "^12.1.0",
46
- "enquirer": "^2.4.1",
47
46
  "execa": "^8.0.1",
48
47
  "figures": "^6.1.0",
49
48
  "fs-extra": "^11.2.0",
50
49
  "globby": "^14.0.2",
51
- "inquirer": "^9.3.7",
52
- "inquirer-autocomplete-prompt": "^3.0.1",
53
50
  "js-yaml": "^4.1.0",
54
51
  "listr2": "^8.2.4",
55
52
  "read-pkg-up": "^11.0.0",
@@ -65,7 +62,7 @@
65
62
  "uuid": "^10.0.0"
66
63
  },
67
64
  "devDependencies": {
68
- "@tsed/typescript": "7.0.0-beta.1",
65
+ "@tsed/typescript": "7.0.0-beta.11",
69
66
  "@types/commander": "2.12.2",
70
67
  "@types/figures": "3.0.1",
71
68
  "@types/fs-extra": "^11.0.4",
package/readme.md CHANGED
@@ -116,7 +116,7 @@ export class GenerateCmd implements CommandProvider {
116
116
  srcRenderService: SrcRendererService;
117
117
 
118
118
  /**
119
- * Prompt use Inquirer.js to print questions (see Inquirer.js for more details)
119
+ * Prompts run through the Ts.ED prompt runner (powered by `@clack/prompts`) to gather inputs
120
120
  */
121
121
  $prompt(initialOptions: Partial<GenerateCmdContext>) {
122
122
  return [
@@ -216,7 +216,7 @@ website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
216
216
 
217
217
  The MIT License (MIT)
218
218
 
219
- Copyright (c) 2016 - 2023 Romain Lenzotti
219
+ Copyright (c) 2016 - Today Romain Lenzotti
220
220
 
221
221
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
222
222
  documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
@@ -1,8 +0,0 @@
1
- import { StoreMerge } from "@tsed/core";
2
- export function On(hookName, name) {
3
- return (target, propertyKey) => {
4
- StoreMerge(hookName, {
5
- [name]: [propertyKey]
6
- })(target);
7
- };
8
- }
@@ -1,5 +0,0 @@
1
- import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
2
- import { On } from "./on.js";
3
- export function OnAdd(cliPlugin) {
4
- return On(CommandStoreKeys.ADD, cliPlugin);
5
- }
@@ -1,5 +0,0 @@
1
- import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
2
- import { On } from "./on.js";
3
- export function OnExec(cmdName) {
4
- return On(CommandStoreKeys.EXEC_HOOKS, cmdName);
5
- }
@@ -1,5 +0,0 @@
1
- import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
2
- import { On } from "./on.js";
3
- export function OnPostInstall(cmdName) {
4
- return On(CommandStoreKeys.POST_INSTALL_HOOKS, cmdName);
5
- }
@@ -1,5 +0,0 @@
1
- import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
2
- import { On } from "./on.js";
3
- export function OnPrompt(cmdName) {
4
- return On(CommandStoreKeys.PROMPT_HOOKS, cmdName);
5
- }
@@ -1,8 +0,0 @@
1
- export var CommandStoreKeys;
2
- (function (CommandStoreKeys) {
3
- CommandStoreKeys["COMMAND"] = "command";
4
- CommandStoreKeys["ADD"] = "$onAdd";
5
- CommandStoreKeys["EXEC_HOOKS"] = "$onExec";
6
- CommandStoreKeys["POST_INSTALL_HOOKS"] = "$onPostInstall";
7
- CommandStoreKeys["PROMPT_HOOKS"] = "$onPrompt";
8
- })(CommandStoreKeys || (CommandStoreKeys = {}));
@@ -1 +0,0 @@
1
- export declare function On(hookName: string, name: string): MethodDecorator;
@@ -1 +0,0 @@
1
- export declare function OnAdd(cliPlugin: string): MethodDecorator;
@@ -1 +0,0 @@
1
- export declare function OnExec(cmdName: string): MethodDecorator;
@@ -1 +0,0 @@
1
- export declare function OnPostInstall(cmdName: string): MethodDecorator;
@@ -1 +0,0 @@
1
- export declare function OnPrompt(cmdName: string): MethodDecorator;
@@ -1,7 +0,0 @@
1
- export declare enum CommandStoreKeys {
2
- COMMAND = "command",
3
- ADD = "$onAdd",
4
- EXEC_HOOKS = "$onExec",
5
- POST_INSTALL_HOOKS = "$onPostInstall",
6
- PROMPT_HOOKS = "$onPrompt"
7
- }