Skip to content

Commit 1157d47

Browse files
committed
chore: wip
1 parent 97e2f0c commit 1157d47

File tree

6 files changed

+21
-27
lines changed

6 files changed

+21
-27
lines changed

.stacks/core/actions/src/upgrade.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { log } from '@stacksjs/logging'
33
import * as storage from '@stacksjs/storage'
44
import { projectPath } from '@stacksjs/path'
55
import type { UpgradeOptions } from '@stacksjs/types'
6-
import { NpmScript } from '@stacksjs/types'
76

87
// import { determineDebugLevel } from '@stacksjs/utils'
98

@@ -50,14 +49,15 @@ export async function downloadFrameworkUpdate(options: UpgradeOptions) {
5049
log.success('Your framework updated correctly to version: ', version)
5150
}
5251

53-
export async function updateDependencies(options: UpgradeOptions) {
52+
// export async function updateDependencies(options: UpgradeOptions) {
53+
export async function updateDependencies() {
5454
const perf = await intro('buddy upgrade:dependencies')
55-
const result = await runCommand(NpmScript.UpgradeDependencies, options)
55+
// const result = await runCommand(NpmScript.UpgradeDependencies, options)
5656

57-
if (result.isErr()) {
58-
outro('While running the upgrade:dependencies command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
59-
process.exit()
60-
}
57+
// if (result.isErr()) {
58+
// outro('While running the upgrade:dependencies command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
59+
// process.exit()
60+
// }
6161

6262
outro('Freshly updated your dependencies.', { startTime: perf, useSeconds: true })
6363
process.exit()

.stacks/core/actions/test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// import { runCommand } from '@stacksjs/cli'
2+
3+
// const t = await runCommand(['echo', 'hello world'])

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function create(buddy: CLI) {
4242
await onlineCheck()
4343
const result = await download(name, path, options)
4444

45-
if (result.isErr()) {
45+
if (result?.isErr()) {
4646
log.error(result.error)
4747
process.exit(ExitCode.FatalError)
4848
}
@@ -100,14 +100,14 @@ async function install(path: string, options: CreateOptions) {
100100
log.info('Installing & setting up Stacks')
101101
let result = await runCommand('pnpm install', { ...options, cwd: path })
102102

103-
if (result.isErr()) {
103+
if (result?.isErr()) {
104104
log.error(result.error)
105105
process.exit()
106106
}
107107

108108
result = await runCommand('cp .env.example .env', { ...options, cwd: path })
109109

110-
if (result.isErr()) {
110+
if (result?.isErr()) {
111111
log.error(result.error)
112112
process.exit(ExitCode.FatalError)
113113
}
@@ -116,7 +116,7 @@ async function install(path: string, options: CreateOptions) {
116116

117117
result = await runCommand('git init', { ...options, cwd: path })
118118

119-
if (result.isErr()) {
119+
if (result?.isErr()) {
120120
log.error(result.error)
121121
process.exit(ExitCode.FatalError)
122122
}

.stacks/core/cli/src/actions/install.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { installPackage as installPkg } from '@antfu/install-pkg'
2-
import type { CommandReturnValue } from '@stacksjs/types'
32

43
interface InstallPackageOptions {
54
cwd?: string
@@ -18,7 +17,7 @@ interface InstallPackageOptions {
1817
* @param pkg - The options to pass to the install.The options to pass to the install.
1918
* @returns The result of the install.
2019
*/
21-
export async function installPackage(pkg: string, options?: InstallPackageOptions): Promise<CommandReturnValue> {
20+
export async function installPackage(pkg: string, options?: InstallPackageOptions) {
2221
if (options)
2322
return await installPkg(pkg, options)
2423

@@ -32,7 +31,7 @@ export async function installPackage(pkg: string, options?: InstallPackageOption
3231
* @param options - The options to pass to the install.
3332
* @returns The result of the install.
3433
*/
35-
export async function installStack(name: string, options?: InstallPackageOptions): Promise<CommandReturnValue> {
34+
export async function installStack(name: string, options?: InstallPackageOptions) {
3635
if (options)
3736
return await installPkg(`@stacksjs/${name}`, options)
3837

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { CliOptions, SpinnerOptions as Spinner } from '@stacksjs/types'
22
import { ExitCode } from '@stacksjs/types'
33
import { projectPath } from '@stacksjs/path'
44
import { determineDebugLevel } from '@stacksjs/utils'
5-
import { err, ok } from '@stacksjs/error-handling'
5+
import { ok } from '@stacksjs/error-handling'
66
import { log } from '@stacksjs/logging'
77
import { spawn, spawnSync } from './command'
88
import { startSpinner } from './helpers'
@@ -29,14 +29,6 @@ export async function exec(command: string | string[], options?: CliOptions) {
2929
cwd,
3030
env: process.env,
3131
shell,
32-
// stdio: 'inherit',
33-
onExit(subprocess, exitCode, signalCode, error) {
34-
console.log('subprocess', subprocess)
35-
console.log('exitCode', exitCode)
36-
console.log('signalCode', signalCode)
37-
console.log('error', error)
38-
return err('Failed to execute command')
39-
},
4032
})
4133

4234
console.log('proc', proc)
@@ -92,10 +84,10 @@ export async function runCommands(commands: string[], options?: CliOptions) {
9284
for (const command of commands) {
9385
const result = await runCommand(command, options)
9486

95-
if (result.isOk()) {
87+
if (result?.isOk()) {
9688
results.push(result)
9789
}
98-
else if (result.isErr()) {
90+
else if (result?.isErr()) {
9991
log.error(new Error(`Failed to run command ${italic(command)}`))
10092

10193
process.exit(ExitCode.FatalError)

.stacks/core/testing/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// export type { Expect, TestOptions as BunTestOptions, Test, Describe, Mock } from 'bun:test'
2-
// export { describe, test, it, afterEach, afterAll, beforeEach, beforeAll, jest, mock, expect, spyOn, setSystemTime } from 'bun:test'
1+
export type { Expect, TestOptions as BunTestOptions, Test, Describe, Mock } from 'bun:test'
2+
export { describe, test, it, afterEach, afterAll, beforeEach, beforeAll, jest, mock, expect, spyOn, setSystemTime } from 'bun:test'
33
export * as feature from '@playwright/test'

0 commit comments

Comments
 (0)