Skip to content

Commit 91df35f

Browse files
committed
chore: wip
1 parent adb7669 commit 91df35f

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

bun.lockb

-392 Bytes
Binary file not shown.

routes/api.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { route } from '@stacksjs/router'
2+
// const { route } = await import('@stacksjs/router')
23

34
/**
45
* This file is the entry point for your application's API routes.
@@ -8,21 +9,21 @@ import { route } from '@stacksjs/router'
89
* @see https://stacksjs.org/docs/routing
910
*/
1011

11-
await route.get('/foo/bar/{id}', () => 'hello world, foo bar') // stacksjs.org/api/hello/world
12-
await route.get('/', () => 'hello world') // $APP_URL/api
13-
await route.get('/hello/world', () => 'hello world, buddy') // stacksjs.org/api/hello/world
12+
route.get('/foo/bar/{id}', () => 'hello world, foo bar') // stacksjs.org/api/hello/world
13+
route.get('/', () => 'hello world') // $APP_URL/api
14+
route.get('/hello/world', () => 'hello world, buddy') // stacksjs.org/api/hello/world
1415

15-
await route.post('/email/subscribe', 'Actions/SubscriberEmailAction')
16+
route.post('/email/subscribe', 'Actions/SubscriberEmailAction')
1617

17-
await route.post('/login', 'Actions/LoginAction')
18+
route.post('/login', 'Actions/LoginAction')
1819

19-
await route.email('/welcome')
20-
await route.health() // adds a GET `/api/health` route
20+
route.email('/welcome')
21+
route.health() // adds a GET `/api/health` route
2122

22-
// await route.group('/some-path', async () => {...})
23-
// await route.action('/example') // equivalent to `route.get('/example', 'ExampleAction')`
23+
// route.group('/some-path', async () => {...})
24+
// route.action('/example') // equivalent to `route.get('/example', 'ExampleAction')`
2425

25-
// await route.action('Dashboard/GetProjects')
26-
// await route.action('Dashboard/Settings/UpdateAiConfig')
26+
// route.action('Dashboard/GetProjects')
27+
// route.action('Dashboard/Settings/UpdateAiConfig')
2728

28-
// await route.job('/example-two') // equivalent to `route.get('/example-two', 'ExampleTwoJob')`
29+
// route.job('/example-two') // equivalent to `route.get('/example-two', 'ExampleTwoJob')`

storage/framework/core/logging/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function logLevel() {
3131
}
3232

3333
export const logger = createConsola({
34-
level: await logLevel(),
34+
level: 3,
3535
// fancy: true,
3636
// formatOptions: {
3737
// columns: 80,
@@ -82,7 +82,6 @@ export interface Log {
8282

8383
export const log: Log = {
8484
async info(...arg: any) {
85-
// @ts-expect-error intentional
8685
logger.info(...arg)
8786
await writeToLogFile(`INFO: ${arg}`)
8887
},

storage/framework/core/router/src/middleware.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ async function importMiddlewares(directory: string) {
3030
return [directory] // fix this: return array of middlewares
3131
}
3232

33-
export const middlewares = await importMiddlewares(userMiddlewarePath())
33+
export const middlewares = async() => {
34+
return await importMiddlewares(userMiddlewarePath())
35+
}

storage/framework/core/router/src/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { Action } from '@stacksjs/actions'
22
import { log } from '@stacksjs/logging'
3-
import { path as p, projectStoragePath, routesPath } from '@stacksjs/path'
3+
import { path as p } from '@stacksjs/path'
44
import { kebabCase, pascalCase } from '@stacksjs/strings'
55
import type { Job } from '@stacksjs/types'
66
import type { RedirectCode, Route, RouteGroupOptions, RouterInterface, StatusCode } from '@stacksjs/types'
7-
import { extractDefaultRequest, extractModelRequest, findRequestInstance } from './utils'
7+
import { extractDefaultRequest, findRequestInstance } from './utils'
88

99
type ActionPath = string // TODO: narrow this by automating its generation
1010

storage/framework/orm/routes.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { route } from '@stacksjs/router'
22

3-
await route.get('users', '/Users/chrisbreuer/Code/stacks/storage/framework/actions/UserIndexOrmAction.ts')
4-
5-
await route.get('users/{id}', '/Users/chrisbreuer/Code/stacks/storage/framework/actions/UserShowOrmAction.ts')
6-
7-
await route.post('users', '/Users/chrisbreuer/Code/stacks/app/Actions/UserStoreAction.ts')
8-
9-
await route.delete('users/{id}', '/Users/chrisbreuer/Code/stacks/storage/framework/actions/UserDestroyOrmAction.ts')
3+
route.get('users', '/Users/chrisbreuer/Code/stacks/storage/framework/actions/UserIndexOrmAction.ts')
4+
route.get('users/{id}', '/Users/chrisbreuer/Code/stacks/storage/framework/actions/UserShowOrmAction.ts')
5+
route.post('users', '/Users/chrisbreuer/Code/stacks/app/Actions/UserStoreAction.ts')
6+
route.delete('users/{id}', '/Users/chrisbreuer/Code/stacks/storage/framework/actions/UserDestroyOrmAction.ts')

storage/framework/server/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ FROM base AS release
1616
COPY ./storage ./storage
1717
COPY ./config ./config
1818
COPY ./docs ./docs
19-
COPY ./routes ./routes
2019
COPY ./dist/* ./
2120
COPY ./tsconfig.json ./
2221

0 commit comments

Comments
 (0)