stacks 0.58.68 → 0.58.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +1 -1
- package/core/ai/package.json +1 -1
- package/core/alias/package.json +1 -1
- package/core/analytics/package.json +1 -1
- package/core/api/package.json +1 -1
- package/core/arrays/package.json +1 -1
- package/core/auth/package.json +1 -1
- package/core/buddy/dist/{chunk-6658b07ce4c24cac.js → chunk-89229d657386eb70.js} +17 -14
- package/core/buddy/dist/cli.js +1 -1
- package/core/buddy/dist/index.js +3 -1
- package/core/buddy/package.json +1 -1
- package/core/buddy/src/commands/setup.ts +19 -14
- package/core/build/package.json +1 -1
- package/core/bun-create/bud/package.json +1 -1
- package/core/bun-create/buddy/package.json +1 -1
- package/core/bun-create/stack/package.json +1 -1
- package/core/bun-create/stacks/package.json +1 -1
- package/core/bun-create/stx/package.json +1 -1
- package/core/bun-plugin-yaml/package.json +1 -1
- package/core/cache/package.json +1 -1
- package/core/chat/package.json +1 -1
- package/core/cli/dist/index.js +1 -1
- package/core/cli/package.json +1 -1
- package/core/cloud/package.json +1 -1
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +1 -1
- package/core/cloud/src/cloud/router-layer/nodejs/package.json +1 -1
- package/core/collections/package.json +1 -1
- package/core/config/package.json +1 -1
- package/core/database/package.json +1 -1
- package/core/datetime/package.json +1 -1
- package/core/desktop/package.json +1 -1
- package/core/development/package.json +1 -1
- package/core/dns/package.json +1 -1
- package/core/docs/package.json +1 -1
- package/core/email/package.json +1 -1
- package/core/enums/package.json +1 -1
- package/core/env/package.json +1 -1
- package/core/error-handling/package.json +1 -1
- package/core/eslint-config/package.json +1 -1
- package/core/events/package.json +1 -1
- package/core/faker/package.json +1 -1
- package/core/git/package.json +1 -1
- package/core/health/package.json +1 -1
- package/core/http/package.json +1 -1
- package/core/lint/package.json +1 -1
- package/core/logging/package.json +1 -1
- package/core/notifications/package.json +1 -1
- package/core/objects/package.json +1 -1
- package/core/orm/package.json +1 -1
- package/core/path/package.json +1 -1
- package/core/payments/package.json +1 -1
- package/core/push/package.json +1 -1
- package/core/query-builder/package.json +1 -1
- package/core/queue/package.json +1 -1
- package/core/raycast/package.json +1 -1
- package/core/realtime/package.json +1 -1
- package/core/repl/package.json +1 -1
- package/core/router/dist/index.js +540 -2
- package/core/router/package.json +1 -1
- package/core/router/src/router.ts +9 -1
- package/core/router/src/server.ts +15 -1
- package/core/scheduler/package.json +1 -1
- package/core/search-engine/package.json +1 -1
- package/core/security/package.json +1 -1
- package/core/server/package.json +1 -1
- package/core/signals/package.json +1 -1
- package/core/slug/package.json +1 -1
- package/core/sms/package.json +1 -1
- package/core/storage/package.json +1 -1
- package/core/strings/package.json +1 -1
- package/core/tables/package.json +1 -1
- package/core/testing/dist/index.js +1 -1
- package/core/testing/package.json +1 -1
- package/core/tinker/package.json +1 -1
- package/core/tunnel/package.json +1 -1
- package/core/types/package.json +1 -1
- package/core/ui/package.json +1 -1
- package/core/utils/dist/index.js +1 -1
- package/core/utils/package.json +1 -1
- package/core/validation/package.json +1 -1
- package/core/vite/dist/index.js +1 -1
- package/core/vite/package.json +1 -1
- package/core/whois/package.json +1 -1
- package/core/x-ray/package.json +1 -1
- package/core/zsh-buddy/package.json +1 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RedirectCode, Route, RouteGroupOptions, StatusCode } from '@stacksjs/types'
|
|
2
2
|
import { path as p, projectPath } from '@stacksjs/path'
|
|
3
|
+
import { pascalCase } from '@stacksjs/strings'
|
|
3
4
|
|
|
4
5
|
export interface RouterInterface {
|
|
5
6
|
get: (url: Route['url'], callback: Route['callback']) => Promise<this>
|
|
@@ -52,9 +53,12 @@ export class Router implements RouterInterface {
|
|
|
52
53
|
const actionModule = await callback
|
|
53
54
|
callback = actionModule.default
|
|
54
55
|
}
|
|
56
|
+
|
|
55
57
|
else if (typeof callback === 'string') {
|
|
56
58
|
// import the module and use the default.handle function as the callback
|
|
57
59
|
const actionModule = await import(p.userActionsPath(`${callback}.ts`))
|
|
60
|
+
|
|
61
|
+
path = actionModule.default.path ?? path // in case a custom path is defined inside the Action, use that instead of the path passed by the router
|
|
58
62
|
callback = actionModule.default.handle
|
|
59
63
|
}
|
|
60
64
|
|
|
@@ -71,7 +75,11 @@ export class Router implements RouterInterface {
|
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
public async job(path: Route['url']): Promise<this> {
|
|
74
|
-
|
|
78
|
+
if (path.includes('api/')) // TODO: once the api prefix is removed from the router/api, remove this
|
|
79
|
+
pascalCase(path.replace(/^api\/?|^\//, ''))
|
|
80
|
+
|
|
81
|
+
// removes the potential `JobJob` suffix in case the user does not choose to use the Job suffix in their file name
|
|
82
|
+
const jobModule = await import(p.userJobsPath(`${path}Job.ts`.replace(/JobJob/, 'Job')))
|
|
75
83
|
const callback = jobModule.default.handle
|
|
76
84
|
|
|
77
85
|
this.addRoute('GET', path, callback, 200)
|
|
@@ -27,8 +27,22 @@ export async function serve(options: ServeOptions = {}) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export async function serverResponse(req: Request) {
|
|
30
|
+
const timestamp = new Date().toISOString()
|
|
31
|
+
|
|
32
|
+
// log the request in a structured way like Laravel does in the console
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
console.log(`${timestamp} - Incoming request: ${req.method} ${req.url}`)
|
|
35
|
+
// eslint-disable-next-line no-console
|
|
36
|
+
console.log(`${timestamp} - Headers: ${JSON.stringify(req.headers)}`)
|
|
37
|
+
// eslint-disable-next-line no-console
|
|
38
|
+
console.log(`${timestamp} - Body: ${JSON.stringify(req.body)}`)
|
|
30
39
|
// eslint-disable-next-line no-console
|
|
31
|
-
console.log(
|
|
40
|
+
console.log(`${timestamp} - Query: ${JSON.stringify(req.query)}`)
|
|
41
|
+
// eslint-disable-next-line no-console
|
|
42
|
+
console.log(`${timestamp} - Params: ${JSON.stringify(req.params)}`)
|
|
43
|
+
// eslint-disable-next-line no-console
|
|
44
|
+
console.log(`${timestamp} - Cookies: ${JSON.stringify(req.cookies)}`)
|
|
45
|
+
|
|
32
46
|
const routesList: Route[] = await route.getRoutes()
|
|
33
47
|
const url = new URL(req.url)
|
|
34
48
|
|
package/core/server/package.json
CHANGED
package/core/slug/package.json
CHANGED
package/core/sms/package.json
CHANGED
package/core/tables/package.json
CHANGED
|
@@ -7015,7 +7015,7 @@ class Queue {
|
|
|
7015
7015
|
}
|
|
7016
7016
|
|
|
7017
7017
|
// /home/runner/work/stacks/stacks/node_modules/p-limit/index.js
|
|
7018
|
-
import {AsyncResource} from "dist/
|
|
7018
|
+
import {AsyncResource} from "dist/index.";
|
|
7019
7019
|
|
|
7020
7020
|
// /home/runner/work/stacks/stacks/node_modules/@vitest/utils/dist/helpers.js
|
|
7021
7021
|
var assertTypes = function(value, name, types) {
|
package/core/tinker/package.json
CHANGED
package/core/tunnel/package.json
CHANGED
package/core/types/package.json
CHANGED
package/core/ui/package.json
CHANGED
package/core/utils/dist/index.js
CHANGED
package/core/utils/package.json
CHANGED
package/core/vite/dist/index.js
CHANGED
|
@@ -609,7 +609,7 @@ var web_components_default = defineConfig6(({ command }) => {
|
|
|
609
609
|
// src/plugin/docs.ts
|
|
610
610
|
import {kolorist as c2} from "@stacksjs/cli";
|
|
611
611
|
// package.json
|
|
612
|
-
var version = "0.58.
|
|
612
|
+
var version = "0.58.69";
|
|
613
613
|
|
|
614
614
|
// src/plugin/docs.ts
|
|
615
615
|
var docsEngine = {
|
package/core/vite/package.json
CHANGED
package/core/whois/package.json
CHANGED
package/core/x-ray/package.json
CHANGED
package/ide/vscode/package.json
CHANGED