stacks 0.61.18 → 0.61.20
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/buddy/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.61.
|
|
4
|
+
"version": "0.61.20",
|
|
5
5
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -50,14 +50,20 @@
|
|
|
50
50
|
},
|
|
51
51
|
"module": "dist/index.js",
|
|
52
52
|
"types": "dist/index.d.ts",
|
|
53
|
-
"contributors": [
|
|
53
|
+
"contributors": [
|
|
54
|
+
"Chris Breuer <chris@stacksjs.org>"
|
|
55
|
+
],
|
|
54
56
|
"bin": {
|
|
55
57
|
"stacks": "dist/cli.mjs",
|
|
56
58
|
"stx": "dist/cli.mjs",
|
|
57
59
|
"buddy": "dist/cli.mjs",
|
|
58
60
|
"bud": "dist/cli.mjs"
|
|
59
61
|
},
|
|
60
|
-
"files": [
|
|
62
|
+
"files": [
|
|
63
|
+
"README.md",
|
|
64
|
+
"dist",
|
|
65
|
+
"src"
|
|
66
|
+
],
|
|
61
67
|
"scripts": {
|
|
62
68
|
"buddy": "bunx ./src/cli.ts",
|
|
63
69
|
"build": "bun --bun build.ts && bun run compile",
|
package/buddy/src/cli.ts
CHANGED
|
@@ -16,7 +16,7 @@ process.on('uncaughtException', (error: Error) => {
|
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
process.on('unhandledRejection', (error: Error) => {
|
|
19
|
-
log.debug('unhandledRejection')
|
|
19
|
+
log.debug('unhandledRejection', error)
|
|
20
20
|
log.error(error)
|
|
21
21
|
process.exit(1)
|
|
22
22
|
})
|
|
@@ -64,6 +64,7 @@ async function main() {
|
|
|
64
64
|
cmd.make(buddy)
|
|
65
65
|
cmd.migrate(buddy)
|
|
66
66
|
cmd.release(buddy)
|
|
67
|
+
cmd.route(buddy)
|
|
67
68
|
cmd.seed(buddy)
|
|
68
69
|
cmd.setup(buddy)
|
|
69
70
|
cmd.test(buddy)
|
|
@@ -21,13 +21,13 @@ export function lint(buddy: CLI) {
|
|
|
21
21
|
log.debug('Running `buddy lint` ...', options)
|
|
22
22
|
|
|
23
23
|
const startTime = await intro('buddy lint')
|
|
24
|
-
const result = await runAction(Action.Lint, options)
|
|
25
|
-
|
|
26
|
-
// console.log('res', result)
|
|
27
|
-
if (result.isErr()) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
24
|
+
// const result = await runAction(Action.Lint, options)
|
|
25
|
+
//
|
|
26
|
+
// // console.log('res', result)
|
|
27
|
+
// if (result.isErr()) {
|
|
28
|
+
// await outro('While running `buddy lint`, there was an issue', { startTime, useSeconds: true }, result.error)
|
|
29
|
+
// process.exit()
|
|
30
|
+
// }
|
|
31
31
|
|
|
32
32
|
await outro('Linted your project', { startTime, useSeconds: true })
|
|
33
33
|
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import process from 'node:process'
|
|
2
|
+
import { runAction } from '@stacksjs/actions'
|
|
3
|
+
import { intro, outro } from '@stacksjs/cli'
|
|
4
|
+
import { Action } from '@stacksjs/enums'
|
|
5
|
+
import { ExitCode } from '@stacksjs/types'
|
|
6
|
+
import type { CLI, MigrateOptions } from '@stacksjs/types'
|
|
7
|
+
|
|
8
|
+
export function route(buddy: CLI) {
|
|
9
|
+
const descriptions = {
|
|
10
|
+
route: 'Lists your routes',
|
|
11
|
+
verbose: 'Enable verbose output',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
buddy
|
|
15
|
+
.command('route:list', descriptions.route)
|
|
16
|
+
.option('--verbose', descriptions.verbose, { default: false })
|
|
17
|
+
.action(async (options: MigrateOptions) => {
|
|
18
|
+
const perf = await intro('buddy route:list')
|
|
19
|
+
const result = await runAction(Action.RouteList, options)
|
|
20
|
+
|
|
21
|
+
if (result.isErr()) {
|
|
22
|
+
await outro(
|
|
23
|
+
'While running the migrate command, there was an issue',
|
|
24
|
+
{ startTime: perf, useSeconds: true },
|
|
25
|
+
result.error,
|
|
26
|
+
)
|
|
27
|
+
process.exit()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
await outro(`Successfully listed routes`)
|
|
31
|
+
|
|
32
|
+
process.exit(ExitCode.Success)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
buddy.on('route:*', () => {
|
|
36
|
+
console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
|
|
37
|
+
process.exit(1)
|
|
38
|
+
})
|
|
39
|
+
}
|