Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Mar 14, 2024
1 parent 949d408 commit 4a90baf
Show file tree
Hide file tree
Showing 113 changed files with 782 additions and 654 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"storage/framework/core",
"storage/framework/core/*",
"storage/framework/core/bun-create/*",
"storage/framework/core/components/*",
"storage/framework/docs",
"storage/framework/email",
"storage/framework/libs/*",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/actions/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/core/actions/src/dev/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { config } from '@stacksjs/config'

const options = parseOptions()

log.debug('Running API dev server via', `bunx vite --config ${p.vitePath('src/api.ts')}`, options)
log.debug('Running API dev server via', `bunx vite --config ${p.viteConfigPath('src/api.ts')}`, options)

serve({
port: config.ports?.api, // defaults to 3008
})

// the reason we start a Vite dev server next is because we need the Bun server proxied by vite
await runCommand(`bunx vite --config ${p.vitePath('src/api.ts')}`, {
await runCommand(`bunx vite --config ${p.viteConfigPath('src/api.ts')}`, {
// ...options,
cwd: p.frameworkPath(),
})
4 changes: 2 additions & 2 deletions storage/framework/core/actions/src/dev/components.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { frameworkPath, vitePath } from '@stacksjs/path'
import { frameworkPath, viteConfigPath } from '@stacksjs/path'
import { parseOptions, runCommand } from '@stacksjs/cli'
import type { DeployOptions } from '@stacksjs/types'

Expand All @@ -8,7 +8,7 @@ if (options.verbose)
// eslint-disable-next-line no-console
console.log('dev components options', options)

await runCommand(`bunx vite --config ${vitePath('src/components.ts')}`, {
await runCommand(`bunx vite --config ${viteConfigPath('src/components.ts')}`, {
...options,
cwd: frameworkPath(),
})
2 changes: 1 addition & 1 deletion storage/framework/core/ai/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/alias/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
12 changes: 8 additions & 4 deletions storage/framework/core/alias/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ export const alias: Record<string, string> = {
'@stacksjs/utils/*': p.utilsPath('src/*'),
'@stacksjs/validation': p.validationPath('src/index.ts'),
'@stacksjs/validation/*': p.validationPath('src/*'),
'@stacksjs/vite': p.vitePath('src/index.ts'),
'@stacksjs/vite/*': p.vitePath('src/*'),
'@stacksjs/vite-config': p.viteConfigPath('src/index.ts'),
'@stacksjs/vite-config/*': p.viteConfigPath('src/*'),
'@stacksjs/vite-plugin': p.vitePluginPath('src/index.ts'),
'@stacksjs/vite-plugin/*': p.vitePluginPath('src/*'),
'@stacksjs/x-ray': p.xRayPath('src/index.ts'),
'@stacksjs/x-ray/*': p.xRayPath('src/*'),

Expand Down Expand Up @@ -200,8 +202,10 @@ export const alias: Record<string, string> = {
'stacks/utils/*': p.utilsPath('src/*'),
'stacks/validation': p.validationPath('src/index.ts'),
'stacks/validation/*': p.validationPath('src/*'),
'stacks/vite': p.vitePath('src/index.ts'),
'stacks/vite/*': p.vitePath('src/*'),
'stacks/vite-config': p.viteConfigPath('src/index.ts'),
'stacks/vite-config/*': p.viteConfigPath('src/*'),
'stacks/vite-plugin': p.vitePluginPath('src/index.ts'),
'stacks/vite-plugin/*': p.vitePluginPath('src/*'),
'stacks/x-ray': p.xRayPath('src/index.ts'),
'stacks/x-ray/*': p.xRayPath('src/*'),
'~/app/*': p.appPath('*'),
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/analytics/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
3 changes: 1 addition & 2 deletions storage/framework/core/build/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from './src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand All @@ -15,7 +15,6 @@ const result = await Bun.build({
'@stacksjs/path',
'@stacksjs/storage',
'@stacksjs/cli',
'@stacksjs/vite',
],
})

Expand Down
5 changes: 3 additions & 2 deletions storage/framework/core/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@
"prepublishOnly": "bun run build"
},
"peerDependencies": {
"@stacksjs/vite": "workspace:*",
"bun-plugin-dts-auto": "^0.10.0",
"vue-docgen-web-types": "^0.1.8"
},
"dependencies": {
"@stacksjs/vite": "workspace:*",
"@stacksjs/cli": "workspace:*",
"@stacksjs/path": "workspace:*",
"@stacksjs/storage": "workspace:*",
"bun-plugin-dts-auto": "^0.10.0",
"vue-docgen-web-types": "^0.1.8"
},
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/cache/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/chat/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/cli/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/core/cli/src/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
stdout: (options?.silent || options?.quiet) ? 'ignore' : (options?.stdin ? options.stdin : (options?.stdout || 'inherit')),
stderr: (options?.silent || options?.quiet) ? 'ignore' : (options?.stderr || 'inherit'),
detached: options?.background || false,
cwd: options?.cwd || import.meta.dir,
cwd: options?.cwd || process.cwd(),
// env: { ...e, ...options?.env },
onExit(subprocess, exitCode, signalCode, error) {
exitHandler('spawn', subprocess, exitCode, signalCode, error)
Expand Down Expand Up @@ -100,7 +100,7 @@ export async function execSync(command: string | string[], options?: CliOptions)
stdin: options?.stdin ?? 'inherit',
stdout: options?.stdout ?? 'pipe',
stderr: options?.stderr ?? 'inherit',
cwd: options?.cwd ?? import.meta.dir,
cwd: options?.cwd ?? process.cwd(),
// env: { ...Bun.env, ...options?.env },
onExit(subprocess, exitCode, signalCode, error) {
exitHandler('spawnSync', subprocess, exitCode, signalCode, error)
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/cloud/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/collections/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/config/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/database/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/datetime/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/desktop/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/development/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/dns/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
3 changes: 1 addition & 2 deletions storage/framework/core/docs/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand All @@ -15,7 +15,6 @@ const result = await Bun.build({
'@stacksjs/config',
'@stacksjs/alias',
'@stacksjs/path',
'@stacksjs/vite',
'@stacksjs/server',
'@stacksjs/env',
'@stacksjs/cli',
Expand Down
2 changes: 0 additions & 2 deletions storage/framework/core/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@stacksjs/config": "workspace:*",
"@stacksjs/path": "workspace:*",
"@stacksjs/server": "workspace:*",
"@stacksjs/vite": "workspace:*",
"vitepress": "1.0.0-rc.45",
"vitepress-plugin-twoslash": "^0.10.2"
},
Expand All @@ -60,7 +59,6 @@
"@stacksjs/config": "workspace:*",
"@stacksjs/path": "workspace:*",
"@stacksjs/server": "workspace:*",
"@stacksjs/vite": "workspace:*",
"vitepress": "1.0.0-rc.45",
"vitepress-plugin-twoslash": "^0.10.2"
},
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { docs } from '@stacksjs/config'
import { server } from '@stacksjs/server'
import { kolorist as c } from '@stacksjs/cli'
import { withPwa } from '@vite-pwa/vitepress'
import { version } from '../../../../../package.json'
import { version } from '../package.json'
import { pwaDocs as pwa } from './scripts/pwa'

export const frameworkDefaults = {
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/email/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/enums/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/env/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/error-handling/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/eslint-config/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/events/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/faker/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/git/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/health/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/http/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/lint/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/logging/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
7 changes: 4 additions & 3 deletions storage/framework/core/logging/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { appendFile, mkdir } from 'node:fs/promises'
import { dirname } from 'node:path'
import { consola, createConsola } from 'consola'
import { ExitCode } from '@stacksjs/types'
import { config } from '@stacksjs/config'
import { handleError } from '@stacksjs/error-handling'
import type { Prompt } from '@stacksjs/cli'
import { buddyOptions, prompt as getPrompt } from '@stacksjs/cli'
import { logsPath } from '@stacksjs/path'

export function logLevel() {
export async function logLevel() {
const config = await import('@stacksjs/config')

/**
* This regex checks for:
* - --verbose true or --verbose=true exactly at the end of the string ($ denotes the end of the string).
Expand All @@ -30,7 +31,7 @@ export function logLevel() {
}

export const logger = createConsola({
level: logLevel(),
level: await logLevel(),
// fancy: true,
// formatOptions: {
// columns: 80,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/notifications/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/objects/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/orm/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
11 changes: 4 additions & 7 deletions storage/framework/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,6 @@
"bun": "./validation/src/index.ts",
"types": "./validation/dist/index.d.ts",
"import": "./validation/dist/index.js"
},
"./vite": {
"bun": "./vite/src/index.ts",
"types": "./vite/dist/index.d.ts",
"import": "./vite/dist/index.js"
}
},
"types": "./types/dist/index.d.ts",
Expand Down Expand Up @@ -400,7 +395,8 @@
"@stacksjs/ui": "workspace:*",
"@stacksjs/utils": "workspace:*",
"@stacksjs/validation": "workspace:*",
"@stacksjs/vite": "workspace:*"
"@stacksjs/vite-config": "workspace:*",
"@stacksjs/vite-plugin": "workspace:*"
},
"dependencies": {
"@stacksjs/actions": "workspace:*",
Expand Down Expand Up @@ -448,6 +444,7 @@
"@stacksjs/ui": "workspace:*",
"@stacksjs/utils": "workspace:*",
"@stacksjs/validation": "workspace:*",
"@stacksjs/vite": "workspace:*"
"@stacksjs/vite-config": "workspace:*",
"@stacksjs/vite-plugin": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion storage/framework/core/path/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { intro, outro } from '@stacksjs/build'
import { intro, outro } from '../build/src'

const { startTime } = await intro({
dir: import.meta.dir,
Expand Down
Loading

0 comments on commit 4a90baf

Please sign in to comment.