stacks 0.52.0 → 0.52.2
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.
- package/auto-imports.d.ts +1595 -651
- package/components.d.ts +4 -2
- package/core/actions/build.config.ts +2 -0
- package/core/actions/package.json +14 -2
- package/core/actions/src/clean.ts +9 -12
- package/core/actions/src/deploy/domains.ts +1 -1
- package/core/actions/src/helpers/package-json.ts +1 -2
- package/core/actions/src/helpers/utils.ts +1 -2
- package/core/actions/src/release.ts +1 -1
- package/core/actions/src/tinker.ts +1 -0
- package/core/ai/build.config.ts +2 -0
- package/core/ai/package.json +1 -1
- package/core/alias/build.config.ts +2 -0
- package/core/alias/package.json +1 -2
- package/core/analytics/build.config.ts +2 -0
- package/core/analytics/package.json +1 -1
- package/core/arrays/build.config.ts +2 -0
- package/core/arrays/package.json +1 -1
- package/core/auth/build.config.ts +2 -0
- package/core/auth/package.json +1 -1
- package/core/auth/src/index.ts +1 -3
- package/core/buddy/README.md +1 -1
- package/core/buddy/package.json +1 -1
- package/core/buddy/src/commands/build.ts +8 -11
- package/core/buddy/src/commands/changelog.ts +4 -5
- package/core/buddy/src/commands/clean.ts +2 -3
- package/core/buddy/src/commands/deploy.ts +4 -5
- package/core/buddy/src/commands/dev.ts +2 -1
- package/core/buddy/src/commands/fresh.ts +2 -2
- package/core/buddy/src/commands/inspire.ts +4 -5
- package/core/buddy/src/commands/key.ts +4 -5
- package/core/buddy/src/commands/lint.ts +8 -10
- package/core/buddy/src/commands/make.ts +4 -5
- package/core/buddy/src/commands/migrate.ts +4 -5
- package/core/buddy/src/commands/onboarding.ts +4 -5
- package/core/buddy/src/commands/release.ts +4 -12
- package/core/buddy/src/commands/seed.ts +14 -14
- package/core/buddy/src/commands/setting.ts +4 -5
- package/core/buddy/src/commands/test.ts +29 -34
- package/core/buddy/src/commands/upgrade.ts +13 -16
- package/core/buddy/src/commands/version.ts +25 -16
- package/core/build/build.config.ts +2 -0
- package/core/build/node_modules/.bin/vite +4 -4
- package/core/build/node_modules/.bin/vite-ssg +4 -4
- package/core/build/node_modules/.bin/vue-docgen-web-types +4 -4
- package/core/build/package.json +5 -5
- package/core/build/src/stacks.ts +8 -14
- package/core/build/src/vue-components.ts +6 -4
- package/core/cache/build.config.ts +2 -0
- package/core/cache/package.json +2 -2
- package/core/chat/build.config.ts +2 -0
- package/core/chat/package.json +6 -6
- package/core/cli/package.json +1 -1
- package/core/cli/src/actions/install.ts +20 -2
- package/core/cli/src/helpers.ts +6 -1
- package/core/cli/src/run.ts +5 -8
- package/core/cloud/build.config.ts +2 -0
- package/core/cloud/package.json +1 -1
- package/core/collections/build.config.ts +2 -0
- package/core/collections/package.json +1 -1
- package/core/config/package.json +1 -1
- package/core/config/src/defaults.ts +0 -2
- package/core/config/src/stacks.ts +9 -2
- package/core/database/package.json +1 -1
- package/core/database/src/migrations/index.ts +2 -1
- package/core/datetime/package.json +1 -1
- package/core/desktop/build.config.ts +2 -0
- package/core/desktop/package.json +2 -2
- package/core/development/build.config.ts +2 -0
- package/core/development/package.json +6 -6
- package/core/docs/build.config.ts +1 -0
- package/core/docs/node_modules/.bin/vitepress +4 -4
- package/core/docs/package.json +2 -2
- package/core/domains/build.config.ts +2 -0
- package/core/domains/package.json +1 -1
- package/core/email/package.json +12 -12
- package/core/email/src/drivers/mailjet.ts +1 -0
- package/core/email/src/tailwind.config.ts +1 -1
- package/core/error-handling/package.json +2 -2
- package/core/events/package.json +1 -1
- package/core/faker/build.config.ts +2 -0
- package/core/faker/package.json +1 -1
- package/core/git/build.config.ts +2 -0
- package/core/git/package.json +1 -1
- package/core/health/build.config.ts +2 -0
- package/core/health/package.json +1 -1
- package/core/lint/build.config.ts +2 -0
- package/core/lint/node_modules/.bin/eslint +4 -4
- package/core/lint/package.json +3 -3
- package/core/lint/src/index.ts +1 -1
- package/core/logging/package.json +5 -5
- package/core/modules/build.config.ts +2 -0
- package/core/modules/package.json +1 -1
- package/core/notifications/package.json +22 -22
- package/core/notifications/src/index.ts +5 -8
- package/core/objects/build.config.ts +2 -0
- package/core/objects/package.json +1 -1
- package/core/orm/package.json +1 -1
- package/core/pages/build.config.ts +2 -0
- package/core/pages/package.json +1 -1
- package/core/path/build.config.ts +1 -0
- package/core/path/package.json +1 -1
- package/core/payments/build.config.ts +2 -0
- package/core/payments/package.json +2 -2
- package/core/push/build.config.ts +2 -0
- package/core/push/package.json +3 -3
- package/core/query-builder/build.config.ts +2 -0
- package/core/query-builder/package.json +1 -1
- package/core/queue/build.config.ts +2 -0
- package/core/queue/package.json +1 -1
- package/core/realtime/build.config.ts +2 -0
- package/core/realtime/package.json +1 -1
- package/core/router/build.config.ts +2 -0
- package/core/router/package.json +2 -2
- package/core/router/src/index.ts +114 -11
- package/core/scheduler/build.config.ts +2 -0
- package/core/scheduler/package.json +1 -1
- package/core/search-engine/build.config.ts +1 -0
- package/core/search-engine/package.json +1 -1
- package/core/search-engine/src/index.ts +1 -22
- package/core/security/build.config.ts +2 -0
- package/core/security/package.json +1 -1
- package/core/server/build.config.ts +2 -0
- package/core/server/node_modules/.bin/nitro +4 -4
- package/core/server/node_modules/.bin/nitropack +4 -4
- package/core/server/node_modules/.bin/vite +4 -4
- package/core/server/package.json +3 -3
- package/core/signals/build.config.ts +2 -0
- package/core/signals/package.json +1 -1
- package/core/slug/build.config.ts +2 -0
- package/core/slug/package.json +1 -1
- package/core/sms/build.config.ts +2 -0
- package/core/sms/package.json +11 -11
- package/core/storage/build.config.ts +2 -0
- package/core/storage/package.json +1 -1
- package/core/storage/src/index.ts +11 -1
- package/core/strings/package.json +1 -1
- package/core/strings/src/index.ts +0 -1
- package/core/testing/build.config.ts +2 -0
- package/core/testing/node_modules/.bin/vitest +4 -4
- package/core/testing/package.json +4 -4
- package/core/testing/src/index.ts +1 -0
- package/core/tinker/package.json +1 -1
- package/core/types/build.config.ts +2 -0
- package/core/types/node_modules/.bin/vite +4 -4
- package/core/types/node_modules/.bin/vite-ssg +4 -4
- package/core/types/node_modules/.bin/vitepress +4 -4
- package/core/types/package.json +7 -7
- package/core/types/src/cli.ts +10 -9
- package/core/types/src/fs.ts +8 -0
- package/core/types/src/router.ts +22 -0
- package/core/types/src/stacks.ts +3 -3
- package/core/ui/build.config.ts +2 -0
- package/core/ui/package.json +3 -3
- package/core/ui/src/index.ts +1 -1
- package/core/utils/build.config.ts +2 -0
- package/core/utils/node_modules/.bin/rimraf +4 -4
- package/core/utils/package.json +3 -3
- package/core/utils/src/base.ts +6 -5
- package/core/utils/src/config.ts +2 -3
- package/core/utils/src/currency.ts +26 -0
- package/core/utils/src/delete.ts +3 -0
- package/core/utils/src/helpers.ts +2 -2
- package/core/utils/src/index.ts +7 -9
- package/core/utils/src/math.ts +30 -0
- package/core/utils/src/throttle.ts +3 -6
- package/core/utils/src/vendors.ts +221 -0
- package/core/utils/src/versions.ts +1 -0
- package/core/validation/build.config.ts +2 -0
- package/core/validation/package.json +1 -1
- package/core/validation/src/index.ts +2 -29
- package/core/{strings/src/validation.ts → validation/src/is.ts} +83 -8
- package/core/validation/src/validate.ts +29 -0
- package/docs/node_modules/.bin/rimraf +4 -4
- package/docs/node_modules/.bin/vitepress +4 -4
- package/docs/package.json +2 -2
- package/package.json +93 -46
- package/vitest.config.ts +25 -17
- package/core/utils/src/is.ts +0 -83
- package/tests/feature/example.spec.ts +0 -20
- package/tests/unit/example.test.ts +0 -7
package/components.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// Generated by unplugin-vue-components
|
|
3
5
|
// Read more: https://github.com/vuejs/core/pull/3399
|
|
4
6
|
import '@vue/runtime-core'
|
|
5
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.52.
|
|
4
|
+
"version": "0.52.2",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -259,9 +259,21 @@
|
|
|
259
259
|
"vue-component-meta": "^1.6.5"
|
|
260
260
|
},
|
|
261
261
|
"dependencies": {
|
|
262
|
+
"@stacksjs/cli": "workspace:*",
|
|
263
|
+
"@stacksjs/config": "workspace:*",
|
|
264
|
+
"@stacksjs/database": "workspace:*",
|
|
265
|
+
"@stacksjs/error-handling": "workspace:*",
|
|
266
|
+
"@stacksjs/logging": "workspace:*",
|
|
267
|
+
"@stacksjs/pages": "workspace:*",
|
|
268
|
+
"@stacksjs/path": "workspace:*",
|
|
269
|
+
"@stacksjs/security": "workspace:*",
|
|
270
|
+
"@stacksjs/storage": "workspace:*",
|
|
262
271
|
"@stacksjs/strings": "workspace:*",
|
|
272
|
+
"@stacksjs/utils": "workspace:*",
|
|
263
273
|
"fast-glob": "^3.2.12",
|
|
264
|
-
"fs-extra": "^11.1.1"
|
|
274
|
+
"fs-extra": "^11.1.1",
|
|
275
|
+
"markdown-it": "^13.0.1",
|
|
276
|
+
"vue-component-meta": "^1.6.5"
|
|
265
277
|
},
|
|
266
278
|
"devDependencies": {
|
|
267
279
|
"@stacksjs/development": "workspace:*",
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { log
|
|
1
|
+
import { log } from '@stacksjs/cli'
|
|
2
2
|
import { projectPath } from '@stacksjs/path'
|
|
3
|
-
import {
|
|
3
|
+
import { del } from '@stacksjs/utils'
|
|
4
4
|
|
|
5
|
-
log.info('Running clean command...')
|
|
5
|
+
log.info('Running clean command...', projectPath())
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
log.error(result.error)
|
|
15
|
-
process.exit(ExitCode.FatalError)
|
|
7
|
+
await del([
|
|
8
|
+
projectPath('pnpm-lock.yaml'),
|
|
9
|
+
projectPath('node_modules/'),
|
|
10
|
+
projectPath('.stacks/**/dist'),
|
|
11
|
+
projectPath('.stacks/**/node_modules'),
|
|
12
|
+
])
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { log } from '@stacksjs/logging'
|
|
2
2
|
import { writeTextFile } from '@stacksjs/storage'
|
|
3
3
|
import { packageJsonPath } from '@stacksjs/path'
|
|
4
|
-
import { library } from '@stacksjs/config'
|
|
5
|
-
import { packageManager } from '../../package.json' assert { type: 'json' }
|
|
4
|
+
import { library, packageManager } from '@stacksjs/config'
|
|
6
5
|
|
|
7
6
|
export async function generatePackageJson(type: 'vue-components' | 'web-components' | 'functions') {
|
|
8
7
|
let name, description, directory, keywords, config, prettyName
|
|
@@ -10,7 +10,7 @@ function parseOptions(options?: ActionOptions) {
|
|
|
10
10
|
|
|
11
11
|
const parsedOptions = Object.entries(options).map(([key, value]) => {
|
|
12
12
|
if (key.length === 1)
|
|
13
|
-
return
|
|
13
|
+
return `-${key}=${value}`
|
|
14
14
|
if (typeof value === 'boolean' && value) // if the value is a boolean and true, just return the key
|
|
15
15
|
return `--${key}`
|
|
16
16
|
else
|
|
@@ -37,7 +37,6 @@ export async function runAction(action: string, options?: ActionOptions): Promis
|
|
|
37
37
|
// we need to parse options here because they need to bw passed to the action
|
|
38
38
|
const opts = parseOptions(options)
|
|
39
39
|
const cmd = `npx tsx ${actionsPath(`${action}.ts ${opts}`)}`
|
|
40
|
-
|
|
41
40
|
// eslint-disable-next-line no-console
|
|
42
41
|
console.log('cmd', cmd)
|
|
43
42
|
|
|
@@ -3,7 +3,7 @@ import { frameworkPath } from '@stacksjs/path'
|
|
|
3
3
|
import { runActions } from '@stacksjs/actions'
|
|
4
4
|
import { Action } from '@stacksjs/types'
|
|
5
5
|
|
|
6
|
-
// import { log } from '@
|
|
6
|
+
// import { log } from '@stacksjs/cli'
|
|
7
7
|
|
|
8
8
|
await runActions([
|
|
9
9
|
// Action.GeneratePackageJsons, // generate the package.json's for each package
|
package/core/ai/build.config.ts
CHANGED
package/core/ai/package.json
CHANGED
package/core/alias/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/alias",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.52.
|
|
4
|
+
"version": "0.52.2",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "The Stacks aliases.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"import": "./dist/index.mjs"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"main": "dist/index.mjs",
|
|
30
29
|
"module": "dist/index.mjs",
|
|
31
30
|
"types": "dist/index.d.ts",
|
|
32
31
|
"contributors": [
|
package/core/arrays/package.json
CHANGED
package/core/auth/package.json
CHANGED
package/core/auth/src/index.ts
CHANGED
package/core/buddy/README.md
CHANGED
|
@@ -72,7 +72,7 @@ _Create your personal or professional Vercel-like cloud, based on MIT-licensed O
|
|
|
72
72
|
- ⛅️ **Serverless** _on-demand, auto-scaling, zero maintenance_
|
|
73
73
|
- 🚏 **CDN** _zero-config low-latency CDN, including request life-cycle hooks & optimized request compressions (Brotli & gzip)_
|
|
74
74
|
- 🔀 **Domain** _version-controlled & zero-config domain management (e.g. DNS)_
|
|
75
|
-
- 📧 **Email** _secure & simplistic easy-peasy@custom-domains.com mail_
|
|
75
|
+
- 📧 **Email** _secure & simplistic <easy-peasy@custom-domains.com> mail_
|
|
76
76
|
- 🔐 **Firewall** _native web application firewall support_
|
|
77
77
|
- 🚜 **Maintenance** _handles your cloud infrastructure via the Stacks & Serverless framework_
|
|
78
78
|
- 🤖 **Infrastructure as Code** _create & maintain your cloud infrastructure with ease_
|
package/core/buddy/package.json
CHANGED
|
@@ -110,12 +110,10 @@ async function build(buddy: CLI) {
|
|
|
110
110
|
const startTime = await intro('buddy build:core')
|
|
111
111
|
const result = await runAction(Action.BuildCore, options)
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// process.exit()
|
|
118
|
-
// }
|
|
113
|
+
if (result.isErr()) {
|
|
114
|
+
log.error('Failed to build the Stacks core.', result.error as Error)
|
|
115
|
+
process.exit()
|
|
116
|
+
}
|
|
119
117
|
|
|
120
118
|
outro('Stacks core built successfully', { startTime, useSeconds: true })
|
|
121
119
|
})
|
|
@@ -127,12 +125,11 @@ async function build(buddy: CLI) {
|
|
|
127
125
|
.action(async (options: BuildOptions) => {
|
|
128
126
|
const startTime = await intro('buddy build:stacks')
|
|
129
127
|
const result = await runAction(Action.BuildStacks, options)
|
|
130
|
-
console.log('result', result)
|
|
131
128
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
if (result.isErr()) {
|
|
130
|
+
log.error('Failed to build Stacks.', result.error as Error)
|
|
131
|
+
process.exit()
|
|
132
|
+
}
|
|
136
133
|
|
|
137
134
|
outro('Stacks built successfully', { startTime, useSeconds: true })
|
|
138
135
|
})
|
|
@@ -15,12 +15,11 @@ async function changelog(buddy: CLI) {
|
|
|
15
15
|
.action(async (options: FreshOptions) => {
|
|
16
16
|
const perf = await intro('buddy changelog')
|
|
17
17
|
const result = await runAction(Action.Changelog, options)
|
|
18
|
-
console.log('result', result)
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
outro('While running the changelog command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
21
|
+
process.exit()
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
outro('Generated the CHANGELOG.md file.', { startTime: perf, useSeconds: true })
|
|
26
25
|
process.exit(ExitCode.Success)
|
|
@@ -13,16 +13,15 @@ async function clean(buddy: CLI) {
|
|
|
13
13
|
.command('clean', descriptions.clean)
|
|
14
14
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
15
15
|
.action(async (options: CleanOptions) => {
|
|
16
|
-
// { shell: true, verbose: true }
|
|
17
16
|
const perf = await intro('buddy clean')
|
|
18
|
-
const result = await runAction(Action.
|
|
17
|
+
const result = await runAction(Action.Clean, { ...options, verbose: true })
|
|
19
18
|
|
|
20
19
|
if (result.isErr()) {
|
|
21
20
|
outro('While running the clean command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
22
21
|
process.exit(ExitCode.FatalError)
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
outro('Cleaned
|
|
24
|
+
outro('Cleaned up', { startTime: perf, useSeconds: true })
|
|
26
25
|
process.exit(ExitCode.Success)
|
|
27
26
|
})
|
|
28
27
|
}
|
|
@@ -15,12 +15,11 @@ async function deploy(buddy: CLI) {
|
|
|
15
15
|
.action(async (options: DeployOptions) => {
|
|
16
16
|
const perf = await intro('buddy deploy')
|
|
17
17
|
const result = await runAction(Action.Deploy, options)
|
|
18
|
-
console.log('result', result)
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
outro('While running the `buddy deploy`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
21
|
+
process.exit()
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
outro('Deployment succeeded.', { startTime: perf, useSeconds: true })
|
|
26
25
|
process.exit(ExitCode.Success)
|
|
@@ -81,7 +81,8 @@ async function dev(buddy: CLI) {
|
|
|
81
81
|
process.exit()
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
console.log('')
|
|
85
|
+
outro('Exited', { startTime: perf, useSeconds: true })
|
|
85
86
|
process.exit(ExitCode.Success)
|
|
86
87
|
})
|
|
87
88
|
|
|
@@ -14,10 +14,10 @@ async function fresh(buddy: CLI) {
|
|
|
14
14
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
15
15
|
.action(async (options: FreshOptions) => {
|
|
16
16
|
const perf = await intro('buddy fresh')
|
|
17
|
-
const result = await runAction(Action.Fresh, { verbose: true })
|
|
17
|
+
const result = await runAction(Action.Fresh, { ...options, verbose: true })
|
|
18
18
|
|
|
19
19
|
if (result.isErr()) {
|
|
20
|
-
outro('While running the fresh command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
20
|
+
outro('While running the `fresh` command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
21
21
|
process.exit(ExitCode.FatalError)
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -10,12 +10,11 @@ async function inspire(buddy: CLI) {
|
|
|
10
10
|
.action(async () => {
|
|
11
11
|
const perf = await intro('buddy inspire')
|
|
12
12
|
const result = await runAction(Action.Inspire)
|
|
13
|
-
console.log('result', result)
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (result.isErr()) {
|
|
15
|
+
outro('While running the inspire command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
16
|
+
process.exit()
|
|
17
|
+
}
|
|
19
18
|
|
|
20
19
|
outro('Your quote is: ...', { startTime: perf, useSeconds: true })
|
|
21
20
|
process.exit(ExitCode.Success)
|
|
@@ -15,12 +15,11 @@ async function key(buddy: CLI) {
|
|
|
15
15
|
.action(async (options: KeyOptions) => {
|
|
16
16
|
const startTime = await intro('buddy key:generate')
|
|
17
17
|
const result = await runAction(Action.KeyGenerate, options)
|
|
18
|
-
console.log('result', result)
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
log.error('Failed to set random application key.', result.error as Error)
|
|
21
|
+
process.exit()
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
outro('Set random application key.', { startTime })
|
|
26
25
|
})
|
|
@@ -17,12 +17,11 @@ async function lint(buddy: CLI) {
|
|
|
17
17
|
.action(async (options: LintOptions) => {
|
|
18
18
|
const perf = await intro('buddy lint')
|
|
19
19
|
const result = await runAction(Action.Lint, { ...options, showSpinner: true, spinnerText: 'Linting...' })
|
|
20
|
-
console.log('result', result)
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (result.isErr()) {
|
|
22
|
+
outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
23
|
+
process.exit()
|
|
24
|
+
}
|
|
26
25
|
|
|
27
26
|
outro('Linted your project.', { startTime: perf, useSeconds: true })
|
|
28
27
|
})
|
|
@@ -33,12 +32,11 @@ async function lint(buddy: CLI) {
|
|
|
33
32
|
.action(async (options: LintOptions) => {
|
|
34
33
|
log.info('Fixing lint errors...')
|
|
35
34
|
const result = await runAction(Action.LintFix, { ...options, showSpinner: true, spinnerText: 'Linting...' })
|
|
36
|
-
console.log('result', result)
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
if (result.isErr()) {
|
|
37
|
+
log.error('There was an error lint fixing your code.', result.error as Error)
|
|
38
|
+
process.exit()
|
|
39
|
+
}
|
|
42
40
|
|
|
43
41
|
log.success('Fixed lint errors.')
|
|
44
42
|
})
|
|
@@ -185,12 +185,11 @@ async function make(buddy: CLI) {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
const result = await createNotification(options)
|
|
188
|
-
console.log('result', result)
|
|
189
188
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
if (!result) {
|
|
190
|
+
outro('While running the make:notification command, there was an issue', { startTime: perf, useSeconds: true, isError: true })
|
|
191
|
+
process.exit()
|
|
192
|
+
}
|
|
194
193
|
|
|
195
194
|
outro(`Created your ${italic(name)} notification.`, { startTime: perf, useSeconds: true })
|
|
196
195
|
process.exit(ExitCode.Success)
|
|
@@ -15,12 +15,11 @@ async function migrate(buddy: CLI) {
|
|
|
15
15
|
.action(async (options: FreshOptions) => {
|
|
16
16
|
const perf = await intro('buddy migrate')
|
|
17
17
|
const result = await runAction(Action.Migrate, { ...options, showSpinner: true, spinnerText: 'Migrating...' })
|
|
18
|
-
console.log('result', result)
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
outro('While running the migrate command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
21
|
+
process.exit()
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
const APP_ENV = process.env.APP_ENV || 'local'
|
|
26
25
|
|
|
@@ -15,12 +15,11 @@ async function onboarding(buddy: CLI) {
|
|
|
15
15
|
.action(async () => {
|
|
16
16
|
const startTime = await intro('buddy page:onboarding')
|
|
17
17
|
const result = await runAction(Action.GenerateOnboarding)
|
|
18
|
-
console.log('result', result)
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
log.error('Something went wrong when generating', result.error as Error)
|
|
21
|
+
process.exit()
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
outro('Pages generated successfully', { startTime })
|
|
26
25
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/types'
|
|
2
2
|
import type { CLI, ReleaseOptions } from '@stacksjs/types'
|
|
3
|
-
import { intro, outro } from '@stacksjs/cli'
|
|
3
|
+
import { intro, log, outro } from '@stacksjs/cli'
|
|
4
4
|
import { runAction } from '@stacksjs/actions'
|
|
5
5
|
|
|
6
6
|
const descriptions = {
|
|
@@ -14,22 +14,14 @@ async function release(buddy: CLI) {
|
|
|
14
14
|
.option('--verbose', descriptions.verbose, { default: true }) // it's on by default because it requires manual input
|
|
15
15
|
.action(async (options: ReleaseOptions) => {
|
|
16
16
|
const startTime = await intro('buddy release')
|
|
17
|
-
const result = await runAction(Action.Release, { shell: true })
|
|
18
|
-
|
|
19
|
-
console.log('result', result)
|
|
20
|
-
|
|
21
|
-
// check if any element of the array is an error
|
|
22
|
-
if (Array.isArray(result) && result.some(r => r.isErr())) {
|
|
23
|
-
log.error('Failed to trigger the CI/CD release workflow.', result)
|
|
24
|
-
process.exit()
|
|
25
|
-
}
|
|
17
|
+
const result = await runAction(Action.Release, { ...options, shell: true })
|
|
26
18
|
|
|
27
19
|
if (result.isErr()) {
|
|
28
|
-
log.error('Failed to
|
|
20
|
+
log.error('Failed to release', result.error)
|
|
29
21
|
process.exit()
|
|
30
22
|
}
|
|
31
23
|
|
|
32
|
-
outro('Triggered CI/CD release workflow', { startTime, useSeconds: true })
|
|
24
|
+
outro('Triggered your CI/CD release workflow', { startTime, useSeconds: true })
|
|
33
25
|
})
|
|
34
26
|
}
|
|
35
27
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { CLI,
|
|
2
|
-
import {
|
|
1
|
+
import type { CLI, SeedOptions } from '@stacksjs/types'
|
|
2
|
+
import { runAction } from '@stacksjs/actions'
|
|
3
|
+
import { intro, outro } from '@stacksjs/cli'
|
|
4
|
+
import { Action, ExitCode } from '@stacksjs/types'
|
|
3
5
|
|
|
4
6
|
async function seed(buddy: CLI) {
|
|
5
7
|
const descriptions = {
|
|
@@ -10,21 +12,19 @@ async function seed(buddy: CLI) {
|
|
|
10
12
|
buddy
|
|
11
13
|
.command('seed', descriptions.seed)
|
|
12
14
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
13
|
-
.action(async (options:
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
.action(async (options: SeedOptions) => {
|
|
16
|
+
const perf = await intro('buddy seed')
|
|
17
|
+
const result = await runAction(Action.Seed, { ...options, showSpinner: true, spinnerText: 'Seeding...' })
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
outro('While running the seed command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
|
|
21
|
+
process.exit(ExitCode.FatalError)
|
|
22
|
+
}
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
const APP_ENV = process.env.APP_ENV || 'local'
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
await seeder()
|
|
26
|
+
outro(`Seeded your ${APP_ENV} database.`, { startTime: perf, useSeconds: true })
|
|
27
|
+
process.exit(ExitCode.Success)
|
|
28
28
|
})
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -15,12 +15,11 @@ async function setting(buddy: CLI) {
|
|
|
15
15
|
.action(async () => {
|
|
16
16
|
const startTime = await intro('buddy page:setting')
|
|
17
17
|
const result = await runAction(Action.GenerateSettings)
|
|
18
|
-
console.log('result', result)
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
log.error('Something went wrong when generating', result.error as Error)
|
|
21
|
+
process.exit()
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
outro('Pages generated successfully', { startTime })
|
|
26
25
|
})
|