@bagelink/workspace 1.7.39 → 1.7.43
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/README.md +23 -7
- package/dist/bin/bgl.cjs +1081 -14
- package/dist/bin/bgl.mjs +1070 -4
- package/dist/index.cjs +0 -131
- package/dist/index.d.cts +3 -123
- package/dist/index.d.mts +3 -123
- package/dist/index.d.ts +3 -123
- package/dist/index.mjs +1 -109
- package/dist/shared/workspace.D1xukL92.d.cts +44 -0
- package/dist/shared/workspace.D1xukL92.d.mts +44 -0
- package/dist/shared/workspace.D1xukL92.d.ts +44 -0
- package/dist/shared/workspace.Dx9_TIij.cjs +86 -0
- package/dist/shared/workspace.Twuo1PFw.mjs +78 -0
- package/dist/vite.cjs +88 -4
- package/dist/vite.d.cts +97 -2
- package/dist/vite.d.mts +97 -2
- package/dist/vite.d.ts +97 -2
- package/dist/vite.mjs +82 -3
- package/package.json +1 -1
- package/src/index.ts +8 -81
- package/src/lint.ts +90 -2
- package/src/vite.ts +4 -0
- package/dist/shared/workspace.CSNgk3PR.d.cts +0 -113
- package/dist/shared/workspace.CSNgk3PR.d.mts +0 -113
- package/dist/shared/workspace.CSNgk3PR.d.ts +0 -113
- package/dist/shared/workspace.CamNrnD_.cjs +0 -1155
- package/dist/shared/workspace.D0MF8ERh.mjs +0 -79
- package/dist/shared/workspace.DfLGMczD.cjs +0 -87
- package/dist/shared/workspace.PLrsjsJ2.mjs +0 -1134
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ export default defineConfig(({ mode }) => {
|
|
|
162
162
|
**Access config at runtime with `useWorkspace()`:**
|
|
163
163
|
|
|
164
164
|
```typescript
|
|
165
|
-
import { useWorkspace, getApiUrl } from '@bagelink/workspace
|
|
165
|
+
import { useWorkspace, getApiUrl } from '@bagelink/workspace'
|
|
166
166
|
|
|
167
167
|
// In your app setup
|
|
168
168
|
const { proxy, host, mode } = useWorkspace()
|
|
@@ -176,7 +176,7 @@ const apiUrl = getApiUrl() // 'https://project.bagel.to/api'
|
|
|
176
176
|
|
|
177
177
|
```vue
|
|
178
178
|
<script setup lang="ts">
|
|
179
|
-
import { useWorkspace } from '@bagelink/workspace
|
|
179
|
+
import { useWorkspace } from '@bagelink/workspace'
|
|
180
180
|
import { initAuth } from '@bagelink/auth'
|
|
181
181
|
|
|
182
182
|
const { proxy, host, mode } = useWorkspace()
|
|
@@ -514,7 +514,7 @@ Show CLI help.
|
|
|
514
514
|
Get workspace configuration at runtime. Config is injected as environment variables during build.
|
|
515
515
|
|
|
516
516
|
```typescript
|
|
517
|
-
import { useWorkspace } from '@bagelink/workspace
|
|
517
|
+
import { useWorkspace } from '@bagelink/workspace'
|
|
518
518
|
|
|
519
519
|
const { proxy, host, openapiUrl, mode } = useWorkspace()
|
|
520
520
|
```
|
|
@@ -534,7 +534,7 @@ interface RuntimeWorkspaceConfig {
|
|
|
534
534
|
Get the full API URL by combining host and proxy.
|
|
535
535
|
|
|
536
536
|
```typescript
|
|
537
|
-
import { getApiUrl } from '@bagelink/workspace
|
|
537
|
+
import { getApiUrl } from '@bagelink/workspace'
|
|
538
538
|
|
|
539
539
|
const apiUrl = getApiUrl() // 'https://project.bagel.to/api'
|
|
540
540
|
```
|
|
@@ -580,21 +580,37 @@ const proxy = workspace.createProxy(config)
|
|
|
580
580
|
workspace.generateNetlify(config, './netlify.toml')
|
|
581
581
|
```
|
|
582
582
|
|
|
583
|
-
###
|
|
583
|
+
### Build-Time Functions
|
|
584
|
+
|
|
585
|
+
These are available from `@bagelink/workspace/vite`:
|
|
586
|
+
|
|
587
|
+
#### `createViteProxy(config)`
|
|
584
588
|
|
|
585
589
|
Generate Vite proxy configuration.
|
|
586
590
|
|
|
587
|
-
|
|
591
|
+
```typescript
|
|
592
|
+
import { createViteProxy } from '@bagelink/workspace/vite'
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
#### `writeNetlifyConfig(config, outPath?, additionalConfig?)`
|
|
588
596
|
|
|
589
597
|
Generate and write netlify.toml file.
|
|
590
598
|
|
|
591
|
-
|
|
599
|
+
```typescript
|
|
600
|
+
import { writeNetlifyConfig } from '@bagelink/workspace/vite'
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
#### `setBuildEnvVars(config)`
|
|
592
604
|
|
|
593
605
|
Set environment variables for build process:
|
|
594
606
|
- `BGL_PROXY_PATH` - Proxy path (e.g., `/api`)
|
|
595
607
|
- `BGL_API_HOST` - API host URL
|
|
596
608
|
- `BGL_OPENAPI_URL` - OpenAPI specification URL
|
|
597
609
|
|
|
610
|
+
```typescript
|
|
611
|
+
import { setBuildEnvVars } from '@bagelink/workspace/vite'
|
|
612
|
+
```
|
|
613
|
+
|
|
598
614
|
## License
|
|
599
615
|
|
|
600
616
|
MIT © Bagel Studio
|