Skip to content

Commit 188962c

Browse files
committed
chore: wip
1 parent 7682a01 commit 188962c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+491
-274
lines changed

bun.lockb

-41.3 KB
Binary file not shown.

config/ai.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ export default {
2525
// 'meta.llama2-13b-chat-v1',
2626
'meta.llama2-70b-chat-v1',
2727
],
28+
29+
deploy: true,
2830
} satisfies AiConfig

config/docs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ const sidebar = {
331331

332332
{
333333
text: 'Project',
334-
// collapsible: true,
334+
collapsible: true,
335+
collapsed: true,
335336
items: [
336337
{ text: 'Roadmap', link: '/project/roadmap' },
337338
{ text: 'Contributing', link: '/project/contributing' },
@@ -354,6 +355,7 @@ export default {
354355
title: 'Stacks',
355356
description: 'Rapid application, cloud & library development framework.',
356357
lastUpdated: true,
358+
deploy: true,
357359

358360
themeConfig: {
359361
logo: 'https://raw.githubusercontent.com/stacksjs/stacks/main/public/logo-transparent.svg?https://raw.githubusercontent.com/stacksjs/stacks/main/public/logo-transparent.svg?asdas',

config/logger.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import type { LoggerConfig } from '@stacksjs/types'
2+
3+
/**
4+
* **Logger Configuration**
5+
*
6+
* This configuration defines all of your logger options. Because Stacks is fully-typed, you
7+
* may hover any of the options below and the definitions will be provided. In case you
8+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
9+
*/
10+
export default {
11+
/**
12+
* **Log Level**
13+
*
14+
* The log level is a number that represents the verbosity of the logs. The higher the number,
15+
* the more verbose the logs will be. The log levels are as follows:
16+
*
17+
* - 0: Error
18+
* - 1: Warning
19+
* - 2: Normal
20+
* - 3: Info
21+
* - 4: Debug
22+
* - 5: Trace
23+
* - -999: Silent
24+
* - +999: Verbose
25+
*
26+
* @default 3
27+
*/
28+
level: 3,
29+
30+
/**
31+
* **Log File Path**
32+
*
33+
* The path to the log file. This will be used to write logs to a file. If you do not want to
34+
* write logs to a file, you may set this to `null`.
35+
*
36+
* @default 'storage/logs/console.log'
37+
*/
38+
logFilePath: 'storage/logs/console.log',
39+
40+
/**
41+
* **Errors Log Path**
42+
*
43+
* The path to the errors log file. This will be used to write error logs to a file. If you do
44+
* not want to write error logs to a file, you may set this to `null`.
45+
*
46+
* @default 'storage/logs/errors.log'
47+
*/
48+
errorsPath: 'storage/logs/errors.log',
49+
} satisfies LoggerConfig

storage/framework/core/actions/src/bump.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ await runCommand(changelogCommand, {
88
cwd: p.projectPath(),
99
})
1010

11-
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'
11+
const bumpCommand = options?.dryRun
12+
? 'bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --no-push'
13+
: 'bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --all'
1214

1315
await runCommand(
1416
bumpCommand,

storage/framework/core/buddy/src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import process from 'node:process'
22
import { handleError } from '@stacksjs/error-handling'
33
import { CAC } from 'cac'
44
import { ensureProjectIsInitialized } from '@stacksjs/utils'
5-
import { path as p } from '@stacksjs/path'
6-
import { fs } from '@stacksjs/storage'
75
import { log } from '@stacksjs/cli'
86
import { collect } from '@stacksjs/collections'
97
import * as cmd from './commands'
@@ -94,7 +92,9 @@ async function main() {
9492
})
9593

9694
buddy.on('inspire:*', () => {
95+
// eslint-disable-next-line no-console
9796
console.log('Invalid command:', buddy.args.join(' '))
97+
// eslint-disable-next-line no-console
9898
console.log('See `--help` for a list of available commands')
9999
throw new Error('Invalid command')
100100
})

storage/framework/core/buddy/src/commands/add.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import process from 'node:process'
22
import type { AddOptions, BuildOptions, CLI } from '@stacksjs/types'
33
import { ExitCode } from '@stacksjs/types'
44
import { runAdd } from '@stacksjs/actions'
5+
import { log } from 'stacks/logging'
56

67
export function add(buddy: CLI) {
78
const descriptions = {
@@ -22,6 +23,8 @@ export function add(buddy: CLI) {
2223
.option('-p, --project', descriptions.project, { default: false })
2324
.option('--verbose', descriptions.verbose, { default: false })
2425
.action(async (options: BuildOptions) => {
26+
log.debug('Running `buddy add`...', options)
27+
2528
if (hasNoOptions(options)) {
2629
// const answers = await log.prompt(descriptions.select, {
2730
// type: 'multiselect',

storage/framework/core/buddy/src/commands/build.ts

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import process from 'node:process'
22
import { runAction } from '@stacksjs/actions'
3-
import { intro, log, outro, prompt } from '@stacksjs/cli'
3+
import { intro, log, outro } from '@stacksjs/cli'
44
import type { BuildOptions, CLI } from '@stacksjs/types'
55
import { ExitCode } from '@stacksjs/types'
66
import { Action } from '@stacksjs/enums'
7-
import { isString } from '@stacksjs/validation'
87

98
export function build(buddy: CLI) {
109
const descriptions = {
@@ -41,6 +40,8 @@ export function build(buddy: CLI) {
4140
.option('--server', descriptions.server, { default: false })
4241
.option('--verbose', descriptions.verbose, { default: false })
4342
.action(async (server: string | undefined, options: BuildOptions) => {
43+
log.debug('Running `buddy build` ...', options)
44+
4445
switch (server) {
4546
case 'components':
4647
options.components = true
@@ -76,28 +77,29 @@ export function build(buddy: CLI) {
7677
break
7778
}
7879

79-
if (hasNoOptions(options)) {
80-
let answers = await prompt.require()
81-
.multiselect(descriptions.select, {
82-
options: [
83-
{ label: 'Components', value: 'components' },
84-
// { label: 'Vue Components', value: 'vue-components' },
85-
{ label: 'Web Components', value: 'web-components' },
86-
{ label: 'Functions', value: 'functions' },
87-
{ label: 'Views', value: 'views' },
88-
{ label: 'Documentation', value: 'docs' },
89-
],
90-
})
91-
92-
if (answers !== null)
93-
process.exit(ExitCode.InvalidArgument)
94-
95-
if (isString(answers))
96-
answers = [answers]
97-
98-
// creates an object out of array and sets answers to true
99-
options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
100-
}
80+
// TODO: uncomment this when prompt is available
81+
// if (hasNoOptions(options)) {
82+
// let answers = await prompt.require
83+
// .multiselect(descriptions.select, {
84+
// options: [
85+
// { label: 'Components', value: 'components' },
86+
// // { label: 'Vue Components', value: 'vue-components' },
87+
// { label: 'Web Components', value: 'web-components' },
88+
// { label: 'Functions', value: 'functions' },
89+
// { label: 'Views', value: 'views' },
90+
// { label: 'Documentation', value: 'docs' },
91+
// ],
92+
// })
93+
//
94+
// if (answers !== null)
95+
// process.exit(ExitCode.InvalidArgument)
96+
//
97+
// if (isString(answers))
98+
// answers = [answers]
99+
//
100+
// // creates an object out of array and sets answers to true
101+
// options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
102+
// }
101103

102104
await runAction(Action.BuildStacks, options)
103105

@@ -111,6 +113,7 @@ export function build(buddy: CLI) {
111113
.option('-p, --project', descriptions.project, { default: false })
112114
.option('--verbose', descriptions.verbose, { default: false })
113115
.action(async (options: BuildOptions) => {
116+
log.debug('Running `buddy build:components` ...', options)
114117
await runAction(Action.BuildComponentLibs, options)
115118
})
116119

@@ -121,6 +124,7 @@ export function build(buddy: CLI) {
121124
.option('-p, --project', descriptions.project, { default: false })
122125
.option('--verbose', descriptions.verbose, { default: false })
123126
.action(async (options: BuildOptions) => {
127+
log.debug('Running `buddy build:cli` ...', options)
124128
await runAction(Action.BuildCli, options)
125129
})
126130

@@ -131,6 +135,7 @@ export function build(buddy: CLI) {
131135
.option('-p, --project', descriptions.project, { default: false })
132136
.option('--verbose', descriptions.verbose, { default: false })
133137
.action(async (options: BuildOptions) => {
138+
log.debug('Running `buddy build:server` ...', options)
134139
await runAction(Action.BuildServer, options)
135140
})
136141

@@ -140,6 +145,7 @@ export function build(buddy: CLI) {
140145
.option('-p, --project', descriptions.project, { default: false })
141146
.option('--verbose', descriptions.verbose, { default: false })
142147
.action(async (options: BuildOptions) => {
148+
log.debug('Running `buddy `build:functions` ...', options)
143149
await runAction(Action.BuildFunctionLib, options)
144150
})
145151

@@ -153,6 +159,7 @@ export function build(buddy: CLI) {
153159
.option('--verbose', descriptions.verbose, { default: false })
154160
.alias('build:vue')
155161
.action(async (options: BuildOptions) => {
162+
log.debug('Running `buddy build:vue-components` ...', options)
156163
await runAction(Action.BuildVueComponentLib, options)
157164
})
158165

@@ -165,6 +172,7 @@ export function build(buddy: CLI) {
165172
.option('-p, --project', descriptions.project, { default: false })
166173
.option('--verbose', descriptions.verbose, { default: false })
167174
.action(async (options: BuildOptions) => {
175+
log.debug('Running `buddy build:web-components` ...', options)
168176
await runAction(Action.BuildWebComponentLib, options)
169177
})
170178

@@ -177,6 +185,7 @@ export function build(buddy: CLI) {
177185
.option('-p, --project', descriptions.project, { default: false })
178186
.option('--verbose', descriptions.verbose, { default: false })
179187
.action(async (options: BuildOptions) => {
188+
log.debug('Running `buddy build:docs` ...', options)
180189
await runAction(Action.BuildDocs, options)
181190
})
182191

@@ -185,6 +194,8 @@ export function build(buddy: CLI) {
185194
.option('-p, --project', descriptions.project, { default: false })
186195
.option('--verbose', descriptions.verbose, { default: false })
187196
.action(async (options: BuildOptions) => {
197+
log.debug('Running `buddy build:core` ...', options)
198+
188199
const startTime = await intro('buddy build:core')
189200
const result = await runAction(Action.BuildCore, options)
190201

@@ -202,6 +213,8 @@ export function build(buddy: CLI) {
202213
.option('-p, --project', descriptions.project, { default: false })
203214
.option('--verbose', descriptions.verbose, { default: false })
204215
.action(async (options: BuildOptions) => {
216+
log.debug('Running `buddy build:desktop` ...', options)
217+
205218
const perf = await intro('buddy build:desktop')
206219
const result = await runAction(Action.BuildDesktop, options)
207220

@@ -222,6 +235,8 @@ export function build(buddy: CLI) {
222235
.option('-p, --project', descriptions.project, { default: false })
223236
.option('--verbose', descriptions.verbose, { default: false })
224237
.action(async (options: BuildOptions) => {
238+
log.debug('Running `buddy build:stacks` ...', options)
239+
225240
const startTime = await intro('buddy build:stacks')
226241
const result = await runAction(Action.BuildStacks, options)
227242

@@ -239,6 +254,6 @@ export function build(buddy: CLI) {
239254
})
240255
}
241256

242-
function hasNoOptions(options: BuildOptions) {
243-
return !options.components && !options.vueComponents && !options.webComponents && !options.elements && !options.functions && !options.views && !options.docs && !options.stacks && !options.buddy
244-
}
257+
// function hasNoOptions(options: BuildOptions) {
258+
// return !options.components && !options.vueComponents && !options.webComponents && !options.elements && !options.functions && !options.views && !options.docs && !options.stacks && !options.buddy
259+
// }

storage/framework/core/buddy/src/commands/changelog.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import process from 'node:process'
22
import type { CLI, FreshOptions } from '@stacksjs/types'
3-
import { ExitCode } from '@stacksjs/types'
43
import { runAction } from '@stacksjs/actions'
54
import { intro, log, outro } from '@stacksjs/cli'
65
import { Action } from '@stacksjs/enums'
@@ -23,6 +22,8 @@ export function changelog(buddy: CLI) {
2322
.option('-p, --project', descriptions.project, { default: false })
2423
.option('--verbose', descriptions.verbose, { default: false })
2524
.action(async (options: FreshOptions) => {
25+
log.debug('Running `buddy changelog` ...', options)
26+
2627
const perf = await intro('buddy changelog')
2728
const result = await runAction(Action.Changelog, options)
2829

storage/framework/core/buddy/src/commands/clean.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import process from 'node:process'
22
import { ExitCode } from '@stacksjs/types'
33
import type { CLI, CleanOptions } from '@stacksjs/types'
44
import { runAction } from '@stacksjs/actions'
5-
import { intro, outro } from '@stacksjs/cli'
5+
import { intro, log, outro } from '@stacksjs/cli'
66
import { Action } from '@stacksjs/enums'
77

88
export function clean(buddy: CLI) {
@@ -17,6 +17,8 @@ export function clean(buddy: CLI) {
1717
.option('-p, --project', descriptions.project, { default: false })
1818
.option('--verbose', descriptions.verbose, { default: false })
1919
.action(async (options: CleanOptions) => {
20+
log.debug('Running `buddy clean` ...', options)
21+
2022
const perf = await intro('buddy clean')
2123
const result = await runAction(Action.Clean, options)
2224

0 commit comments

Comments
 (0)