@stacksjs/buddy 0.58.59 → 0.58.61

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.
@@ -63,6 +63,22 @@ function build(buddy) {
63
63
  default:
64
64
  break;
65
65
  }
66
+ if (hasNoOptions(options)) {
67
+ let answers = await log.prompt.require().multiselect(descriptions.select, {
68
+ options: [
69
+ { label: "Components", value: "components" },
70
+ { label: "Web Components", value: "web-components" },
71
+ { label: "Functions", value: "functions" },
72
+ { label: "Views", value: "views" },
73
+ { label: "Documentation", value: "docs" }
74
+ ]
75
+ });
76
+ if (answers !== null)
77
+ process.exit(ExitCode.InvalidArgument);
78
+ if (isString(answers))
79
+ answers = [answers];
80
+ options = answers.reduce((a, v) => ({ ...a, [v]: true }), {});
81
+ }
66
82
  await runAction(Action.BuildStacks, options);
67
83
  process.exit(ExitCode.Success);
68
84
  });
@@ -131,6 +147,9 @@ function build(buddy) {
131
147
  process.exit(1);
132
148
  });
133
149
  }
150
+ var hasNoOptions = function(options) {
151
+ return !options.components && !options.vueComponents && !options.webComponents && !options.elements && !options.functions && !options.views && !options.docs && !options.stacks && !options.buddy;
152
+ };
134
153
 
135
154
  // src/commands/changelog.ts
136
155
  import process2 from "process";
@@ -732,7 +751,7 @@ async function configureDomain(domain, options, startTime) {
732
751
  }
733
752
  async function checkIfAwsIsConfigured() {
734
753
  log8.info("Ensuring AWS is configured...");
735
- const result = await runCommand4("buddy configure:aws --quiet", {
754
+ const result = await runCommand4("buddy configure:aws", {
736
755
  silent: true
737
756
  });
738
757
  if (result.isErr()) {
@@ -804,6 +823,30 @@ function dev(buddy) {
804
823
  default:
805
824
  }
806
825
  if (wantsInteractive(options)) {
826
+ const answer = await log9.prompt.require().select(descriptions.select, {
827
+ options: [
828
+ { value: "all", label: "All" },
829
+ { value: "frontend", label: "Frontend" },
830
+ { value: "api", label: "Backend" },
831
+ { value: "dashboard", label: "Dashboard" },
832
+ { value: "desktop", label: "Desktop" },
833
+ { value: "email", label: "Email" },
834
+ { value: "components", label: "Components" },
835
+ { value: "docs", label: "Documentation" }
836
+ ]
837
+ });
838
+ if (answer === "components") {
839
+ await runComponentsDevServer(options);
840
+ } else if (answer === "api") {
841
+ await runApiDevServer(options);
842
+ } else if (answer === "dashboard") {
843
+ await runDashboardDevServer(options);
844
+ } else if (answer === "docs") {
845
+ await runDocsDevServer(options);
846
+ } else {
847
+ log9.error("Invalid option during interactive mode");
848
+ process10.exit(ExitCode8.InvalidArgument);
849
+ }
807
850
  } else {
808
851
  if (options.components)
809
852
  await runComponentsDevServer(options);
@@ -1807,6 +1850,21 @@ function upgrade(buddy) {
1807
1850
  buddy.command("upgrade", descriptions2.command).option("-c, --framework", descriptions2.framework, { default: false }).option("-d, --dependencies", descriptions2.dependencies, { default: false }).option("-b, --bun", descriptions2.bun, { default: false }).option("-a, --all", descriptions2.all, { default: false }).option("-f, --force", descriptions2.force, { default: false }).option("-p, --project", descriptions2.project, { default: false }).option("--verbose", descriptions2.verbose, { default: false }).alias("update").example("buddy upgrade -a --verbose").action(async (options) => {
1808
1851
  log24.debug("Running `buddy upgrade` ...", options);
1809
1852
  const perf = await intro18("buddy upgrade");
1853
+ if (hasNoOptions2(options)) {
1854
+ let answers = await log24.prompt.require().multiselect(descriptions2.select, {
1855
+ options: [
1856
+ { value: "dependencies", label: "Dependencies" },
1857
+ { value: "framework", label: "Framework" },
1858
+ { value: "node", label: "Node.js" },
1859
+ { value: "package-manager", label: "Package Manager" }
1860
+ ]
1861
+ });
1862
+ if (answers !== null)
1863
+ process29.exit(ExitCode20.InvalidArgument);
1864
+ if (isString(answers))
1865
+ answers = [answers];
1866
+ options = answers.reduce((a, v) => ({ ...a, [v]: true }), {});
1867
+ }
1810
1868
  const result = await runAction17(Action17.Upgrade, options);
1811
1869
  if (result.isErr()) {
1812
1870
  await outro18("While running the buddy:upgrade command, there was an issue", { startTime: perf, useSeconds: true }, result.error);
@@ -1842,6 +1900,9 @@ function upgrade(buddy) {
1842
1900
  process29.exit(1);
1843
1901
  });
1844
1902
  }
1903
+ var hasNoOptions2 = function(options) {
1904
+ return !options.framework && !options.dependencies && !options.packageManager && !options.node && !options.all;
1905
+ };
1845
1906
 
1846
1907
  // src/commands/version.ts
1847
1908
  import process30 from "process";
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ list,
19
19
  release,
20
20
  setup,
21
21
  upgrade
22
- } from "./chunk-7b24d1e3e585766e.js";
22
+ } from "./chunk-6658b07ce4c24cac.js";
23
23
  import {
24
24
  __commonJS,
25
25
  __toESM
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ tinker,
31
31
  types,
32
32
  upgrade,
33
33
  version
34
- } from "./chunk-7b24d1e3e585766e.js";
34
+ } from "./chunk-6658b07ce4c24cac.js";
35
35
  import"./chunk-0455e53fab4244b1.js";
36
36
  import"./chunk-59a9de11428ba763.js";
37
37
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.58.59",
4
+ "version": "0.58.61",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -78,28 +78,28 @@ export function build(buddy: CLI) {
78
78
  }
79
79
 
80
80
  // TODO: uncomment this when prompt is available
81
- // if (hasNoOptions(options)) {
82
- // let answers = await prompt.require
83
- // .multiselect(descriptions.select, {
84
- // options: [
85
- // { label: 'Components', value: 'components' },
86
- // // { label: 'Vue Components', value: 'vue-components' },
87
- // { label: 'Web Components', value: 'web-components' },
88
- // { label: 'Functions', value: 'functions' },
89
- // { label: 'Views', value: 'views' },
90
- // { label: 'Documentation', value: 'docs' },
91
- // ],
92
- // })
93
- //
94
- // if (answers !== null)
95
- // process.exit(ExitCode.InvalidArgument)
96
- //
97
- // if (isString(answers))
98
- // answers = [answers]
99
- //
100
- // // creates an object out of array and sets answers to true
101
- // options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
102
- // }
81
+ if (hasNoOptions(options)) {
82
+ let answers = await log.prompt.require()
83
+ .multiselect(descriptions.select, {
84
+ options: [
85
+ { label: 'Components', value: 'components' },
86
+ // { label: 'Vue Components', value: 'vue-components' },
87
+ { label: 'Web Components', value: 'web-components' },
88
+ { label: 'Functions', value: 'functions' },
89
+ { label: 'Views', value: 'views' },
90
+ { label: 'Documentation', value: 'docs' },
91
+ ],
92
+ })
93
+
94
+ if (answers !== null)
95
+ process.exit(ExitCode.InvalidArgument)
96
+
97
+ if (isString(answers))
98
+ answers = [answers]
99
+
100
+ // creates an object out of array and sets answers to true
101
+ options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
102
+ }
103
103
 
104
104
  await runAction(Action.BuildStacks, options)
105
105
 
@@ -254,6 +254,6 @@ export function build(buddy: CLI) {
254
254
  })
255
255
  }
256
256
 
257
- // function hasNoOptions(options: BuildOptions) {
258
- // return !options.components && !options.vueComponents && !options.webComponents && !options.elements && !options.functions && !options.views && !options.docs && !options.stacks && !options.buddy
259
- // }
257
+ function hasNoOptions(options: BuildOptions) {
258
+ return !options.components && !options.vueComponents && !options.webComponents && !options.elements && !options.functions && !options.views && !options.docs && !options.stacks && !options.buddy
259
+ }
@@ -113,7 +113,7 @@ async function configureDomain(domain: string, options: DeployOptions, startTime
113
113
 
114
114
  async function checkIfAwsIsConfigured() {
115
115
  log.info('Ensuring AWS is configured...')
116
- const result = await runCommand('buddy configure:aws --quiet', {
116
+ const result = await runCommand('buddy configure:aws', {
117
117
  silent: true,
118
118
  })
119
119
 
@@ -91,40 +91,39 @@ export function dev(buddy: CLI) {
91
91
  }
92
92
 
93
93
  if (wantsInteractive(options)) {
94
- // TODO: uncomment this when prompt is available
95
- // const answer = await prompt.require()
96
- // .select(descriptions.select, {
97
- // options: [
98
- // { value: 'all', label: 'All' },
99
- // { value: 'frontend', label: 'Frontend' },
100
- // { value: 'api', label: 'Backend' },
101
- // { value: 'dashboard', label: 'Dashboard' },
102
- // { value: 'desktop', label: 'Desktop' },
103
- // { value: 'email', label: 'Email' },
104
- // { value: 'components', label: 'Components' },
105
- // { value: 'docs', label: 'Documentation' },
106
- // ],
107
- // })
108
- //
109
- // if (answer === 'components') {
110
- // await runComponentsDevServer(options)
111
- // }
112
- // else if (answer === 'api') {
113
- // await runApiDevServer(options)
114
- // }
115
- // else if (answer === 'dashboard') {
116
- // await runDashboardDevServer(options)
117
- // }
118
- // // else if (answer === 'email')
119
- // // await runEmailDevServer(options)
120
- // else if (answer === 'docs') {
121
- // await runDocsDevServer(options)
122
- // }
123
- //
124
- // else {
125
- // log.error('Invalid option during interactive mode')
126
- // process.exit(ExitCode.InvalidArgument)
127
- // }
94
+ const answer = await log.prompt.require()
95
+ .select(descriptions.select, {
96
+ options: [
97
+ { value: 'all', label: 'All' },
98
+ { value: 'frontend', label: 'Frontend' },
99
+ { value: 'api', label: 'Backend' },
100
+ { value: 'dashboard', label: 'Dashboard' },
101
+ { value: 'desktop', label: 'Desktop' },
102
+ { value: 'email', label: 'Email' },
103
+ { value: 'components', label: 'Components' },
104
+ { value: 'docs', label: 'Documentation' },
105
+ ],
106
+ })
107
+
108
+ if (answer === 'components') {
109
+ await runComponentsDevServer(options)
110
+ }
111
+ else if (answer === 'api') {
112
+ await runApiDevServer(options)
113
+ }
114
+ else if (answer === 'dashboard') {
115
+ await runDashboardDevServer(options)
116
+ }
117
+ // else if (answer === 'email')
118
+ // await runEmailDevServer(options)
119
+ else if (answer === 'docs') {
120
+ await runDocsDevServer(options)
121
+ }
122
+
123
+ else {
124
+ log.error('Invalid option during interactive mode')
125
+ process.exit(ExitCode.InvalidArgument)
126
+ }
128
127
  }
129
128
 
130
129
  else {
@@ -34,27 +34,26 @@ export function upgrade(buddy: CLI) {
34
34
 
35
35
  const perf = await intro('buddy upgrade')
36
36
 
37
- // TODO: uncomment this when prompt is available
38
- // if (hasNoOptions(options)) {
39
- // let answers = await prompt.require()
40
- // .multiselect(descriptions.select, {
41
- // options: [
42
- // { value: 'dependencies', label: 'Dependencies' },
43
- // { value: 'framework', label: 'Framework' },
44
- // { value: 'node', label: 'Node.js' },
45
- // { value: 'package-manager', label: 'Package Manager' },
46
- // ],
47
- // })
48
- //
49
- // if (answers !== null)
50
- // process.exit(ExitCode.InvalidArgument)
51
- //
52
- // if (isString(answers))
53
- // answers = [answers]
54
- //
55
- // // creates an object out of array and sets answers to true
56
- // options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
57
- // }
37
+ if (hasNoOptions(options)) {
38
+ let answers = await log.prompt.require()
39
+ .multiselect(descriptions.select, {
40
+ options: [
41
+ { value: 'dependencies', label: 'Dependencies' },
42
+ { value: 'framework', label: 'Framework' },
43
+ { value: 'node', label: 'Node.js' },
44
+ { value: 'package-manager', label: 'Package Manager' },
45
+ ],
46
+ })
47
+
48
+ if (answers !== null)
49
+ process.exit(ExitCode.InvalidArgument)
50
+
51
+ if (isString(answers))
52
+ answers = [answers]
53
+
54
+ // creates an object out of array and sets answers to true
55
+ options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
56
+ }
58
57
 
59
58
  const result = await runAction(Action.Upgrade, options)
60
59
 
@@ -122,6 +121,6 @@ export function upgrade(buddy: CLI) {
122
121
  })
123
122
  }
124
123
 
125
- // function hasNoOptions(options: UpgradeOptions) {
126
- // return !options.framework && !options.dependencies && !options.packageManager && !options.node && !options.all
127
- // }
124
+ function hasNoOptions(options: UpgradeOptions) {
125
+ return !options.framework && !options.dependencies && !options.packageManager && !options.node && !options.all
126
+ }