Skip to content

Commit 04e397e

Browse files
committed
chore: wip
1 parent 2192635 commit 04e397e

File tree

18 files changed

+97
-56
lines changed

18 files changed

+97
-56
lines changed

.stacks/core/actions/package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,21 @@
259259
"vue-component-meta": "^1.6.5"
260260
},
261261
"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:*",
262271
"@stacksjs/strings": "workspace:*",
272+
"@stacksjs/utils": "workspace:*",
263273
"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"
265277
},
266278
"devDependencies": {
267279
"@stacksjs/development": "workspace:*",

.stacks/core/actions/src/clean.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import { log, runCommand } from '@stacksjs/cli'
1+
import { log } from '@stacksjs/cli'
22
import { projectPath } from '@stacksjs/path'
3-
import { ExitCode, NpmScript } from '@stacksjs/types'
3+
import { del } from '@stacksjs/utils'
44

5-
log.info('Running clean command...')
5+
log.info('Running clean command...', projectPath())
66

7-
const result = await runCommand(NpmScript.Clean, { cwd: projectPath() })
8-
9-
if (result.isOk()) {
10-
log.success('Cleaned up')
11-
process.exit(ExitCode.Success)
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+
])

.stacks/core/actions/src/helpers/package-json.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { log } from '@stacksjs/logging'
22
import { writeTextFile } from '@stacksjs/storage'
33
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'
65

76
export async function generatePackageJson(type: 'vue-components' | 'web-components' | 'functions') {
87
let name, description, directory, keywords, config, prettyName

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ export async function runAction(action: string, options?: ActionOptions): Promis
3838
const opts = parseOptions(options)
3939
const cmd = `npx tsx ${actionsPath(`${action}.ts ${opts}`)}`
4040

41-
// eslint-disable-next-line no-console
42-
console.log('cmd', cmd)
43-
4441
if (options?.verbose)
4542
log.debug('running command:', italic(cmd))
4643

.stacks/core/buddy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ _Create your personal or professional Vercel-like cloud, based on MIT-licensed O
7272
- ⛅️ **Serverless** _on-demand, auto-scaling, zero maintenance_
7373
- 🚏 **CDN** _zero-config low-latency CDN, including request life-cycle hooks & optimized request compressions (Brotli & gzip)_
7474
- 🔀 **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_
7676
- 🔐 **Firewall** _native web application firewall support_
7777
- 🚜 **Maintenance** _handles your cloud infrastructure via the Stacks & Serverless framework_
7878
- 🤖 **Infrastructure as Code** _create & maintain your cloud infrastructure with ease_

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ async function clean(buddy: CLI) {
1414
.option('--verbose', descriptions.verbose, { default: false })
1515
.action(async (options: CleanOptions) => {
1616
const perf = await intro('buddy clean')
17-
const result = await runAction(Action.Fresh, { ...options, verbose: true })
17+
const result = await runAction(Action.Clean, { ...options, verbose: true })
1818

1919
if (result.isErr()) {
2020
outro('While running the clean command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
2121
process.exit(ExitCode.FatalError)
2222
}
2323

24-
outro('Cleaned project.', { startTime: perf, useSeconds: true })
24+
outro('Cleaned up', { startTime: perf, useSeconds: true })
2525
process.exit(ExitCode.Success)
2626
})
2727
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function fresh(buddy: CLI) {
1717
const result = await runAction(Action.Fresh, { ...options, verbose: true })
1818

1919
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)
2121
process.exit(ExitCode.FatalError)
2222
}
2323

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,8 @@ async function release(buddy: CLI) {
1616
const startTime = await intro('buddy release')
1717
const result = await runAction(Action.Release, { ...options, shell: true })
1818

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-
}
26-
2719
if (result.isErr()) {
28-
log.error('Failed to trigger the CI/CD release workflow.', result.error)
20+
log.error('Failed to complete ', result.error)
2921
process.exit()
3022
}
3123

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ import { bold, dim, green, intro } from '@stacksjs/cli'
33
import { filesystem } from '@stacksjs/storage'
44
import { log } from '@stacksjs/logging'
55
import { frameworkPath } from '@stacksjs/path'
6-
import type { PackageJson } from 'type/node'
76

87
async function version(buddy: CLI) {
8+
// maybe use type-fest?
9+
type PackageJson = {
10+
engines: {
11+
node: string
12+
pnpm: string
13+
}
14+
version: string
15+
}
16+
917
const { fs } = filesystem
1018

1119
const descriptions = {

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { execSync as childExec } from 'node:child_process'
22
import type { CliOptions, CommandResult, CommandReturnValue, ResultAsync, SpinnerOptions as Spinner } from '@stacksjs/types'
33
import { ExitCode } from '@stacksjs/types'
44
import { projectPath } from '@stacksjs/path'
5-
import { ResultAsync as AsyncResult, err } from '@stacksjs/error-handling'
5+
import { ResultAsync as AsyncResult } from '@stacksjs/error-handling'
66
import { determineDebugLevel } from '@stacksjs/utils'
77
import { log } from './console'
88
import { spawn } from './command'
@@ -46,7 +46,6 @@ export function execSync(command: string) {
4646
* @returns The result of the command.
4747
*/
4848
export async function runCommand(command: string, options?: CliOptions): Promise<ResultAsync<CommandReturnValue, Error>> {
49-
console.log('runCommand', command, options)
5049
return await exec(command, options)
5150
}
5251

@@ -69,8 +68,6 @@ export async function runCommands(commands: string[], options?: CliOptions): Pro
6968

7069
const spinner = determineSpinner(options)
7170

72-
console.log('spinner', spinner)
73-
7471
for (const command of commands) {
7572
const result = await runCommand(command, options)
7673

@@ -79,8 +76,7 @@ export async function runCommands(commands: string[], options?: CliOptions): Pro
7976
}
8077
else if (result.isErr()) {
8178
if (spinner) {
82-
// spinner.fail('Failed to run command.')
83-
err(result.error)
79+
log.error(new Error('Failed to run command'))
8480
process.exit(ExitCode.FatalError)
8581
}
8682

0 commit comments

Comments
 (0)