swallowkit 2.0.0-alpha.1 → 2.0.0-alpha.10
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.ja.md +14 -0
- package/README.md +14 -0
- package/dist/cli/commands/add-auth.js +37 -6
- package/dist/cli/commands/add-auth.js.map +1 -1
- package/dist/cli/commands/configure-mcp.d.ts +12 -0
- package/dist/cli/commands/configure-mcp.d.ts.map +1 -0
- package/dist/cli/commands/configure-mcp.js +42 -0
- package/dist/cli/commands/configure-mcp.js.map +1 -0
- package/dist/cli/commands/dev.d.ts +2 -2
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +39 -27
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/init.d.ts +8 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +67 -132
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/migrations.d.ts.map +1 -1
- package/dist/cli/commands/migrations.js +25 -0
- package/dist/cli/commands/migrations.js.map +1 -1
- package/dist/cli/commands/provision.d.ts +5 -0
- package/dist/cli/commands/provision.d.ts.map +1 -1
- package/dist/cli/commands/provision.js +278 -55
- package/dist/cli/commands/provision.js.map +1 -1
- package/dist/cli/commands/scaffold.d.ts +4 -0
- package/dist/cli/commands/scaffold.d.ts.map +1 -1
- package/dist/cli/commands/scaffold.js +85 -3
- package/dist/cli/commands/scaffold.js.map +1 -1
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +43 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/core/operations/create-model.d.ts +2 -0
- package/dist/core/operations/create-model.d.ts.map +1 -1
- package/dist/core/operations/create-model.js +60 -8
- package/dist/core/operations/create-model.js.map +1 -1
- package/dist/core/operations/migration-generator.d.ts.map +1 -1
- package/dist/core/operations/migration-generator.js +12 -1
- package/dist/core/operations/migration-generator.js.map +1 -1
- package/dist/core/operations/model-migration.d.ts +22 -0
- package/dist/core/operations/model-migration.d.ts.map +1 -0
- package/dist/core/operations/model-migration.js +36 -0
- package/dist/core/operations/model-migration.js.map +1 -0
- package/dist/core/operations/provision-deployment.d.ts +52 -0
- package/dist/core/operations/provision-deployment.d.ts.map +1 -0
- package/dist/core/operations/provision-deployment.js +164 -0
- package/dist/core/operations/provision-deployment.js.map +1 -0
- package/dist/core/operations/provision-operations.d.ts +62 -6
- package/dist/core/operations/provision-operations.d.ts.map +1 -1
- package/dist/core/operations/provision-operations.js +653 -115
- package/dist/core/operations/provision-operations.js.map +1 -1
- package/dist/core/operations/scaffold-apply.d.ts +1 -0
- package/dist/core/operations/scaffold-apply.d.ts.map +1 -1
- package/dist/core/operations/scaffold-apply.js +1 -0
- package/dist/core/operations/scaffold-apply.js.map +1 -1
- package/dist/core/operations/scaffold-machine.d.ts +1 -0
- package/dist/core/operations/scaffold-machine.d.ts.map +1 -1
- package/dist/core/operations/scaffold-machine.js.map +1 -1
- package/dist/core/operations/scaffold-plan.d.ts +2 -0
- package/dist/core/operations/scaffold-plan.d.ts.map +1 -1
- package/dist/core/operations/scaffold-plan.js +3 -1
- package/dist/core/operations/scaffold-plan.js.map +1 -1
- package/dist/core/project/agent-instructions.d.ts.map +1 -1
- package/dist/core/project/agent-instructions.js +4 -1
- package/dist/core/project/agent-instructions.js.map +1 -1
- package/dist/core/project/boundaries.d.ts +5 -2
- package/dist/core/project/boundaries.d.ts.map +1 -1
- package/dist/core/project/boundaries.js +51 -20
- package/dist/core/project/boundaries.js.map +1 -1
- package/dist/core/project/capabilities.d.ts +10 -0
- package/dist/core/project/capabilities.d.ts.map +1 -1
- package/dist/core/project/capabilities.js +38 -6
- package/dist/core/project/capabilities.js.map +1 -1
- package/dist/core/project/home-page.d.ts +4 -0
- package/dist/core/project/home-page.d.ts.map +1 -0
- package/dist/core/project/home-page.js +113 -0
- package/dist/core/project/home-page.js.map +1 -0
- package/dist/core/project/mcp-config.d.ts +26 -0
- package/dist/core/project/mcp-config.d.ts.map +1 -0
- package/dist/core/project/mcp-config.js +117 -0
- package/dist/core/project/mcp-config.js.map +1 -0
- package/dist/core/project/react-project.d.ts +1 -1
- package/dist/core/project/react-project.d.ts.map +1 -1
- package/dist/core/project/react-project.js +46 -25
- package/dist/core/project/react-project.js.map +1 -1
- package/dist/core/project/state.d.ts +7 -0
- package/dist/core/project/state.d.ts.map +1 -1
- package/dist/core/project/state.js +86 -0
- package/dist/core/project/state.js.map +1 -1
- package/dist/core/project/workflows.d.ts.map +1 -1
- package/dist/core/project/workflows.js +53 -7
- package/dist/core/project/workflows.js.map +1 -1
- package/dist/core/scaffold/auth-generator.d.ts.map +1 -1
- package/dist/core/scaffold/auth-generator.js +26 -27
- package/dist/core/scaffold/auth-generator.js.map +1 -1
- package/dist/core/scaffold/model-parser.d.ts +23 -0
- package/dist/core/scaffold/model-parser.d.ts.map +1 -1
- package/dist/core/scaffold/model-parser.js +407 -137
- package/dist/core/scaffold/model-parser.js.map +1 -1
- package/dist/core/scaffold/native-schema-generator.d.ts +13 -0
- package/dist/core/scaffold/native-schema-generator.d.ts.map +1 -1
- package/dist/core/scaffold/native-schema-generator.js +294 -91
- package/dist/core/scaffold/native-schema-generator.js.map +1 -1
- package/dist/core/scaffold/openapi-generator.d.ts +5 -0
- package/dist/core/scaffold/openapi-generator.d.ts.map +1 -1
- package/dist/core/scaffold/openapi-generator.js +53 -3
- package/dist/core/scaffold/openapi-generator.js.map +1 -1
- package/dist/core/scaffold/ui-generator.d.ts +0 -3
- package/dist/core/scaffold/ui-generator.d.ts.map +1 -1
- package/dist/core/scaffold/ui-generator.js +68 -7
- package/dist/core/scaffold/ui-generator.js.map +1 -1
- package/dist/core/verify/index.d.ts +4 -3
- package/dist/core/verify/index.d.ts.map +1 -1
- package/dist/core/verify/index.js +122 -5
- package/dist/core/verify/index.js.map +1 -1
- package/dist/machine/contracts.d.ts +1 -0
- package/dist/machine/contracts.d.ts.map +1 -1
- package/dist/machine/errors.d.ts +3 -2
- package/dist/machine/errors.d.ts.map +1 -1
- package/dist/machine/errors.js +2 -1
- package/dist/machine/errors.js.map +1 -1
- package/dist/machine/index.d.ts.map +1 -1
- package/dist/machine/index.js +59 -28
- package/dist/machine/index.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -4
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +210 -25
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/version-selection.d.ts +55 -0
- package/dist/mcp/version-selection.d.ts.map +1 -0
- package/dist/mcp/version-selection.js +152 -0
- package/dist/mcp/version-selection.js.map +1 -0
- package/dist/utils/azure-cli.d.ts +56 -0
- package/dist/utils/azure-cli.d.ts.map +1 -0
- package/dist/utils/azure-cli.js +326 -0
- package/dist/utils/azure-cli.js.map +1 -0
- package/dist/utils/azure-diagnostics.d.ts +16 -0
- package/dist/utils/azure-diagnostics.d.ts.map +1 -0
- package/dist/utils/azure-diagnostics.js +68 -0
- package/dist/utils/azure-diagnostics.js.map +1 -0
- package/dist/utils/package-manager.js +2 -2
- package/dist/utils/package-manager.js.map +1 -1
- package/dist/utils/python-uv.d.ts +5 -7
- package/dist/utils/python-uv.d.ts.map +1 -1
- package/dist/utils/python-uv.js +50 -24
- package/dist/utils/python-uv.js.map +1 -1
- package/dist/utils/react-dev.d.ts +4 -0
- package/dist/utils/react-dev.d.ts.map +1 -0
- package/dist/utils/react-dev.js +35 -0
- package/dist/utils/react-dev.js.map +1 -0
- package/dist/utils/semver.d.ts +14 -0
- package/dist/utils/semver.d.ts.map +1 -0
- package/dist/utils/semver.js +61 -0
- package/dist/utils/semver.js.map +1 -0
- package/package.json +6 -3
- package/src/__tests__/__snapshots__/boundaries.test.ts.snap +154 -0
- package/src/__tests__/agent-instructions.test.ts +5 -0
- package/src/__tests__/agent-loop-phase34.test.ts +143 -8
- package/src/__tests__/auth.test.ts +9 -0
- package/src/__tests__/azure-cli.test.ts +202 -0
- package/src/__tests__/boundaries.test.ts +42 -0
- package/src/__tests__/csharp-schema.test.ts +261 -0
- package/src/__tests__/dev.test.ts +13 -6
- package/src/__tests__/fixtures/az wrapper.cmd +2 -0
- package/src/__tests__/fixtures/azure-cli.cjs +153 -0
- package/src/__tests__/fixtures/provision-runner.cjs +28 -0
- package/src/__tests__/generated-project-matrix.test.ts +789 -0
- package/src/__tests__/home-page.test.ts +50 -0
- package/src/__tests__/init.test.ts +116 -0
- package/src/__tests__/mcp-version.test.ts +262 -0
- package/src/__tests__/mcp.test.ts +120 -3
- package/src/__tests__/multi-auth.test.ts +115 -4
- package/src/__tests__/package-manager.test.ts +17 -2
- package/src/__tests__/plan-apply.test.ts +179 -0
- package/src/__tests__/provision-runtime.test.ts +722 -0
- package/src/__tests__/python-uv.test.ts +50 -14
- package/src/__tests__/python-venv.test.ts +48 -0
- package/src/__tests__/react-dev.test.ts +72 -0
- package/src/__tests__/react.test.ts +19 -0
- package/src/__tests__/schema-analysis.test.ts +329 -0
- package/src/cli/commands/add-auth.ts +36 -6
- package/src/cli/commands/configure-mcp.ts +54 -0
- package/src/cli/commands/dev.ts +40 -31
- package/src/cli/commands/init.ts +73 -138
- package/src/cli/commands/migrations.ts +22 -0
- package/src/cli/commands/provision.ts +294 -56
- package/src/cli/commands/scaffold.ts +105 -3
- package/src/cli/index.ts +40 -7
- package/src/core/operations/create-model.ts +51 -13
- package/src/core/operations/migration-generator.ts +14 -1
- package/src/core/operations/model-migration.ts +52 -0
- package/src/core/operations/provision-deployment.ts +183 -0
- package/src/core/operations/provision-operations.ts +662 -154
- package/src/core/operations/scaffold-apply.ts +2 -0
- package/src/core/operations/scaffold-machine.ts +1 -0
- package/src/core/operations/scaffold-plan.ts +5 -1
- package/src/core/project/agent-instructions.ts +4 -1
- package/src/core/project/agent-templates/AGENTS.md +89 -6
- package/src/core/project/agent-templates/CLAUDE.md +14 -1
- package/src/core/project/agent-templates/copilot-instructions.md +15 -1
- package/src/core/project/agent-templates/shared-models.instructions.md +11 -3
- package/src/core/project/boundaries.ts +62 -20
- package/src/core/project/capabilities.ts +49 -6
- package/src/core/project/home-page.ts +114 -0
- package/src/core/project/mcp-config.ts +84 -0
- package/src/core/project/react-project.ts +50 -28
- package/src/core/project/state.ts +70 -0
- package/src/core/project/workflows.ts +53 -7
- package/src/core/scaffold/auth-generator.ts +26 -27
- package/src/core/scaffold/model-parser.ts +413 -129
- package/src/core/scaffold/native-schema-generator.ts +319 -103
- package/src/core/scaffold/openapi-generator.ts +63 -5
- package/src/core/scaffold/ui-generator.ts +70 -8
- package/src/core/verify/index.ts +118 -6
- package/src/machine/contracts.ts +1 -0
- package/src/machine/errors.ts +4 -2
- package/src/machine/index.ts +65 -34
- package/src/mcp/index.ts +221 -31
- package/src/mcp/version-selection.ts +163 -0
- package/src/utils/azure-cli.ts +315 -0
- package/src/utils/azure-diagnostics.ts +75 -0
- package/src/utils/package-manager.ts +2 -2
- package/src/utils/python-uv.ts +53 -33
- package/src/utils/react-dev.ts +31 -0
- package/src/utils/semver.ts +59 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime version selection for `swallowkit-mcp`.
|
|
3
|
+
*
|
|
4
|
+
* Policy: when launched as `latest` (or without an explicit version), use whichever is
|
|
5
|
+
* newer of this MCP package and the project-installed `swallowkit`. A newer project
|
|
6
|
+
* install takes over through its own `swallowkit-mcp`, so prerelease projects never get
|
|
7
|
+
* an older contract. An explicit SWALLOWKIT_MCP_VERSION is always honored.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as fs from "fs";
|
|
11
|
+
import * as path from "path";
|
|
12
|
+
import type { MachineNextAction } from "../machine/contracts";
|
|
13
|
+
import { MCP_LATEST, MCP_VERSION_ENV } from "../core/project/mcp-config";
|
|
14
|
+
import { compareSemver } from "../utils/semver";
|
|
15
|
+
|
|
16
|
+
export const MCP_DELEGATED_FROM_ENV = "SWALLOWKIT_MCP_DELEGATED_FROM";
|
|
17
|
+
|
|
18
|
+
export interface ProjectSwallowKitInstall {
|
|
19
|
+
version: string;
|
|
20
|
+
packageRoot: string;
|
|
21
|
+
mcpEntrypoint: string | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type McpVersionSelection =
|
|
25
|
+
| "running-version"
|
|
26
|
+
| "project-version"
|
|
27
|
+
| "pinned";
|
|
28
|
+
|
|
29
|
+
export interface McpVersionContext {
|
|
30
|
+
/** Version of the MCP server answering the request. */
|
|
31
|
+
mcpVersion: string;
|
|
32
|
+
/** SWALLOWKIT_MCP_VERSION as requested by the launcher (`latest` when unset). */
|
|
33
|
+
requestedVersion: string;
|
|
34
|
+
projectVersion: string | null;
|
|
35
|
+
selection: McpVersionSelection;
|
|
36
|
+
delegated: boolean;
|
|
37
|
+
delegatedFrom?: string;
|
|
38
|
+
warnings: string[];
|
|
39
|
+
nextActions: MachineNextAction[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type McpLaunchDecision =
|
|
43
|
+
| { action: "delegate"; entrypoint: string; fromVersion: string; toVersion: string }
|
|
44
|
+
| { action: "serve"; context: McpVersionContext };
|
|
45
|
+
|
|
46
|
+
export interface McpLaunchInput {
|
|
47
|
+
selfVersion: string;
|
|
48
|
+
selfPackageRoot: string;
|
|
49
|
+
env: NodeJS.ProcessEnv;
|
|
50
|
+
project: ProjectSwallowKitInstall | null;
|
|
51
|
+
execCommand?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function normalizeRoot(value: string): string {
|
|
55
|
+
const resolved = path.resolve(value);
|
|
56
|
+
try {
|
|
57
|
+
return fs.realpathSync.native(resolved).toLowerCase();
|
|
58
|
+
} catch {
|
|
59
|
+
return resolved.toLowerCase();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function resolveProjectSwallowKit(cwd: string): ProjectSwallowKitInstall | null {
|
|
64
|
+
// Same lookup order as Node's node_modules resolution from the project directory.
|
|
65
|
+
let packageJsonPath: string | null = null;
|
|
66
|
+
for (let directory = path.resolve(cwd); ; directory = path.dirname(directory)) {
|
|
67
|
+
const candidate = path.join(directory, "node_modules", "swallowkit", "package.json");
|
|
68
|
+
if (fs.existsSync(candidate)) {
|
|
69
|
+
packageJsonPath = fs.realpathSync(candidate);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
if (path.dirname(directory) === directory) return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const manifest = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")) as {
|
|
77
|
+
version?: string;
|
|
78
|
+
bin?: string | Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
if (!manifest.version) return null;
|
|
81
|
+
const packageRoot = path.dirname(packageJsonPath);
|
|
82
|
+
const bin = typeof manifest.bin === "object" ? manifest.bin["swallowkit-mcp"] : undefined;
|
|
83
|
+
const candidate = path.resolve(packageRoot, bin ?? path.join("dist", "mcp", "index.js"));
|
|
84
|
+
return {
|
|
85
|
+
version: manifest.version,
|
|
86
|
+
packageRoot,
|
|
87
|
+
mcpEntrypoint: fs.existsSync(candidate) ? candidate : null,
|
|
88
|
+
};
|
|
89
|
+
} catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function decideMcpLaunch(input: McpLaunchInput): McpLaunchDecision {
|
|
95
|
+
const { selfVersion, env, project } = input;
|
|
96
|
+
const exec = input.execCommand ?? "npx";
|
|
97
|
+
const requested = (env[MCP_VERSION_ENV] ?? "").trim() || MCP_LATEST;
|
|
98
|
+
const pinned = requested !== MCP_LATEST;
|
|
99
|
+
const delegatedFrom = (env[MCP_DELEGATED_FROM_ENV] ?? "").trim() || undefined;
|
|
100
|
+
const projectVersion = project?.version ?? null;
|
|
101
|
+
const projectNewer = projectVersion ? (compareSemver(projectVersion, selfVersion) ?? 0) > 0 : false;
|
|
102
|
+
const sameInstall = project ? normalizeRoot(project.packageRoot) === normalizeRoot(input.selfPackageRoot) : false;
|
|
103
|
+
|
|
104
|
+
if (!pinned && !delegatedFrom && project && projectNewer && !sameInstall && project.mcpEntrypoint) {
|
|
105
|
+
return { action: "delegate", entrypoint: project.mcpEntrypoint, fromVersion: selfVersion, toVersion: project.version };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const warnings: string[] = [];
|
|
109
|
+
const nextActions: MachineNextAction[] = [];
|
|
110
|
+
if (projectVersion && projectNewer) {
|
|
111
|
+
warnings.push(
|
|
112
|
+
`mcp-older-than-project: swallowkit-mcp ${selfVersion} is older than the project's swallowkit ${projectVersion}. ` +
|
|
113
|
+
"Its capabilities, boundaries, and plan/apply contracts may be outdated for this project."
|
|
114
|
+
);
|
|
115
|
+
nextActions.push({
|
|
116
|
+
command: `${exec} swallowkit machine inspect capabilities`,
|
|
117
|
+
description: "Use the project-local machine interface, which matches the installed SwallowKit version, until MCP is updated.",
|
|
118
|
+
});
|
|
119
|
+
nextActions.push({
|
|
120
|
+
command: `${exec} swallowkit configure-mcp`,
|
|
121
|
+
description: pinned
|
|
122
|
+
? `Re-select the MCP version (${MCP_VERSION_ENV} is pinned to ${requested}), then restart the MCP server.`
|
|
123
|
+
: "Pin the MCP launcher to the project version, then restart the MCP server.",
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
action: "serve",
|
|
129
|
+
context: {
|
|
130
|
+
mcpVersion: selfVersion,
|
|
131
|
+
requestedVersion: requested,
|
|
132
|
+
projectVersion,
|
|
133
|
+
selection: delegatedFrom ? "project-version" : pinned ? "pinned" : "running-version",
|
|
134
|
+
delegated: Boolean(delegatedFrom),
|
|
135
|
+
...(delegatedFrom ? { delegatedFrom } : {}),
|
|
136
|
+
warnings,
|
|
137
|
+
nextActions,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* For an explicitly pinned launcher, report when the published `latest` has caught up
|
|
144
|
+
* with or passed the pinned version so the pin can be removed.
|
|
145
|
+
*/
|
|
146
|
+
export function buildPinnedUpdateNotice(
|
|
147
|
+
context: McpVersionContext,
|
|
148
|
+
publishedLatest: string | null,
|
|
149
|
+
execCommand = "npx"
|
|
150
|
+
): { warning: string; nextAction: MachineNextAction } | null {
|
|
151
|
+
if (context.selection !== "pinned" || !publishedLatest) return null;
|
|
152
|
+
const comparison = compareSemver(publishedLatest, context.requestedVersion);
|
|
153
|
+
if (comparison === null || comparison < 0) return null;
|
|
154
|
+
return {
|
|
155
|
+
warning:
|
|
156
|
+
`mcp-pin-outdated: ${MCP_VERSION_ENV} is pinned to ${context.requestedVersion}, but published latest is ${publishedLatest}. ` +
|
|
157
|
+
`Switch the launcher back to "${MCP_LATEST}".`,
|
|
158
|
+
nextAction: {
|
|
159
|
+
command: `${execCommand} swallowkit configure-mcp`,
|
|
160
|
+
description: `Re-select the MCP launcher version (returns to "${MCP_LATEST}" when it is at least the project version), then restart the MCP server.`,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure CLI invocation that works without a shell on every platform.
|
|
3
|
+
*
|
|
4
|
+
* On Windows `az` is a batch wrapper (az.cmd). Node cannot spawn it with `shell: false`
|
|
5
|
+
* (ENOENT for "az", EINVAL for "az.cmd"), so the wrapper is resolved explicitly:
|
|
6
|
+
* the MSI layout runs its bundled Python exactly like az.cmd does, and other wrappers
|
|
7
|
+
* run through cmd.exe with every argument quoted.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { spawn, spawnSync, SpawnSyncOptions } from "child_process";
|
|
11
|
+
import * as fs from "fs";
|
|
12
|
+
import * as path from "path";
|
|
13
|
+
|
|
14
|
+
export interface AzCliInvocation {
|
|
15
|
+
command: string;
|
|
16
|
+
prefixArgs: string[];
|
|
17
|
+
env?: NodeJS.ProcessEnv;
|
|
18
|
+
/** Batch wrapper that must be started through cmd.exe. */
|
|
19
|
+
batchScript?: string;
|
|
20
|
+
/** Resolved executable or wrapper, for diagnostics. */
|
|
21
|
+
source: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface AzCliResult {
|
|
25
|
+
status: number | null;
|
|
26
|
+
stdout: string;
|
|
27
|
+
stderr: string;
|
|
28
|
+
error?: Error;
|
|
29
|
+
signal: NodeJS.Signals | null;
|
|
30
|
+
elapsedMs: number;
|
|
31
|
+
failureKind?: "timeout" | "buffer" | "cancelled" | "spawn" | "signal" | "communication" | "exit";
|
|
32
|
+
errorCode?: string;
|
|
33
|
+
stdoutTruncated: boolean;
|
|
34
|
+
stderrTruncated: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AzCliRunOptions {
|
|
38
|
+
timeout?: number;
|
|
39
|
+
invocation?: AzCliInvocation | null;
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
/** Capture is bounded independently of the child's output volume. */
|
|
42
|
+
captureBytes?: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type AzCliAvailability =
|
|
46
|
+
| { available: true; invocation: AzCliInvocation }
|
|
47
|
+
| { available: false; reason: "not-found" | "not-runnable"; detail: string };
|
|
48
|
+
|
|
49
|
+
function findOnWindowsPath(name: string, env: NodeJS.ProcessEnv): string | null {
|
|
50
|
+
const pathValue = env.PATH ?? env.Path ?? "";
|
|
51
|
+
const extensions = (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean).map((ext) => ext.toLowerCase());
|
|
52
|
+
for (const directory of pathValue.split(";").filter(Boolean)) {
|
|
53
|
+
for (const extension of extensions) {
|
|
54
|
+
const candidate = path.join(directory.replace(/^"|"$/g, ""), `${name}${extension}`);
|
|
55
|
+
try {
|
|
56
|
+
if (fs.statSync(candidate).isFile()) return candidate;
|
|
57
|
+
} catch {
|
|
58
|
+
// Keep searching PATH.
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function resolveAzCliInvocation(
|
|
66
|
+
env: NodeJS.ProcessEnv = process.env,
|
|
67
|
+
platform: NodeJS.Platform = process.platform
|
|
68
|
+
): AzCliInvocation | null {
|
|
69
|
+
if (platform !== "win32") return { command: "az", prefixArgs: [], source: "az" };
|
|
70
|
+
|
|
71
|
+
const resolved = findOnWindowsPath("az", env);
|
|
72
|
+
if (!resolved) return null;
|
|
73
|
+
const extension = path.extname(resolved).toLowerCase();
|
|
74
|
+
if (extension === ".exe" || extension === ".com") {
|
|
75
|
+
return { command: resolved, prefixArgs: [], source: resolved };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// MSI install: wbin\az.cmd runs "..\python.exe -IBm azure.cli %*" with AZ_INSTALLER=MSI.
|
|
79
|
+
const bundledPython = path.join(path.dirname(resolved), "..", "python.exe");
|
|
80
|
+
if (path.basename(path.dirname(resolved)).toLowerCase() === "wbin" && fs.existsSync(bundledPython)) {
|
|
81
|
+
return {
|
|
82
|
+
command: path.resolve(bundledPython),
|
|
83
|
+
prefixArgs: ["-IBm", "azure.cli"],
|
|
84
|
+
env: { AZ_INSTALLER: "MSI" },
|
|
85
|
+
source: resolved,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return { command: env.ComSpec ?? "cmd.exe", prefixArgs: [], batchScript: resolved, source: resolved };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Builds the cmd.exe /s /c payload. Rejects characters cmd.exe would reinterpret even inside quotes. */
|
|
93
|
+
export function buildBatchCommandLine(script: string, args: string[]): string {
|
|
94
|
+
for (const value of [script, ...args]) {
|
|
95
|
+
if (/["%\r\n]/.test(value)) {
|
|
96
|
+
throw new Error(`Azure CLI argument cannot be passed safely through ${path.basename(script)} (quotes, percent signs, or newlines).`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return `"${[script, ...args].map((value) => `"${value.replace(/(\\+)$/, "$1$1")}"`).join(" ")}"`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let cachedInvocation: AzCliInvocation | null | undefined;
|
|
103
|
+
|
|
104
|
+
export function getAzCliInvocation(): AzCliInvocation | null {
|
|
105
|
+
if (cachedInvocation === undefined) cachedInvocation = resolveAzCliInvocation();
|
|
106
|
+
return cachedInvocation;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function resetAzCliInvocationCache(): void {
|
|
110
|
+
cachedInvocation = undefined;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Test hook: pin the resolved invocation (null = not found). */
|
|
114
|
+
export function setAzCliInvocationForTesting(invocation: AzCliInvocation | null | undefined): void {
|
|
115
|
+
cachedInvocation = invocation;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function runAzCli(
|
|
119
|
+
args: string[],
|
|
120
|
+
options: AzCliRunOptions = {}
|
|
121
|
+
): AzCliResult {
|
|
122
|
+
const startedAt = Date.now();
|
|
123
|
+
const invocation = options.invocation === undefined ? getAzCliInvocation() : options.invocation;
|
|
124
|
+
if (!invocation) {
|
|
125
|
+
return missingCliResult();
|
|
126
|
+
}
|
|
127
|
+
const spawnOptions: SpawnSyncOptions = {
|
|
128
|
+
shell: false,
|
|
129
|
+
encoding: "utf-8",
|
|
130
|
+
timeout: options.timeout ?? 300_000,
|
|
131
|
+
maxBuffer: options.captureBytes ?? 1_048_576,
|
|
132
|
+
env: invocation.env ? { ...process.env, ...invocation.env } : process.env,
|
|
133
|
+
};
|
|
134
|
+
let result;
|
|
135
|
+
try {
|
|
136
|
+
result = invocation.batchScript
|
|
137
|
+
? spawnSync(invocation.command, ["/d", "/s", "/v:off", "/c", buildBatchCommandLine(invocation.batchScript, args)], {
|
|
138
|
+
...spawnOptions,
|
|
139
|
+
windowsVerbatimArguments: true,
|
|
140
|
+
})
|
|
141
|
+
: spawnSync(invocation.command, [...invocation.prefixArgs, ...args], spawnOptions);
|
|
142
|
+
} catch (error) {
|
|
143
|
+
return {
|
|
144
|
+
...missingCliResult(),
|
|
145
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
146
|
+
errorCode: (error as NodeJS.ErrnoException)?.code,
|
|
147
|
+
elapsedMs: Date.now() - startedAt,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const errorCode = (result.error as NodeJS.ErrnoException | undefined)?.code;
|
|
151
|
+
return {
|
|
152
|
+
status: result.status,
|
|
153
|
+
stdout: String(result.stdout ?? ""),
|
|
154
|
+
stderr: String(result.stderr ?? ""),
|
|
155
|
+
signal: result.signal ?? null,
|
|
156
|
+
elapsedMs: Date.now() - startedAt,
|
|
157
|
+
stdoutTruncated: errorCode === "ENOBUFS",
|
|
158
|
+
stderrTruncated: errorCode === "ENOBUFS",
|
|
159
|
+
...(errorCode ? { errorCode } : {}),
|
|
160
|
+
...(errorCode === "ETIMEDOUT" ? { failureKind: "timeout" as const }
|
|
161
|
+
: errorCode === "ENOBUFS" ? { failureKind: "buffer" as const }
|
|
162
|
+
: result.error ? { failureKind: "spawn" as const }
|
|
163
|
+
: result.signal ? { failureKind: "signal" as const }
|
|
164
|
+
: result.status !== 0 ? { failureKind: "exit" as const } : {}),
|
|
165
|
+
...(result.error ? { error: result.error } : {}),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function missingCliResult(): AzCliResult {
|
|
170
|
+
return {
|
|
171
|
+
status: null, stdout: "", stderr: "", signal: null, elapsedMs: 0,
|
|
172
|
+
stdoutTruncated: false, stderrTruncated: false,
|
|
173
|
+
error: Object.assign(new Error("az was not found on PATH"), { code: "ENOENT" }),
|
|
174
|
+
errorCode: "ENOENT", failureKind: "spawn",
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Unlike spawnSync/maxBuffer, discarding excess output never kills the Azure CLI. */
|
|
179
|
+
export async function runAzCliAsync(args: string[], options: AzCliRunOptions = {}): Promise<AzCliResult> {
|
|
180
|
+
const invocation = options.invocation === undefined ? getAzCliInvocation() : options.invocation;
|
|
181
|
+
if (!invocation) return missingCliResult();
|
|
182
|
+
const timeout = options.timeout ?? 60_000;
|
|
183
|
+
const captureBytes = options.captureBytes ?? 65_536;
|
|
184
|
+
if (!Number.isFinite(timeout) || timeout <= 0 || !Number.isInteger(captureBytes) || captureBytes < 1) {
|
|
185
|
+
throw new Error("Azure CLI timeout and captureBytes must be finite positive values.");
|
|
186
|
+
}
|
|
187
|
+
const startedAt = Date.now();
|
|
188
|
+
const result: AzCliResult = {
|
|
189
|
+
status: null, stdout: "", stderr: "", signal: null, elapsedMs: 0,
|
|
190
|
+
stdoutTruncated: false, stderrTruncated: false,
|
|
191
|
+
};
|
|
192
|
+
if (options.signal?.aborted) return { ...result, failureKind: "cancelled" };
|
|
193
|
+
let commandArgs: string[];
|
|
194
|
+
try {
|
|
195
|
+
commandArgs = invocation.batchScript
|
|
196
|
+
? ["/d", "/s", "/v:off", "/c", buildBatchCommandLine(invocation.batchScript, args)]
|
|
197
|
+
: [...invocation.prefixArgs, ...args];
|
|
198
|
+
} catch (error) {
|
|
199
|
+
return { ...result, error: error instanceof Error ? error : new Error(String(error)), failureKind: "spawn" };
|
|
200
|
+
}
|
|
201
|
+
return new Promise<AzCliResult>((resolve) => {
|
|
202
|
+
let stdout = Buffer.alloc(0);
|
|
203
|
+
let stderr = Buffer.alloc(0);
|
|
204
|
+
let finished = false;
|
|
205
|
+
let drainTimer: NodeJS.Timeout | undefined;
|
|
206
|
+
let child: ReturnType<typeof spawn>;
|
|
207
|
+
const finish = () => {
|
|
208
|
+
if (finished) return;
|
|
209
|
+
finished = true;
|
|
210
|
+
clearTimeout(timer);
|
|
211
|
+
if (drainTimer) clearTimeout(drainTimer);
|
|
212
|
+
options.signal?.removeEventListener("abort", abort);
|
|
213
|
+
result.stdout = stdout.toString("utf-8");
|
|
214
|
+
result.stderr = stderr.toString("utf-8");
|
|
215
|
+
result.elapsedMs = Date.now() - startedAt;
|
|
216
|
+
if (!result.failureKind && result.status !== 0) {
|
|
217
|
+
result.failureKind = result.signal ? "signal"
|
|
218
|
+
: /ConnectionReset|ConnectionError|connection.*(?:closed|reset|aborted)|ReadTimeout|RemoteDisconnected|ETIMEDOUT|ECONNRESET/i.test(result.stderr)
|
|
219
|
+
? "communication" : "exit";
|
|
220
|
+
}
|
|
221
|
+
resolve(result);
|
|
222
|
+
};
|
|
223
|
+
const stop = (kind: "timeout" | "cancelled") => {
|
|
224
|
+
if (finished || result.failureKind === "timeout" || result.failureKind === "cancelled") return;
|
|
225
|
+
result.failureKind = kind;
|
|
226
|
+
if (kind === "timeout") result.errorCode = "ETIMEDOUT";
|
|
227
|
+
child?.kill("SIGTERM");
|
|
228
|
+
// Descendants can inherit pipes; do not wait indefinitely for their close events.
|
|
229
|
+
drainTimer = setTimeout(() => {
|
|
230
|
+
child?.kill("SIGKILL");
|
|
231
|
+
child?.stdout?.destroy();
|
|
232
|
+
child?.stderr?.destroy();
|
|
233
|
+
result.stdoutTruncated = true;
|
|
234
|
+
result.stderrTruncated = true;
|
|
235
|
+
finish();
|
|
236
|
+
}, 1_000);
|
|
237
|
+
};
|
|
238
|
+
const abort = () => stop("cancelled");
|
|
239
|
+
const timer = setTimeout(() => stop("timeout"), timeout);
|
|
240
|
+
try {
|
|
241
|
+
child = spawn(invocation.command, commandArgs, {
|
|
242
|
+
shell: false,
|
|
243
|
+
windowsHide: true,
|
|
244
|
+
...(invocation.batchScript ? { windowsVerbatimArguments: true } : {}),
|
|
245
|
+
env: invocation.env ? { ...process.env, ...invocation.env } : process.env,
|
|
246
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
247
|
+
});
|
|
248
|
+
} catch (error) {
|
|
249
|
+
result.error = error instanceof Error ? error : new Error(String(error));
|
|
250
|
+
result.errorCode = (error as NodeJS.ErrnoException)?.code;
|
|
251
|
+
result.failureKind = "spawn";
|
|
252
|
+
finish();
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const capture = (stream: "stdout" | "stderr", chunk: Buffer) => {
|
|
256
|
+
const buffer = stream === "stdout" ? stdout : stderr;
|
|
257
|
+
const remaining = captureBytes - buffer.length;
|
|
258
|
+
if (chunk.length > remaining) result[`${stream}Truncated`] = true;
|
|
259
|
+
if (remaining <= 0) return;
|
|
260
|
+
const combined = Buffer.concat([buffer, chunk.subarray(0, Math.max(remaining, 0))]);
|
|
261
|
+
if (stream === "stdout") stdout = combined;
|
|
262
|
+
else stderr = combined;
|
|
263
|
+
};
|
|
264
|
+
child.stdout?.on("data", (chunk: Buffer) => capture("stdout", chunk));
|
|
265
|
+
child.stderr?.on("data", (chunk: Buffer) => capture("stderr", chunk));
|
|
266
|
+
child.on("error", (error: NodeJS.ErrnoException) => {
|
|
267
|
+
if (finished) return;
|
|
268
|
+
result.error = error;
|
|
269
|
+
result.errorCode = error.code;
|
|
270
|
+
result.failureKind ??= "spawn";
|
|
271
|
+
finish();
|
|
272
|
+
});
|
|
273
|
+
child.on("exit", (code, signal) => {
|
|
274
|
+
if (finished) return;
|
|
275
|
+
result.status = code;
|
|
276
|
+
result.signal = signal;
|
|
277
|
+
if (!drainTimer) {
|
|
278
|
+
drainTimer = setTimeout(() => {
|
|
279
|
+
child.stdout?.destroy();
|
|
280
|
+
child.stderr?.destroy();
|
|
281
|
+
result.stdoutTruncated = true;
|
|
282
|
+
result.stderrTruncated = true;
|
|
283
|
+
finish();
|
|
284
|
+
}, 1_000);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
child.on("close", (code, signal) => {
|
|
288
|
+
if (finished) return;
|
|
289
|
+
result.status = code;
|
|
290
|
+
result.signal = signal;
|
|
291
|
+
finish();
|
|
292
|
+
});
|
|
293
|
+
options.signal?.addEventListener("abort", abort, { once: true });
|
|
294
|
+
if (options.signal?.aborted) abort();
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function checkAzCliAvailability(): AzCliAvailability {
|
|
299
|
+
const invocation = getAzCliInvocation();
|
|
300
|
+
if (!invocation) {
|
|
301
|
+
return { available: false, reason: "not-found", detail: "az was not found on PATH." };
|
|
302
|
+
}
|
|
303
|
+
const result = runAzCli(["--version"], { timeout: 60_000, invocation });
|
|
304
|
+
if (result.status === 0) return { available: true, invocation };
|
|
305
|
+
const errorCode = (result.error as NodeJS.ErrnoException | undefined)?.code;
|
|
306
|
+
if (errorCode === "ENOENT") {
|
|
307
|
+
return { available: false, reason: "not-found", detail: "az was not found on PATH." };
|
|
308
|
+
}
|
|
309
|
+
const output = `${result.stderr || result.stdout}`.trim().split(/\r?\n/).slice(-3).join(" ");
|
|
310
|
+
return {
|
|
311
|
+
available: false,
|
|
312
|
+
reason: "not-runnable",
|
|
313
|
+
detail: `${invocation.source} could not run "az --version" (${result.error?.message ?? `exit ${result.status}`})${output ? `: ${output}` : ""}`,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { AzCliResult } from "./azure-cli";
|
|
2
|
+
|
|
3
|
+
const SENSITIVE_KEY = /outputs|parameters|password|secret|token|authorization|connection.?string|accountkey|api.?key|functions?.?key|client.?secret|access.?key|primary.?key|secondary.?key/i;
|
|
4
|
+
|
|
5
|
+
export function redactAzureText(text: string, secretValues: readonly string[] = []): string {
|
|
6
|
+
const redactValues = (value: string) => {
|
|
7
|
+
for (const secret of secretValues) {
|
|
8
|
+
if (secret) value = value.split(secret).join("[REDACTED]").split(JSON.stringify(secret).slice(1, -1)).join("[REDACTED]");
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
text = redactValues(text);
|
|
13
|
+
let value = text;
|
|
14
|
+
try {
|
|
15
|
+
const redact = (entry: unknown): unknown => {
|
|
16
|
+
if (typeof entry === "string") return redactPlainText(redactValues(entry));
|
|
17
|
+
if (Array.isArray(entry)) return entry.map(redact);
|
|
18
|
+
if (entry && typeof entry === "object") {
|
|
19
|
+
return Object.fromEntries(Object.entries(entry).map(([key, item]) => [key, SENSITIVE_KEY.test(key) ? "[REDACTED]" : redact(item)]));
|
|
20
|
+
}
|
|
21
|
+
return entry;
|
|
22
|
+
};
|
|
23
|
+
value = JSON.stringify(redact(JSON.parse(text)));
|
|
24
|
+
} catch {
|
|
25
|
+
// An incomplete deployment payload cannot be safely projected/redacted.
|
|
26
|
+
if (/"(?:outputs|parameters)"\s*:/i.test(text)) return "[Azure payload omitted: may contain secrets]";
|
|
27
|
+
value = redactPlainText(text);
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function redactPlainText(text: string): string {
|
|
33
|
+
return text
|
|
34
|
+
.replace(/\bBearer\s+[^\s"',;]+/gi, "Bearer [REDACTED]")
|
|
35
|
+
.replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]")
|
|
36
|
+
.replace(/(?:AccountEndpoint|DefaultEndpointsProtocol)=[^\r\n"']+/gi, "[connection string REDACTED]")
|
|
37
|
+
.replace(/((?:api[-_ ]?key|functions?[-_ ]?key|accountkey|password|client[-_ ]?secret|secret|token|access[-_ ]?key|primary[-_ ]?key|secondary[-_ ]?key|authorization)\s*["']?\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;}\]]+)/gi, "$1[REDACTED]")
|
|
38
|
+
.replace(/([?&](?:code|sig|token|key|secret|password)=)[^&\s"'<>]+/gi, "$1[REDACTED]");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface AzureCliDiagnostic {
|
|
42
|
+
phase: string;
|
|
43
|
+
exitCode: number | null;
|
|
44
|
+
signal: NodeJS.Signals | null;
|
|
45
|
+
elapsedMs: number;
|
|
46
|
+
failureKind?: AzCliResult["failureKind"];
|
|
47
|
+
errorCode?: string;
|
|
48
|
+
stdout: string;
|
|
49
|
+
stderr: string;
|
|
50
|
+
outputTruncated: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function azureCliDiagnostic(result: AzCliResult, phase: string, secretValues: readonly string[] = []): AzureCliDiagnostic {
|
|
54
|
+
const stdout = result.stdoutTruncated ? "[stdout omitted: capture limit reached]" : redactAzureText(result.stdout, secretValues);
|
|
55
|
+
const stderr = result.stderrTruncated ? "[stderr omitted: capture limit reached]" : redactAzureText(result.stderr, secretValues);
|
|
56
|
+
return {
|
|
57
|
+
phase,
|
|
58
|
+
exitCode: result.status,
|
|
59
|
+
signal: result.signal ?? null,
|
|
60
|
+
elapsedMs: result.elapsedMs,
|
|
61
|
+
...(result.failureKind ? { failureKind: result.failureKind } : {}),
|
|
62
|
+
...(result.errorCode ? { errorCode: result.errorCode } : {}),
|
|
63
|
+
stdout: stdout.slice(0, 4_000),
|
|
64
|
+
stderr: stderr.slice(0, 4_000),
|
|
65
|
+
outputTruncated: result.stdoutTruncated || result.stderrTruncated || stdout.length > 4_000 || stderr.length > 4_000,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function formatAzureDiagnostic(diagnostic: AzureCliDiagnostic): string {
|
|
70
|
+
return [
|
|
71
|
+
`az ${diagnostic.phase}: exit=${diagnostic.exitCode ?? "unknown"}, signal=${diagnostic.signal ?? "none"}, kind=${diagnostic.failureKind ?? "none"}, elapsed=${diagnostic.elapsedMs}ms${diagnostic.errorCode ? `, error=${diagnostic.errorCode}` : ""}${diagnostic.outputTruncated ? ", output omitted/truncated" : ""}`,
|
|
72
|
+
...(diagnostic.stdout ? [`stdout: ${diagnostic.stdout}`] : []),
|
|
73
|
+
...(diagnostic.stderr ? [`stderr: ${diagnostic.stderr}`] : []),
|
|
74
|
+
].join("\n");
|
|
75
|
+
}
|
|
@@ -156,7 +156,7 @@ export function getWorkspaceConfig(pm: PackageManager, workspaces: string[]) {
|
|
|
156
156
|
/** pnpm uses pnpm-workspace.yaml */
|
|
157
157
|
type: "file" as const,
|
|
158
158
|
filename: "pnpm-workspace.yaml",
|
|
159
|
-
content: `packages:\n${workspaces.map((w) => ` - ${w}`).join("\n")}\nallowBuilds:\n protobufjs: false\n unrs-resolver: false\n`,
|
|
159
|
+
content: `packages:\n${workspaces.map((w) => ` - ${w}`).join("\n")}\nallowBuilds:\n keytar: false\n protobufjs: false\n unrs-resolver: false\n`,
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
|
|
@@ -250,5 +250,5 @@ export function getFunctionsStartScript(
|
|
|
250
250
|
return "cd functions && npm start";
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
return "cd functions && func start";
|
|
253
|
+
return backendLanguage === "csharp" ? "cd functions && dotnet run" : "cd functions && func start";
|
|
254
254
|
}
|