Skip to content

Commit ca2f4d0

Browse files
committed
chore: wip
1 parent 5758cd5 commit ca2f4d0

File tree

8 files changed

+41
-36
lines changed

8 files changed

+41
-36
lines changed

.stacks/core/buddy/src/cli.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
import process from 'node:process'
22
import { handleError } from '@stacksjs/error-handling'
33
import { command } from '@stacksjs/cli'
4-
import { frameworkVersion, initProject, isProjectCreated } from '@stacksjs/utils'
4+
import { initProject, isProjectInitialized } from '@stacksjs/utils'
5+
import pkg from '../package.json'
56
import * as cmd from './commands'
67

7-
const cli = command.cli('buddy')
8+
const { version } = pkg
89

910
// setup global error handlers
1011
process.on('uncaughtException', handleError)
1112
process.on('unhandledRejection', handleError)
1213

1314
async function main() {
15+
const cli = command.cli('buddy')
1416
// the following commands are not dependent on the project being initialized
1517
// await installIfVersionMismatch()
1618
cmd.setup(cli)
1719
cmd.key(cli)
1820

1921
// before running any commands, check if the project is already initialized
20-
if (!await isProjectCreated())
22+
if (!await isProjectInitialized())
2123
await initProject()
2224

2325
cmd.preinstall(cli)

.stacks/core/buddy/src/commands/setup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { runCommand } from '@stacksjs/cli'
2-
import { type CLI, type CliOptions } from '@stacksjs/types'
2+
import type { CLI, CliOptions } from '@stacksjs/types'
33

44
export function setup(buddy: CLI) {
55
const descriptions = {
6-
ensure: 'This command checks whether Node is installed. bun is checked via `only-allow` preinstall hook',
7-
setup: 'This command installs Node & bun',
6+
ensure: 'This command checks whether Bun is installed. If not, it installs it',
7+
setup: 'This command installs Bun',
88
verbose: 'Enable verbose output',
99
}
1010

.stacks/core/cli/src/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type CliOptions, type CommandError, type Subprocess } from '@stacksjs/types'
2-
import { type Result, errAsync } from '@stacksjs/error-handling'
2+
import { type Result, errAsync, okAsync } from '@stacksjs/error-handling'
33
import { exec } from './exec'
44

55
/**

.stacks/core/utils/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function initProject(): Promise<Result<Subprocess, StacksError>> {
3636
return ok(result.value)
3737
}
3838

39-
export async function isProjectCreated() {
39+
export async function isProjectInitialized() {
4040
if (storage.isFile('.env'))
4141
return await isAppKeySet()
4242

.stacks/package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
"import": "./core/analytics/dist/index.js"
6262
},
6363
"./arrays": {
64-
"bun": "./core/utils/arrays/src/index.ts",
65-
"types": "./core/utils/arrays/dist/index.d.ts",
66-
"import": "./core/utils/arrays/dist/index.js"
64+
"bun": "./core/arrays/src/index.ts",
65+
"types": "./core/arrays/dist/index.d.ts",
66+
"import": "./core/arrays/dist/index.js"
6767
},
6868
"./auth": {
6969
"bun": "./core/auth/src/index.ts",
@@ -96,9 +96,9 @@
9696
"import": "./core/cli/dist/index.js"
9797
},
9898
"./collections": {
99-
"bun": "./core/utils/collections/src/index.ts",
100-
"types": "./core/utils/collections/dist/index.d.ts",
101-
"import": "./core/utils/collections/dist/index.js"
99+
"bun": "./core/collections/src/index.ts",
100+
"types": "./core/collections/dist/index.d.ts",
101+
"import": "./core/collections/dist/index.js"
102102
},
103103
"./config": {
104104
"bun": "./core/config/src/index.ts",
@@ -136,9 +136,9 @@
136136
"import": "./core/docs/dist/index.js"
137137
},
138138
"./email": {
139-
"bun": "./core/notifications/email/src/index.ts",
140-
"types": "./core/notifications/email/dist/index.d.ts",
141-
"import": "./core/notifications/email/dist/index.js"
139+
"bun": "./core/email/src/index.ts",
140+
"types": "./core/email/dist/index.d.ts",
141+
"import": "./core/email/dist/index.js"
142142
},
143143
"./error-handling": {
144144
"bun": "./core/error-handling/src/index.ts",
@@ -156,9 +156,9 @@
156156
"import": "./core/faker/dist/index.js"
157157
},
158158
"./git": {
159-
"bun": "./core/utils/git/src/index.ts",
160-
"types": "./core/utils/git/dist/index.d.ts",
161-
"import": "./core/utils/git/dist/index.js"
159+
"bun": "./core/git/src/index.ts",
160+
"types": "./core/git/dist/index.d.ts",
161+
"import": "./core/git/dist/index.js"
162162
},
163163
"./health": {
164164
"bun": "./core/health/src/index.ts",
@@ -201,9 +201,9 @@
201201
"import": "./core/payments/dist/index.js"
202202
},
203203
"./push": {
204-
"bun": "./core/notifications/push/src/index.ts",
205-
"types": "./core/notifications/push/dist/index.d.ts",
206-
"import": "./core/notifications/push/dist/index.js"
204+
"bun": "./core/push/src/index.ts",
205+
"types": "./core/push/dist/index.d.ts",
206+
"import": "./core/push/dist/index.js"
207207
},
208208
"./query-builder": {
209209
"bun": "./core/query-builder/src/index.ts",
@@ -256,24 +256,24 @@
256256
"import": "./core/signals/dist/index.js"
257257
},
258258
"./slug": {
259-
"bun": "./core/utils/slug/src/index.ts",
260-
"types": "./core/utils/slug/dist/index.d.ts",
261-
"import": "./core/utils/slug/dist/index.js"
259+
"bun": "./core/slug/src/index.ts",
260+
"types": "./core/slug/dist/index.d.ts",
261+
"import": "./core/slug/dist/index.js"
262262
},
263263
"./sms": {
264-
"bun": "./core/notifications/sms/src/index.ts",
265-
"types": "./core/notifications/sms/dist/index.d.ts",
266-
"import": "./core/notifications/sms/dist/index.js"
264+
"bun": "./core/sms/src/index.ts",
265+
"types": "./core/sms/dist/index.d.ts",
266+
"import": "./core/sms/dist/index.js"
267267
},
268268
"./storage": {
269269
"bun": "./core/storage/src/index.ts",
270270
"types": "./core/storage/dist/index.d.ts",
271271
"import": "./core/storage/dist/index.js"
272272
},
273273
"./strings": {
274-
"bun": "./core/utils/strings/src/index.ts",
275-
"types": "./core/utils/strings/dist/index.d.ts",
276-
"import": "./core/utils/strings/dist/index.js"
274+
"bun": "./core/strings/src/index.ts",
275+
"types": "./core/strings/dist/index.d.ts",
276+
"import": "./core/strings/dist/index.js"
277277
},
278278
"./testing": {
279279
"bun": "./core/testing/src/index.ts",

.stacks/types/auto-imports.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ declare global {
330330
const isPositive: typeof import('../core/validation/src/is')['isPositive']
331331
const isPositiveOrNegative: typeof import('../core/validation/src/is')['isPositiveOrNegative']
332332
const isPrimitive: typeof import('../core/validation/src/is')['isPrimitive']
333-
const isProjectCreated: typeof import('../core/utils/src/helpers')['isProjectCreated']
333+
const isProjectInitialized: typeof import('../core/utils/src/helpers')['isProjectInitialized']
334334
const isPromise: typeof import('../core/validation/src/is')['isPromise']
335335
const isProxy: typeof import('vue')['isProxy']
336336
const isReactive: typeof import('vue')['isReactive']
@@ -1086,7 +1086,7 @@ declare module 'vue' {
10861086
readonly isPositive: UnwrapRef<typeof import('../core/validation/src/is')['isPositive']>
10871087
readonly isPositiveOrNegative: UnwrapRef<typeof import('../core/validation/src/is')['isPositiveOrNegative']>
10881088
readonly isPrimitive: UnwrapRef<typeof import('../core/validation/src/is')['isPrimitive']>
1089-
readonly isProjectCreated: UnwrapRef<typeof import('../core/utils/src/helpers')['isProjectCreated']>
1089+
readonly isProjectInitialized: UnwrapRef<typeof import('../core/utils/src/helpers')['isProjectInitialized']>
10901090
readonly isPromise: UnwrapRef<typeof import('../core/validation/src/is')['isPromise']>
10911091
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
10921092
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
@@ -1835,7 +1835,7 @@ declare module '@vue/runtime-core' {
18351835
readonly isPositive: UnwrapRef<typeof import('../core/validation/src/is')['isPositive']>
18361836
readonly isPositiveOrNegative: UnwrapRef<typeof import('../core/validation/src/is')['isPositiveOrNegative']>
18371837
readonly isPrimitive: UnwrapRef<typeof import('../core/validation/src/is')['isPrimitive']>
1838-
readonly isProjectCreated: UnwrapRef<typeof import('../core/utils/src/helpers')['isProjectCreated']>
1838+
readonly isProjectInitialized: UnwrapRef<typeof import('../core/utils/src/helpers')['isProjectInitialized']>
18391839
readonly isPromise: UnwrapRef<typeof import('../core/validation/src/is')['isPromise']>
18401840
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
18411841
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>

bun.lockb

0 Bytes
Binary file not shown.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,8 @@
115115
".stacks/vcs/*",
116116
".stacks/views/*",
117117
".stacks"
118-
]
118+
],
119+
"dependencies": {
120+
"stacks": "workspace:*"
121+
}
119122
}

0 commit comments

Comments
 (0)