@stacksjs/buddy 0.70.151 → 0.70.153
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/dist/commands/serve.d.ts +7 -0
- package/dist/commands/serve.js +11 -2
- package/package.json +41 -41
package/dist/commands/serve.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { CLI } from '@stacksjs/types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the project's includes directory using Stacks conventions. Modern
|
|
4
|
+
* Stacks apps keep reusable `.stx` fragments in `resources/components` and
|
|
5
|
+
* commonly point `config/stx.ts#partialsDir` there; older apps may still use
|
|
6
|
+
* one of the dedicated partials directories below.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveUserPartialsPath(cwd?: unknown): string | undefined;
|
|
2
9
|
/**` requests (and any non-GET/HEAD verb) are
|
|
3
10
|
* reverse-proxied to the API process — mirroring the dev views server — so
|
|
4
11
|
* scaffolded `fetch('/api/...')` calls behave identically in production
|
package/dist/commands/serve.js
CHANGED
|
@@ -30,6 +30,15 @@ function parseCookies(req) {
|
|
|
30
30
|
}
|
|
31
31
|
return out;
|
|
32
32
|
}
|
|
33
|
+
export function resolveUserPartialsPath(cwd = process.cwd()) {
|
|
34
|
+
const relative = [
|
|
35
|
+
"resources/partials",
|
|
36
|
+
"resources/views/partials",
|
|
37
|
+
"partials",
|
|
38
|
+
"resources/components"
|
|
39
|
+
].find((candidate) => existsSync(join(cwd, candidate)));
|
|
40
|
+
return relative ? join(cwd, relative) : void 0;
|
|
41
|
+
}
|
|
33
42
|
export function serve(buddy) {
|
|
34
43
|
buddy.command("serve", "Start the production HTTP server (STX views + /api proxy + coming-soon/maintenance gate)").option("-p, --port <port>", "Port to listen on (defaults to PORT env or 3000)").option("--verbose", "Enable verbose output", { default: !1 }).action(async (options) => {
|
|
35
44
|
if (options?.port)
|
|
@@ -53,7 +62,7 @@ export function serve(buddy) {
|
|
|
53
62
|
} catch {}
|
|
54
63
|
if (!stxServe)
|
|
55
64
|
({ serve: stxServe } = await import("bun-plugin-stx/serve"));
|
|
56
|
-
const stxModule = await resolveVendoredStxModule(), { site: siteConfig, i18n: i18nConfig } = await loadStxSiteConfig(), userViewsPath = "resources/views", defaultsResources = resolveDefaultsResources(), defaultViewsPath = join(defaultsResources, "views"), userLayoutsPath = existsSync("resources/views/layouts") ? "resources/views/layouts" : "resources/layouts", userPartialsPath =
|
|
65
|
+
const stxModule = await resolveVendoredStxModule(), { site: siteConfig, i18n: i18nConfig } = await loadStxSiteConfig(), userViewsPath = "resources/views", defaultsResources = resolveDefaultsResources(), defaultViewsPath = join(defaultsResources, "views"), userLayoutsPath = existsSync("resources/views/layouts") ? "resources/views/layouts" : "resources/layouts", userPartialsPath = resolveUserPartialsPath(), apiBase = process.env.API_URL || `http://127.0.0.1:${Number(process.env.PORT_API) || config.ports?.api || 3008}`;
|
|
57
66
|
log.info(`Starting production server on port ${port}...`);
|
|
58
67
|
await stxServe({
|
|
59
68
|
patterns: [userViewsPath, defaultViewsPath],
|
|
@@ -62,7 +71,7 @@ export function serve(buddy) {
|
|
|
62
71
|
reusePort: ["production", "staging", "development"].includes((process.env.APP_ENV || "").toLowerCase()),
|
|
63
72
|
componentsDir: join(defaultsResources, "components"),
|
|
64
73
|
layoutsDir: userLayoutsPath,
|
|
65
|
-
partialsDir: userPartialsPath,
|
|
74
|
+
...userPartialsPath && { partialsDir: userPartialsPath },
|
|
66
75
|
fallbackLayoutsDir: join(defaultsResources, "layouts"),
|
|
67
76
|
fallbackPartialsDir: defaultViewsPath,
|
|
68
77
|
quiet: options?.verbose !== !0,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.70.
|
|
5
|
+
"version": "0.70.153",
|
|
6
6
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -92,51 +92,51 @@
|
|
|
92
92
|
"prepublishOnly": "bun run build"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@stacksjs/actions": "^0.70.
|
|
96
|
-
"@stacksjs/ai": "^0.70.
|
|
97
|
-
"@stacksjs/alias": "^0.70.
|
|
98
|
-
"@stacksjs/arrays": "^0.70.
|
|
99
|
-
"@stacksjs/auth": "^0.70.
|
|
100
|
-
"@stacksjs/build": "^0.70.
|
|
101
|
-
"@stacksjs/cache": "^0.70.
|
|
102
|
-
"@stacksjs/cli": "^0.70.
|
|
95
|
+
"@stacksjs/actions": "^0.70.153",
|
|
96
|
+
"@stacksjs/ai": "^0.70.153",
|
|
97
|
+
"@stacksjs/alias": "^0.70.153",
|
|
98
|
+
"@stacksjs/arrays": "^0.70.153",
|
|
99
|
+
"@stacksjs/auth": "^0.70.153",
|
|
100
|
+
"@stacksjs/build": "^0.70.153",
|
|
101
|
+
"@stacksjs/cache": "^0.70.153",
|
|
102
|
+
"@stacksjs/cli": "^0.70.153",
|
|
103
103
|
"@stacksjs/clapp": "^0.2.10",
|
|
104
|
-
"@stacksjs/cloud": "^0.70.
|
|
105
|
-
"@stacksjs/collections": "^0.70.
|
|
106
|
-
"@stacksjs/config": "^0.70.
|
|
107
|
-
"@stacksjs/database": "^0.70.
|
|
108
|
-
"@stacksjs/desktop": "^0.70.
|
|
109
|
-
"@stacksjs/dns": "^0.70.
|
|
110
|
-
"@stacksjs/email": "^0.70.
|
|
111
|
-
"@stacksjs/enums": "^0.70.
|
|
112
|
-
"@stacksjs/error-handling": "^0.70.
|
|
113
|
-
"@stacksjs/events": "^0.70.
|
|
114
|
-
"@stacksjs/git": "^0.70.
|
|
104
|
+
"@stacksjs/cloud": "^0.70.153",
|
|
105
|
+
"@stacksjs/collections": "^0.70.153",
|
|
106
|
+
"@stacksjs/config": "^0.70.153",
|
|
107
|
+
"@stacksjs/database": "^0.70.153",
|
|
108
|
+
"@stacksjs/desktop": "^0.70.153",
|
|
109
|
+
"@stacksjs/dns": "^0.70.153",
|
|
110
|
+
"@stacksjs/email": "^0.70.153",
|
|
111
|
+
"@stacksjs/enums": "^0.70.153",
|
|
112
|
+
"@stacksjs/error-handling": "^0.70.153",
|
|
113
|
+
"@stacksjs/events": "^0.70.153",
|
|
114
|
+
"@stacksjs/git": "^0.70.153",
|
|
115
115
|
"@stacksjs/gitit": "^0.2.5",
|
|
116
|
-
"@stacksjs/health": "^0.70.
|
|
116
|
+
"@stacksjs/health": "^0.70.153",
|
|
117
117
|
"@stacksjs/dnsx": "^0.2.3",
|
|
118
118
|
"@stacksjs/httx": "^0.1.10",
|
|
119
|
-
"@stacksjs/lint": "^0.70.
|
|
120
|
-
"@stacksjs/logging": "^0.70.
|
|
121
|
-
"@stacksjs/notifications": "^0.70.
|
|
122
|
-
"@stacksjs/objects": "^0.70.
|
|
123
|
-
"@stacksjs/orm": "^0.70.
|
|
124
|
-
"@stacksjs/path": "^0.70.
|
|
125
|
-
"@stacksjs/payments": "^0.70.
|
|
126
|
-
"@stacksjs/realtime": "^0.70.
|
|
127
|
-
"@stacksjs/router": "^0.70.
|
|
119
|
+
"@stacksjs/lint": "^0.70.153",
|
|
120
|
+
"@stacksjs/logging": "^0.70.153",
|
|
121
|
+
"@stacksjs/notifications": "^0.70.153",
|
|
122
|
+
"@stacksjs/objects": "^0.70.153",
|
|
123
|
+
"@stacksjs/orm": "^0.70.153",
|
|
124
|
+
"@stacksjs/path": "^0.70.153",
|
|
125
|
+
"@stacksjs/payments": "^0.70.153",
|
|
126
|
+
"@stacksjs/realtime": "^0.70.153",
|
|
127
|
+
"@stacksjs/router": "^0.70.153",
|
|
128
128
|
"@stacksjs/rpx": "^0.11.29",
|
|
129
|
-
"@stacksjs/search-engine": "^0.70.
|
|
130
|
-
"@stacksjs/security": "^0.70.
|
|
131
|
-
"@stacksjs/server": "^0.70.
|
|
132
|
-
"@stacksjs/storage": "^0.70.
|
|
133
|
-
"@stacksjs/strings": "^0.70.
|
|
134
|
-
"@stacksjs/testing": "^0.70.
|
|
135
|
-
"@stacksjs/tunnel": "^0.70.
|
|
136
|
-
"@stacksjs/types": "^0.70.
|
|
137
|
-
"@stacksjs/ui": "^0.70.
|
|
138
|
-
"@stacksjs/utils": "^0.70.
|
|
139
|
-
"@stacksjs/validation": "^0.70.
|
|
129
|
+
"@stacksjs/search-engine": "^0.70.153",
|
|
130
|
+
"@stacksjs/security": "^0.70.153",
|
|
131
|
+
"@stacksjs/server": "^0.70.153",
|
|
132
|
+
"@stacksjs/storage": "^0.70.153",
|
|
133
|
+
"@stacksjs/strings": "^0.70.153",
|
|
134
|
+
"@stacksjs/testing": "^0.70.153",
|
|
135
|
+
"@stacksjs/tunnel": "^0.70.153",
|
|
136
|
+
"@stacksjs/types": "^0.70.153",
|
|
137
|
+
"@stacksjs/ui": "^0.70.153",
|
|
138
|
+
"@stacksjs/utils": "^0.70.153",
|
|
139
|
+
"@stacksjs/validation": "^0.70.153",
|
|
140
140
|
"@stacksjs/ts-cloud": "^0.7.47"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|