Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Feb 11, 2024
1 parent c21ef72 commit 7828514
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export default {
'meta.llama2-70b-chat-v1',
],

deploy: true,
deploy: true, // deploys AI endpoints
} satisfies AiConfig
8 changes: 4 additions & 4 deletions storage/framework/core/actions/src/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const bumpCommand = options?.dryRun
? 'bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --no-push'
: 'bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --all'

await runCommand(
bumpCommand,
{ cwd: p.frameworkPath(), stdin: 'inherit' },
)
await runCommand(bumpCommand, {
cwd: p.frameworkPath(),
stdin: 'inherit',
})
13 changes: 9 additions & 4 deletions storage/framework/core/actions/src/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as storage from '@stacksjs/storage'
import { buddyOptions, italic, parseOptions, runCommand, runCommands, underline } from '@stacksjs/cli'
import { buddyOptions, runCommand, runCommands } from '@stacksjs/cli'
import { log } from '@stacksjs/logging'
import * as p from '@stacksjs/path'
import type { ActionOptions, StacksError, Subprocess } from '@stacksjs/types'
Expand All @@ -22,8 +22,8 @@ export async function runAction(action: string, options?: ActionOptions): Promis
...options,
}

log.debug('runAction:', underline(italic(cmd)))
log.debug('runAction Options:', optionsWithCwd)
log.debug('runAction:', cmd)
log.debug('action options:', optionsWithCwd)

if (!hasAction(action))
return err(handleError(`The specified action "${action}" does not exist`))
Expand All @@ -39,6 +39,9 @@ export async function runAction(action: string, options?: ActionOptions): Promis
* @returns The result of the command.
*/
export async function runActions(actions: string[], options?: ActionOptions) {
log.debug('runActions:', actions)
log.debug('actions options:', options)

if (!actions.length)
return err('No actions were specified')

Expand All @@ -51,11 +54,13 @@ export async function runActions(actions: string[], options?: ActionOptions) {

const o = {
cwd: options?.cwd || p.projectPath(),
...parseOptions(),
...options,
}

const commands = actions.map(action => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`)

// eslint-disable-next-line no-console
console.log('this should have inherit:', o)
return await runCommands(commands, o)
}

Expand Down
5 changes: 4 additions & 1 deletion storage/framework/core/actions/src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ await runActions([
Action.LintFix, // ensure there are no lint errors
// Action.Test, // run the tests
Action.Bump, // bump the versions, create the git tag, generate the changelog, commit & push the changes
], { cwd: projectPath(), stdin: 'inherit' }) // debug mode needs to be enabled to see the output due to the interactive prompts
], { // debug mode needs to be enabled to see the output due to the interactive prompts
cwd: projectPath(),
stdin: 'inherit',
})

log.success(`Successfully released ${app.name}`)
16 changes: 8 additions & 8 deletions storage/framework/core/cli/src/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
if (!cmd)
return err(handleError(`Failed to parse command: ${cmd}`, options))

log.debug('Running exec:', Array.isArray(command) ? command.join(' ') : command)
log.debug('exec:', Array.isArray(command) ? command.join(' ') : command)
log.debug('cmd:', cmd)
log.debug('Options:', options)
log.debug('exec options:', options)

const proc = Bun.spawn(cmd, {
...options,
Expand All @@ -51,12 +51,12 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
})

// Check if we need to write to stdin
if (options?.stdin === 'pipe' && options.input) {
if (proc.stdin) {
proc.stdin.write(options.input)
proc.stdin.end()
}
}
// if (options?.stdin === 'pipe' && options.input) {
// if (proc.stdin) {
// proc.stdin.write(options.input)
// proc.stdin.end()
// }
// }

const exited = await proc.exited
if (exited === ExitCode.Success)
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { log } from './console'
*/
export async function runCommand(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>> {
log.debug('runCommand:', command)
log.debug('runCommand Options:', options)
log.debug('options:', options)

return await exec(command, options)
}
Expand Down

0 comments on commit 7828514

Please sign in to comment.