@stacksjs/buddy 0.66.0 → 0.68.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.
Files changed (296) hide show
  1. package/dist/add.d.ts +4 -0
  2. package/dist/build.d.ts +4 -0
  3. package/dist/changelog.d.ts +3 -0
  4. package/dist/chunk-06g79v9j.js +2 -0
  5. package/dist/chunk-08bm2xax.js +2 -0
  6. package/dist/chunk-0enrsn65.js +978 -0
  7. package/dist/chunk-0m218zhk.js +2 -0
  8. package/dist/chunk-0q0jn0kk.js +6 -0
  9. package/dist/chunk-0yyhz107.js +2 -0
  10. package/dist/chunk-11vhe2za.js +2 -0
  11. package/dist/chunk-13143jmy.js +3 -0
  12. package/dist/chunk-1agj4qty.js +2 -0
  13. package/dist/chunk-1c4yywmn.js +9 -0
  14. package/dist/chunk-1e2f0z80.js +2 -0
  15. package/dist/chunk-1v13dkfw.js +2 -0
  16. package/dist/chunk-20e0mpcw.js +9 -0
  17. package/dist/chunk-25nxsybw.js +2 -0
  18. package/dist/chunk-27ksm11g.js +2 -0
  19. package/dist/chunk-2mhj5ght.js +2 -0
  20. package/dist/chunk-2wrs9p57.js +1 -0
  21. package/dist/chunk-2yj4j69j.js +2 -0
  22. package/dist/chunk-2ymn50ck.js +2 -0
  23. package/dist/chunk-3vjfkr7v.js +978 -0
  24. package/dist/{chunk-3zx3yk1m.js → chunk-3wpw5xgd.js} +1 -4
  25. package/dist/chunk-3y0gapf6.js +2 -0
  26. package/dist/chunk-4rb5r88h.js +978 -0
  27. package/dist/chunk-4wb68jfr.js +2 -0
  28. package/dist/chunk-5ewcj9vd.js +2 -0
  29. package/dist/chunk-5fm9mfqs.js +2 -0
  30. package/dist/chunk-5jhkn5by.js +2 -0
  31. package/dist/chunk-5m9xts4v.js +2 -0
  32. package/dist/chunk-6sqy7049.js +2 -0
  33. package/dist/chunk-6yazdvb4.js +2 -0
  34. package/dist/chunk-746p83dw.js +2 -0
  35. package/dist/chunk-76g7tr80.js +2 -0
  36. package/dist/chunk-7fz1p8p3.js +10 -0
  37. package/dist/chunk-814adsn3.js +2 -0
  38. package/dist/chunk-831wk0b3.js +2 -0
  39. package/dist/chunk-833tanrb.js +2 -0
  40. package/dist/chunk-8cx90pvv.js +2 -0
  41. package/dist/chunk-8gx9at51.js +1 -0
  42. package/dist/chunk-91pnyybg.js +9 -0
  43. package/dist/chunk-99syj1p0.js +2 -0
  44. package/dist/chunk-9bxh78vd.js +5 -0
  45. package/dist/chunk-9jaqey2q.js +2 -0
  46. package/dist/chunk-9tyaew40.js +2 -0
  47. package/dist/chunk-9zcyq5gh.js +2 -0
  48. package/dist/chunk-a4g1e1n0.js +2 -0
  49. package/dist/chunk-a6g2jk1y.js +2 -0
  50. package/dist/chunk-aaqd43t5.js +2 -0
  51. package/dist/chunk-adswb3gq.js +2 -0
  52. package/dist/chunk-atnw2cq3.js +2 -0
  53. package/dist/chunk-avdharmq.js +2 -0
  54. package/dist/chunk-b13gbfg3.js +2 -0
  55. package/dist/chunk-b3wr7cpk.js +2 -0
  56. package/dist/chunk-bngyck4v.js +2 -0
  57. package/dist/chunk-brb5zthb.js +1 -0
  58. package/dist/chunk-bx2vf8g7.js +5 -0
  59. package/dist/chunk-c343n0yt.js +2 -0
  60. package/dist/chunk-cdwpqzrw.js +2 -0
  61. package/dist/chunk-cm7bwdk9.js +2 -0
  62. package/dist/chunk-cs5k02gt.js +1 -0
  63. package/dist/chunk-cv8f2v27.js +2 -0
  64. package/dist/chunk-d2dbhn2h.js +2 -0
  65. package/dist/chunk-d3awsfqm.js +9 -0
  66. package/dist/chunk-d9q17hb8.js +2 -0
  67. package/dist/chunk-dw62d69f.js +2 -0
  68. package/dist/chunk-e8p8v7ca.js +978 -0
  69. package/dist/chunk-ehhrhkwe.js +9 -0
  70. package/dist/chunk-enhf12a1.js +2 -0
  71. package/dist/chunk-f0ksrase.js +8 -0
  72. package/dist/chunk-f2d9w3nr.js +2 -0
  73. package/dist/chunk-f3y73e4b.js +6 -0
  74. package/dist/chunk-fe3xb8z9.js +2 -0
  75. package/dist/chunk-fg5gh4dn.js +2 -0
  76. package/dist/chunk-fh4rw8kr.js +5 -0
  77. package/dist/chunk-fxsv4p5c.js +8 -0
  78. package/dist/chunk-gg80s18j.js +2 -0
  79. package/dist/chunk-h5saw32v.js +2 -0
  80. package/dist/chunk-ha75r57f.js +8 -0
  81. package/dist/chunk-hgrs6wcy.js +2 -0
  82. package/dist/chunk-hrsat16n.js +8 -0
  83. package/dist/chunk-hxy5t7tm.js +10 -0
  84. package/dist/chunk-hzfqtj82.js +2 -0
  85. package/dist/chunk-j2n86dsz.js +2 -0
  86. package/dist/chunk-jg68fsnk.js +10 -0
  87. package/dist/chunk-jhvjhf1j.js +2 -0
  88. package/dist/chunk-jr4naxsv.js +2 -0
  89. package/dist/chunk-jtax0mpm.js +2 -0
  90. package/dist/chunk-k59kbbvm.js +2 -0
  91. package/dist/chunk-kanz993c.js +2 -0
  92. package/dist/chunk-kg9abatp.js +2 -0
  93. package/dist/chunk-kvghsjg7.js +5 -0
  94. package/dist/chunk-ky8p46ae.js +5 -0
  95. package/dist/chunk-kzm498bh.js +2 -0
  96. package/dist/chunk-m4gwjnfh.js +6 -0
  97. package/dist/chunk-msv6dcc2.js +2 -0
  98. package/dist/chunk-mxdajhb4.js +10 -0
  99. package/dist/chunk-mxzjn2gs.js +978 -0
  100. package/dist/chunk-n1bqkqk7.js +10 -0
  101. package/dist/chunk-njtyervf.js +1 -0
  102. package/dist/chunk-nx1598yr.js +2 -0
  103. package/dist/chunk-p18kqenr.js +1 -0
  104. package/dist/chunk-p23aswbf.js +2 -0
  105. package/dist/chunk-p55ntqj0.js +2 -0
  106. package/dist/chunk-p5va3trj.js +2 -0
  107. package/dist/chunk-p88bsqtc.js +10 -0
  108. package/dist/chunk-p9z7f8c8.js +2 -0
  109. package/dist/chunk-ppkzf21q.js +8 -0
  110. package/dist/chunk-prqq5zw2.js +2 -0
  111. package/dist/chunk-pv6hp18q.js +10 -0
  112. package/dist/chunk-q9ycfthp.js +2 -0
  113. package/dist/chunk-qhcx6dmf.js +2 -0
  114. package/dist/chunk-qma4ysd8.js +9 -0
  115. package/dist/chunk-qqp394c2.js +2 -0
  116. package/dist/chunk-ra5sfgg4.js +2 -0
  117. package/dist/chunk-rfd43z7p.js +5 -0
  118. package/dist/chunk-s2n3hw0a.js +2 -0
  119. package/dist/chunk-sm7vvfqf.js +2 -0
  120. package/dist/chunk-sqbdav33.js +2 -0
  121. package/dist/chunk-sy4d4hnx.js +2 -0
  122. package/dist/chunk-t0b356bb.js +978 -0
  123. package/dist/chunk-t9wdnzz4.js +6 -0
  124. package/dist/chunk-v25g7h01.js +2 -0
  125. package/dist/chunk-v7zy7xda.js +1 -0
  126. package/dist/chunk-vg4vfkzk.js +6 -0
  127. package/dist/chunk-vgcre8jy.js +2 -0
  128. package/dist/chunk-vqyngnj0.js +9 -0
  129. package/dist/chunk-w17d2rbd.js +6 -0
  130. package/dist/chunk-x22v9kvb.js +2 -0
  131. package/dist/chunk-xacjs4ar.js +6 -0
  132. package/dist/chunk-xmdbxa8w.js +1 -0
  133. package/dist/chunk-xy6hjazn.js +978 -0
  134. package/dist/chunk-y0m35t3m.js +2 -0
  135. package/dist/chunk-y1tre8v8.js +8 -0
  136. package/dist/chunk-y50mc7dt.js +2 -0
  137. package/dist/chunk-y93ke5m6.js +2 -0
  138. package/dist/chunk-yktee4wv.js +1 -0
  139. package/dist/chunk-yvmyw2r2.js +2 -0
  140. package/dist/chunk-z1h35hsa.js +2 -0
  141. package/dist/chunk-z6xydw90.js +2 -0
  142. package/dist/chunk-zak32nab.js +2 -0
  143. package/dist/clean.d.ts +3 -0
  144. package/dist/cli.d.ts +4 -1
  145. package/dist/cli.js +1 -4
  146. package/dist/cloud.d.ts +3 -0
  147. package/dist/commit.d.ts +3 -0
  148. package/dist/configure.d.ts +4 -0
  149. package/dist/create.d.ts +8 -0
  150. package/dist/custom-cli.d.ts +1 -1
  151. package/dist/deploy.d.ts +7 -0
  152. package/dist/{commands/dev.d.ts → dev.d.ts} +3 -1
  153. package/dist/dns.d.ts +18 -0
  154. package/dist/domains.d.ts +3 -0
  155. package/dist/fresh.d.ts +3 -0
  156. package/dist/generate.d.ts +3 -0
  157. package/dist/http.d.ts +6 -0
  158. package/dist/index.d.ts +1 -1
  159. package/dist/index.js +1 -4
  160. package/dist/install.d.ts +3 -0
  161. package/dist/key.d.ts +3 -0
  162. package/dist/lint.d.ts +3 -0
  163. package/dist/list.d.ts +3 -0
  164. package/dist/make.d.ts +1 -0
  165. package/dist/migrate.d.ts +3 -0
  166. package/dist/outdated.d.ts +3 -0
  167. package/dist/ports.d.ts +7 -0
  168. package/dist/prepublish.d.ts +3 -0
  169. package/dist/projects.d.ts +3 -0
  170. package/dist/release.d.ts +9 -0
  171. package/dist/route.d.ts +3 -0
  172. package/dist/saas.d.ts +3 -0
  173. package/dist/seed.d.ts +3 -0
  174. package/dist/setup.d.ts +8 -0
  175. package/dist/stacks +0 -0
  176. package/dist/test.d.ts +3 -0
  177. package/dist/tinker.d.ts +3 -0
  178. package/dist/types.d.ts +3 -0
  179. package/dist/upgrade.d.ts +4 -0
  180. package/dist/version.d.ts +3 -0
  181. package/package.json +48 -49
  182. package/dist/chunk-3cfvbq6w.js +0 -5
  183. package/dist/chunk-3cfvbq6w.js.map +0 -32
  184. package/dist/chunk-3v3h2zkp.js +0 -5
  185. package/dist/chunk-3v3h2zkp.js.map +0 -46
  186. package/dist/chunk-3zx3yk1m.js.map +0 -15
  187. package/dist/chunk-8a487snn.js +0 -5
  188. package/dist/chunk-8a487snn.js.map +0 -9
  189. package/dist/chunk-9kkf5maz.js +0 -5
  190. package/dist/chunk-9kkf5maz.js.map +0 -23
  191. package/dist/chunk-9qba8jdt.js +0 -12
  192. package/dist/chunk-9qba8jdt.js.map +0 -11
  193. package/dist/chunk-cvpb67bs.js +0 -5
  194. package/dist/chunk-cvpb67bs.js.map +0 -10
  195. package/dist/chunk-eqwfdbyk.js +0 -5
  196. package/dist/chunk-eqwfdbyk.js.map +0 -17
  197. package/dist/chunk-f41k7dpa.js +0 -5
  198. package/dist/chunk-f41k7dpa.js.map +0 -11
  199. package/dist/chunk-fx1zxxxa.js +0 -9
  200. package/dist/chunk-fx1zxxxa.js.map +0 -13
  201. package/dist/chunk-get5gzkc.js +0 -11
  202. package/dist/chunk-get5gzkc.js.map +0 -10
  203. package/dist/chunk-m43npkjw.js +0 -5
  204. package/dist/chunk-m43npkjw.js.map +0 -12
  205. package/dist/chunk-mrrgcavv.js +0 -831
  206. package/dist/chunk-mrrgcavv.js.map +0 -240
  207. package/dist/chunk-n5y0mrsg.js +0 -15
  208. package/dist/chunk-n5y0mrsg.js.map +0 -173
  209. package/dist/chunk-qebxvzqz.js +0 -5
  210. package/dist/chunk-qebxvzqz.js.map +0 -26
  211. package/dist/chunk-qj2v5psd.js +0 -5
  212. package/dist/chunk-qj2v5psd.js.map +0 -20
  213. package/dist/chunk-rh4brnzh.js +0 -5
  214. package/dist/chunk-rh4brnzh.js.map +0 -16
  215. package/dist/chunk-w2vwjv6k.js +0 -6
  216. package/dist/chunk-w2vwjv6k.js.map +0 -57
  217. package/dist/chunk-w81rbh65.js +0 -5
  218. package/dist/chunk-w81rbh65.js.map +0 -10
  219. package/dist/chunk-wayp5kn2.js +0 -5
  220. package/dist/chunk-wayp5kn2.js.map +0 -22
  221. package/dist/chunk-x5c5ngpb.js +0 -4
  222. package/dist/chunk-x5c5ngpb.js.map +0 -23
  223. package/dist/cli.js.map +0 -10
  224. package/dist/commands/add.d.ts +0 -2
  225. package/dist/commands/build.d.ts +0 -2
  226. package/dist/commands/changelog.d.ts +0 -2
  227. package/dist/commands/clean.d.ts +0 -2
  228. package/dist/commands/cloud.d.ts +0 -2
  229. package/dist/commands/commit.d.ts +0 -2
  230. package/dist/commands/configure.d.ts +0 -2
  231. package/dist/commands/create.d.ts +0 -2
  232. package/dist/commands/deploy.d.ts +0 -2
  233. package/dist/commands/dns.d.ts +0 -2
  234. package/dist/commands/domains.d.ts +0 -2
  235. package/dist/commands/fresh.d.ts +0 -2
  236. package/dist/commands/generate.d.ts +0 -2
  237. package/dist/commands/http.d.ts +0 -2
  238. package/dist/commands/index.d.ts +0 -33
  239. package/dist/commands/install.d.ts +0 -2
  240. package/dist/commands/key.d.ts +0 -2
  241. package/dist/commands/lint.d.ts +0 -2
  242. package/dist/commands/list.d.ts +0 -2
  243. package/dist/commands/make.d.ts +0 -2
  244. package/dist/commands/migrate.d.ts +0 -2
  245. package/dist/commands/outdated.d.ts +0 -2
  246. package/dist/commands/ports.d.ts +0 -2
  247. package/dist/commands/prepublish.d.ts +0 -2
  248. package/dist/commands/projects.d.ts +0 -2
  249. package/dist/commands/release.d.ts +0 -2
  250. package/dist/commands/route.d.ts +0 -2
  251. package/dist/commands/seed.d.ts +0 -2
  252. package/dist/commands/setup.d.ts +0 -4
  253. package/dist/commands/test.d.ts +0 -2
  254. package/dist/commands/tinker.d.ts +0 -2
  255. package/dist/commands/types.d.ts +0 -2
  256. package/dist/commands/upgrade.d.ts +0 -2
  257. package/dist/commands/version.d.ts +0 -2
  258. package/dist/index.js.map +0 -9
  259. package/src/cli.ts +0 -105
  260. package/src/commands/add.ts +0 -71
  261. package/src/commands/build.ts +0 -299
  262. package/src/commands/changelog.ts +0 -52
  263. package/src/commands/clean.ts +0 -46
  264. package/src/commands/cloud.ts +0 -553
  265. package/src/commands/commit.ts +0 -26
  266. package/src/commands/configure.ts +0 -84
  267. package/src/commands/create.ts +0 -143
  268. package/src/commands/deploy.ts +0 -194
  269. package/src/commands/dev.ts +0 -292
  270. package/src/commands/dns.ts +0 -86
  271. package/src/commands/domains.ts +0 -255
  272. package/src/commands/fresh.ts +0 -48
  273. package/src/commands/generate.ts +0 -202
  274. package/src/commands/http.ts +0 -57
  275. package/src/commands/index.ts +0 -33
  276. package/src/commands/install.ts +0 -30
  277. package/src/commands/key.ts +0 -36
  278. package/src/commands/lint.ts +0 -54
  279. package/src/commands/list.ts +0 -42
  280. package/src/commands/make.ts +0 -352
  281. package/src/commands/migrate.ts +0 -105
  282. package/src/commands/outdated.ts +0 -31
  283. package/src/commands/ports.ts +0 -188
  284. package/src/commands/prepublish.ts +0 -28
  285. package/src/commands/projects.ts +0 -54
  286. package/src/commands/release.ts +0 -47
  287. package/src/commands/route.ts +0 -39
  288. package/src/commands/seed.ts +0 -47
  289. package/src/commands/setup.ts +0 -145
  290. package/src/commands/test.ts +0 -214
  291. package/src/commands/tinker.ts +0 -42
  292. package/src/commands/types.ts +0 -35
  293. package/src/commands/upgrade.ts +0 -200
  294. package/src/commands/version.ts +0 -29
  295. package/src/custom-cli.ts +0 -35
  296. package/src/index.ts +0 -1
@@ -1,86 +0,0 @@
1
- import type { CLI } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { log, runCommand } from '@stacksjs/cli'
4
- import { config } from '@stacksjs/config'
5
- import { ExitCode } from '@stacksjs/types'
6
-
7
- // import { Action } from '@stacksjs/enums'
8
- // import { runAction } from '@stacksjs/actions'
9
-
10
- interface DnsOptions {
11
- query?: string
12
- type?: string
13
- nameserver?: string
14
- class?: string
15
- udp?: boolean
16
- tcp?: boolean
17
- tls?: boolean
18
- https?: boolean
19
- short?: boolean
20
- json?: boolean
21
- pretty?: boolean
22
- p?: boolean // short for pretty
23
- verbose?: boolean
24
- }
25
-
26
- export function dns(buddy: CLI): void {
27
- const descriptions = {
28
- dns: 'Lists the DNS records for a domain',
29
- query: 'Host name or IP address to query',
30
- type: 'Type of the DNS record being queried (A, MX, NS…)',
31
- nameserver: 'Address of the nameserver to send packets to',
32
- class: 'Network class of the DNS record being queried (IN, CH, HS)',
33
- udp: 'Use the DNS protocol over UDP',
34
- tcp: 'Use the DNS protocol over TCP',
35
- tls: 'Use the DNS-over-TLS protocol',
36
- https: 'Use the DNS-over-HTTPS protocol',
37
- short: 'Short mode: display nothing but the first result',
38
- json: 'Display the output as JSON',
39
- pretty: 'Display the output as JSON in a pretty format',
40
- project: 'Target a specific project',
41
- verbose: 'Enable verbose output',
42
- }
43
-
44
- buddy
45
- .command('dns [domain]', descriptions.dns)
46
- .option('-q, --query <query>', descriptions.query)
47
- .option('-t, --type <type>', descriptions.type, { default: 'ANY' })
48
- .option('-n, --nameserver <nameserver>', descriptions.nameserver)
49
- .option('--class <class>', descriptions.nameserver)
50
- // transport options
51
- .option('-U, --udp', descriptions.udp)
52
- .option('-T, --tcp', descriptions.tcp)
53
- .option('-S, --tls', descriptions.tls)
54
- .option('-H, --https', descriptions.https)
55
- // output options
56
- .option('-1, --short', descriptions.short, { default: false })
57
- .option('-J, --json', descriptions.json, { default: false })
58
- .option('-p, --pretty', descriptions.pretty, { default: true })
59
- .option('-p, --project [project]', descriptions.project, { default: false })
60
- .option('--verbose', descriptions.verbose, { default: false })
61
- .action(async (domain: string | undefined, options: DnsOptions) => {
62
- log.debug('Running `buddy dns [domain]` ...', options)
63
- // let prettyOutput = false
64
-
65
- // if (options.json && options.pretty)
66
- // prettyOutput = true
67
-
68
- options.pretty = undefined
69
- options.p = undefined
70
-
71
- // Convert options object to command-line options string
72
- const optionsString = Object.entries(options)
73
- .filter(([key, value]) => key !== '--' && key.length > 1 && value !== false) // filter out '--' key and short options
74
- .map(([key, value]) => `--${key} ${value}`)
75
- .join(' ')
76
-
77
- await runCommand(`dog ${domain || config.app.url} ${optionsString}`)
78
-
79
- process.exit(ExitCode.Success)
80
- })
81
-
82
- buddy.on('dns:*', () => {
83
- console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
84
- process.exit(1)
85
- })
86
- }
@@ -1,255 +0,0 @@
1
- import type { CLI, DomainsOptions } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { runAction } from '@stacksjs/actions'
4
- import { bgCyan, bold, intro, italic, log, outro, prompts } from '@stacksjs/cli'
5
- import { config } from '@stacksjs/config'
6
- import { addDomain } from '@stacksjs/dns'
7
- import { Action } from '@stacksjs/enums'
8
- import { ExitCode } from '@stacksjs/types'
9
-
10
- export function domains(buddy: CLI): void {
11
- const descriptions = {
12
- purchase: 'Purchase a domain',
13
- add: 'Add a domain to your cloud', // given you already own it with a different registrar
14
- remove: 'Remove a domain from your cloud',
15
- skip: 'Skip the confirmation prompt',
16
- project: 'Target a specific project',
17
- verbose: 'Enable verbose output',
18
- }
19
-
20
- const c = config.dns.contactInfo
21
-
22
- buddy
23
- .command('domains:purchase <domain>', descriptions.purchase)
24
- .option('--years <years>', 'Number of years to purchase the domain for', {
25
- default: 1,
26
- })
27
- .option('--privacy', 'Enable privacy protection', { default: true })
28
- .option('--auto-renew', 'Enable auto-renew', { default: true })
29
- .option('--first-name <firstName>', 'Registrant first name', {
30
- default: c?.firstName,
31
- })
32
- .option('--last-name <lastName>', 'Registrant last name', {
33
- default: c?.lastName,
34
- })
35
- .option('--organization <organization>', 'Registrant organization name', {
36
- default: c?.organizationName,
37
- })
38
- .option('--address-line1 <address>', 'Registrant address line 1', {
39
- default: c?.addressLine1,
40
- })
41
- .option('--address-line2 <address>', 'Registrant address line 2', {
42
- default: c?.addressLine2,
43
- })
44
- .option('--city <city>', 'Registrant city', { default: c?.city })
45
- .option('--state <state>', 'Registrant state', { default: c?.state })
46
- .option('--country <country>', 'Registrant country code', {
47
- default: c?.countryCode,
48
- })
49
- .option('--zip <zip>', 'Registrant zip', { default: c?.zip })
50
- .option('--phone <phone>', 'Registrant phone', { default: c?.phoneNumber })
51
- .option('--email <email>', 'Registrant email', { default: c?.email })
52
- .option('--admin-first-name <firstName>', 'Admin first name', {
53
- default: c?.admin?.firstName || c?.firstName,
54
- })
55
- .option('--admin-last-name <lastName>', 'Admin last name', {
56
- default: c?.admin?.lastName || c?.lastName,
57
- })
58
- .option('--admin-organization <organization>', 'Admin organization', {
59
- default: c?.admin?.organizationName || c?.organizationName,
60
- })
61
- .option('--admin-address-line1 <address>', 'Admin address line 1', {
62
- default: c?.admin?.addressLine1 || c?.addressLine1,
63
- })
64
- .option('--admin-address-line2 <address>', 'Admin address line 2', {
65
- default: c?.admin?.addressLine2 || c?.addressLine2,
66
- })
67
- .option('--admin-city <city>', 'Admin city', {
68
- default: c?.admin?.city || c?.city,
69
- })
70
- .option('--admin-state <state>', 'Admin state', {
71
- default: c?.admin?.state || c?.state,
72
- })
73
- .option('--admin-country <country>', 'Admin country code', {
74
- default: c?.admin?.countryCode || c?.countryCode,
75
- })
76
- .option('--admin-zip <zip>', 'Admin zip', {
77
- default: c?.admin?.zip || c?.zip,
78
- })
79
- .option('--admin-phone <phone>', 'Admin phone number', {
80
- default: c?.admin?.phoneNumber || c?.phoneNumber,
81
- })
82
- .option('--admin-email <email>', 'Admin email', {
83
- default: c?.admin?.email || c?.email,
84
- })
85
- .option('--tech-first-name <firstName>', 'Tech first name', {
86
- default: c?.tech?.firstName || c?.firstName,
87
- })
88
- .option('--tech-last-name <lastName>', 'Tech last name', {
89
- default: c?.tech?.lastName || c?.lastName,
90
- })
91
- .option('--tech-organization <organization>', 'Tech organization name', {
92
- default: c?.tech?.organizationName || c?.organizationName,
93
- })
94
- .option('--tech-address-line1 <address>', 'Tech address line 1', {
95
- default: c?.tech?.addressLine1 || c?.addressLine1,
96
- })
97
- .option('--tech-address-line2 <address>', 'Tech address line 2', {
98
- default: c?.tech?.addressLine2 || c?.addressLine2,
99
- })
100
- .option('--tech-city <city>', 'Tech city', {
101
- default: c?.tech?.city || c?.city,
102
- })
103
- .option('--tech-state <state>', 'Tech state', {
104
- default: c?.tech?.state || c?.state,
105
- })
106
- .option('--tech-country <country>', 'Tech country', {
107
- default: c?.tech?.countryCode || c?.countryCode,
108
- })
109
- .option('--tech-zip <zip>', 'Tech zip', { default: c?.tech?.zip || c?.zip })
110
- .option('--tech-phone <phone>', 'Tech phone', {
111
- default: c?.tech?.phoneNumber || c?.phoneNumber,
112
- })
113
- .option('--tech-email <email>', 'Tech email', {
114
- default: c?.tech?.email || c?.email,
115
- })
116
- .option('--privacy-admin', 'Enable privacy protection for admin', {
117
- default: c?.privacyAdmin || c?.privacy || true,
118
- })
119
- .option('--privacy-tech', 'Enable privacy protection for tech', {
120
- default: c?.privacyTech || c?.privacy || true,
121
- })
122
- .option('--privacy-registrant', 'Enable privacy protection for registrant', {
123
- default: c?.privacyRegistrant || c?.privacy || true,
124
- })
125
- .option('--contact-type <type>', 'Contact type', { default: 'person' })
126
- .option('-p, --project [project]', descriptions.project, { default: false })
127
- .option('--verbose', descriptions.verbose, { default: false })
128
- .action(async (domain: string, options: DomainsOptions) => {
129
- log.debug('Running `buddy domains:purchase <domain>` ...', options)
130
-
131
- options.domain = domain
132
- const startTime = await intro('buddy domains:purchase')
133
- const result = await runAction(Action.DomainsPurchase, options)
134
-
135
- if (result.isErr()) {
136
- await outro(
137
- 'While running the domains:purchase command, there was an issue',
138
- { startTime, useSeconds: true },
139
- result.error,
140
- )
141
- process.exit(ExitCode.FatalError)
142
- }
143
-
144
- const { confirm } = await prompts({
145
- name: 'confirm',
146
- type: 'confirm',
147
- message: `Would you like to set ${domain} as your APP_URL?`,
148
- })
149
-
150
- if (!confirm) {
151
- await outro(`Alrighty! ${italic(domain)} was added to your account.`, {
152
- startTime,
153
- useSeconds: true,
154
- type: 'success',
155
- })
156
- log.info(
157
- `Please note, you may need to validate your email address. Check your ${italic(
158
- options.registrantEmail as string,
159
- )} inbox.`,
160
- )
161
- process.exit(ExitCode.Success)
162
- }
163
-
164
- // set .env APP_URL to domain
165
- const { writeEnv } = await import('@stacksjs/env')
166
- writeEnv('APP_URL', domain)
167
-
168
- let message = `Great! ${italic(domain)} was added to your account.`
169
- message += `\n\nAnd your APP_URL has been set to ${italic(domain)}.
170
- \nPlease note, this change has not been deployed yet.
171
- \nThe next time you run ${bgCyan(italic(bold(' buddy deploy ')))}, your app will deploy to ${italic(domain)}.
172
- \n${italic(
173
- 'You may need to deploy 2-3 times for the changes to take effect. Issue tracked here: https://github.com/stacksjs/stacks/issues/685',
174
- )}`
175
-
176
- await outro(message, { startTime, useSeconds: true, type: 'info' })
177
- process.exit(ExitCode.Success)
178
- })
179
-
180
- buddy
181
- .command('domains:add <domain>', descriptions.add)
182
- .option('--verbose', descriptions.verbose, { default: false })
183
- .action(async (options: DomainsOptions) => {
184
- log.debug('Running `buddy domains:add <domain>` ...', options)
185
-
186
- const startTime = await intro('buddy domains:add')
187
- const result = await addDomain({
188
- ...options,
189
- startTime,
190
- })
191
-
192
- if (result.isErr()) {
193
- await outro(
194
- 'While running the `buddy deploy`, there was an issue',
195
- { startTime, useSeconds: true },
196
- result.error,
197
- )
198
- process.exit(ExitCode.FatalError)
199
- }
200
-
201
- await outro('Added your domain.', { startTime, useSeconds: true })
202
- process.exit(ExitCode.Success)
203
- })
204
-
205
- buddy
206
- .command('domains:remove <domain>', descriptions.remove)
207
- .option('--yes', descriptions.skip, { default: false })
208
- .option('--verbose', descriptions.verbose, { default: false })
209
- .action(async (options: DomainsOptions) => {
210
- log.debug('Running `buddy domains:remove <domain>` ...', options)
211
-
212
- const domain = options.domain || config.app.url
213
- const opts = { ...options, domain }
214
- const startTime = await intro('buddy domains:remove')
215
-
216
- if (!opts.yes) {
217
- const { confirm } = await prompts({
218
- name: 'confirm',
219
- type: 'confirm',
220
- message: `Are you sure you want to remove ${domain}?`,
221
- })
222
-
223
- if (!confirm) {
224
- await outro('Cancelled the domains:remove command', {
225
- startTime,
226
- useSeconds: true,
227
- type: 'info',
228
- })
229
- process.exit(ExitCode.Success)
230
- }
231
- }
232
-
233
- const result = await runAction(Action.DomainsRemove, opts)
234
-
235
- if (result.isErr()) {
236
- await outro(
237
- 'While running the domains:remove command, there was an issue',
238
- { startTime, useSeconds: true },
239
- result.error,
240
- )
241
- process.exit(ExitCode.FatalError)
242
- }
243
-
244
- await outro('Removed your domain DNS records.', {
245
- startTime,
246
- useSeconds: true,
247
- })
248
- process.exit(ExitCode.Success)
249
- })
250
-
251
- buddy.on('domains:*', () => {
252
- console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
253
- process.exit(1)
254
- })
255
- }
@@ -1,48 +0,0 @@
1
- import type { CLI, FreshOptions } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { runAction } from '@stacksjs/actions'
4
- import { intro, log, outro } from '@stacksjs/cli'
5
- import { Action } from '@stacksjs/enums'
6
- import { ExitCode } from '@stacksjs/types'
7
-
8
- export function fresh(buddy: CLI): void {
9
- const descriptions = {
10
- fresh: 'Re-installs your npm dependencies',
11
- project: 'Target a specific project',
12
- verbose: 'Enable verbose output',
13
- }
14
-
15
- buddy
16
- .command('fresh', descriptions.fresh)
17
- .option('-p, --project [project]', descriptions.project, { default: false })
18
- .option('--verbose', descriptions.verbose, { default: false })
19
- .action(async (options: FreshOptions) => {
20
- log.debug('Running `buddy fresh` ...', options)
21
-
22
- const perf = await intro('buddy fresh')
23
- const result = await runAction(Action.Fresh, {
24
- ...options,
25
- stdout: 'inherit',
26
- })
27
-
28
- if (result.isErr()) {
29
- await outro(
30
- 'While running `buddy fresh`, there was an issue',
31
- { startTime: perf, useSeconds: true },
32
- result.error,
33
- )
34
- process.exit(ExitCode.FatalError)
35
- }
36
-
37
- await outro('Freshly reinstalled your dependencies', {
38
- startTime: perf,
39
- useSeconds: true,
40
- })
41
- process.exit(ExitCode.Success)
42
- })
43
-
44
- buddy.on('fresh:*', () => {
45
- console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
46
- process.exit(1)
47
- })
48
- }
@@ -1,202 +0,0 @@
1
- import process from 'node:process'
2
- import {
3
- generateComponentMeta,
4
- generateCoreSymlink,
5
- generateIdeHelpers,
6
- generateLibEntries,
7
- generateOpenApiSpec,
8
- generatePkgxConfig,
9
- generateTypes,
10
- generateVsCodeCustomData,
11
- generateWebTypes,
12
- invoke as startGenerationProcess,
13
- } from '@stacksjs/actions'
14
- import { intro, log, outro } from '@stacksjs/cli'
15
- import { generateModelFiles } from '@stacksjs/orm'
16
- import { type CLI, ExitCode, type GeneratorOptions } from '@stacksjs/types'
17
-
18
- export function generate(buddy: CLI): void {
19
- const descriptions = {
20
- command:
21
- 'Automagically build any of your libraries/packages for production use. Select any of the following packages',
22
- types: 'Generate your TypeScript types',
23
- entries: 'Generate your function & Component Library Entry Points',
24
- webTypes: 'Generate web-types.json for IDEs',
25
- customData: 'Generate VS Code custom data (custom-elements.json) for IDEs',
26
- ideHelpers: 'Generate IDE helpers',
27
- componentMeta: 'Generate component meta information',
28
- coreSymlink: 'Generate symlink of the core framework to the project root',
29
- pkgx: 'Generate the pkgx configuration file',
30
- modelFiles: 'Generate the model files',
31
- openApi: 'Generate the OpenAPI specification',
32
- select: 'What are you trying to generate?',
33
- project: 'Target a specific project',
34
- verbose: 'Enable verbose output',
35
- }
36
-
37
- buddy
38
- .command('generate', descriptions.command)
39
- .option('-t, --types', descriptions.types)
40
- .option('-e, --entries', descriptions.entries)
41
- .option('-w, --web-types', descriptions.webTypes)
42
- .option('-c, --custom-data', descriptions.customData)
43
- .option('-i, --ide-helpers', descriptions.ideHelpers)
44
- .option('-c, --component-meta', descriptions.componentMeta)
45
- .option('-p, --pkgx', descriptions.pkgx)
46
- .option('-m, --model-files', descriptions.modelFiles)
47
- .option('-o, --openapi', descriptions.openApi)
48
- .option('-p, --project [project]', descriptions.project, { default: false })
49
- .option('--core-symlink', descriptions.coreSymlink)
50
- .option('--verbose', descriptions.verbose, { default: false })
51
- .action(async (options: GeneratorOptions) => {
52
- log.debug('Running `buddy generate` ...', options)
53
-
54
- // TODO: uncomment this
55
- // if (hasNoOptions(options)) {
56
- // let answers = await prompt.require()
57
- // .multiselect(descriptions.select, {
58
- // options: [
59
- // { label: '1.) TypeScript Types', value: 'types' },
60
- // { label: '2.) Library Entry Points', value: 'entries' },
61
- // { label: '3.) Web Types', value: 'web-types' },
62
- // { label: '4.) VS Code Custom Data', value: 'custom-data' },
63
- // { label: '5.) IDE Helpers', value: 'ide-helpers' },
64
- // { label: '6.) Component Meta', value: 'component-meta' },
65
- // ],
66
- // })
67
- //
68
- // if (isString(answers))
69
- // answers = [answers]
70
- //
71
- // // creates an object out of array and sets answers to true
72
- // options = (answers as Array<any>).reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
73
- // }
74
-
75
- await startGenerationProcess(options)
76
-
77
- process.exit(ExitCode.Success)
78
- })
79
-
80
- buddy
81
- .command('generate:types', descriptions.types)
82
- .option('-p, --project [project]', descriptions.project, { default: false })
83
- .option('--verbose', descriptions.verbose, { default: false })
84
- .alias('types:generate')
85
- .action(async (options: GeneratorOptions) => {
86
- log.debug('Running `buddy generate:types` ...', options)
87
- await generateTypes(options)
88
- })
89
-
90
- buddy
91
- .command('generate:entries', descriptions.entries)
92
- .option('-p, --project [project]', descriptions.project, { default: false })
93
- .option('--verbose', descriptions.verbose, { default: false })
94
- .action(async (options: GeneratorOptions) => {
95
- log.debug('Running `buddy generate:entries` ...', options)
96
- await generateLibEntries(options)
97
- })
98
-
99
- buddy
100
- .command('generate:web-types', descriptions.webTypes)
101
- .option('-p, --project [project]', descriptions.project, { default: false })
102
- .option('--verbose', descriptions.verbose, { default: false })
103
- .action(async (options: GeneratorOptions) => {
104
- log.debug('Running `buddy generate:web-types` ...', options)
105
- await generateWebTypes(options)
106
- })
107
-
108
- buddy
109
- .command('generate:vscode-custom-data', descriptions.customData)
110
- .option('-p, --project [project]', descriptions.project, { default: false })
111
- .option('--verbose', descriptions.verbose, { default: false })
112
- .action(async (options: GeneratorOptions) => {
113
- log.debug('Running `buddy generate:vscode-custom-data` ...', options)
114
- await generateVsCodeCustomData(options)
115
- })
116
-
117
- buddy
118
- .command('generate:ide-helpers', descriptions.ideHelpers)
119
- .option('-p, --project [project]', descriptions.project, { default: false })
120
- .option('--verbose', descriptions.verbose, { default: false })
121
- .action(async (options: GeneratorOptions) => {
122
- log.debug('Running `buddy generate:ide-helpers` ...', options)
123
- await generateIdeHelpers(options)
124
- })
125
-
126
- buddy
127
- .command('generate:component-meta', descriptions.componentMeta)
128
- .option('-p, --project [project]', descriptions.project, { default: false })
129
- .option('--verbose', descriptions.verbose, { default: false })
130
- .action(async (options: GeneratorOptions) => {
131
- log.debug('Running `buddy generate:component-meta` ...', options)
132
- await generateComponentMeta(options)
133
- })
134
-
135
- buddy
136
- .command('generate:pkgx-config', descriptions.pkgx)
137
- .option('-p, --project [project]', descriptions.project, { default: false })
138
- .option('--verbose', descriptions.verbose, { default: false })
139
- .action((options: GeneratorOptions) => {
140
- log.debug('Running `buddy generate:pkgx-config` ...', options)
141
- generatePkgxConfig()
142
- })
143
-
144
- buddy
145
- .command('generate:model-files', descriptions.modelFiles)
146
- .option('-p, --project [project]', descriptions.project, { default: false })
147
- .option('--verbose', descriptions.verbose, { default: false })
148
- .action(async () => {
149
- const perf = await intro('buddy generate:model-files')
150
-
151
- try {
152
- await generateModelFiles()
153
-
154
- outro('Generated Model files', {
155
- startTime: perf,
156
- useSeconds: true,
157
- })
158
- }
159
- catch (error) {
160
- log.error('There was an error generating your model files', error)
161
- process.exit(ExitCode.FatalError)
162
- }
163
- })
164
-
165
- buddy
166
- .command('generate:openapi-spec', descriptions.openApi)
167
- .alias('generate:openapi')
168
- .option('-p, --project [project]', descriptions.project, { default: false })
169
- .option('--verbose', descriptions.verbose, { default: false })
170
- .action(async (options: GeneratorOptions) => {
171
- log.debug('Running `buddy generate:openapi-spec` ...', options)
172
- const perf = await intro('buddy generate:openapi-spec')
173
-
174
- await generateOpenApiSpec()
175
-
176
- outro('Generated OpenAPI specification', {
177
- startTime: perf,
178
- useSeconds: true,
179
- })
180
- })
181
-
182
- buddy.command('generate:migrations', 'Generate Migrations').action((options: GeneratorOptions) => {
183
- log.debug('Running `buddy generate:migrations` ...', options)
184
- // generateMigrations()
185
- })
186
-
187
- buddy
188
- .command('generate:core-symlink', 'Generate core symlink. A shortcut for core developers.')
189
- .action(async (options: GeneratorOptions) => {
190
- log.debug('Running `buddy core-symlink` ...', options)
191
- await generateCoreSymlink()
192
- })
193
-
194
- buddy.on('generate:*', () => {
195
- console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
196
- process.exit(1)
197
- })
198
- }
199
-
200
- // function hasNoOptions(options: GeneratorOptions) {
201
- // return !options.types && !options.entries && !options.webTypes && !options.customData && !options.ideHelpers && !options.componentMeta
202
- // }
@@ -1,57 +0,0 @@
1
- import type { CLI } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { config } from '@stacksjs/config'
4
- import { ExitCode } from '@stacksjs/types'
5
-
6
- // import { path } from '@stacksjs/path'
7
- import { log, runCommandSync } from '@stacksjs/cli'
8
-
9
- // function runCommand(command: string): Promise<string> {
10
- // return new Promise((resolve, reject) => {
11
- // exec(command, { shell: true, cwd: path.projectPath() }, (error, stdout, stderr) => {
12
- // if (error) {
13
- // console.error(`exec error: ${error}`)
14
- // reject(error)
15
- // } else {
16
- // console.log(error, stdout, stderr)
17
- // resolve(stdout)
18
- // }
19
- // })
20
- // })
21
- // }
22
-
23
- // import { Action } from '@stacksjs/enums'
24
- // import { runAction } from '@stacksjs/actions'
25
-
26
- interface HttpOptions {
27
- verbose?: boolean
28
- }
29
-
30
- export function http(buddy: CLI): void {
31
- const descriptions = {
32
- http: 'Send an HTTP request to a domain',
33
- project: 'Target a specific project',
34
- verbose: 'Enable verbose output',
35
- }
36
-
37
- buddy
38
- .command('http [domain]', descriptions.http)
39
- .option('-p, --project [project]', descriptions.project, { default: false })
40
- // .option('--verbose', descriptions.verbose, { default: false })
41
- .action(async (domain: string | undefined, options: HttpOptions) => {
42
- log.debug('Running `buddy http [domain]` ...', options)
43
-
44
- // Convert options object to command-line options string
45
- const optionsString = Object.entries(options)
46
- .filter(([key, value]) => key !== '--' && key.length > 1 && value !== false) // filter out '--' key and short options
47
- .map(([key, value]) => `--${key} ${value}`)
48
- .join(' ')
49
-
50
- const command = `http GET ${domain || config.app.url} ${optionsString}`
51
-
52
- log.info(`Running command: ${command}`)
53
- await runCommandSync(command)
54
-
55
- process.exit(ExitCode.Success)
56
- })
57
- }
@@ -1,33 +0,0 @@
1
- export * from './build'
2
- export * from './changelog'
3
- export * from './clean'
4
- export * from './cloud'
5
- export * from './commit'
6
- export * from './configure'
7
- export * from './create'
8
- export * from './deploy'
9
- export * from './dev'
10
- export * from './dns'
11
- export * from './domains'
12
- export * from './fresh'
13
- export * from './generate'
14
- export * from './http'
15
- export * from './install'
16
- export * from './key'
17
- export * from './lint'
18
- export * from './list'
19
- export * from './make'
20
- export * from './migrate'
21
- export * from './outdated'
22
- export * from './ports'
23
- export * from './prepublish'
24
- export * from './projects'
25
- export * from './release'
26
- export * from './route'
27
- export * from './seed'
28
- export * from './setup'
29
- export * from './test'
30
- export * from './tinker'
31
- export * from './types'
32
- export * from './upgrade'
33
- export * from './version'