@bagelink/workspace 1.9.0 → 1.10.1
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 +95 -3
- package/bin/bgl.ts +59 -12
- package/dist/bin/bgl.cjs +55 -18
- package/dist/bin/bgl.mjs +51 -14
- package/dist/index.cjs +18 -14
- package/dist/index.d.cts +25 -3
- package/dist/index.d.mts +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.mjs +2 -2
- package/dist/shared/{workspace.cX7U2RUq.mjs → workspace.B6LGs4Ed.mjs} +361 -175
- package/dist/shared/{workspace.CCUm_5GG.cjs → workspace.Ndvn7T1u.cjs} +353 -163
- package/package.json +6 -1
- package/src/detect.ts +91 -0
- package/src/index.ts +3 -1
- package/src/sdk.ts +186 -0
package/README.md
CHANGED
|
@@ -304,12 +304,104 @@ bgl lint init
|
|
|
304
304
|
- `bun run format` - Format code
|
|
305
305
|
- `bun run format:check` - Check formatting
|
|
306
306
|
|
|
307
|
-
**
|
|
307
|
+
**Auto-detects workspace:**
|
|
308
308
|
```bash
|
|
309
|
-
|
|
309
|
+
# In workspace root (auto-detected)
|
|
310
|
+
bgl lint init
|
|
311
|
+
✓ Detected workspace mode
|
|
312
|
+
# Sets up at workspace root
|
|
313
|
+
|
|
314
|
+
# In single project (auto-detected)
|
|
315
|
+
bgl lint init
|
|
316
|
+
# Sets up in current project
|
|
317
|
+
|
|
318
|
+
# Force modes:
|
|
319
|
+
bgl lint init --workspace # Force workspace mode
|
|
320
|
+
bgl lint init --project # Force single project mode
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**Workspace detection:**
|
|
324
|
+
- Checks for `workspaces` field in package.json
|
|
325
|
+
- Checks for multiple project directories
|
|
326
|
+
- Auto-applies best mode
|
|
327
|
+
|
|
328
|
+
### SDK Generation
|
|
329
|
+
|
|
330
|
+
#### `bgl sdk generate`
|
|
331
|
+
|
|
332
|
+
Generate TypeScript SDK from OpenAPI specification:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
bgl sdk generate
|
|
336
|
+
|
|
337
|
+
? OpenAPI spec URL: › http://localhost:8000/openapi.json
|
|
338
|
+
? Output directory: › ./src/api
|
|
339
|
+
? Split into organized files? › Yes
|
|
340
|
+
|
|
341
|
+
📡 Fetching OpenAPI spec from: http://localhost:8000/openapi.json
|
|
342
|
+
📁 Output directory: ./src/api
|
|
343
|
+
|
|
344
|
+
✅ Generated types.d.ts
|
|
345
|
+
✅ Generated api.ts
|
|
346
|
+
✅ Generated index.ts
|
|
347
|
+
🔀 Splitting into organized files...
|
|
348
|
+
✅ Files organized into directories
|
|
349
|
+
|
|
350
|
+
✅ SDK generated successfully!
|
|
351
|
+
|
|
352
|
+
Import it in your code:
|
|
353
|
+
import { api } from './api'
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**Features:**
|
|
357
|
+
- Auto-reads `openapi_url` from `bgl.config.ts`
|
|
358
|
+
- Generates TypeScript types from OpenAPI schema
|
|
359
|
+
- Creates type-safe API client
|
|
360
|
+
- Optional file organization (split by endpoints)
|
|
361
|
+
- Works with both local and remote OpenAPI specs
|
|
362
|
+
|
|
363
|
+
**Auto-detects workspace:**
|
|
364
|
+
```bash
|
|
365
|
+
# In workspace root (auto-detected)
|
|
366
|
+
bgl sdk generate
|
|
367
|
+
✓ Detected workspace mode - will generate for multiple projects
|
|
368
|
+
|
|
369
|
+
? Select projects to generate SDK for:
|
|
370
|
+
✔ admin
|
|
371
|
+
✔ customer
|
|
372
|
+
✔ mobile
|
|
373
|
+
|
|
374
|
+
# In single project (auto-detected)
|
|
375
|
+
bgl sdk generate
|
|
376
|
+
# Generates SDK for current project only
|
|
377
|
+
|
|
378
|
+
# Force modes:
|
|
379
|
+
bgl sdk generate --workspace # Force workspace mode
|
|
380
|
+
bgl sdk generate --project # Force single project mode
|
|
310
381
|
```
|
|
311
382
|
|
|
312
|
-
|
|
383
|
+
**Smart behavior:**
|
|
384
|
+
- Auto-detects workspace structure
|
|
385
|
+
- Prompts for project selection in workspace mode
|
|
386
|
+
- Reads `openapi_url` from each project's `bgl.config.ts`
|
|
387
|
+
|
|
388
|
+
**Generated structure:**
|
|
389
|
+
```
|
|
390
|
+
src/api/
|
|
391
|
+
├── index.ts # Main export
|
|
392
|
+
├── types.d.ts # TypeScript types
|
|
393
|
+
└── api.ts # API client
|
|
394
|
+
|
|
395
|
+
# Or with --split:
|
|
396
|
+
src/api/
|
|
397
|
+
├── endpoints/
|
|
398
|
+
│ ├── users.ts
|
|
399
|
+
│ ├── auth.ts
|
|
400
|
+
│ └── data.ts
|
|
401
|
+
├── types/
|
|
402
|
+
│ └── index.ts
|
|
403
|
+
└── index.ts
|
|
404
|
+
```
|
|
313
405
|
|
|
314
406
|
### `npx bgl --help`
|
|
315
407
|
|
package/bin/bgl.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from 'node:process'
|
|
3
3
|
import { generateWorkspaceConfig } from '../src/init.js'
|
|
4
|
-
import {
|
|
4
|
+
import { isWorkspace } from '../src/detect.js'
|
|
5
5
|
import { setupLint } from '../src/lint.js'
|
|
6
|
+
import { generateSDK, generateSDKForWorkspace } from '../src/sdk.js'
|
|
7
|
+
import { addProject, initWorkspace, listProjects } from '../src/workspace.js'
|
|
6
8
|
|
|
7
9
|
const [,, command, subcommand, ...args] = process.argv
|
|
8
10
|
|
|
@@ -32,20 +34,61 @@ async function main() {
|
|
|
32
34
|
}
|
|
33
35
|
else {
|
|
34
36
|
console.log('\nProjects:')
|
|
35
|
-
projects.forEach(p => console.log(` - ${p}`))
|
|
37
|
+
projects.forEach((p) => { console.log(` - ${p}`) })
|
|
36
38
|
console.log('')
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
else if (command === 'lint') {
|
|
40
42
|
if (subcommand === 'init') {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
// Auto-detect workspace or allow override
|
|
44
|
+
const forceWorkspace = args.includes('--workspace') || args.includes('-w')
|
|
45
|
+
const forceProject = args.includes('--project') || args.includes('-p')
|
|
46
|
+
|
|
47
|
+
let workspaceMode = isWorkspace()
|
|
48
|
+
if (forceWorkspace) workspaceMode = true
|
|
49
|
+
if (forceProject) workspaceMode = false
|
|
50
|
+
|
|
51
|
+
if (workspaceMode) {
|
|
52
|
+
console.log('✓ Detected workspace mode')
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
await setupLint(process.cwd(), workspaceMode)
|
|
43
56
|
}
|
|
44
57
|
else {
|
|
45
58
|
console.log(`
|
|
46
59
|
Lint Commands:
|
|
47
|
-
bgl lint init Set up linting
|
|
48
|
-
bgl lint init --workspace
|
|
60
|
+
bgl lint init Set up linting (auto-detects workspace)
|
|
61
|
+
bgl lint init --workspace Force workspace mode
|
|
62
|
+
bgl lint init --project Force single project mode
|
|
63
|
+
`)
|
|
64
|
+
process.exit(1)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (command === 'sdk') {
|
|
68
|
+
if (subcommand === 'generate') {
|
|
69
|
+
// Auto-detect workspace or allow override
|
|
70
|
+
const forceWorkspace = args.includes('--workspace') || args.includes('-w')
|
|
71
|
+
const forceProject = args.includes('--project') || args.includes('-p')
|
|
72
|
+
|
|
73
|
+
let workspaceMode = isWorkspace()
|
|
74
|
+
if (forceWorkspace) workspaceMode = true
|
|
75
|
+
if (forceProject) workspaceMode = false
|
|
76
|
+
|
|
77
|
+
if (workspaceMode) {
|
|
78
|
+
console.log('✓ Detected workspace mode - will generate for multiple projects')
|
|
79
|
+
await generateSDKForWorkspace()
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const projectName = args.find(arg => !arg.startsWith('-'))
|
|
83
|
+
await generateSDK(process.cwd(), projectName)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
console.log(`
|
|
88
|
+
SDK Commands:
|
|
89
|
+
bgl sdk generate Generate SDK (auto-detects workspace)
|
|
90
|
+
bgl sdk generate --workspace Force workspace mode
|
|
91
|
+
bgl sdk generate --project Force single project mode
|
|
49
92
|
`)
|
|
50
93
|
process.exit(1)
|
|
51
94
|
}
|
|
@@ -55,15 +98,19 @@ Lint Commands:
|
|
|
55
98
|
Bagel Workspace CLI
|
|
56
99
|
|
|
57
100
|
Usage:
|
|
58
|
-
bgl init
|
|
59
|
-
bgl init --workspace
|
|
60
|
-
bgl add <name>
|
|
61
|
-
bgl list
|
|
62
|
-
bgl lint init
|
|
63
|
-
bgl
|
|
101
|
+
bgl init Generate bgl.config.ts for single project
|
|
102
|
+
bgl init --workspace Create a new workspace with multiple projects
|
|
103
|
+
bgl add <name> Add a new project to workspace
|
|
104
|
+
bgl list List all projects in workspace
|
|
105
|
+
bgl lint init Set up linting (auto-detects workspace)
|
|
106
|
+
bgl sdk generate Generate SDK (auto-detects workspace)
|
|
64
107
|
|
|
65
108
|
Options:
|
|
109
|
+
--workspace, -w Force workspace mode
|
|
110
|
+
--project, -p Force single project mode
|
|
66
111
|
--help, -h Show this help message
|
|
112
|
+
|
|
113
|
+
Note: Commands auto-detect workspace mode based on directory structure
|
|
67
114
|
`)
|
|
68
115
|
process.exit(command === '--help' || command === '-h' ? 0 : 1)
|
|
69
116
|
}
|
package/dist/bin/bgl.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const process = require('node:process');
|
|
5
|
-
const
|
|
5
|
+
const detect = require('../shared/workspace.Ndvn7T1u.cjs');
|
|
6
6
|
require('node:fs');
|
|
7
7
|
require('node:path');
|
|
8
8
|
require('prompts');
|
|
@@ -14,11 +14,11 @@ const process__default = /*#__PURE__*/_interopDefaultCompat(process);
|
|
|
14
14
|
const [, , command, subcommand, ...args] = process__default.argv;
|
|
15
15
|
async function main() {
|
|
16
16
|
if (command === "init") {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
await
|
|
17
|
+
const isWorkspace2 = args.includes("--workspace") || args.includes("-w");
|
|
18
|
+
if (isWorkspace2) {
|
|
19
|
+
await detect.initWorkspace();
|
|
20
20
|
} else {
|
|
21
|
-
await
|
|
21
|
+
await detect.generateWorkspaceConfig();
|
|
22
22
|
}
|
|
23
23
|
} else if (command === "add") {
|
|
24
24
|
const projectName = args[0];
|
|
@@ -27,25 +27,58 @@ async function main() {
|
|
|
27
27
|
console.log("Usage: bgl add <project-name>");
|
|
28
28
|
process__default.exit(1);
|
|
29
29
|
}
|
|
30
|
-
await
|
|
30
|
+
await detect.addProject(projectName);
|
|
31
31
|
} else if (command === "list") {
|
|
32
|
-
const projects =
|
|
32
|
+
const projects = detect.listProjects();
|
|
33
33
|
if (projects.length === 0) {
|
|
34
34
|
console.log("No projects found");
|
|
35
35
|
} else {
|
|
36
36
|
console.log("\nProjects:");
|
|
37
|
-
projects.forEach((p) =>
|
|
37
|
+
projects.forEach((p) => {
|
|
38
|
+
console.log(` - ${p}`);
|
|
39
|
+
});
|
|
38
40
|
console.log("");
|
|
39
41
|
}
|
|
40
42
|
} else if (command === "lint") {
|
|
41
43
|
if (subcommand === "init") {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
+
const forceWorkspace = args.includes("--workspace") || args.includes("-w");
|
|
45
|
+
const forceProject = args.includes("--project") || args.includes("-p");
|
|
46
|
+
let workspaceMode = detect.isWorkspace();
|
|
47
|
+
if (forceWorkspace) workspaceMode = true;
|
|
48
|
+
if (forceProject) workspaceMode = false;
|
|
49
|
+
if (workspaceMode) {
|
|
50
|
+
console.log("\u2713 Detected workspace mode");
|
|
51
|
+
}
|
|
52
|
+
await detect.setupLint(process__default.cwd(), workspaceMode);
|
|
44
53
|
} else {
|
|
45
54
|
console.log(`
|
|
46
55
|
Lint Commands:
|
|
47
|
-
bgl lint init Set up linting
|
|
48
|
-
bgl lint init --workspace
|
|
56
|
+
bgl lint init Set up linting (auto-detects workspace)
|
|
57
|
+
bgl lint init --workspace Force workspace mode
|
|
58
|
+
bgl lint init --project Force single project mode
|
|
59
|
+
`);
|
|
60
|
+
process__default.exit(1);
|
|
61
|
+
}
|
|
62
|
+
} else if (command === "sdk") {
|
|
63
|
+
if (subcommand === "generate") {
|
|
64
|
+
const forceWorkspace = args.includes("--workspace") || args.includes("-w");
|
|
65
|
+
const forceProject = args.includes("--project") || args.includes("-p");
|
|
66
|
+
let workspaceMode = detect.isWorkspace();
|
|
67
|
+
if (forceWorkspace) workspaceMode = true;
|
|
68
|
+
if (forceProject) workspaceMode = false;
|
|
69
|
+
if (workspaceMode) {
|
|
70
|
+
console.log("\u2713 Detected workspace mode - will generate for multiple projects");
|
|
71
|
+
await detect.generateSDKForWorkspace();
|
|
72
|
+
} else {
|
|
73
|
+
args.find((arg) => !arg.startsWith("-"));
|
|
74
|
+
await detect.generateSDK(process__default.cwd());
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
console.log(`
|
|
78
|
+
SDK Commands:
|
|
79
|
+
bgl sdk generate Generate SDK (auto-detects workspace)
|
|
80
|
+
bgl sdk generate --workspace Force workspace mode
|
|
81
|
+
bgl sdk generate --project Force single project mode
|
|
49
82
|
`);
|
|
50
83
|
process__default.exit(1);
|
|
51
84
|
}
|
|
@@ -54,15 +87,19 @@ Lint Commands:
|
|
|
54
87
|
Bagel Workspace CLI
|
|
55
88
|
|
|
56
89
|
Usage:
|
|
57
|
-
bgl init
|
|
58
|
-
bgl init --workspace
|
|
59
|
-
bgl add <name>
|
|
60
|
-
bgl list
|
|
61
|
-
bgl lint init
|
|
62
|
-
bgl
|
|
90
|
+
bgl init Generate bgl.config.ts for single project
|
|
91
|
+
bgl init --workspace Create a new workspace with multiple projects
|
|
92
|
+
bgl add <name> Add a new project to workspace
|
|
93
|
+
bgl list List all projects in workspace
|
|
94
|
+
bgl lint init Set up linting (auto-detects workspace)
|
|
95
|
+
bgl sdk generate Generate SDK (auto-detects workspace)
|
|
63
96
|
|
|
64
97
|
Options:
|
|
98
|
+
--workspace, -w Force workspace mode
|
|
99
|
+
--project, -p Force single project mode
|
|
65
100
|
--help, -h Show this help message
|
|
101
|
+
|
|
102
|
+
Note: Commands auto-detect workspace mode based on directory structure
|
|
66
103
|
`);
|
|
67
104
|
process__default.exit(command === "--help" || command === "-h" ? 0 : 1);
|
|
68
105
|
}
|
package/dist/bin/bgl.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from 'node:process';
|
|
3
|
-
import { i as initWorkspace, g as generateWorkspaceConfig,
|
|
3
|
+
import { i as initWorkspace, g as generateWorkspaceConfig, h as addProject, l as listProjects, k as isWorkspace, d as setupLint, f as generateSDKForWorkspace, e as generateSDK } from '../shared/workspace.B6LGs4Ed.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:path';
|
|
6
6
|
import 'prompts';
|
|
@@ -8,8 +8,8 @@ import 'prompts';
|
|
|
8
8
|
const [, , command, subcommand, ...args] = process.argv;
|
|
9
9
|
async function main() {
|
|
10
10
|
if (command === "init") {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
11
|
+
const isWorkspace2 = args.includes("--workspace") || args.includes("-w");
|
|
12
|
+
if (isWorkspace2) {
|
|
13
13
|
await initWorkspace();
|
|
14
14
|
} else {
|
|
15
15
|
await generateWorkspaceConfig();
|
|
@@ -28,18 +28,51 @@ async function main() {
|
|
|
28
28
|
console.log("No projects found");
|
|
29
29
|
} else {
|
|
30
30
|
console.log("\nProjects:");
|
|
31
|
-
projects.forEach((p) =>
|
|
31
|
+
projects.forEach((p) => {
|
|
32
|
+
console.log(` - ${p}`);
|
|
33
|
+
});
|
|
32
34
|
console.log("");
|
|
33
35
|
}
|
|
34
36
|
} else if (command === "lint") {
|
|
35
37
|
if (subcommand === "init") {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
+
const forceWorkspace = args.includes("--workspace") || args.includes("-w");
|
|
39
|
+
const forceProject = args.includes("--project") || args.includes("-p");
|
|
40
|
+
let workspaceMode = isWorkspace();
|
|
41
|
+
if (forceWorkspace) workspaceMode = true;
|
|
42
|
+
if (forceProject) workspaceMode = false;
|
|
43
|
+
if (workspaceMode) {
|
|
44
|
+
console.log("\u2713 Detected workspace mode");
|
|
45
|
+
}
|
|
46
|
+
await setupLint(process.cwd(), workspaceMode);
|
|
38
47
|
} else {
|
|
39
48
|
console.log(`
|
|
40
49
|
Lint Commands:
|
|
41
|
-
bgl lint init Set up linting
|
|
42
|
-
bgl lint init --workspace
|
|
50
|
+
bgl lint init Set up linting (auto-detects workspace)
|
|
51
|
+
bgl lint init --workspace Force workspace mode
|
|
52
|
+
bgl lint init --project Force single project mode
|
|
53
|
+
`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
} else if (command === "sdk") {
|
|
57
|
+
if (subcommand === "generate") {
|
|
58
|
+
const forceWorkspace = args.includes("--workspace") || args.includes("-w");
|
|
59
|
+
const forceProject = args.includes("--project") || args.includes("-p");
|
|
60
|
+
let workspaceMode = isWorkspace();
|
|
61
|
+
if (forceWorkspace) workspaceMode = true;
|
|
62
|
+
if (forceProject) workspaceMode = false;
|
|
63
|
+
if (workspaceMode) {
|
|
64
|
+
console.log("\u2713 Detected workspace mode - will generate for multiple projects");
|
|
65
|
+
await generateSDKForWorkspace();
|
|
66
|
+
} else {
|
|
67
|
+
args.find((arg) => !arg.startsWith("-"));
|
|
68
|
+
await generateSDK(process.cwd());
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
console.log(`
|
|
72
|
+
SDK Commands:
|
|
73
|
+
bgl sdk generate Generate SDK (auto-detects workspace)
|
|
74
|
+
bgl sdk generate --workspace Force workspace mode
|
|
75
|
+
bgl sdk generate --project Force single project mode
|
|
43
76
|
`);
|
|
44
77
|
process.exit(1);
|
|
45
78
|
}
|
|
@@ -48,15 +81,19 @@ Lint Commands:
|
|
|
48
81
|
Bagel Workspace CLI
|
|
49
82
|
|
|
50
83
|
Usage:
|
|
51
|
-
bgl init
|
|
52
|
-
bgl init --workspace
|
|
53
|
-
bgl add <name>
|
|
54
|
-
bgl list
|
|
55
|
-
bgl lint init
|
|
56
|
-
bgl
|
|
84
|
+
bgl init Generate bgl.config.ts for single project
|
|
85
|
+
bgl init --workspace Create a new workspace with multiple projects
|
|
86
|
+
bgl add <name> Add a new project to workspace
|
|
87
|
+
bgl list List all projects in workspace
|
|
88
|
+
bgl lint init Set up linting (auto-detects workspace)
|
|
89
|
+
bgl sdk generate Generate SDK (auto-detects workspace)
|
|
57
90
|
|
|
58
91
|
Options:
|
|
92
|
+
--workspace, -w Force workspace mode
|
|
93
|
+
--project, -p Force single project mode
|
|
59
94
|
--help, -h Show this help message
|
|
95
|
+
|
|
96
|
+
Note: Commands auto-detect workspace mode based on directory structure
|
|
60
97
|
`);
|
|
61
98
|
process.exit(command === "--help" || command === "-h" ? 0 : 1);
|
|
62
99
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const node_fs = require('node:fs');
|
|
4
4
|
const node_path = require('node:path');
|
|
5
5
|
const process = require('node:process');
|
|
6
|
-
const
|
|
6
|
+
const detect = require('./shared/workspace.Ndvn7T1u.cjs');
|
|
7
7
|
require('prompts');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
@@ -32,7 +32,7 @@ async function resolveConfig(mode = "development", options = {}) {
|
|
|
32
32
|
currentDir = parentDir;
|
|
33
33
|
}
|
|
34
34
|
if (options.interactive !== false) {
|
|
35
|
-
await
|
|
35
|
+
await detect.generateWorkspaceConfig(root, configFile);
|
|
36
36
|
const newConfig = await loadConfig(localConfigPath, mode);
|
|
37
37
|
if (newConfig) {
|
|
38
38
|
return newConfig;
|
|
@@ -131,13 +131,13 @@ function createWorkspace(options = {}) {
|
|
|
131
131
|
* Generate Netlify configuration file
|
|
132
132
|
*/
|
|
133
133
|
generateNetlify(config, outPath = "./netlify.toml", additionalConfig) {
|
|
134
|
-
|
|
134
|
+
detect.writeNetlifyConfig(config, outPath, additionalConfig);
|
|
135
135
|
},
|
|
136
136
|
/**
|
|
137
137
|
* Set build environment variables
|
|
138
138
|
*/
|
|
139
139
|
setBuildEnv(config) {
|
|
140
|
-
|
|
140
|
+
detect.setBuildEnvVars(config);
|
|
141
141
|
},
|
|
142
142
|
/**
|
|
143
143
|
* Clear cached configuration
|
|
@@ -148,16 +148,20 @@ function createWorkspace(options = {}) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
exports.addProject =
|
|
152
|
-
exports.generateNetlifyConfig =
|
|
153
|
-
exports.generateNetlifyRedirect =
|
|
154
|
-
exports.
|
|
155
|
-
exports.
|
|
156
|
-
exports.
|
|
157
|
-
exports.
|
|
158
|
-
exports.
|
|
159
|
-
exports.
|
|
160
|
-
exports.
|
|
151
|
+
exports.addProject = detect.addProject;
|
|
152
|
+
exports.generateNetlifyConfig = detect.generateNetlifyConfig;
|
|
153
|
+
exports.generateNetlifyRedirect = detect.generateNetlifyRedirect;
|
|
154
|
+
exports.generateSDK = detect.generateSDK;
|
|
155
|
+
exports.generateSDKForWorkspace = detect.generateSDKForWorkspace;
|
|
156
|
+
exports.generateWorkspaceConfig = detect.generateWorkspaceConfig;
|
|
157
|
+
exports.generateWorkspaceConfigSync = detect.generateWorkspaceConfigSync;
|
|
158
|
+
exports.getWorkspaceInfo = detect.getWorkspaceInfo;
|
|
159
|
+
exports.initWorkspace = detect.initWorkspace;
|
|
160
|
+
exports.isWorkspace = detect.isWorkspace;
|
|
161
|
+
exports.listProjects = detect.listProjects;
|
|
162
|
+
exports.setBuildEnvVars = detect.setBuildEnvVars;
|
|
163
|
+
exports.setupLint = detect.setupLint;
|
|
164
|
+
exports.writeNetlifyConfig = detect.writeNetlifyConfig;
|
|
161
165
|
exports.createCustomProxy = createCustomProxy;
|
|
162
166
|
exports.createViteProxy = createViteProxy;
|
|
163
167
|
exports.createWorkspace = createWorkspace;
|
package/dist/index.d.cts
CHANGED
|
@@ -91,6 +91,20 @@ declare function createCustomProxy(paths: string[], target: string, options?: {
|
|
|
91
91
|
secure?: boolean;
|
|
92
92
|
}): ProxyConfig;
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Set up linting in a project
|
|
96
|
+
*/
|
|
97
|
+
declare function setupLint(root?: string, isWorkspace?: boolean): Promise<void>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Generate SDK from OpenAPI spec
|
|
101
|
+
*/
|
|
102
|
+
declare function generateSDK(root?: string, projectName?: string): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Generate SDK for all projects in workspace
|
|
105
|
+
*/
|
|
106
|
+
declare function generateSDKForWorkspace(root?: string): Promise<void>;
|
|
107
|
+
|
|
94
108
|
/**
|
|
95
109
|
* Initialize a new workspace with flat structure
|
|
96
110
|
*/
|
|
@@ -105,9 +119,17 @@ declare function addProject(name: string, root?: string): Promise<void>;
|
|
|
105
119
|
declare function listProjects(root?: string): string[];
|
|
106
120
|
|
|
107
121
|
/**
|
|
108
|
-
*
|
|
122
|
+
* Detect if current directory is a workspace root
|
|
109
123
|
*/
|
|
110
|
-
declare function
|
|
124
|
+
declare function isWorkspace(root?: string): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Get workspace info
|
|
127
|
+
*/
|
|
128
|
+
declare function getWorkspaceInfo(root?: string): {
|
|
129
|
+
isWorkspace: boolean;
|
|
130
|
+
projects: string[];
|
|
131
|
+
hasShared: boolean;
|
|
132
|
+
};
|
|
111
133
|
|
|
112
134
|
/**
|
|
113
135
|
* Define workspace configuration
|
|
@@ -141,5 +163,5 @@ declare function createWorkspace(options?: WorkspaceOptions): {
|
|
|
141
163
|
clearCache(): void;
|
|
142
164
|
};
|
|
143
165
|
|
|
144
|
-
export { addProject, createCustomProxy, createViteProxy, createWorkspace, defineWorkspace, generateNetlifyConfig, generateNetlifyRedirect, generateWorkspaceConfig, generateWorkspaceConfigSync, initWorkspace, listProjects, mergeConfigs, resolveConfig, setBuildEnvVars, setupLint, writeNetlifyConfig };
|
|
166
|
+
export { addProject, createCustomProxy, createViteProxy, createWorkspace, defineWorkspace, generateNetlifyConfig, generateNetlifyRedirect, generateSDK, generateSDKForWorkspace, generateWorkspaceConfig, generateWorkspaceConfigSync, getWorkspaceInfo, initWorkspace, isWorkspace, listProjects, mergeConfigs, resolveConfig, setBuildEnvVars, setupLint, writeNetlifyConfig };
|
|
145
167
|
export type { ProxyConfig, WorkspaceConfig, WorkspaceEnvironment, WorkspaceOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -91,6 +91,20 @@ declare function createCustomProxy(paths: string[], target: string, options?: {
|
|
|
91
91
|
secure?: boolean;
|
|
92
92
|
}): ProxyConfig;
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Set up linting in a project
|
|
96
|
+
*/
|
|
97
|
+
declare function setupLint(root?: string, isWorkspace?: boolean): Promise<void>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Generate SDK from OpenAPI spec
|
|
101
|
+
*/
|
|
102
|
+
declare function generateSDK(root?: string, projectName?: string): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Generate SDK for all projects in workspace
|
|
105
|
+
*/
|
|
106
|
+
declare function generateSDKForWorkspace(root?: string): Promise<void>;
|
|
107
|
+
|
|
94
108
|
/**
|
|
95
109
|
* Initialize a new workspace with flat structure
|
|
96
110
|
*/
|
|
@@ -105,9 +119,17 @@ declare function addProject(name: string, root?: string): Promise<void>;
|
|
|
105
119
|
declare function listProjects(root?: string): string[];
|
|
106
120
|
|
|
107
121
|
/**
|
|
108
|
-
*
|
|
122
|
+
* Detect if current directory is a workspace root
|
|
109
123
|
*/
|
|
110
|
-
declare function
|
|
124
|
+
declare function isWorkspace(root?: string): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Get workspace info
|
|
127
|
+
*/
|
|
128
|
+
declare function getWorkspaceInfo(root?: string): {
|
|
129
|
+
isWorkspace: boolean;
|
|
130
|
+
projects: string[];
|
|
131
|
+
hasShared: boolean;
|
|
132
|
+
};
|
|
111
133
|
|
|
112
134
|
/**
|
|
113
135
|
* Define workspace configuration
|
|
@@ -141,5 +163,5 @@ declare function createWorkspace(options?: WorkspaceOptions): {
|
|
|
141
163
|
clearCache(): void;
|
|
142
164
|
};
|
|
143
165
|
|
|
144
|
-
export { addProject, createCustomProxy, createViteProxy, createWorkspace, defineWorkspace, generateNetlifyConfig, generateNetlifyRedirect, generateWorkspaceConfig, generateWorkspaceConfigSync, initWorkspace, listProjects, mergeConfigs, resolveConfig, setBuildEnvVars, setupLint, writeNetlifyConfig };
|
|
166
|
+
export { addProject, createCustomProxy, createViteProxy, createWorkspace, defineWorkspace, generateNetlifyConfig, generateNetlifyRedirect, generateSDK, generateSDKForWorkspace, generateWorkspaceConfig, generateWorkspaceConfigSync, getWorkspaceInfo, initWorkspace, isWorkspace, listProjects, mergeConfigs, resolveConfig, setBuildEnvVars, setupLint, writeNetlifyConfig };
|
|
145
167
|
export type { ProxyConfig, WorkspaceConfig, WorkspaceEnvironment, WorkspaceOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -91,6 +91,20 @@ declare function createCustomProxy(paths: string[], target: string, options?: {
|
|
|
91
91
|
secure?: boolean;
|
|
92
92
|
}): ProxyConfig;
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Set up linting in a project
|
|
96
|
+
*/
|
|
97
|
+
declare function setupLint(root?: string, isWorkspace?: boolean): Promise<void>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Generate SDK from OpenAPI spec
|
|
101
|
+
*/
|
|
102
|
+
declare function generateSDK(root?: string, projectName?: string): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Generate SDK for all projects in workspace
|
|
105
|
+
*/
|
|
106
|
+
declare function generateSDKForWorkspace(root?: string): Promise<void>;
|
|
107
|
+
|
|
94
108
|
/**
|
|
95
109
|
* Initialize a new workspace with flat structure
|
|
96
110
|
*/
|
|
@@ -105,9 +119,17 @@ declare function addProject(name: string, root?: string): Promise<void>;
|
|
|
105
119
|
declare function listProjects(root?: string): string[];
|
|
106
120
|
|
|
107
121
|
/**
|
|
108
|
-
*
|
|
122
|
+
* Detect if current directory is a workspace root
|
|
109
123
|
*/
|
|
110
|
-
declare function
|
|
124
|
+
declare function isWorkspace(root?: string): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Get workspace info
|
|
127
|
+
*/
|
|
128
|
+
declare function getWorkspaceInfo(root?: string): {
|
|
129
|
+
isWorkspace: boolean;
|
|
130
|
+
projects: string[];
|
|
131
|
+
hasShared: boolean;
|
|
132
|
+
};
|
|
111
133
|
|
|
112
134
|
/**
|
|
113
135
|
* Define workspace configuration
|
|
@@ -141,5 +163,5 @@ declare function createWorkspace(options?: WorkspaceOptions): {
|
|
|
141
163
|
clearCache(): void;
|
|
142
164
|
};
|
|
143
165
|
|
|
144
|
-
export { addProject, createCustomProxy, createViteProxy, createWorkspace, defineWorkspace, generateNetlifyConfig, generateNetlifyRedirect, generateWorkspaceConfig, generateWorkspaceConfigSync, initWorkspace, listProjects, mergeConfigs, resolveConfig, setBuildEnvVars, setupLint, writeNetlifyConfig };
|
|
166
|
+
export { addProject, createCustomProxy, createViteProxy, createWorkspace, defineWorkspace, generateNetlifyConfig, generateNetlifyRedirect, generateSDK, generateSDKForWorkspace, generateWorkspaceConfig, generateWorkspaceConfigSync, getWorkspaceInfo, initWorkspace, isWorkspace, listProjects, mergeConfigs, resolveConfig, setBuildEnvVars, setupLint, writeNetlifyConfig };
|
|
145
167
|
export type { ProxyConfig, WorkspaceConfig, WorkspaceEnvironment, WorkspaceOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { resolve, join } from 'node:path';
|
|
3
3
|
import process from 'node:process';
|
|
4
|
-
import { g as generateWorkspaceConfig, s as setBuildEnvVars, w as writeNetlifyConfig } from './shared/workspace.
|
|
5
|
-
export {
|
|
4
|
+
import { g as generateWorkspaceConfig, s as setBuildEnvVars, w as writeNetlifyConfig } from './shared/workspace.B6LGs4Ed.mjs';
|
|
5
|
+
export { h as addProject, a as generateNetlifyConfig, b as generateNetlifyRedirect, e as generateSDK, f as generateSDKForWorkspace, c as generateWorkspaceConfigSync, j as getWorkspaceInfo, i as initWorkspace, k as isWorkspace, l as listProjects, d as setupLint } from './shared/workspace.B6LGs4Ed.mjs';
|
|
6
6
|
import 'prompts';
|
|
7
7
|
|
|
8
8
|
async function resolveConfig(mode = "development", options = {}) {
|