@bagelink/workspace 1.7.98 → 1.7.104

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/bin/bgl.cjs CHANGED
@@ -1082,6 +1082,9 @@ async function generateSDK(root = process__default.cwd()) {
1082
1082
  `);
1083
1083
  try {
1084
1084
  const { openAPI } = await import('@bagelink/sdk');
1085
+ const { readFileSync } = await import('node:fs');
1086
+ const { dirname, join } = await import('node:path');
1087
+ const { fileURLToPath } = await import('node:url');
1085
1088
  const { types, code } = await openAPI(finalUrl, "/api");
1086
1089
  const outputPath = node_path.resolve(root, outputDir);
1087
1090
  if (!node_fs.existsSync(outputPath)) {
@@ -1093,6 +1096,20 @@ async function generateSDK(root = process__default.cwd()) {
1093
1096
  const apiPath = node_path.resolve(outputPath, "api.ts");
1094
1097
  node_fs.writeFileSync(apiPath, code);
1095
1098
  console.log("\u2705 Generated api.ts");
1099
+ try {
1100
+ const sdkModule = await import('@bagelink/sdk');
1101
+ const sdkPath = fileURLToPath(undefined("@bagelink/sdk"));
1102
+ const sdkDir = dirname(sdkPath);
1103
+ const streamClientSource = join(sdkDir, "openAPITools", "streamClient.ts");
1104
+ if (node_fs.existsSync(streamClientSource)) {
1105
+ const streamClientCode = readFileSync(streamClientSource, "utf-8");
1106
+ const streamClientPath = node_path.resolve(outputPath, "streamClient.ts");
1107
+ node_fs.writeFileSync(streamClientPath, streamClientCode);
1108
+ console.log("\u2705 Generated streamClient.ts");
1109
+ }
1110
+ } catch (e) {
1111
+ console.log("\u2139\uFE0F streamClient.ts not found (optional)");
1112
+ }
1096
1113
  const indexPath = node_path.resolve(outputPath, "index.ts");
1097
1114
  node_fs.writeFileSync(
1098
1115
  indexPath,
package/dist/bin/bgl.mjs CHANGED
@@ -1075,6 +1075,9 @@ async function generateSDK(root = process.cwd()) {
1075
1075
  `);
1076
1076
  try {
1077
1077
  const { openAPI } = await import('@bagelink/sdk');
1078
+ const { readFileSync } = await import('node:fs');
1079
+ const { dirname, join } = await import('node:path');
1080
+ const { fileURLToPath } = await import('node:url');
1078
1081
  const { types, code } = await openAPI(finalUrl, "/api");
1079
1082
  const outputPath = resolve(root, outputDir);
1080
1083
  if (!existsSync(outputPath)) {
@@ -1086,6 +1089,20 @@ async function generateSDK(root = process.cwd()) {
1086
1089
  const apiPath = resolve(outputPath, "api.ts");
1087
1090
  writeFileSync(apiPath, code);
1088
1091
  console.log("\u2705 Generated api.ts");
1092
+ try {
1093
+ const sdkModule = await import('@bagelink/sdk');
1094
+ const sdkPath = fileURLToPath(import.meta.resolve("@bagelink/sdk"));
1095
+ const sdkDir = dirname(sdkPath);
1096
+ const streamClientSource = join(sdkDir, "openAPITools", "streamClient.ts");
1097
+ if (existsSync(streamClientSource)) {
1098
+ const streamClientCode = readFileSync(streamClientSource, "utf-8");
1099
+ const streamClientPath = resolve(outputPath, "streamClient.ts");
1100
+ writeFileSync(streamClientPath, streamClientCode);
1101
+ console.log("\u2705 Generated streamClient.ts");
1102
+ }
1103
+ } catch (e) {
1104
+ console.log("\u2139\uFE0F streamClient.ts not found (optional)");
1105
+ }
1089
1106
  const indexPath = resolve(outputPath, "index.ts");
1090
1107
  writeFileSync(
1091
1108
  indexPath,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.-kRoU6TC.cjs';
2
- export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.-kRoU6TC.cjs';
1
+ import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.CefUteAh.cjs';
2
+ export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.CefUteAh.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.-kRoU6TC.mjs';
2
- export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.-kRoU6TC.mjs';
1
+ import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.CefUteAh.mjs';
2
+ export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.CefUteAh.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.-kRoU6TC.js';
2
- export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.-kRoU6TC.js';
1
+ import { W as WorkspaceEnvironment, a as WorkspaceConfig } from './shared/workspace.CefUteAh.js';
2
+ export { P as ProxyConfig, b as WorkspaceOptions } from './shared/workspace.CefUteAh.js';
3
3
  export { RuntimeWorkspaceConfig, getApiUrl, useWorkspace } from './composable.js';
4
4
 
5
5
  /**
@@ -39,6 +39,9 @@ interface ProxyConfig {
39
39
  rewrite?: (path: string) => string;
40
40
  secure: boolean;
41
41
  ws?: boolean;
42
+ followRedirects?: boolean;
43
+ autoRewrite?: boolean;
44
+ protocolRewrite?: string;
42
45
  configure?: (proxy: any, options: any) => void;
43
46
  };
44
47
  }
@@ -39,6 +39,9 @@ interface ProxyConfig {
39
39
  rewrite?: (path: string) => string;
40
40
  secure: boolean;
41
41
  ws?: boolean;
42
+ followRedirects?: boolean;
43
+ autoRewrite?: boolean;
44
+ protocolRewrite?: string;
42
45
  configure?: (proxy: any, options: any) => void;
43
46
  };
44
47
  }
@@ -39,6 +39,9 @@ interface ProxyConfig {
39
39
  rewrite?: (path: string) => string;
40
40
  secure: boolean;
41
41
  ws?: boolean;
42
+ followRedirects?: boolean;
43
+ autoRewrite?: boolean;
44
+ protocolRewrite?: string;
42
45
  configure?: (proxy: any, options: any) => void;
43
46
  };
44
47
  }
package/dist/vite.cjs CHANGED
@@ -19,6 +19,9 @@ function createViteProxy(config) {
19
19
  rewrite: (path) => path.replace(new RegExp(`^${config.proxy}`), ""),
20
20
  secure: false,
21
21
  ws: true,
22
+ followRedirects: true,
23
+ autoRewrite: true,
24
+ protocolRewrite: "http",
22
25
  configure: (proxy2, _options) => {
23
26
  proxy2.on("proxyReq", (proxyReq, req, _res) => {
24
27
  if (req.headers.origin) {
@@ -36,7 +39,8 @@ function createViteProxy(config) {
36
39
  target: config.host,
37
40
  changeOrigin: true,
38
41
  secure: false,
39
- ws: true
42
+ ws: true,
43
+ followRedirects: true
40
44
  };
41
45
  }
42
46
  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.-kRoU6TC.cjs';
2
+ import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.CefUteAh.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.-kRoU6TC.mjs';
2
+ import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.CefUteAh.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.-kRoU6TC.js';
2
+ import { a as WorkspaceConfig, P as ProxyConfig, W as WorkspaceEnvironment } from './shared/workspace.CefUteAh.js';
3
3
 
4
4
  /**
5
5
  * Generate complete netlify.toml file
package/dist/vite.mjs CHANGED
@@ -13,6 +13,9 @@ function createViteProxy(config) {
13
13
  rewrite: (path) => path.replace(new RegExp(`^${config.proxy}`), ""),
14
14
  secure: false,
15
15
  ws: true,
16
+ followRedirects: true,
17
+ autoRewrite: true,
18
+ protocolRewrite: "http",
16
19
  configure: (proxy2, _options) => {
17
20
  proxy2.on("proxyReq", (proxyReq, req, _res) => {
18
21
  if (req.headers.origin) {
@@ -30,7 +33,8 @@ function createViteProxy(config) {
30
33
  target: config.host,
31
34
  changeOrigin: true,
32
35
  secure: false,
33
- ws: true
36
+ ws: true,
37
+ followRedirects: true
34
38
  };
35
39
  }
36
40
  return proxy;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/workspace",
3
3
  "type": "module",
4
- "version": "1.7.98",
4
+ "version": "1.7.104",
5
5
  "description": "Monorepo workspace tooling for Bagel projects with proxy and config management",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
package/src/proxy.ts CHANGED
@@ -15,6 +15,9 @@ export function createViteProxy(config: WorkspaceConfig): ProxyConfig {
15
15
  rewrite: (path: string) => path.replace(new RegExp(`^${config.proxy}`), ''),
16
16
  secure: false,
17
17
  ws: true,
18
+ followRedirects: true,
19
+ autoRewrite: true,
20
+ protocolRewrite: 'http',
18
21
  configure: (proxy: any, _options: any) => {
19
22
  proxy.on('proxyReq', (proxyReq: ClientRequest, req: IncomingMessage, _res: ServerResponse) => {
20
23
  // Ensure proper headers are forwarded
@@ -36,6 +39,7 @@ export function createViteProxy(config: WorkspaceConfig): ProxyConfig {
36
39
  changeOrigin: true,
37
40
  secure: false,
38
41
  ws: true,
42
+ followRedirects: true,
39
43
  }
40
44
  }
41
45
 
package/src/sdk.ts CHANGED
@@ -69,6 +69,9 @@ export async function generateSDK(
69
69
  try {
70
70
  // Dynamic import of @bagelink/sdk
71
71
  const { openAPI } = await import('@bagelink/sdk')
72
+ const { readFileSync } = await import('node:fs')
73
+ const { dirname, join } = await import('node:path')
74
+ const { fileURLToPath } = await import('node:url')
72
75
 
73
76
  const { types, code } = await openAPI(finalUrl, '/api')
74
77
 
@@ -87,6 +90,24 @@ export async function generateSDK(
87
90
  writeFileSync(apiPath, code)
88
91
  console.log('✅ Generated api.ts')
89
92
 
93
+ // Copy streamClient.ts from @bagelink/sdk
94
+ try {
95
+ const sdkModule = await import('@bagelink/sdk')
96
+ const sdkPath = fileURLToPath(import.meta.resolve('@bagelink/sdk'))
97
+ const sdkDir = dirname(sdkPath)
98
+ const streamClientSource = join(sdkDir, 'openAPITools', 'streamClient.ts')
99
+
100
+ if (existsSync(streamClientSource)) {
101
+ const streamClientCode = readFileSync(streamClientSource, 'utf-8')
102
+ const streamClientPath = resolve(outputPath, 'streamClient.ts')
103
+ writeFileSync(streamClientPath, streamClientCode)
104
+ console.log('✅ Generated streamClient.ts')
105
+ }
106
+ } catch (e) {
107
+ // Stream client is optional, don't fail if not found
108
+ console.log('ℹ️ streamClient.ts not found (optional)')
109
+ }
110
+
90
111
  // Write index
91
112
  const indexPath = resolve(outputPath, 'index.ts')
92
113
  writeFileSync(
package/src/types.ts CHANGED
@@ -46,6 +46,9 @@ export interface ProxyConfig {
46
46
  rewrite?: (path: string) => string
47
47
  secure: boolean
48
48
  ws?: boolean
49
+ followRedirects?: boolean
50
+ autoRewrite?: boolean
51
+ protocolRewrite?: string
49
52
  configure?: (proxy: any, options: any) => void
50
53
  }
51
54
  }