@bagelink/workspace 1.15.188 → 1.15.190
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/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/shared/{workspace.BzlV5kcN.d.cts → workspace.DZnmudeh.d.cts} +9 -0
- package/dist/shared/{workspace.BzlV5kcN.d.mts → workspace.DZnmudeh.d.mts} +9 -0
- package/dist/shared/{workspace.BzlV5kcN.d.ts → workspace.DZnmudeh.d.ts} +9 -0
- package/dist/vite.cjs +7 -3
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +7 -3
- package/package.json +1 -1
- package/src/proxy.ts +12 -3
- package/src/types.ts +10 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.
|
|
2
|
-
export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.
|
|
1
|
+
import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.DZnmudeh.cjs';
|
|
2
|
+
export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.DZnmudeh.cjs';
|
|
3
3
|
export { RuntimeWorkspaceConfig, getApiUrl, useWorkspace } from './composable.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.
|
|
2
|
-
export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.
|
|
1
|
+
import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.DZnmudeh.mjs';
|
|
2
|
+
export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.DZnmudeh.mjs';
|
|
3
3
|
export { RuntimeWorkspaceConfig, getApiUrl, useWorkspace } from './composable.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.
|
|
2
|
-
export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.
|
|
1
|
+
import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.DZnmudeh.js';
|
|
2
|
+
export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.DZnmudeh.js';
|
|
3
3
|
export { RuntimeWorkspaceConfig, getApiUrl, useWorkspace } from './composable.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -11,6 +11,15 @@ interface WorkspaceConfig {
|
|
|
11
11
|
* @example '/api'
|
|
12
12
|
*/
|
|
13
13
|
proxy?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional host for the file CDN (e.g. uploaded files served from a
|
|
16
|
+
* separate origin like a bucket/CDN). When set, the dev server proxies
|
|
17
|
+
* `/files/*` to this host (stripping the `/files` prefix), mirroring how
|
|
18
|
+
* `proxy` proxies API requests to `host`. In production this is handled by
|
|
19
|
+
* a Netlify redirect. Defaults to `host` when not set.
|
|
20
|
+
* @example 'https://files.bagel.design'
|
|
21
|
+
*/
|
|
22
|
+
filesHost?: string;
|
|
14
23
|
/**
|
|
15
24
|
* Optional OpenAPI specification URL for SDK generation
|
|
16
25
|
*/
|
|
@@ -11,6 +11,15 @@ interface WorkspaceConfig {
|
|
|
11
11
|
* @example '/api'
|
|
12
12
|
*/
|
|
13
13
|
proxy?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional host for the file CDN (e.g. uploaded files served from a
|
|
16
|
+
* separate origin like a bucket/CDN). When set, the dev server proxies
|
|
17
|
+
* `/files/*` to this host (stripping the `/files` prefix), mirroring how
|
|
18
|
+
* `proxy` proxies API requests to `host`. In production this is handled by
|
|
19
|
+
* a Netlify redirect. Defaults to `host` when not set.
|
|
20
|
+
* @example 'https://files.bagel.design'
|
|
21
|
+
*/
|
|
22
|
+
filesHost?: string;
|
|
14
23
|
/**
|
|
15
24
|
* Optional OpenAPI specification URL for SDK generation
|
|
16
25
|
*/
|
|
@@ -11,6 +11,15 @@ interface WorkspaceConfig {
|
|
|
11
11
|
* @example '/api'
|
|
12
12
|
*/
|
|
13
13
|
proxy?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional host for the file CDN (e.g. uploaded files served from a
|
|
16
|
+
* separate origin like a bucket/CDN). When set, the dev server proxies
|
|
17
|
+
* `/files/*` to this host (stripping the `/files` prefix), mirroring how
|
|
18
|
+
* `proxy` proxies API requests to `host`. In production this is handled by
|
|
19
|
+
* a Netlify redirect. Defaults to `host` when not set.
|
|
20
|
+
* @example 'https://files.bagel.design'
|
|
21
|
+
*/
|
|
22
|
+
filesHost?: string;
|
|
14
23
|
/**
|
|
15
24
|
* Optional OpenAPI specification URL for SDK generation
|
|
16
25
|
*/
|
package/dist/vite.cjs
CHANGED
|
@@ -35,13 +35,17 @@ function createViteProxy(config) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
const filesHost = config.filesHost || config.host;
|
|
39
|
+
if (filesHost) {
|
|
39
40
|
proxy["/files"] = {
|
|
40
|
-
target:
|
|
41
|
+
target: filesHost,
|
|
41
42
|
changeOrigin: true,
|
|
42
43
|
secure: false,
|
|
43
44
|
ws: true,
|
|
44
|
-
followRedirects: true
|
|
45
|
+
followRedirects: true,
|
|
46
|
+
...config.filesHost && {
|
|
47
|
+
rewrite: (path) => path.replace(/^\/files/, "")
|
|
48
|
+
}
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
return proxy;
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.
|
|
2
|
+
import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.DZnmudeh.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Generate complete netlify.toml file
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.
|
|
2
|
+
import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.DZnmudeh.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Generate complete netlify.toml file
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.
|
|
2
|
+
import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.DZnmudeh.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Generate complete netlify.toml file
|
package/dist/vite.mjs
CHANGED
|
@@ -30,13 +30,17 @@ function createViteProxy(config) {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
const filesHost = config.filesHost || config.host;
|
|
34
|
+
if (filesHost) {
|
|
34
35
|
proxy["/files"] = {
|
|
35
|
-
target:
|
|
36
|
+
target: filesHost,
|
|
36
37
|
changeOrigin: true,
|
|
37
38
|
secure: false,
|
|
38
39
|
ws: true,
|
|
39
|
-
followRedirects: true
|
|
40
|
+
followRedirects: true,
|
|
41
|
+
...config.filesHost && {
|
|
42
|
+
rewrite: (path) => path.replace(/^\/files/, "")
|
|
43
|
+
}
|
|
40
44
|
};
|
|
41
45
|
}
|
|
42
46
|
return proxy;
|
package/package.json
CHANGED
package/src/proxy.ts
CHANGED
|
@@ -32,14 +32,23 @@ export function createViteProxy(config: WorkspaceConfig): ProxyConfig {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// Files endpoint proxy
|
|
36
|
-
|
|
35
|
+
// Files endpoint proxy.
|
|
36
|
+
// When `filesHost` is set the CDN lives on a separate origin that serves
|
|
37
|
+
// files at the root (no `/files` prefix), so strip the prefix — mirroring
|
|
38
|
+
// how the API proxy rewrites `config.proxy` off before hitting `host`.
|
|
39
|
+
// Otherwise fall back to the API host with no rewrite (files served under
|
|
40
|
+
// `/files` there).
|
|
41
|
+
const filesHost = config.filesHost || config.host
|
|
42
|
+
if (filesHost) {
|
|
37
43
|
proxy['/files'] = {
|
|
38
|
-
target:
|
|
44
|
+
target: filesHost,
|
|
39
45
|
changeOrigin: true,
|
|
40
46
|
secure: false,
|
|
41
47
|
ws: true,
|
|
42
48
|
followRedirects: true,
|
|
49
|
+
...(config.filesHost && {
|
|
50
|
+
rewrite: (path: string) => path.replace(/^\/files/, ''),
|
|
51
|
+
}),
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
|
package/src/types.ts
CHANGED
|
@@ -14,6 +14,16 @@ export interface WorkspaceConfig {
|
|
|
14
14
|
*/
|
|
15
15
|
proxy?: string
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Optional host for the file CDN (e.g. uploaded files served from a
|
|
19
|
+
* separate origin like a bucket/CDN). When set, the dev server proxies
|
|
20
|
+
* `/files/*` to this host (stripping the `/files` prefix), mirroring how
|
|
21
|
+
* `proxy` proxies API requests to `host`. In production this is handled by
|
|
22
|
+
* a Netlify redirect. Defaults to `host` when not set.
|
|
23
|
+
* @example 'https://files.bagel.design'
|
|
24
|
+
*/
|
|
25
|
+
filesHost?: string
|
|
26
|
+
|
|
17
27
|
/**
|
|
18
28
|
* Optional OpenAPI specification URL for SDK generation
|
|
19
29
|
*/
|