@tsed/cli 7.0.0-alpha.9 → 7.0.0-beta.10

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 (126) hide show
  1. package/lib/esm/bin/ts-mode.js +10 -0
  2. package/lib/esm/bin/tsed.js +25 -3
  3. package/lib/esm/commands/add/AddCmd.js +2 -1
  4. package/lib/esm/commands/generate/GenerateCmd.js +2 -1
  5. package/lib/esm/commands/index.js +3 -1
  6. package/lib/esm/commands/init/InitCmd.js +20 -113
  7. package/lib/esm/commands/init/InitOptionsCmd.js +17 -0
  8. package/lib/esm/commands/init/config/FeaturesPrompt.js +35 -36
  9. package/lib/esm/commands/init/config/InitSchema.js +337 -0
  10. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js +1 -1
  11. package/lib/esm/commands/mcp/McpCommand.js +15 -0
  12. package/lib/esm/commands/mcp/resources/index.js +4 -0
  13. package/lib/esm/commands/mcp/resources/initOptionsResource.js +93 -0
  14. package/lib/esm/commands/mcp/resources/projectInfoResource.js +43 -0
  15. package/lib/esm/commands/mcp/resources/serverInfoResource.js +40 -0
  16. package/lib/esm/commands/mcp/schema/InitMCPSchema.js +9 -0
  17. package/lib/esm/commands/mcp/schema/ProjectPreferencesSchema.js +16 -0
  18. package/lib/esm/commands/mcp/tools/generateTool.js +105 -0
  19. package/lib/esm/commands/mcp/tools/getTemplateTool.js +47 -0
  20. package/lib/esm/commands/mcp/tools/index.js +6 -0
  21. package/lib/esm/commands/mcp/tools/initProjectTool.js +64 -0
  22. package/lib/esm/commands/mcp/tools/listTemplatesTool.js +37 -0
  23. package/lib/esm/commands/mcp/tools/setWorkspaceTool.js +64 -0
  24. package/lib/esm/commands/run/RunCmd.js +4 -1
  25. package/lib/esm/commands/template/CreateTemplateCommand.js +2 -1
  26. package/lib/esm/commands/update/UpdateCmd.js +3 -4
  27. package/lib/esm/index.js +6 -1
  28. package/lib/esm/processors/transformConfigFile.js +1 -1
  29. package/lib/esm/processors/transformServerFile.js +5 -7
  30. package/lib/esm/services/CliProjectService.js +7 -3
  31. package/lib/esm/services/CliStats.js +45 -0
  32. package/lib/esm/services/CliTemplatesService.js +20 -8
  33. package/lib/esm/templates/agents.template.js +17 -0
  34. package/lib/esm/templates/asyncFactory.template.js +4 -3
  35. package/lib/esm/templates/barrels.template.js +1 -8
  36. package/lib/esm/templates/command.template.js +1 -0
  37. package/lib/esm/templates/controller.template.js +7 -0
  38. package/lib/esm/templates/decorator.template.js +22 -11
  39. package/lib/esm/templates/dockerfile.template.js +5 -0
  40. package/lib/esm/templates/exception-filter.template.js +1 -0
  41. package/lib/esm/templates/factory.template.js +4 -3
  42. package/lib/esm/templates/index.command.template.js +1 -1
  43. package/lib/esm/templates/index.controller.template.js +12 -8
  44. package/lib/esm/templates/index.js +1 -0
  45. package/lib/esm/templates/index.logger.template.js +0 -1
  46. package/lib/esm/templates/interceptor.template.js +1 -0
  47. package/lib/esm/templates/interface.template.js +1 -0
  48. package/lib/esm/templates/middleware.template.js +14 -4
  49. package/lib/esm/templates/model.template.js +1 -0
  50. package/lib/esm/templates/module.template.js +1 -0
  51. package/lib/esm/templates/pipe.template.js +1 -0
  52. package/lib/esm/templates/prisma.service.template.js +1 -0
  53. package/lib/esm/templates/repository.template.js +1 -0
  54. package/lib/esm/templates/response-filter.template.js +1 -0
  55. package/lib/esm/templates/service.template.js +1 -0
  56. package/lib/esm/templates/value.template.js +1 -0
  57. package/lib/esm/utils/resolveSchema.js +17 -0
  58. package/lib/esm/utils/summarizeSchema.js +24 -0
  59. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  60. package/lib/types/bin/ts-mode.d.ts +1 -0
  61. package/lib/types/bin/tsed.d.ts +1 -1
  62. package/lib/types/commands/generate/GenerateCmd.d.ts +38 -1
  63. package/lib/types/commands/index.d.ts +103 -1
  64. package/lib/types/commands/init/InitCmd.d.ts +2 -5
  65. package/lib/types/commands/init/InitOptionsCmd.d.ts +52 -0
  66. package/lib/types/commands/init/config/FeaturesPrompt.d.ts +26 -32
  67. package/lib/types/commands/init/config/InitSchema.d.ts +18 -0
  68. package/lib/types/commands/mcp/McpCommand.d.ts +52 -0
  69. package/lib/types/commands/mcp/resources/index.d.ts +2 -0
  70. package/lib/types/commands/mcp/resources/initOptionsResource.d.ts +1 -0
  71. package/lib/types/commands/mcp/resources/projectInfoResource.d.ts +1 -0
  72. package/lib/types/commands/mcp/resources/serverInfoResource.d.ts +1 -0
  73. package/lib/types/commands/mcp/schema/InitMCPSchema.d.ts +5 -0
  74. package/lib/types/commands/mcp/schema/ProjectPreferencesSchema.d.ts +9 -0
  75. package/lib/types/commands/mcp/tools/generateTool.d.ts +116 -0
  76. package/lib/types/commands/mcp/tools/getTemplateTool.d.ts +114 -0
  77. package/lib/types/commands/mcp/tools/index.d.ts +345 -0
  78. package/lib/types/commands/mcp/tools/initProjectTool.d.ts +116 -0
  79. package/lib/types/commands/mcp/tools/listTemplatesTool.d.ts +114 -0
  80. package/lib/types/commands/mcp/tools/setWorkspaceTool.d.ts +119 -0
  81. package/lib/types/index.d.ts +6 -1
  82. package/lib/types/interfaces/InitCmdOptions.d.ts +1 -1
  83. package/lib/types/pipes/SymbolNamePipe.d.ts +1 -1
  84. package/lib/types/services/CliProjectService.d.ts +1 -1
  85. package/lib/types/services/CliStats.d.ts +36 -0
  86. package/lib/types/services/CliTemplatesService.d.ts +7 -4
  87. package/lib/types/templates/agents.template.d.ts +17 -0
  88. package/lib/types/templates/asyncFactory.template.d.ts +1 -0
  89. package/lib/types/templates/barrels.template.d.ts +1 -0
  90. package/lib/types/templates/command.template.d.ts +1 -0
  91. package/lib/types/templates/config.template.d.ts +1 -0
  92. package/lib/types/templates/controller.template.d.ts +1 -0
  93. package/lib/types/templates/decorator.template.d.ts +1 -0
  94. package/lib/types/templates/docker-compose.template.d.ts +1 -0
  95. package/lib/types/templates/exception-filter.template.d.ts +1 -0
  96. package/lib/types/templates/factory.template.d.ts +1 -0
  97. package/lib/types/templates/index.command.template.d.ts +1 -0
  98. package/lib/types/templates/index.config.utils.template.d.ts +1 -0
  99. package/lib/types/templates/index.controller.template.d.ts +1 -0
  100. package/lib/types/templates/index.d.ts +1 -0
  101. package/lib/types/templates/index.logger.template.d.ts +3 -2
  102. package/lib/types/templates/index.template.d.ts +1 -0
  103. package/lib/types/templates/interceptor.template.d.ts +1 -0
  104. package/lib/types/templates/interface.template.d.ts +1 -0
  105. package/lib/types/templates/middleware.template.d.ts +1 -0
  106. package/lib/types/templates/model.template.d.ts +1 -0
  107. package/lib/types/templates/module.template.d.ts +1 -0
  108. package/lib/types/templates/pipe.template.d.ts +1 -0
  109. package/lib/types/templates/prisma.service.template.d.ts +1 -0
  110. package/lib/types/templates/readme.template.d.ts +1 -0
  111. package/lib/types/templates/repository.template.d.ts +1 -0
  112. package/lib/types/templates/response-filter.template.d.ts +1 -0
  113. package/lib/types/templates/server.template.d.ts +1 -0
  114. package/lib/types/templates/service.template.d.ts +1 -0
  115. package/lib/types/templates/tsconfig.spec.template.d.ts +1 -0
  116. package/lib/types/templates/value.template.d.ts +1 -0
  117. package/lib/types/utils/defineTemplate.d.ts +11 -0
  118. package/lib/types/utils/resolveSchema.d.ts +2 -0
  119. package/lib/types/utils/summarizeSchema.d.ts +8 -0
  120. package/package.json +19 -14
  121. package/templates/views/home.ejs +347 -0
  122. package/lib/esm/Cli.js +0 -58
  123. package/lib/esm/commands/init/config/InitFileSchema.js +0 -49
  124. package/lib/types/Cli.d.ts +0 -27
  125. package/lib/types/commands/init/config/InitFileSchema.d.ts +0 -49
  126. package/templates/views/swagger.ejs +0 -100
@@ -0,0 +1,347 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Ts.ED Starter</title>
6
+ <base href="/">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Inter+Tight:wght@500&display=swap" rel="stylesheet">
12
+ <style>
13
+ :root {
14
+ --brand-indigo-1: #3451b2;
15
+ --brand-indigo-2: #3a5ccc;
16
+ --brand-indigo-3: #5672cd;
17
+ --brand-accent: #db2777;
18
+ --gradient-start: #bd34fe;
19
+ --gradient-end: #47caff;
20
+ --gray-900: #0f172a;
21
+ --gray-700: #475467;
22
+ --gray-400: #94a3b8;
23
+ --surface: #ffffff;
24
+ --background: #f3f4f6;
25
+ --gradient-vertical: linear-gradient(180deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
26
+ --gradient-horizontal: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
27
+ --pill-accent: var(--brand-indigo-2);
28
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
29
+ -webkit-font-smoothing: antialiased;
30
+ -moz-osx-font-smoothing: grayscale;
31
+ }
32
+
33
+ *, *::before, *::after {
34
+ box-sizing: border-box;
35
+ }
36
+
37
+ body {
38
+ margin: 0;
39
+ min-height: 100vh;
40
+ background: var(--background);
41
+ color: var(--gray-900);
42
+ font-family: inherit;
43
+ }
44
+
45
+ main {
46
+ width: 100%;
47
+ min-height: 100vh;
48
+ display: flex;
49
+ flex-direction: column;
50
+ justify-content: center;
51
+ align-items: center;
52
+ padding: 2rem 1rem;
53
+ position: relative;
54
+ }
55
+
56
+ .content {
57
+ display: flex;
58
+ justify-content: space-around;
59
+ align-items: stretch;
60
+ width: 100%;
61
+ max-width: 960px;
62
+ background: var(--surface);
63
+ border-radius: 32px;
64
+ padding: 3rem clamp(1.5rem, 4vw, 3.5rem);
65
+ box-shadow: 0 25px 80px rgba(52, 81, 178, 0.2);
66
+ gap: 2rem;
67
+ }
68
+
69
+ .content + .content {
70
+ margin-top: 2rem;
71
+ }
72
+
73
+ .left-side {
74
+ flex: 1 1 45%;
75
+ }
76
+
77
+ .tsed-logo {
78
+ max-width: 9.2rem;
79
+ }
80
+
81
+ h1 {
82
+ font-size: clamp(2.5rem, 5vw, 3.5rem);
83
+ color: var(--gray-900);
84
+ font-weight: 500;
85
+ line-height: 1;
86
+ letter-spacing: -0.125rem;
87
+ margin: 1.75rem 0 0;
88
+ font-family: "Inter Tight", "Inter", system-ui, sans-serif;
89
+ }
90
+
91
+ p {
92
+ margin: 1.5rem 0 0;
93
+ color: var(--gray-700);
94
+ font-size: 1rem;
95
+ }
96
+
97
+ pre {
98
+ margin-top: 1.5rem;
99
+ padding: 1rem 1.25rem;
100
+ background: rgba(52, 81, 178, 0.08);
101
+ border-radius: 0.75rem;
102
+ border: 1px solid rgba(52, 81, 178, 0.15);
103
+ font-family: "Source Code Pro", "SFMono-Regular", Consolas, monospace;
104
+ font-size: 0.95rem;
105
+ color: var(--gray-900);
106
+ overflow-x: auto;
107
+ }
108
+
109
+ .mcp-card {
110
+ margin-top: 1.75rem;
111
+ }
112
+ .mcp-card p {
113
+ margin: 0 0 0.75rem;
114
+ font-weight: 600;
115
+ color: var(--gray-700);
116
+ }
117
+ .mcp-card pre {
118
+ margin: 0;
119
+ background: rgba(189, 52, 254, 0.08);
120
+ border-color: rgba(189, 52, 254, 0.25);
121
+ color: var(--brand-indigo-1);
122
+ border-radius: 0.75rem;
123
+ }
124
+
125
+ .divider {
126
+ width: 1px;
127
+ background: var(--gradient-vertical);
128
+ }
129
+
130
+ .right-side {
131
+ flex: 1 1 45%;
132
+ display: flex;
133
+ flex-direction: column;
134
+ gap: 2rem;
135
+ }
136
+
137
+ .pill-group {
138
+ display: flex;
139
+ flex-direction: column;
140
+ align-items: flex-start;
141
+ gap: 1.1rem;
142
+ }
143
+
144
+ .pill-title {
145
+ font-size: 0.85rem;
146
+ text-transform: uppercase;
147
+ letter-spacing: 0.08em;
148
+ color: var(--gray-700);
149
+ margin: 0 0 0.2rem;
150
+ }
151
+
152
+ .pill {
153
+ display: inline-flex;
154
+ align-items: center;
155
+ --pill-accent: var(--brand-indigo-2);
156
+ background: color-mix(in srgb, var(--pill-accent) 8%, transparent);
157
+ color: var(--pill-accent);
158
+ padding: 0.45rem 0.95rem;
159
+ border-radius: 2.75rem;
160
+ border: 0;
161
+ font-family: inherit;
162
+ font-size: 0.9rem;
163
+ font-weight: 500;
164
+ letter-spacing: -0.00875rem;
165
+ text-decoration: none;
166
+ white-space: nowrap;
167
+ transition: background 0.3s ease;
168
+ }
169
+
170
+ .pill svg {
171
+ margin-left: 0.25rem;
172
+ }
173
+
174
+ .pill:hover {
175
+ background: color-mix(in srgb, var(--pill-accent) 18%, transparent);
176
+ }
177
+
178
+ .pill:nth-child(6n + 1) { --pill-accent: var(--brand-indigo-1); }
179
+ .pill:nth-child(6n + 2) { --pill-accent: var(--brand-indigo-2); }
180
+ .pill:nth-child(6n + 3) { --pill-accent: var(--brand-indigo-3); }
181
+ .pill:nth-child(6n + 4) { --pill-accent: var(--brand-accent); }
182
+ .pill:nth-child(6n + 5) { --pill-accent: #5c73e7; }
183
+ .pill:nth-child(6n + 6) { --pill-accent: #3e63dd; }
184
+
185
+ .docs-pill {
186
+ --pill-accent: var(--brand-accent);
187
+ width: 100%;
188
+ justify-content: space-between;
189
+ background: color-mix(in srgb, var(--brand-accent) 10%, transparent);
190
+ }
191
+
192
+ .docs-pill span {
193
+ font-size: 0.8rem;
194
+ color: var(--gray-700);
195
+ margin-right: 0.5rem;
196
+ }
197
+
198
+
199
+ .social-links {
200
+ display: flex;
201
+ align-items: center;
202
+ gap: 0.75rem;
203
+ margin-top: 1.5rem;
204
+ }
205
+
206
+ .social-links path {
207
+ transition: fill 0.3s ease;
208
+ fill: var(--gray-400);
209
+ }
210
+
211
+ .social-links a:hover path {
212
+ fill: var(--gray-900);
213
+ }
214
+
215
+ @media screen and (max-width: 820px) {
216
+ .content {
217
+ flex-direction: column;
218
+ }
219
+
220
+ .divider {
221
+ height: 1px;
222
+ width: 100%;
223
+ background: var(--gradient-horizontal);
224
+ margin: 1.5rem 0;
225
+ }
226
+ }
227
+ </style>
228
+ </head>
229
+ <body>
230
+ <% const resources = [
231
+ {
232
+ title: "Explore the Docs",
233
+ description: "Controllers, DI, validation, and configuration",
234
+ href: "https://tsed.dev/introduction/getting-started"
235
+ },
236
+ {
237
+ title: "Learn with Tutorials",
238
+ description: "GraphQL, Swagger, authentication, and more",
239
+ href: "https://tsed.dev/tutorials/swagger.html"
240
+ },
241
+ {
242
+ title: "Develop with AI",
243
+ description: "Prompts and best practices for coding assistants",
244
+ href: "https://tsed.dev/introduction/ai/develop-with-ai.html"
245
+ },
246
+ {
247
+ title: "CLI Docs",
248
+ description: "Generate controllers, services, DTOs, and tests",
249
+ href: "https://tsed.dev/docs/command.html"
250
+ },
251
+ {
252
+ title: "Plugins Marketplace",
253
+ description: "Extend Ts.ED with auth, logging, tracing, and more",
254
+ href: "https://tsed.dev/plugins/"
255
+ },
256
+ {
257
+ title: "Join the Community",
258
+ description: "Hang out with maintainers on Slack",
259
+ href: "https://slack.tsed.dev"
260
+ }
261
+ ]; %>
262
+ <main class="main">
263
+ <div class="content">
264
+ <div class="left-side">
265
+ <img class="tsed-logo" src="https://tsed.dev/tsed.svg" alt="Ts.ED logo">
266
+ <h1>Hello Maestro!</h1>
267
+ <p>Congratulations! Your Ts.ED server is running. Scaffold features with the CLI, connect decorators, and ship production-ready APIs faster.</p>
268
+ <p class="pill-title" style="margin-top:1.5rem;">Scaffold with the CLI</p>
269
+ <pre>tsed generate controller users
270
+ tsed generate service users</pre>
271
+ <div class="mcp-card">
272
+ <p>Need AI-assisted scaffolding? Run Ts.ED MCP:</p>
273
+ <pre>npx -p @tsed/cli tsed mcp</pre>
274
+ </div>
275
+ <div class="social-links">
276
+ <a href="https://github.com/tsedio/tsed" aria-label="GitHub" target="_blank" rel="noreferrer">
277
+ <svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img">
278
+ <path d="M12.305 0C5.506 0 0 5.509 0 12.305 0 17.742 3.525 22.354 8.413 23.979c.615.116.84-.264.84-.591 0-.292-.01-1.066-.015-2.091-3.423.742-4.145-1.651-4.145-1.651-.56-1.42-1.368-1.799-1.368-1.799-1.115-.763.086-.748.086-.748 1.236.086 1.885 1.267 1.885 1.267 1.097 1.882 2.881 1.339 3.584 1.024.111-.796.428-1.338.78-1.646-2.733-.308-5.605-1.366-5.605-6.081 0-1.343.477-2.44 1.267-3.301-.138-.311-.553-1.562.109-3.257 0 0 1.031-.33 3.384 1.261a11.844 11.844 0 0 1 6 0c2.348-1.591 3.379-1.261 3.379-1.261.662 1.695.247 2.946.109 3.257.79.861 1.267 1.958 1.267 3.301 0 4.717-2.876 5.768-5.613 6.076.444.386.84 1.154.84 2.34 0 1.689-.015 3.012-.015 3.412 0 .323.215.708.845.585 4.922-1.614 8.444-6.228 8.444-11.657C24.61 5.509 19.1 0 12.305 0Z"/>
279
+ </svg>
280
+ </a>
281
+ <a href="https://x.com/TsED_io" aria-label="X" target="_blank" rel="noreferrer">
282
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img">
283
+ <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231 5.451-6.231Zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
284
+ </svg>
285
+ </a>
286
+ <a href="https://slack.tsed.dev" aria-label="Slack" target="_blank" rel="noreferrer">
287
+ <svg width="24" height="24" viewBox="0 0 122.8 122.8" xmlns="http://www.w3.org/2000/svg" role="img">
288
+ <path d="M27.3 75.6a13.7 13.7 0 1 1-13.6-13.6h13.6z" fill="#36c5f0"/>
289
+ <path d="M34.1 75.6a13.7 13.7 0 1 1 27.3 0v34.1a13.7 13.7 0 1 1-27.3 0z" fill="#36c5f0"/>
290
+ <path d="M47.7 27.3a13.7 13.7 0 1 1 13.6-13.6v13.6z" fill="#2eb67d"/>
291
+ <path d="M47.7 34.1a13.7 13.7 0 1 1 0 27.3H13.6a13.7 13.7 0 1 1 0-27.3z" fill="#2eb67d"/>
292
+ <path d="M95.1 47.7a13.7 13.7 0 1 1 13.6 13.6H95.1z" fill="#ecb22e"/>
293
+ <path d="M88.3 47.7a13.7 13.7 0 1 1-27.3 0V13.6a13.7 13.7 0 1 1 27.3 0z" fill="#ecb22e"/>
294
+ <path d="M75.6 95.1a13.7 13.7 0 1 1-13.6 13.6V95.1z" fill="#e01e5a"/>
295
+ <path d="M75.6 88.3a13.7 13.7 0 1 1 0-27.3h34.1a13.7 13.7 0 1 1 0 27.3z" fill="#e01e5a"/>
296
+ </svg>
297
+ </a>
298
+ </div>
299
+ </div>
300
+ <div role="separator" aria-label="Divider" class="divider"></div>
301
+ <div class="right-side">
302
+ <div class="pill-group">
303
+ <% resources.forEach((resource, index) => { %>
304
+ <a class="pill" href="<%= resource.href %>" target="_blank" rel="noreferrer">
305
+ <span><%= resource.title %></span>
306
+ <svg xmlns="http://www.w3.org/2000/svg" height="14" viewBox="0 -960 960 960" width="14" fill="currentColor" aria-hidden="true">
307
+ <path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"/>
308
+ </svg>
309
+ </a>
310
+ <small style="margin-left:0.35rem; color: var(--gray-700);"><%= resource.description %></small>
311
+ <% }) %>
312
+ </div>
313
+ </div>
314
+ </div>
315
+ <div class="content">
316
+ <div class="left-side">
317
+ <h2 style="margin-top:0;">Available APIs</h2>
318
+ <p>Inspect the Swagger/OpenAPI specs generated by Ts.ED for this project.</p>
319
+ </div>
320
+ <div class="right-side">
321
+ <% if (docs && docs.length) { %>
322
+ <div class="pill-group">
323
+ <% docs.forEach((doc) => { %>
324
+ <% const docName = doc.name || (doc.spec && doc.spec.info && doc.spec.info.title) || doc.path || "Swagger UI"; %>
325
+ <% const docVersion = doc.specVersion || "OpenAPI"; %>
326
+ <% const docFamily = doc.specVersion && doc.specVersion.startsWith("2") ? "Swagger" : "OpenSpec"; %>
327
+ <a class="pill docs-pill" href="<%= doc.url %>" target="_blank" rel="noreferrer">
328
+ <div>
329
+ <strong><%= docName %></strong>
330
+ <span><%= docFamily %> (<%= docVersion %>)</span>
331
+ </div>
332
+ <svg xmlns="http://www.w3.org/2000/svg" height="14" viewBox="0 -960 960 960" width="14" fill="currentColor" aria-hidden="true">
333
+ <path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"/>
334
+ </svg>
335
+ </a>
336
+ <% }) %>
337
+ </div>
338
+ <% } else { %>
339
+ <div class="pill-group">
340
+ <p style="color: var(--gray-700); margin: 0;">No Swagger configurations yet. <a href="https://tsed.dev/tutorials/swagger.html" target="_blank" rel="noreferrer" style="color: var(--brand-indigo-2); font-weight: 600;">Add one following the guide.</a></p>
341
+ </div>
342
+ <% } %>
343
+ </div>
344
+ </div>
345
+ </main>
346
+ </body>
347
+ </html>
package/lib/esm/Cli.js DELETED
@@ -1,58 +0,0 @@
1
- import "@tsed/logger-std";
2
- import "./templates/index.js";
3
- import { CliCore } from "@tsed/cli-core";
4
- import chalk from "chalk";
5
- import commands from "./commands/index.js";
6
- import { PKG, TEMPLATE_DIR } from "./constants/index.js";
7
- import { ArchitectureConvention, ProjectConvention } from "./interfaces/index.js";
8
- export class Cli extends CliCore {
9
- static { this.defaults = {
10
- name: "tsed",
11
- pkg: PKG,
12
- templateDir: TEMPLATE_DIR,
13
- plugins: true,
14
- commands,
15
- defaultProjectPreferences() {
16
- return {
17
- convention: ProjectConvention.DEFAULT,
18
- architecture: ArchitectureConvention.DEFAULT
19
- };
20
- },
21
- project: {
22
- reinstallAfterRun: true
23
- },
24
- logger: {
25
- level: "info"
26
- }
27
- }; }
28
- static checkPackage(pkg) {
29
- if (!pkg) {
30
- console.log(chalk.red(`settings.pkg is required. Require the package.json of your CLI when you bootstrap the CLI.`));
31
- process.exit(1);
32
- }
33
- }
34
- static checkName(name) {
35
- if (!name) {
36
- console.log(chalk.red(`settings.name is required. Add the name of your CLI.`));
37
- process.exit(1);
38
- }
39
- }
40
- static checkPrecondition(settings) {
41
- const { pkg } = settings;
42
- this.checkPackage(pkg);
43
- this.checkName(pkg.name);
44
- if (pkg?.engines?.node) {
45
- this.checkNodeVersion(pkg.engines.node, pkg.name);
46
- }
47
- }
48
- static async bootstrap(settings = {}) {
49
- const opts = {
50
- ...Cli.defaults,
51
- ...settings
52
- };
53
- const { pkg } = opts;
54
- this.checkPrecondition(opts);
55
- await this.updateNotifier(pkg);
56
- return super.bootstrap(opts, Cli);
57
- }
58
- }
@@ -1,49 +0,0 @@
1
- import { PackageManager } from "@tsed/cli-core";
2
- import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces/index.js";
3
- import { FeatureType } from "./FeaturesPrompt.js";
4
- export const InitFileSchema = {
5
- type: "object",
6
- properties: {
7
- tsedVersion: {
8
- type: "string"
9
- },
10
- projectName: {
11
- type: "string",
12
- maxLength: 100
13
- },
14
- platform: {
15
- type: "string",
16
- description: "The project name. By default, the project is the same as the name directory.",
17
- enum: Object.values(PlatformType),
18
- default: PlatformType.EXPRESS
19
- },
20
- architecture: {
21
- type: "string",
22
- enum: Object.values(ArchitectureConvention),
23
- default: ArchitectureConvention.DEFAULT
24
- },
25
- convention: {
26
- type: "string",
27
- enum: Object.values(ProjectConvention),
28
- default: ProjectConvention.DEFAULT
29
- },
30
- features: {
31
- type: "array",
32
- items: {
33
- type: "string",
34
- enum: Object.values(FeatureType)
35
- }
36
- },
37
- packageManager: {
38
- type: "string",
39
- enum: Object.values(PackageManager),
40
- default: PackageManager.YARN
41
- },
42
- skipPrompt: {
43
- type: "boolean",
44
- default: false
45
- }
46
- },
47
- required: ["features"],
48
- additionalProperties: true
49
- };
@@ -1,27 +0,0 @@
1
- import "@tsed/logger-std";
2
- import "./templates/index.js";
3
- import { CliCore } from "@tsed/cli-core";
4
- import { ArchitectureConvention, ProjectConvention } from "./interfaces/index.js";
5
- export declare class Cli extends CliCore {
6
- static defaults: {
7
- name: string;
8
- pkg: import("read-pkg-up").NormalizedPackageJson;
9
- templateDir: string;
10
- plugins: boolean;
11
- commands: (typeof import("./index.js").AddCmd | typeof import("./index.js").GenerateCmd | typeof import("./index.js").InitCmd | typeof import("./index.js").UpdateCmd | typeof import("./commands/template/CreateTemplateCommand.js").CreateTemplateCommand | typeof import("./commands/run/RunCmd.js").RunCmd)[];
12
- defaultProjectPreferences(): {
13
- convention: ProjectConvention;
14
- architecture: ArchitectureConvention;
15
- };
16
- project: {
17
- reinstallAfterRun: boolean;
18
- };
19
- logger: {
20
- level: string;
21
- };
22
- };
23
- static checkPackage(pkg: any): void;
24
- static checkName(name: string): void;
25
- static checkPrecondition(settings: any): void;
26
- static bootstrap(settings?: any): Promise<CliCore>;
27
- }
@@ -1,49 +0,0 @@
1
- import { PackageManager } from "@tsed/cli-core";
2
- import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces/index.js";
3
- import { FeatureType } from "./FeaturesPrompt.js";
4
- export declare const InitFileSchema: {
5
- type: string;
6
- properties: {
7
- tsedVersion: {
8
- type: string;
9
- };
10
- projectName: {
11
- type: string;
12
- maxLength: number;
13
- };
14
- platform: {
15
- type: string;
16
- description: string;
17
- enum: PlatformType[];
18
- default: PlatformType;
19
- };
20
- architecture: {
21
- type: string;
22
- enum: ArchitectureConvention[];
23
- default: ArchitectureConvention;
24
- };
25
- convention: {
26
- type: string;
27
- enum: ProjectConvention[];
28
- default: ProjectConvention;
29
- };
30
- features: {
31
- type: string;
32
- items: {
33
- type: string;
34
- enum: FeatureType[];
35
- };
36
- };
37
- packageManager: {
38
- type: string;
39
- enum: PackageManager[];
40
- default: PackageManager;
41
- };
42
- skipPrompt: {
43
- type: string;
44
- default: boolean;
45
- };
46
- };
47
- required: string[];
48
- additionalProperties: boolean;
49
- };
@@ -1,100 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
- <title>client</title>
9
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet" />
10
- <style>
11
- body, h1 {
12
- font-family: Source Sans Pro,sans-serif;
13
- }
14
- body:after {
15
- content: "";
16
- background-image: radial-gradient(#eef2f5 0,#f4f7f8 40%,transparent 75%);
17
- position: absolute;
18
- top: 0;
19
- right: 0;
20
- width: 60%;
21
- height: 100%;
22
- z-index: 1;
23
- }
24
- .container {
25
- position: fixed;
26
- top: 0;
27
- left: 0;
28
- width: 100vw;
29
- height: 100vh;
30
- z-index: 2;
31
- display: flex;
32
- align-items: center;
33
- justify-content: center;
34
- }
35
- .container-logo {
36
- display: flex;
37
- align-items: center;
38
- justify-content: center;
39
- margin-bottom: 60px;
40
- }
41
- .container-logo img {
42
- max-width: 150px;
43
- border-radius: 50%;
44
- }
45
-
46
- ul {
47
- list-style: none;
48
- margin: 0;
49
- padding: 0;
50
- display: flex;
51
- align-items: center;
52
- justify-content: center;
53
- margin-bottom: 40px;
54
- }
55
- ul li a {
56
- padding-left: 1rem;
57
- padding-right: 1rem;
58
- padding-top: .25rem;
59
- padding-bottom: .25rem;
60
- margin-left: 10px;
61
- margin-right: 10px;
62
- border: 2px solid #504747;
63
- min-width: 110px;
64
- border-radius: 10px;
65
- text-align: center;
66
- display: block;
67
- border-radius: 1rem;
68
- color: #504747;
69
- text-decoration: none;
70
- transition: all ease-in-out 0.5s;
71
- }
72
- ul li a:hover {
73
- color: #14a5c2;
74
- border-color: #14a5c2;
75
- }
76
- ul li a span {
77
- margin: .25rem;
78
- display: block;
79
- }
80
- </style>
81
- </head>
82
- <body>
83
- <div class="container">
84
- <div>
85
- <div class="container-logo">
86
- <img src="https://tsed.dev/tsed-og.png" alt="Ts.ED">
87
- </div>
88
-
89
- <ul>
90
- <% docs.forEach((doc) => { %>
91
-
92
- <li><a href="<%= doc.path %>"><span>OpenSpec <%= doc.specVersion %></span></a></li>
93
-
94
- <% }) %>
95
- </ul>
96
- </div>
97
- </div>
98
- <!-- built files will be auto injected -->
99
- </body>
100
- </html>