@stacksjs/browser 0.74.7 → 0.74.9
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/utils/api-url.d.ts +13 -0
- package/dist/utils/api-url.js +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the public API root without exposing server environment state to a
|
|
3
|
+
* browser bundle. Split-origin deployments may inject an explicit root;
|
|
4
|
+
* otherwise clients use the same-origin `/api` router.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveApiBaseUrl(defaultPath?: string): string;
|
|
7
|
+
/*`.
|
|
8
|
+
* Absolute URLs are already fully resolved and pass through unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveApiUrl(input: string, baseUrl?: unknown): string;
|
|
11
|
+
declare type StacksBrowserGlobal = typeof globalThis & {
|
|
12
|
+
__STACKS_API_URL__?: string
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function resolveApiBaseUrl(defaultPath="/api"){const configured=globalThis.__STACKS_API_URL__;if(configured)return configured.replace(/\/+$/,"");const origin=typeof window<"u"?window.location?.origin:void 0;if(origin)return`${origin}${defaultPath}`;return defaultPath}export function resolveApiUrl(input,baseUrl=resolveApiBaseUrl()){if(/^https?:\/\//i.test(input))return input;const base=baseUrl.replace(/\/+$/,"");let path=input.startsWith("/")?input:`/${input}`;if(base.endsWith("/api")&&(path==="/api"||path.startsWith("/api/")))path=path.slice(4)||"/";return`${base}${path}`}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./base";export*from"./billable";export*from"./date";export*from"./debounce";export*from"./fetch";export*from"./function";export*from"./guards";export*from"./lazy";export*from"./math";export*from"./plans";export*from"./promise";export*from"./random";export*from"./regex";export*from"./retry";export*from"./sleep";export*from"./throttle";export*from"./vendors";
|
|
1
|
+
export*from"./base";export*from"./api-url";export*from"./billable";export*from"./date";export*from"./debounce";export*from"./fetch";export*from"./function";export*from"./guards";export*from"./lazy";export*from"./math";export*from"./plans";export*from"./promise";export*from"./random";export*from"./regex";export*from"./retry";export*from"./sleep";export*from"./throttle";export*from"./vendors";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/browser",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.9",
|
|
6
6
|
"description": "Stacks core frontend/browser functionalities.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"prepublishOnly": "bun run build"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@stacksjs/composables": "0.74.
|
|
73
|
-
"@stacksjs/datetime": "0.74.
|
|
74
|
-
"@stacksjs/strings": "0.74.
|
|
75
|
-
"@stacksjs/stx": "^0.2.
|
|
72
|
+
"@stacksjs/composables": "0.74.9",
|
|
73
|
+
"@stacksjs/datetime": "0.74.9",
|
|
74
|
+
"@stacksjs/strings": "0.74.9",
|
|
75
|
+
"@stacksjs/stx": "^0.2.267",
|
|
76
76
|
"bun-query-builder": "^0.2.62"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@stacksjs/utils": "0.74.
|
|
87
|
+
"@stacksjs/utils": "0.74.9",
|
|
88
88
|
"@stripe/stripe-js": "^9.10.0",
|
|
89
89
|
"better-dx": "^0.2.24"
|
|
90
90
|
}
|