stacks 0.44.11 → 0.45.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 (121) hide show
  1. package/README.md +4 -3
  2. package/buddy/README.md +4 -3
  3. package/buddy/package.json +7 -6
  4. package/buddy/src/commands/add.ts +12 -12
  5. package/buddy/src/commands/build.ts +55 -31
  6. package/buddy/src/commands/clean.ts +6 -6
  7. package/buddy/src/commands/commit.ts +6 -6
  8. package/buddy/src/commands/create.ts +14 -14
  9. package/buddy/src/commands/dev.ts +15 -15
  10. package/buddy/src/commands/example.ts +11 -11
  11. package/buddy/src/commands/fresh.ts +21 -10
  12. package/buddy/src/commands/generate.ts +20 -20
  13. package/buddy/src/commands/key.ts +2 -2
  14. package/buddy/src/commands/lint.ts +29 -11
  15. package/buddy/src/commands/make.ts +33 -33
  16. package/buddy/src/commands/preinstall.ts +6 -6
  17. package/buddy/src/commands/prepublish.ts +6 -6
  18. package/buddy/src/commands/release.ts +4 -4
  19. package/buddy/src/commands/setup.ts +8 -8
  20. package/buddy/src/commands/test.ts +11 -11
  21. package/buddy/src/commands/types.ts +8 -8
  22. package/buddy/src/commands/update.ts +20 -20
  23. package/buddy/src/index.ts +1 -0
  24. package/core/actions/package.json +2 -2
  25. package/core/actions/src/build-component-libs.ts +15 -0
  26. package/core/actions/src/build-core.ts +7 -0
  27. package/core/actions/src/build-stacks.ts +9 -0
  28. package/core/actions/src/bump.ts +10 -0
  29. package/core/actions/src/fix-lint-issues.ts +4 -0
  30. package/core/actions/src/fresh.ts +6 -26
  31. package/core/actions/src/{generate-package-json.ts → generate-package-jsons.ts} +0 -0
  32. package/core/actions/src/generate.ts +5 -5
  33. package/core/actions/src/helpers/lib-entries.ts +1 -1
  34. package/core/actions/src/helpers/package-json.ts +1 -1
  35. package/core/actions/src/helpers/utils.ts +31 -6
  36. package/core/actions/src/lint-fix.ts +8 -0
  37. package/core/actions/src/lint.ts +6 -30
  38. package/core/actions/src/make.ts +8 -8
  39. package/core/actions/src/release.ts +9 -28
  40. package/core/ai/package.json +1 -1
  41. package/core/alias/package.json +1 -1
  42. package/core/arrays/package.json +1 -1
  43. package/core/auth/package.json +1 -1
  44. package/core/build/node_modules/.bin/vite +2 -2
  45. package/core/build/node_modules/.bin/vite-ssg +2 -2
  46. package/core/build/package.json +3 -3
  47. package/core/cache/package.json +2 -2
  48. package/core/cache/tests/Redis.test.ts +0 -1
  49. package/core/cli/package.json +1 -1
  50. package/core/cli/src/actions/run.ts +24 -11
  51. package/core/cli/src/helpers.ts +6 -6
  52. package/core/cloud/package.json +1 -1
  53. package/core/collections/package.json +1 -1
  54. package/core/config/package.json +1 -1
  55. package/core/dashboard/package.json +1 -1
  56. package/core/database/package.json +2 -2
  57. package/core/datetime/package.json +1 -1
  58. package/core/desktop/package.json +1 -1
  59. package/core/docs/node_modules/.bin/vitepress +2 -2
  60. package/core/docs/package.json +2 -2
  61. package/core/domains/package.json +1 -1
  62. package/core/drivers/package.json +1 -1
  63. package/core/email/package.json +1 -1
  64. package/core/error-handling/package.json +2 -2
  65. package/core/git/package.json +1 -1
  66. package/core/{cloud/dist/actions → health}/README.md +11 -8
  67. package/core/health/node_modules/.bin/mkdist +17 -0
  68. package/core/health/node_modules/.bin/tsc +17 -0
  69. package/core/health/node_modules/.bin/tsserver +17 -0
  70. package/core/health/package.json +54 -0
  71. package/core/health/src/drivers/ohdear.ts +1 -0
  72. package/core/health/src/index.ts +1 -0
  73. package/core/health/src/notifications/index.ts +1 -0
  74. package/core/{notifications → health}/tests/example.test.ts +0 -0
  75. package/core/lint/node_modules/.bin/eslint +2 -2
  76. package/core/lint/package.json +3 -3
  77. package/core/logging/package.json +1 -1
  78. package/core/modules/package.json +1 -1
  79. package/core/modules/src/nprogress.ts +3 -1
  80. package/core/notifications/README.md +205 -30
  81. package/core/notifications/package.json +1 -1
  82. package/core/notifications/src/drivers/chat/slack.ts +1 -1
  83. package/core/notifications/src/drivers/email/actions/send.ts +1 -1
  84. package/core/notifications/src/drivers/push/expo.ts +19 -0
  85. package/core/notifications/src/drivers/push/fcm.ts +19 -0
  86. package/core/notifications/src/index.ts +17 -22
  87. package/core/notifications/tests/chat/Slack.test.ts +12 -2
  88. package/core/notifications/tests/email/Mailgun.test.ts +14 -3
  89. package/core/notifications/tests/email/Sendgrid.test.ts +15 -4
  90. package/core/notifications/tests/sms/Twilio.test.ts +13 -2
  91. package/core/objects/package.json +1 -1
  92. package/core/path/package.json +1 -1
  93. package/core/payments/package.json +1 -1
  94. package/core/realtime/package.json +1 -1
  95. package/core/router/package.json +1 -1
  96. package/core/search-engine/package.json +2 -2
  97. package/core/security/package.json +1 -1
  98. package/core/server/node_modules/.bin/vite +2 -2
  99. package/core/server/package.json +2 -2
  100. package/core/storage/package.json +1 -1
  101. package/core/strings/package.json +1 -1
  102. package/core/testing/node_modules/.bin/mkdist +2 -2
  103. package/core/testing/node_modules/.bin/vitest +2 -2
  104. package/core/testing/package.json +5 -5
  105. package/core/types/node_modules/.bin/vitepress +2 -2
  106. package/core/types/package.json +4 -4
  107. package/core/types/src/cli.ts +33 -3
  108. package/core/types/src/notifications.ts +161 -0
  109. package/core/ui/node_modules/.bin/vue-tsc +2 -2
  110. package/core/ui/package.json +2 -2
  111. package/core/utils/package.json +5 -5
  112. package/core/utils/src/helpers.ts +1 -1
  113. package/core/x-ray/package.json +1 -1
  114. package/core/x-ray/src/desktop/app.vue +0 -1
  115. package/core/x-ray/src/ray.config.js +1 -0
  116. package/core/x-ray/src/types.ts +1 -0
  117. package/package.json +8 -8
  118. package/tsconfig.json +2 -2
  119. package/components/vue/dist/.gitkeep +0 -0
  120. package/components/web/dist/.gitkeep +0 -0
  121. package/core/actions/test.ts +0 -10
@@ -1,26 +1,44 @@
1
1
  import type { CLI, LintOptions } from '@stacksjs/types'
2
- import { invoke, lintFix } from '@stacksjs/actions/lint'
2
+ import { intro, log, outro } from '@stacksjs/cli'
3
+ import { Action } from '@stacksjs/types'
4
+ import { runAction } from '@stacksjs/actions'
3
5
 
4
- const descriptions = {
5
- lint: 'Automagically lints your codebase',
6
- lintFix: 'Automagically fixes lint errors',
7
- debug: 'Enable debug mode',
8
- }
6
+ async function lint(buddy: CLI) {
7
+ const descriptions = {
8
+ lint: 'Automagically lints your codebase',
9
+ lintFix: 'Automagically fixes lint errors',
10
+ debug: 'Enable debug mode',
11
+ }
9
12
 
10
- async function lint(stacks: CLI) {
11
- stacks
13
+ buddy
12
14
  .command('lint', descriptions.lint)
13
15
  .option('-f, --fix', descriptions.lintFix, { default: false })
14
16
  .option('--debug', descriptions.debug, { default: false })
15
17
  .action(async (options: LintOptions) => {
16
- await invoke(options)
18
+ const perf = intro('buddy lint')
19
+ const result = await runAction(Action.Lint, options)
20
+
21
+ if (result.isErr()) {
22
+ outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true })
23
+ process.exit()
24
+ }
25
+
26
+ outro('Linted', { startTime: perf, useSeconds: true })
17
27
  })
18
28
 
19
- stacks
29
+ buddy
20
30
  .command('lint:fix', descriptions.lintFix)
21
31
  .option('--debug', descriptions.debug, { default: false })
22
32
  .action(async (options: LintOptions) => {
23
- await lintFix(options)
33
+ log.info('Fixing lint errors...')
34
+ const result = await runAction(Action.LintFix, options)
35
+
36
+ if (result.isErr()) {
37
+ log.error('There was an error lint fixing your code.', result.error)
38
+ process.exit()
39
+ }
40
+
41
+ log.success('Fixed lint errors')
24
42
  })
25
43
  }
26
44
 
@@ -14,21 +14,21 @@ import {
14
14
  stack as makeStack,
15
15
  } from '@stacksjs/actions/make'
16
16
 
17
- const descriptions = {
18
- component: 'Create a new component',
19
- page: 'Create a new page',
20
- function: 'Create a new function',
21
- language: 'Create a new language',
22
- database: 'Create a new database',
23
- migration: 'Create a new migration',
24
- factory: 'Create a new factory',
25
- notification: 'Create a new notification',
26
- stack: 'Create a new new stack',
27
- debug: 'Enable debug mode',
28
- }
29
-
30
- async function make(stacks: CLI) {
31
- stacks
17
+ async function make(buddy: CLI) {
18
+ const descriptions = {
19
+ component: 'Create a new component',
20
+ page: 'Create a new page',
21
+ function: 'Create a new function',
22
+ language: 'Create a new language',
23
+ database: 'Create a new database',
24
+ migration: 'Create a new migration',
25
+ factory: 'Create a new factory',
26
+ notification: 'Create a new notification',
27
+ stack: 'Create a new new stack',
28
+ debug: 'Enable debug mode',
29
+ }
30
+
31
+ buddy
32
32
  .command('make', 'The make command')
33
33
  .option('-c, --component', descriptions.component, { default: false })
34
34
  .option('-p, --page', descriptions.page, { default: false })
@@ -41,7 +41,7 @@ async function make(stacks: CLI) {
41
41
  .option('-s, --stack', descriptions.stack, { default: false })
42
42
  .option('--debug', descriptions.debug, { default: false })
43
43
  .action(async (options: MakeOptions) => {
44
- const name = stacks.args[0]
44
+ const name = buddy.args[0]
45
45
 
46
46
  if (!name) {
47
47
  log.error('You need to specify a name. Read more about the documentation here.')
@@ -75,12 +75,12 @@ async function make(stacks: CLI) {
75
75
  process.exit(ExitCode.Success)
76
76
  })
77
77
 
78
- stacks
78
+ buddy
79
79
  .command('make:component', descriptions.component)
80
80
  .option('--n, -name', 'The name of the component')
81
81
  .option('--debug', descriptions.debug, { default: false })
82
82
  .action(async (options: MakeOptions) => {
83
- const name = stacks.args[0] || options.name
83
+ const name = buddy.args[0] || options.name
84
84
  options.name = name
85
85
 
86
86
  if (!name) {
@@ -91,12 +91,12 @@ async function make(stacks: CLI) {
91
91
  await makeComponent(options)
92
92
  })
93
93
 
94
- stacks
94
+ buddy
95
95
  .command('make:database', descriptions.database)
96
96
  .option('--n, -name', 'The name of the database')
97
97
  .option('--debug', descriptions.debug, { default: false })
98
98
  .action(async (options: MakeOptions) => {
99
- const name = stacks.args[0] || options.name
99
+ const name = buddy.args[0] || options.name
100
100
  options.name = name
101
101
 
102
102
  if (!name) {
@@ -107,12 +107,12 @@ async function make(stacks: CLI) {
107
107
  await makeDatabase(options)
108
108
  })
109
109
 
110
- stacks
110
+ buddy
111
111
  .command('make:migration', descriptions.migration)
112
112
  .option('--n, -name', 'The name of the migration')
113
113
  .option('--debug', descriptions.debug, { default: false })
114
114
  .action(async (options: MakeOptions) => {
115
- const name = stacks.args[0] || options.name
115
+ const name = buddy.args[0] || options.name
116
116
  options.name = name
117
117
 
118
118
  if (!name) {
@@ -123,12 +123,12 @@ async function make(stacks: CLI) {
123
123
  await makeMigration(options)
124
124
  })
125
125
 
126
- stacks
126
+ buddy
127
127
  .command('make:factory', descriptions.factory)
128
128
  .option('--n, -name', 'The name of the factory')
129
129
  .option('--debug', descriptions.debug, { default: false })
130
130
  .action(async (options: MakeOptions) => {
131
- const name = stacks.args[0] || options.name
131
+ const name = buddy.args[0] || options.name
132
132
  options.name = name
133
133
 
134
134
  if (!name) {
@@ -139,12 +139,12 @@ async function make(stacks: CLI) {
139
139
  await makeFactory(options)
140
140
  })
141
141
 
142
- stacks
142
+ buddy
143
143
  .command('make:page', descriptions.page)
144
144
  .option('--n, -name', 'The name of the page')
145
145
  .option('--debug', descriptions.debug, { default: false })
146
146
  .action(async (options: MakeOptions) => {
147
- const name = stacks.args[0] || options.name
147
+ const name = buddy.args[0] || options.name
148
148
  options.name = name
149
149
 
150
150
  if (!name) {
@@ -155,7 +155,7 @@ async function make(stacks: CLI) {
155
155
  await makePage(options)
156
156
  })
157
157
 
158
- stacks
158
+ buddy
159
159
  .command('make:function', descriptions.function)
160
160
  .option('--n, -name', 'The name of the function')
161
161
  .option('--debug', descriptions.debug, { default: false })
@@ -163,12 +163,12 @@ async function make(stacks: CLI) {
163
163
  await makeFunction(options)
164
164
  })
165
165
 
166
- stacks
166
+ buddy
167
167
  .command('make:lang', descriptions.language)
168
168
  .option('--n, -name', 'The name of the language')
169
169
  .option('--debug', descriptions.debug, { default: false })
170
170
  .action(async (options: MakeOptions) => {
171
- const name = stacks.args[0] || options.name
171
+ const name = buddy.args[0] || options.name
172
172
  options.name = name
173
173
 
174
174
  if (!name) {
@@ -179,12 +179,12 @@ async function make(stacks: CLI) {
179
179
  await makeLanguage(options)
180
180
  })
181
181
 
182
- stacks
182
+ buddy
183
183
  .command('make:notification', descriptions.notification)
184
184
  .option('--n, -name', 'The name of the notification')
185
185
  .option('--debug', descriptions.debug, { default: false })
186
186
  .action(async (options: MakeOptions) => {
187
- const name = stacks.args[0] || options.name
187
+ const name = buddy.args[0] || options.name
188
188
  options.name = name
189
189
 
190
190
  if (!name) {
@@ -195,12 +195,12 @@ async function make(stacks: CLI) {
195
195
  await makeNotification(options)
196
196
  })
197
197
 
198
- stacks
198
+ buddy
199
199
  .command('make:stack', descriptions.stack)
200
200
  .option('--n, -name', 'The name of the stack')
201
201
  .option('--debug', descriptions.debug, { default: false })
202
202
  .action(async (options: MakeOptions) => {
203
- const name = stacks.args[0] || options.name
203
+ const name = buddy.args[0] || options.name
204
204
  options.name = name
205
205
 
206
206
  if (!name) {
@@ -1,13 +1,13 @@
1
1
  import type { CLI, PreinstallOptions } from '@stacksjs/types'
2
2
  import { invoke } from '@stacksjs/actions/preinstall'
3
3
 
4
- const descriptions = {
5
- command: 'Run your preinstall script',
6
- debug: 'Enable debug mode',
7
- }
4
+ async function preinstall(buddy: CLI) {
5
+ const descriptions = {
6
+ command: 'Run your preinstall script',
7
+ debug: 'Enable debug mode',
8
+ }
8
9
 
9
- async function preinstall(stacks: CLI) {
10
- stacks
10
+ buddy
11
11
  .command('preinstall', descriptions.command)
12
12
  .option('--debug', descriptions.debug, { default: false })
13
13
  .action(async (options: PreinstallOptions) => {
@@ -2,13 +2,13 @@ import type { CLI, PrepublishOptions } from '@stacksjs/types'
2
2
  import { Action } from '@stacksjs/types'
3
3
  import { runAction } from '@stacksjs/actions'
4
4
 
5
- const descriptions = {
6
- command: 'Run your prepublish script',
7
- debug: 'Enable debug mode',
8
- }
5
+ async function prepublish(buddy: CLI) {
6
+ const descriptions = {
7
+ command: 'Run your prepublish script',
8
+ debug: 'Enable debug mode',
9
+ }
9
10
 
10
- async function prepublish(stacks: CLI) {
11
- stacks
11
+ buddy
12
12
  .command('prepublish', descriptions.command)
13
13
  .option('--debug', descriptions.debug, { default: false })
14
14
  .action(async (options: PrepublishOptions) => {
@@ -8,12 +8,12 @@ const descriptions = {
8
8
  debug: 'Enable debug mode',
9
9
  }
10
10
 
11
- async function release(stacks: CLI) {
12
- stacks
11
+ async function release(buddy: CLI) {
12
+ buddy
13
13
  .command('release', descriptions.release)
14
14
  .option('--debug', descriptions.debug, { default: true }) // it's on by default because it requires manual input
15
15
  .action(async (options: ReleaseOptions) => {
16
- const perf = intro('buddy release')
16
+ const startTime = intro('buddy release')
17
17
  const result = await runAction(Action.Release, options)
18
18
 
19
19
  if (result.isErr()) {
@@ -21,7 +21,7 @@ async function release(stacks: CLI) {
21
21
  process.exit()
22
22
  }
23
23
 
24
- outro('Triggered CI/CD release workflow', { startTime: perf, useSeconds: true })
24
+ outro('Triggered CI/CD release workflow', { startTime, useSeconds: true })
25
25
  })
26
26
  }
27
27
 
@@ -1,21 +1,21 @@
1
1
  import { runCommand } from '@stacksjs/cli'
2
2
  import type { CLI, CliOptions } from '@stacksjs/types'
3
3
 
4
- const descriptions = {
5
- ensure: 'This command checks whether Node is installed. pnpm is checked via `only-allow` preinstall hook',
6
- setup: 'This command installs Node & pnpm',
7
- debug: 'Enable debug mode',
8
- }
4
+ async function setup(buddy: CLI) {
5
+ const descriptions = {
6
+ ensure: 'This command checks whether Node is installed. pnpm is checked via `only-allow` preinstall hook',
7
+ setup: 'This command installs Node & pnpm',
8
+ debug: 'Enable debug mode',
9
+ }
9
10
 
10
- async function setup(stacks: CLI) {
11
- stacks
11
+ buddy
12
12
  .command('ensure', descriptions.ensure)
13
13
  .option('--debug', descriptions.debug, { default: false })
14
14
  .action(async (options: CliOptions) => {
15
15
  await runCommand('pnpm install', options)
16
16
  })
17
17
 
18
- stacks
18
+ buddy
19
19
  .command('setup', descriptions.setup)
20
20
  .option('--debug', descriptions.debug, { default: false })
21
21
  .action(async (options: CliOptions) => {
@@ -1,36 +1,36 @@
1
1
  import type { CLI, TestOptions } from '@stacksjs/types'
2
2
  import { invoke, testCoverageReport, testUi, typecheck } from '@stacksjs/actions/test'
3
3
 
4
- const descriptions = {
5
- command: 'Runs your test suite',
6
- types: 'Typechecks your codebase',
7
- coverage: 'Generates a test coverage report',
8
- debug: 'Enable debug mode',
9
- }
4
+ async function test(buddy: CLI) {
5
+ const descriptions = {
6
+ command: 'Runs your test suite',
7
+ types: 'Typechecks your codebase',
8
+ coverage: 'Generates a test coverage report',
9
+ debug: 'Enable debug mode',
10
+ }
10
11
 
11
- async function test(stacks: CLI) {
12
- stacks
12
+ buddy
13
13
  .command('test', descriptions.command)
14
14
  .option('--debug', descriptions.debug, { default: false })
15
15
  .action(async (options: TestOptions) => {
16
16
  await invoke(options)
17
17
  })
18
18
 
19
- stacks
19
+ buddy
20
20
  .command('test:ui', descriptions.command)
21
21
  .option('--debug', descriptions.debug, { default: false })
22
22
  .action(async (options: TestOptions) => {
23
23
  await testUi(options)
24
24
  })
25
25
 
26
- stacks
26
+ buddy
27
27
  .command('test:types', descriptions.types)
28
28
  .option('--debug', descriptions.debug, { default: false })
29
29
  .action(async (options: TestOptions) => {
30
30
  await typecheck(options)
31
31
  })
32
32
 
33
- stacks
33
+ buddy
34
34
  .command('test:coverage', descriptions.coverage)
35
35
  .option('--debug', descriptions.debug, { default: false })
36
36
  .action(async (options: TestOptions) => {
@@ -1,21 +1,21 @@
1
1
  import type { CLI } from '@stacksjs/types'
2
2
  import { types as generateTypes } from '@stacksjs/actions/generate'
3
3
 
4
- const descriptions = {
5
- generate: 'Generate the types of & for your library/libraries',
6
- fix: 'wip',
7
- debug: 'Enable debug mode',
8
- }
4
+ async function types(buddy: CLI) {
5
+ const descriptions = {
6
+ generate: 'Generate the types of & for your library/libraries',
7
+ fix: 'wip',
8
+ debug: 'Enable debug mode',
9
+ }
9
10
 
10
- async function types(stacks: CLI) {
11
- stacks
11
+ buddy
12
12
  .command('types:generate', descriptions.generate)
13
13
  .option('--debug', descriptions.debug, { default: false })
14
14
  .action(async () => {
15
15
  await generateTypes()
16
16
  })
17
17
 
18
- stacks
18
+ buddy
19
19
  .command('types:fix', descriptions.fix)
20
20
  .option('--debug', descriptions.debug, { default: false })
21
21
  .action(async () => {
@@ -3,20 +3,20 @@ import { ExitCode } from '@stacksjs/types'
3
3
  import { prompts } from '@stacksjs/cli'
4
4
  import { invoke as updateStacks } from '@stacksjs/actions/update'
5
5
 
6
- const descriptions = {
7
- command: 'Update dependencies, framework, package manager, and/or Node',
8
- framework: 'Update the Stacks framework',
9
- dependencies: 'Update your dependencies',
10
- packageManager: 'Update your package manager, i.e. pnpm',
11
- node: 'Update Node to the version defined in ./node-version',
12
- all: 'Update Node, package manager, project dependencies, and framework',
13
- force: 'Overwrite possible local updates with remote framework updates',
14
- debug: 'Enable debug mode',
15
- select: 'What are you trying to update?',
16
- }
6
+ async function update(buddy: CLI) {
7
+ const descriptions = {
8
+ command: 'Update dependencies, framework, package manager, and/or Node',
9
+ framework: 'Update the Stacks framework',
10
+ dependencies: 'Update your dependencies',
11
+ packageManager: 'Update your package manager, i.e. pnpm',
12
+ node: 'Update Node to the version defined in ./node-version',
13
+ all: 'Update Node, package manager, project dependencies, and framework',
14
+ force: 'Overwrite possible local updates with remote framework updates',
15
+ debug: 'Enable debug mode',
16
+ select: 'What are you trying to update?',
17
+ }
17
18
 
18
- async function update(stacks: CLI) {
19
- stacks
19
+ buddy
20
20
  .command('update', descriptions.command)
21
21
  .option('-c, --framework', descriptions.framework, { default: false })
22
22
  .option('-d, --dependencies', descriptions.dependencies, { default: false })
@@ -47,7 +47,7 @@ async function update(stacks: CLI) {
47
47
  await updateStacks(options)
48
48
  })
49
49
 
50
- stacks
50
+ buddy
51
51
  .command('update:framework', descriptions.framework)
52
52
  .option('-f, --framework', descriptions.framework, { default: true })
53
53
  .option('--debug', descriptions.debug, { default: false })
@@ -56,7 +56,7 @@ async function update(stacks: CLI) {
56
56
  await updateStacks(options)
57
57
  })
58
58
 
59
- stacks
59
+ buddy
60
60
  .command('update:dependencies', descriptions.dependencies)
61
61
  .option('-d, --dependencies', descriptions.dependencies, { default: true })
62
62
  .option('--debug', descriptions.debug, { default: false })
@@ -66,7 +66,7 @@ async function update(stacks: CLI) {
66
66
  await updateStacks(options)
67
67
  })
68
68
 
69
- stacks
69
+ buddy
70
70
  .command('update:package-manager', descriptions.packageManager)
71
71
  .option('-p, --package-manager', descriptions.packageManager, { default: true })
72
72
  .option('--debug', descriptions.debug, { default: false })
@@ -76,15 +76,15 @@ async function update(stacks: CLI) {
76
76
  .action(async (options: UpdateOptions) => {
77
77
  options.version = 'latest'
78
78
 
79
- if (stacks.args[0])
80
- options.version = stacks.args[0]
79
+ if (buddy.args[0])
80
+ options.version = buddy.args[0]
81
81
 
82
82
  await updateStacks(options)
83
83
 
84
84
  process.exit(ExitCode.Success)
85
85
  })
86
86
 
87
- stacks
87
+ buddy
88
88
  .command('update:node', descriptions.node)
89
89
  .option('-n, --node', descriptions.node, { default: true })
90
90
  .option('--debug', descriptions.debug, { default: false })
@@ -92,7 +92,7 @@ async function update(stacks: CLI) {
92
92
  await updateStacks(options)
93
93
  })
94
94
 
95
- stacks
95
+ buddy
96
96
  .command('update:all', descriptions.all)
97
97
  .option('-a, --all', descriptions.all, { default: true })
98
98
  .option('--debug', descriptions.debug, { default: false })
@@ -7,6 +7,7 @@ export * from '@stacksjs/cloud'
7
7
  export * from '@stacksjs/collections'
8
8
  export * from '@stacksjs/config'
9
9
  // export * from '@stacksjs/desktop'
10
+ // export * from '@stacksjs/notifications'
10
11
  export * from '@stacksjs/storage'
11
12
  export * from '@stacksjs/router'
12
13
  export * from '@stacksjs/server'
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.44.11",
4
+ "version": "0.45.0",
5
5
  "packageManager": "pnpm@7.18.2",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
@@ -54,7 +54,7 @@
54
54
  "@stacksjs/types": "workspace:*",
55
55
  "@stacksjs/utils": "workspace:*",
56
56
  "markdown-it": "^13.0.1",
57
- "vue-component-meta": "^1.0.13"
57
+ "vue-component-meta": "^1.0.16"
58
58
  },
59
59
  "dependencies": {
60
60
  "@stacksjs/strings": "workspace:*",
@@ -0,0 +1,15 @@
1
+ import { log } from '@stacksjs/logging'
2
+ import { frameworkPath } from '@stacksjs/path'
3
+ import { runCommand } from '@stacksjs/cli'
4
+
5
+ log.info('Building Component Libraries...')
6
+
7
+ // run the `npx mkdist -d` command to build the dist folder
8
+ const result = await runCommand('npx mkdist -d', { debug: true, cwd: frameworkPath() })
9
+
10
+ if (result.isErr()) {
11
+ log.error('There was an error running `npx mkdist -d`.', result.error)
12
+ process.exit()
13
+ }
14
+
15
+ log.success('Building Stacks was successful.')
@@ -0,0 +1,7 @@
1
+ import { frameworkPath } from '@stacksjs/path'
2
+ import { runCommands } from '@stacksjs/cli'
3
+
4
+ await runCommands([
5
+ 'pnpm --filter \'./core/**\' --filter=\'!./core/config\' --filter=\'!./core/x-ray\' build', // command to build the core packages, excluding the config & x-ray package
6
+ 'pnpm --filter \'../core/config\' build', // command to build the config package
7
+ ], { debug: true, cwd: frameworkPath() })
@@ -0,0 +1,9 @@
1
+ import { frameworkPath } from '@stacksjs/path'
2
+ import { runCommands } from '@stacksjs/cli'
3
+
4
+ await runCommands([
5
+ 'npx mkdist -d', // command to build the dist folder
6
+ 'pnpm build:cli', // command to build the Buddy CLI
7
+ 'pnpm build:core', // command to build the Stacks Core
8
+ 'cp -a ./core/. ./', // copy the core stacks to the famework's root
9
+ ], { debug: true, cwd: frameworkPath() })
@@ -0,0 +1,10 @@
1
+ import { runCommand } from '@stacksjs/cli'
2
+ import { frameworkPath } from '@stacksjs/path'
3
+
4
+ const result = await runCommand(
5
+ 'npx bumpp ./package.json ./buddy/package.json ./core/**/package.json ./vscode/package.json --execute \'pnpm run changelog\' --all',
6
+ { debug: true, cwd: frameworkPath(), shell: true },
7
+ )
8
+
9
+ if (result.isErr())
10
+ console.error(result.error)
@@ -0,0 +1,4 @@
1
+ import { runCommand } from '@stacksjs/cli'
2
+ import { projectPath } from '@stacksjs/path'
3
+
4
+ await runCommand('npx eslint . --fix', { debug: true, cwd: projectPath() })
@@ -1,27 +1,7 @@
1
- import { intro, outro, runCommands } from '@stacksjs/cli'
2
- import type { CliOptions as FreshOptions } from '@stacksjs/types'
3
- import { ExitCode } from '@stacksjs/types'
1
+ import { runCommands } from '@stacksjs/cli'
2
+ import { frameworkPath } from '@stacksjs/path'
4
3
 
5
- export async function invoke(options?: FreshOptions) {
6
- const perf = intro('buddy fresh')
7
- const results = await runCommands(['pnpm run clean', 'pnpm install'], options)
8
-
9
- for (const result of results) {
10
- if (result.isErr()) {
11
- outro('While running the fresh command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
12
- process.exit(ExitCode.FatalError)
13
- }
14
- }
15
-
16
- outro('Freshly reinstalled your dependencies.', { startTime: perf, useSeconds: true })
17
- process.exit(ExitCode.Success)
18
- }
19
-
20
- /**
21
- * An alias of the invoke method.
22
- * @param options
23
- * @returns
24
- */
25
- export async function fresh(options: FreshOptions) {
26
- return invoke(options)
27
- }
4
+ await runCommands([
5
+ 'pnpm run clean',
6
+ 'pnpm install',
7
+ ], { cwd: frameworkPath(), debug: true })
@@ -1,10 +1,10 @@
1
1
  import { log } from '@stacksjs/logging'
2
- import { NpmScript } from '@stacksjs/types'
2
+ import { Action, NpmScript } from '@stacksjs/types'
3
3
  import type { GeneratorOptions } from '@stacksjs/types'
4
4
  import { runNpmScript } from '@stacksjs/utils'
5
5
  import { projectPath } from '@stacksjs/path'
6
6
  import { runCommand } from '@stacksjs/cli'
7
- import { lintFix } from './lint'
7
+ import { runAction } from './helpers'
8
8
 
9
9
  export async function invoke(options?: GeneratorOptions) {
10
10
  if (options?.types)
@@ -79,7 +79,7 @@ export async function vsCodeCustomData(options?: GeneratorOptions) {
79
79
  process.exit()
80
80
  }
81
81
 
82
- await lintFix({ fix: true }) // the created json file needs to be linted
82
+ await runAction(Action.LintFix, { debug: true }) // the generated json file needs to be linted
83
83
  log.success('Successfully generated the custom-elements.json file')
84
84
  }
85
85
 
@@ -91,7 +91,7 @@ export async function ideHelpers(options?: GeneratorOptions) {
91
91
  process.exit()
92
92
  }
93
93
 
94
- await lintFix({ fix: true }) // the created json file needs to be linted
94
+ await runAction(Action.LintFix, { debug: true }) // the generated json file needs to be linted
95
95
  log.success('Successfully generated IDE helpers')
96
96
  }
97
97
 
@@ -103,7 +103,7 @@ export async function componentMeta(options?: GeneratorOptions) {
103
103
  process.exit()
104
104
  }
105
105
 
106
- await lintFix({ fix: true }) // the created json file needs to be linted
106
+ await runAction(Action.LintFix, { debug: true }) // the generated json file needs to be linted
107
107
  log.success('Successfully generated component meta information')
108
108
  }
109
109