@builder.io/dev-tools 0.2.31 → 0.11.33-dev.202509151402.6aa9b1f64
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 +43 -0
- package/angular/index.cjs +46 -0
- package/angular/index.d.ts +1 -0
- package/angular/index.mjs +21 -0
- package/cli/index.cjs +114063 -0
- package/cli/index.cjs.map +7 -0
- package/cli/main.cjs +26 -0
- package/core/index.cjs +14366 -325
- package/core/index.mjs +14349 -317
- package/figma/index.cjs +47 -0
- package/figma/index.d.ts +1 -0
- package/figma/index.mjs +28 -0
- package/figma/jsx-runtime/index.cjs +7 -0
- package/figma/jsx-runtime/index.d.ts +46 -0
- package/figma/jsx-runtime/index.js +7 -0
- package/figma/jsx-runtime/prop-types.d.ts +125 -0
- package/figma/jsx-runtime/react.d.ts +5217 -0
- package/next/index.d.ts +1 -1
- package/node/index.cjs +25310 -1
- package/node/index.mjs +25315 -1
- package/package.json +87 -22
- package/remix/build.cjs +132 -1
- package/remix/index.mjs +114 -1
- package/remix/server-build/index.mjs +1 -0
- package/server/index.cjs +22508 -192
- package/server/index.mjs +22508 -192
- package/types/_tests_/code.e2e.d.ts +1 -0
- package/types/_tests_/create-builder.e2e.d.ts +1 -0
- package/types/_tests_/dev-tools.e2e.d.ts +1 -0
- package/types/_tests_/figma-generate.e2e.d.ts +1 -0
- package/types/_tests_/figma-publish.e2e.d.ts +1 -0
- package/types/_tests_/fusionInit.e2e.d.ts +1 -0
- package/types/_tests_/help.e2e.d.ts +1 -0
- package/types/_tests_/launch.e2e.d.ts +1 -0
- package/types/_tests_/repo-indexing.test.d.ts +1 -0
- package/types/_tests_/sync-utils.test.d.ts +1 -0
- package/types/_tests_/utils.d.ts +44 -0
- package/types/_tests_/vitest.config.d.ts +2 -0
- package/types/_tests_/workspace.e2e.d.ts +1 -0
- package/types/angular/index.d.ts +1 -0
- package/types/cli/__tests__/parseGitDiffToApplyActions.spec.d.ts +1 -0
- package/types/cli/abort-signal-any.d.ts +1 -0
- package/types/cli/auth/auth-utils.d.ts +2 -0
- package/types/cli/auth/auth.d.ts +3 -0
- package/types/cli/auth/status.d.ts +3 -0
- package/types/cli/auto-update.d.ts +22 -0
- package/types/cli/auto-update.test.d.ts +1 -0
- package/types/cli/backup.d.ts +116 -0
- package/types/cli/builder-add/interface.d.ts +5 -0
- package/types/cli/builder-add/options.d.ts +2 -0
- package/types/cli/code-file-utils.d.ts +12 -0
- package/types/cli/code-file-utils.unit.d.ts +1 -0
- package/types/cli/code-tools.d.ts +91 -0
- package/types/cli/code.d.ts +7 -0
- package/types/cli/codegen.d.ts +339 -0
- package/types/cli/constants.d.ts +1 -0
- package/types/cli/credentials.d.ts +52 -0
- package/types/cli/download.d.ts +10 -0
- package/types/cli/exit.d.ts +1 -0
- package/types/cli/fetch.d.ts +1 -0
- package/types/cli/figma-publish.d.ts +24 -0
- package/types/cli/figma-publish.spec.d.ts +1 -0
- package/types/cli/figma-utils.d.ts +31 -0
- package/types/cli/figma.d.ts +4 -0
- package/types/cli/generate.d.ts +16 -0
- package/types/cli/help.d.ts +1 -0
- package/types/cli/incremental-tsc.d.ts +30 -0
- package/types/cli/index.d.ts +95 -0
- package/types/cli/indexing.d.ts +5 -0
- package/types/cli/launch/InitStateMachine.d.ts +68 -0
- package/types/cli/launch/config.d.ts +6 -0
- package/types/cli/launch/dev-server-orchestrator.d.ts +64 -0
- package/types/cli/launch/dry-run-backup.d.ts +9 -0
- package/types/cli/launch/errors.d.ts +3 -0
- package/types/cli/launch/github.d.ts +3 -0
- package/types/cli/launch/grafana.d.ts +4 -0
- package/types/cli/launch/helpers.d.ts +15 -0
- package/types/cli/launch/machine-health.d.ts +12 -0
- package/types/cli/launch/proxy.d.ts +3 -0
- package/types/cli/launch/server.d.ts +20 -0
- package/types/cli/launch.d.ts +90 -0
- package/types/cli/prettier.d.ts +3 -0
- package/types/cli/repo-indexing/component-discovery.d.ts +15 -0
- package/types/cli/repo-indexing/component-indexing.d.ts +19 -0
- package/types/cli/repo-indexing/repo-indexing-utils.d.ts +41 -0
- package/types/cli/repo-indexing/repo-indexing.d.ts +24 -0
- package/types/cli/repo-indexing/repo-indexing.mock.d.ts +5 -0
- package/types/cli/repo-indexing/types.d.ts +17 -0
- package/types/cli/repo-indexing-utils.d.ts +2 -0
- package/types/cli/repo-indexing.d.ts +17 -0
- package/types/cli/repo-indexing.mock.d.ts +5 -0
- package/types/cli/report/figma-report.d.ts +54 -0
- package/types/cli/server-ws.d.ts +50 -0
- package/types/cli/spinner.d.ts +6 -0
- package/types/cli/sync-utils.d.ts +21 -0
- package/types/cli/track.d.ts +5 -0
- package/types/cli/utils/component-group-mdx-prompt.d.ts +1 -0
- package/types/cli/utils/dev-server-url-parser.d.ts +11 -0
- package/types/cli/utils/dev-server-url-parser.test.d.ts +1 -0
- package/types/cli/utils/feature-flags.d.ts +2 -0
- package/types/cli/utils/git.d.ts +11 -0
- package/types/cli/utils/open.d.ts +1 -0
- package/types/cli/utils/parseGitDiff.d.ts +8 -0
- package/types/cli/utils/repo-indexing-agent-prompt.d.ts +1 -0
- package/types/cli/utils/repo-indexing-group-prompt.d.ts +1 -0
- package/types/cli/utils/repo-indexing-group-prompts.d.ts +1 -0
- package/types/cli/utils/signals.d.ts +2 -0
- package/types/cli/utils/terminal-buffer.d.ts +27 -0
- package/types/cli/utils/terminal-buffer.spec.d.ts +1 -0
- package/types/cli/utils/workspace-path-resolver.d.ts +92 -0
- package/types/cli/utils/workspace-path-resolver.unit.d.ts +1 -0
- package/types/cli/version.d.ts +1 -0
- package/types/client/client-api.d.ts +3 -2
- package/types/client/menu/pages/component-list.d.ts +2 -1
- package/types/client/tracking.d.ts +1 -1
- package/types/common/ast/component-info.d.ts +2 -0
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/ast/convert-values.d.ts +1 -1
- package/types/common/ast/imported-statements.d.ts +4 -0
- package/types/common/ast/imported-statements.unit.d.ts +1 -0
- package/types/common/builder/builder-api.d.ts +8 -1
- package/types/common/builder/builder-sdks.d.ts +10 -0
- package/types/common/builder/content-generation.d.ts +1 -1
- package/types/common/constants.d.ts +2 -0
- package/types/common/dotenv.d.ts +1 -1
- package/types/common/dotenv.test.d.ts +1 -0
- package/types/common/errors.d.ts +32 -0
- package/types/common/estimate-code-tokens.d.ts +8 -0
- package/types/common/fs.d.ts +2 -0
- package/types/common/interactive-select-files.d.ts +3 -0
- package/types/common/test-utils.d.ts +6 -2
- package/types/common/typescript.d.ts +1 -1
- package/types/common/utils.d.ts +12 -1
- package/types/core/adapters/angular/angular-api-key.d.ts +10 -0
- package/types/core/adapters/angular/angular-api-key.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-app-module-imports.d.ts +3 -0
- package/types/core/adapters/angular/angular-app-module-imports.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-app-routes-update.d.ts +2 -0
- package/types/core/adapters/angular/angular-app-routes-update.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-components.d.ts +18 -0
- package/types/core/adapters/angular/angular-components.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-ensure-builder-setup.d.ts +5 -0
- package/types/core/adapters/angular/angular-ensure-config-plugin.d.ts +9 -0
- package/types/core/adapters/angular/angular-ensure-config-plugin.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-fix-tsconfig.d.ts +2 -0
- package/types/core/adapters/angular/angular-registry-parse.d.ts +16 -0
- package/types/core/adapters/angular/angular-registry-parse.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-registry.d.ts +3 -0
- package/types/core/adapters/angular/angular-registry.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-test-utils.d.ts +6 -0
- package/types/core/adapters/angular/index.d.ts +14 -0
- package/types/core/adapters/angular/types.d.ts +11 -0
- package/types/core/adapters/next/index.d.ts +15 -1
- package/types/core/adapters/next/next-ensure-builder-setup.d.ts +1 -1
- package/types/core/adapters/next/next-registry-parse.d.ts +2 -1
- package/types/core/adapters/next/next-registry.d.ts +1 -1
- package/types/core/adapters/next/next-test-utils.d.ts +3 -2
- package/types/core/adapters/react/index.d.ts +13 -0
- package/types/core/adapters/react/react-api-key.d.ts +6 -0
- package/types/core/adapters/react/react-builder-sdk-setup.d.ts +2 -0
- package/types/core/adapters/react/react-component-info.d.ts +5 -0
- package/types/core/adapters/react/react-components.d.ts +6 -4
- package/types/core/adapters/react/react-ensure-builder-setup.d.ts +4 -0
- package/types/core/adapters/react/react-registry-parse.d.ts +13 -0
- package/types/core/adapters/react/react-registry-parse.unit.d.ts +1 -0
- package/types/core/adapters/react/react-registry.d.ts +3 -0
- package/types/core/adapters/react/react-registry.unit.d.ts +1 -0
- package/types/core/adapters/react/react-test-utils.d.ts +7 -0
- package/types/core/adapters/remix/index.d.ts +1 -0
- package/types/core/adapters/remix/remix-ensure-builder-setup.d.ts +1 -1
- package/types/core/adapters/remix/remix-registry-parse.d.ts +1 -1
- package/types/core/adapters/remix/remix-registry.d.ts +1 -1
- package/types/core/adapters/remix/remix-test-utils.d.ts +2 -1
- package/types/core/adapters/vite/vite-ensure-config-plugin.d.ts +4 -0
- package/types/core/adapters/vue/index.d.ts +14 -0
- package/types/core/adapters/vue/vue-api-key.d.ts +6 -0
- package/types/core/adapters/vue/vue-components.d.ts +4 -0
- package/types/core/adapters/vue/vue-ensure-builder-setup.d.ts +7 -0
- package/types/core/adapters/vue/vue-registry-parse.d.ts +16 -0
- package/types/core/adapters/vue/vue-registry.d.ts +5 -0
- package/types/core/adapters/webpack/webpack-config-helpers.d.ts +11 -0
- package/types/core/adapters/webpack/webpack-config-helpers.unit.d.ts +1 -0
- package/types/core/adapters/webpack/webpack-ensure-config-plugin.d.ts +1 -1
- package/types/core/detect-frameworks.d.ts +2 -1
- package/types/core/find-dependencies.d.ts +7 -0
- package/types/core/import-export-registry.d.ts +1 -1
- package/types/figma/index.d.ts +88 -0
- package/types/node/node-sys.d.ts +5 -1
- package/types/scripts/analyze-projects.d.ts +18 -0
- package/types/scripts/call-ensure-container.d.ts +5 -0
- package/types/scripts/cli.d.ts +1 -0
- package/types/scripts/db.d.ts +3 -0
- package/types/scripts/download-projects.d.ts +12 -0
- package/types/server/builder-connect.d.ts +5 -2
- package/types/server/index.d.ts +1 -1
- package/types/server/request-handler.d.ts +0 -1
- package/types/tsconfig.tsbuildinfo +1 -0
- package/types/types.d.ts +152 -7
- package/types/vitest.config.d.ts +2 -0
- package/vite/index.cjs +153 -3
- package/vite/index.d.ts +1 -1
- package/vite/index.mjs +120 -3
- package/webpack/index.cjs +2883 -28
- package/webpack/index.d.ts +1 -1
- package/webpack/index.mjs +2872 -28
- package/types/next/index.d.cts +0 -4
- package/types/next/index.d.mts +0 -4
- package/types/remix/index-shim.d.cts +0 -2
- /package/types/vite/{index.d.ts → main.d.ts} +0 -0
- /package/types/webpack/{index.d.ts → main.d.ts} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import { type FusionConfig, type WorkspaceFolder, type InitState, type InitStateStep, type InitStatusLog } from "$/ai-utils";
|
|
3
|
+
import type { Credentials } from "../credentials";
|
|
4
|
+
import { type GitBackupDownloadResult } from "../backup";
|
|
5
|
+
export interface InitConfig {
|
|
6
|
+
fusionConfig: FusionConfig;
|
|
7
|
+
credentials: Credentials;
|
|
8
|
+
sys: DevToolsSys;
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
sentryTags?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface InitStatus {
|
|
13
|
+
message: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class InitStateMachine {
|
|
17
|
+
logIdCounter: number;
|
|
18
|
+
initStatusLogs: InitStatusLog[];
|
|
19
|
+
sys: DevToolsSys;
|
|
20
|
+
config: InitConfig;
|
|
21
|
+
debug: boolean;
|
|
22
|
+
initState: InitState;
|
|
23
|
+
constructor(config: InitConfig);
|
|
24
|
+
checkout(branchName: string, ref: string, repoPath: string): Promise<boolean>;
|
|
25
|
+
execAsync(exec: string, args: string[], cwd?: string, retry?: number): Promise<string>;
|
|
26
|
+
git(args: string[], cwd?: string, retry?: number): Promise<string>;
|
|
27
|
+
performBackup({ sys, credentials, fusionConfig, volumePath, repositories, isConnectedToProvider, forcedFullBackup, }: {
|
|
28
|
+
sys: DevToolsSys;
|
|
29
|
+
credentials: Credentials;
|
|
30
|
+
fusionConfig: FusionConfig;
|
|
31
|
+
volumePath: string;
|
|
32
|
+
repositories: Required<WorkspaceFolder>[];
|
|
33
|
+
isConnectedToProvider: boolean;
|
|
34
|
+
forcedFullBackup: boolean;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
performRegularBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
37
|
+
performOfflineBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
38
|
+
performForcedFullBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
39
|
+
init(): Promise<boolean>;
|
|
40
|
+
addInitLog(type: "status" | "log" | "error" | "complete", message: string, options?: {
|
|
41
|
+
step?: InitStateStep;
|
|
42
|
+
error?: string;
|
|
43
|
+
success?: boolean;
|
|
44
|
+
}): void;
|
|
45
|
+
clearInitLogs(): void;
|
|
46
|
+
hasFilesButNoGit(repoPath: string): Promise<boolean>;
|
|
47
|
+
step1CheckDirectories(volumePath: string, repositories: Required<WorkspaceFolder>[]): Promise<void>;
|
|
48
|
+
step2ConfigureGitRepositories(volumePath: string, repositories: Required<WorkspaceFolder>[]): Promise<void>;
|
|
49
|
+
step3ConfigureGitUser(volumePath: string, repositories: Required<WorkspaceFolder>[]): Promise<void>;
|
|
50
|
+
step4StashChanges(volumePath: string, repositories: Required<WorkspaceFolder>[]): Promise<void>;
|
|
51
|
+
step5CollectRepoInfo(config: InitConfig, volumePath: string, repositories: Required<WorkspaceFolder>[]): Promise<void>;
|
|
52
|
+
private isGitConfigured;
|
|
53
|
+
private getGitRemoteUrl;
|
|
54
|
+
private sanitizeGitRemoteUrl;
|
|
55
|
+
private cleanupLockFiles;
|
|
56
|
+
validateGitRepo(repoPath: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
|
|
59
|
+
* If no backup is available, do nothing.
|
|
60
|
+
*/
|
|
61
|
+
private restoreFromPartialBackup;
|
|
62
|
+
private initializeGitRepo;
|
|
63
|
+
cloneRepository({ repo, repoPath, backupResult, }: {
|
|
64
|
+
repo: Required<WorkspaceFolder>;
|
|
65
|
+
repoPath: string;
|
|
66
|
+
backupResult: GitBackupDownloadResult | undefined;
|
|
67
|
+
}): Promise<boolean>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FusionConfig } from "$/ai-utils";
|
|
2
|
+
import type { LaunchArgs } from "../launch";
|
|
3
|
+
import type { DevToolsSys } from "types";
|
|
4
|
+
export declare function getFusionConfig(sys: DevToolsSys, args: LaunchArgs): Promise<FusionConfig>;
|
|
5
|
+
export declare function saveFusionConfig(sys: DevToolsSys, fusionConfig: FusionConfig): Promise<void>;
|
|
6
|
+
export declare function trackConfigData(sys: DevToolsSys, fusionConfig: FusionConfig): void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import { type RequestHandler as ProxyRequestHandler } from "http-proxy-middleware";
|
|
3
|
+
import type { DevCommandState, EnvironmentVariable, HttpServerState } from "$/ai-utils";
|
|
4
|
+
import EventEmitter from "events";
|
|
5
|
+
import { ChildProcess } from "node:child_process";
|
|
6
|
+
import type { FusionConfig, SetupCommandState } from "$/ai-utils";
|
|
7
|
+
export type DevServerState = Exclude<SetupCommandState | DevCommandState, "installed" | "starting">;
|
|
8
|
+
export interface SetupCommandResult {
|
|
9
|
+
code: number | null;
|
|
10
|
+
output: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DevServerOrchestrator {
|
|
13
|
+
devCommand: string;
|
|
14
|
+
setupCommand: string | undefined;
|
|
15
|
+
setupState: SetupCommandState;
|
|
16
|
+
lastServerBody: string | undefined;
|
|
17
|
+
lastServerStatus: number | undefined;
|
|
18
|
+
devState: DevCommandState;
|
|
19
|
+
httpServerState: HttpServerState;
|
|
20
|
+
state: DevServerState;
|
|
21
|
+
proxyTarget: string;
|
|
22
|
+
proxyPort: number;
|
|
23
|
+
environmentVariables: EnvironmentVariable[];
|
|
24
|
+
envVars: Record<string, string>;
|
|
25
|
+
proxyMiddleware: ProxyRequestHandler | undefined;
|
|
26
|
+
pid: number | undefined;
|
|
27
|
+
autoDetectedUrl: string | undefined;
|
|
28
|
+
abortSetupCommand: () => void;
|
|
29
|
+
clearEnvVariables: () => void;
|
|
30
|
+
setEnvVariable: (key: string, value: string | undefined) => boolean;
|
|
31
|
+
ensureDevCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
|
|
32
|
+
ensureSetupCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
|
|
33
|
+
setupCommandPromise: Promise<SetupCommandResult> | undefined;
|
|
34
|
+
runSetupCommand: (signal?: AbortSignal) => Promise<SetupCommandResult>;
|
|
35
|
+
setSetupCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<SetupCommandResult | null>;
|
|
36
|
+
setDevCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<boolean>;
|
|
37
|
+
setProxyServer: (newProxyServer: string) => Promise<boolean>;
|
|
38
|
+
setPort: (newPort: number) => Promise<boolean>;
|
|
39
|
+
addCheckpoint: () => void;
|
|
40
|
+
getOpenPorts: () => Promise<number[]>;
|
|
41
|
+
getCheckpoints: (n: number, mode: "all" | "out" | "err") => string;
|
|
42
|
+
getAllStdout: () => string;
|
|
43
|
+
getAllStderr: () => string;
|
|
44
|
+
getOutput: () => string;
|
|
45
|
+
getSetupOutput: () => string;
|
|
46
|
+
waitUntilIdle: (initialWaitMs?: number, idleTimeMs?: number) => Promise<void>;
|
|
47
|
+
onClose: (callback: (code: number | null) => void) => void;
|
|
48
|
+
restart: (abortSignal?: AbortSignal) => Promise<void>;
|
|
49
|
+
emitter: EventEmitter<{
|
|
50
|
+
close: [number | null];
|
|
51
|
+
stdout: [string];
|
|
52
|
+
stderr: [string];
|
|
53
|
+
installStdout: [string];
|
|
54
|
+
installStderr: [string];
|
|
55
|
+
setupState: [SetupCommandState];
|
|
56
|
+
devState: [DevCommandState];
|
|
57
|
+
httpServerState: [HttpServerState];
|
|
58
|
+
urlDetected: [string];
|
|
59
|
+
}>;
|
|
60
|
+
close: () => Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
export declare function devServerOrchestrator(sys: DevToolsSys, fusionConfig: FusionConfig, initialSetupState: "installed" | "not-installed" | "install-failed"): Promise<DevServerOrchestrator>;
|
|
63
|
+
export declare const checkPortsListenedByPid: (pid: number) => number[];
|
|
64
|
+
export declare function killProcess(sys: DevToolsSys, proc: ChildProcess | undefined, abortSignal?: AbortSignal, timeout?: number): Promise<boolean>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type InitConfig } from "./InitStateMachine";
|
|
2
|
+
import type { InitState } from "$/ai-utils";
|
|
3
|
+
export declare const attemptDryRunBackupGit: (initConfig: InitConfig, realInitState: InitState) => Promise<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
error: string;
|
|
6
|
+
} | {
|
|
7
|
+
success: boolean;
|
|
8
|
+
error?: undefined;
|
|
9
|
+
} | null>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FusionConfig } from "$/ai-utils";
|
|
2
|
+
import type { DevToolsSys } from "types";
|
|
3
|
+
export declare const getCommandWithShellArgs: (command: string, shell: string) => string[];
|
|
4
|
+
export declare const isInRemoteContainer: () => boolean;
|
|
5
|
+
export declare const getVolumePath: (fusionConfig: FusionConfig) => string;
|
|
6
|
+
export declare function computeAIBranchName(featureBranch: string, sessionId: string): string;
|
|
7
|
+
export declare const getAndParseGitRepoInfo: ({ sys, gitWorkingDirectory, strict, }: {
|
|
8
|
+
sys: DevToolsSys;
|
|
9
|
+
gitWorkingDirectory: string;
|
|
10
|
+
strict: boolean;
|
|
11
|
+
}) => Promise<{
|
|
12
|
+
currentBranch: string;
|
|
13
|
+
featureBranch: string;
|
|
14
|
+
sessionId: string | undefined;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import type { Credentials } from "../credentials";
|
|
3
|
+
import type { FusionConfig, LaunchServerStatus } from "$/ai-utils";
|
|
4
|
+
interface FusionStatusMonitor {
|
|
5
|
+
start: () => void;
|
|
6
|
+
stop: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a fusion status monitor that pings the status endpoint periodically
|
|
10
|
+
*/
|
|
11
|
+
export declare function createFusionStatusMonitor(sys: DevToolsSys, credentials: Credentials, fusionConfig: FusionConfig, sharedState: LaunchServerStatus): FusionStatusMonitor | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Express } from "express";
|
|
2
|
+
import type { LaunchServerStatus } from "$/ai-utils";
|
|
3
|
+
export declare const BUILDER_ENDPOINT_PREFIX = "/_builder.io";
|
|
4
|
+
export declare const BUILDER_API_ENDPOINT_PREFIX: string;
|
|
5
|
+
/**
|
|
6
|
+
* Endpoints that are not authenticated because they are used by the fly.io health check.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NON_AUTHENTICATED_ENDPOINTS: {
|
|
9
|
+
readonly STATUS: "/status";
|
|
10
|
+
readonly PROXY_STATUS: "/proxy-status";
|
|
11
|
+
readonly STATUS_V2: "/status-v2";
|
|
12
|
+
readonly INIT_LOGS: "/init-logs";
|
|
13
|
+
};
|
|
14
|
+
export declare const configureServer: ({ app, validBuilderPrivateKey, authenticateProxy, isLocal, sharedState, }: {
|
|
15
|
+
app: Express;
|
|
16
|
+
validBuilderPrivateKey: string | undefined;
|
|
17
|
+
authenticateProxy: boolean;
|
|
18
|
+
isLocal: boolean;
|
|
19
|
+
sharedState: LaunchServerStatus;
|
|
20
|
+
}) => void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import type { CLIArgs } from "./index";
|
|
3
|
+
/**
|
|
4
|
+
* Large random-ish port number that is unlikely to be used
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROXY_PORT = 48752;
|
|
7
|
+
export interface LaunchArgs extends CLIArgs {
|
|
8
|
+
/** Project ID for the dev server. Only needed when running in a remote container. */
|
|
9
|
+
projectId?: string;
|
|
10
|
+
/** Branch name for the dev server. Only needed when running in a remote container. */
|
|
11
|
+
branchName?: string;
|
|
12
|
+
/** Silent mode for launch command */
|
|
13
|
+
silent?: boolean;
|
|
14
|
+
/** Port number for the dev server */
|
|
15
|
+
port?: number;
|
|
16
|
+
/** Port number for the dev server (shorthand) */
|
|
17
|
+
p?: number;
|
|
18
|
+
/** Dev server command to execute */
|
|
19
|
+
command?: string;
|
|
20
|
+
/** Install command to execute */
|
|
21
|
+
installCommand?: string;
|
|
22
|
+
/** Dev server command to execute (shorthand) */
|
|
23
|
+
c?: string;
|
|
24
|
+
/** Dev server URL to proxy to (alternative to command + port) */
|
|
25
|
+
serverUrl?: string;
|
|
26
|
+
/** Use development server instead of production for launch command */
|
|
27
|
+
dev?: boolean;
|
|
28
|
+
/** Use native builder:// protocol instead of https:// */
|
|
29
|
+
app?: boolean;
|
|
30
|
+
/** Skip browser auto-open (flag form) */
|
|
31
|
+
open?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* If true, CLI will run the init command instead of the launch command.
|
|
34
|
+
*
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
fusionInit?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* If true, CLI will be interactive and prompt the user for input.
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
interactive?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Decides whether to skip authentication for the user's proxy server.
|
|
46
|
+
* Our own _builder.io/ endpoitns are always authenticated.
|
|
47
|
+
*
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
authenticateProxy?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Indicates the type of docker image the CLI is running on.
|
|
53
|
+
*
|
|
54
|
+
* @default "node"
|
|
55
|
+
*/
|
|
56
|
+
dockerImageType?: "fusion-starter" | "node";
|
|
57
|
+
/**
|
|
58
|
+
* Output structured JSON data.
|
|
59
|
+
* Useful for programmatic consumption (e.g., VSCode extensions).
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
jsonOutput?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Enable local development mode with port availability checking.
|
|
66
|
+
* When enabled, automatically finds an available port if the default is in use.
|
|
67
|
+
*
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
local?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Enable privacy mode for codegen.
|
|
73
|
+
* When enabled, encrypts sensitive data in communication with the AI service.
|
|
74
|
+
*
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
privacyMode?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Auto-detect dev server URL and port from command output.
|
|
80
|
+
* When enabled, the system will parse the dev server output to automatically
|
|
81
|
+
* detect the server URL and port instead of requiring manual configuration.
|
|
82
|
+
*
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
autoDetectDevServer?: boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare function runFusionCommand({ sys, args, }: {
|
|
88
|
+
sys: DevToolsSys;
|
|
89
|
+
args: LaunchArgs;
|
|
90
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import builtInPrettier from "prettier";
|
|
2
|
+
export declare function loadPrettier(absoluteFilePath: string | undefined): typeof builtInPrettier;
|
|
3
|
+
export declare function prettierFormat(workingDirectory: string, code: string, parser: string | undefined, filePath: string | undefined): Promise<string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../../types";
|
|
2
|
+
import type { Credentials } from "../credentials";
|
|
3
|
+
import type { WorkspaceConfiguration } from "$/ai-utils";
|
|
4
|
+
import type { Component } from "./types";
|
|
5
|
+
export declare const discoverComponents: (sys: DevToolsSys, credentials: Credentials, sessionId: string, remoteComponents: Component[], opts?: {
|
|
6
|
+
force?: boolean;
|
|
7
|
+
designSystemPackage?: string;
|
|
8
|
+
designSystemVersion?: string;
|
|
9
|
+
workspaceConfig?: WorkspaceConfiguration;
|
|
10
|
+
debug?: boolean;
|
|
11
|
+
}) => Promise<{
|
|
12
|
+
numComponentsFound: number;
|
|
13
|
+
componentsToIndex: Component[];
|
|
14
|
+
discoveredComponents: Component[];
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../../types";
|
|
2
|
+
import type { Credentials } from "../credentials";
|
|
3
|
+
import type { Component, ComponentIssue } from "./types";
|
|
4
|
+
import type { WorkspaceConfiguration } from "$/ai-utils";
|
|
5
|
+
export declare const processComponent: (sys: DevToolsSys, credentials: Credentials, sessionId: string, component: Component, opts?: {
|
|
6
|
+
designSystemId?: string | null;
|
|
7
|
+
designSystemPackage?: string;
|
|
8
|
+
designSystemVersion?: string;
|
|
9
|
+
retriesAllowed?: number;
|
|
10
|
+
workspaceConfig?: WorkspaceConfiguration;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
onIssue?: (issue: ComponentIssue) => void;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
export declare const processAgent: (sys: DevToolsSys, credentials: Credentials, discoveredComponents: Component[], opts?: {
|
|
15
|
+
designSystemId?: string | null;
|
|
16
|
+
retriesAllowed?: number;
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
export declare const deprecateObsoleteComponents: (credentials: Credentials, localComponents: Component[], remoteComponents: Component[]) => Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../../core";
|
|
2
|
+
import { type Credentials } from "../credentials";
|
|
3
|
+
import type { DesignSystem, GenerateUserMessage, WorkspaceConfiguration, StoreComponentDocsInput, UpdateDesignSystemInput, DesignSystemScope, DisplayDesignSystem } from "$/ai-utils";
|
|
4
|
+
export declare const AGENT_FILE = "AGENTS.md";
|
|
5
|
+
export declare const REPO_INDEXING_FOLDER = "repo-indexing";
|
|
6
|
+
export interface UserSettings {
|
|
7
|
+
isAdminInOrganization: boolean;
|
|
8
|
+
email: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const promptForDesignSystemScope: (credentials: Credentials, userSettings: UserSettings | null) => Promise<DesignSystemScope | undefined>;
|
|
11
|
+
export declare const parseDesignSystem: (sys: DevToolsSys, designSystemPackage?: string) => Promise<{
|
|
12
|
+
name: any;
|
|
13
|
+
version: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const storeComponentDocs: (credentials: Credentials, body: StoreComponentDocsInput, debug?: boolean) => Promise<any>;
|
|
16
|
+
export declare const runCodeGen: (sys: DevToolsSys, credentials: Credentials, sessionId: string, message: GenerateUserMessage, debug?: boolean, designSystemPackage?: string, workspaceConfig?: WorkspaceConfiguration, opts?: {
|
|
17
|
+
tags?: object;
|
|
18
|
+
maxTokens?: number;
|
|
19
|
+
}, metadata?: any) => Promise<string>;
|
|
20
|
+
export declare const getAllDesignSystems: (credentials: Credentials, opts?: {
|
|
21
|
+
/**
|
|
22
|
+
* If true, only design systems that the user has permission to edit will be
|
|
23
|
+
* returned. If false, all design systems that the user has permission to edit
|
|
24
|
+
* as well as design systems that the user has permission to read but not edit
|
|
25
|
+
* will be returned. Defaults to false.
|
|
26
|
+
*/
|
|
27
|
+
onlyEditAccess?: boolean;
|
|
28
|
+
}) => Promise<DesignSystem[]>;
|
|
29
|
+
export declare const getDisplayDesignSystems: (credentials: Credentials) => Promise<DisplayDesignSystem[]>;
|
|
30
|
+
export declare const getDesignSystemsByScope: (scope: DesignSystemScope, designSystems: DesignSystem[]) => DesignSystem[];
|
|
31
|
+
export declare const getDesignSystemByName: (designSystemName: string, designSystems: DesignSystem[]) => DesignSystem | null;
|
|
32
|
+
export declare const getDesignSystemByNameAndScope: (credentials: Credentials, designSystemName: string, scope: DesignSystemScope, designSystems: DesignSystem[]) => DesignSystem | null;
|
|
33
|
+
export declare const addDesignSystem: (credentials: Credentials, body: {
|
|
34
|
+
designSystemName: string;
|
|
35
|
+
designSystemVersion?: string;
|
|
36
|
+
designSystemPackage?: string;
|
|
37
|
+
status: string;
|
|
38
|
+
scope: DesignSystemScope;
|
|
39
|
+
}) => Promise<any>;
|
|
40
|
+
export declare const updateDesignSystem: (credentials: Credentials, body: UpdateDesignSystemInput) => Promise<any>;
|
|
41
|
+
export declare const checkRepoIndexingFolder: (sys: DevToolsSys) => Promise<boolean>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../../types";
|
|
2
|
+
import type { CLIArgs } from "../index";
|
|
3
|
+
import { type Credentials } from "../credentials";
|
|
4
|
+
import type { Component, ComponentIssue } from "./types";
|
|
5
|
+
export declare const displayComponentLibrarySummary: (components: Component[], indexedComponents: Component[], startTime: number, numFailed: number | undefined, isForce: boolean | undefined, designSystemName: string, issues?: ComponentIssue[]) => void;
|
|
6
|
+
export interface RepoIndexingDoc {
|
|
7
|
+
name: string;
|
|
8
|
+
content: string | {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
components: string[];
|
|
12
|
+
relevantFiles: string[];
|
|
13
|
+
}[];
|
|
14
|
+
createdDate: string;
|
|
15
|
+
description: string;
|
|
16
|
+
id: string;
|
|
17
|
+
ownerId: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const runRepoIndexing: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
|
|
21
|
+
export declare const isFeatureAllowed: (credentials: Credentials, debug?: boolean) => Promise<{
|
|
22
|
+
isAllowed: boolean;
|
|
23
|
+
reason?: string;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Component {
|
|
2
|
+
id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
relatedComponents: string[];
|
|
6
|
+
relevantFiles: string[];
|
|
7
|
+
designSystemPackage?: string;
|
|
8
|
+
designSystemVersion?: string;
|
|
9
|
+
hash?: string;
|
|
10
|
+
designSystemId?: string | null;
|
|
11
|
+
tokens?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ComponentIssue {
|
|
14
|
+
componentName: string;
|
|
15
|
+
error: string;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../types";
|
|
2
|
+
import type { CLIArgs } from "./index";
|
|
3
|
+
export interface RepoIndexingDoc {
|
|
4
|
+
name: string;
|
|
5
|
+
content: string | {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
components: string[];
|
|
9
|
+
relevantFiles: string[];
|
|
10
|
+
}[];
|
|
11
|
+
createdDate: string;
|
|
12
|
+
description: string;
|
|
13
|
+
id: string;
|
|
14
|
+
ownerId: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const runRepoIndexing: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { FigmaComponentInfo } from "$/ai-utils";
|
|
2
|
+
import type { CLIArgs } from "..";
|
|
3
|
+
import type { DevToolsSys } from "../../core";
|
|
4
|
+
import type { PublishedComponent, PublishedComponentSet } from "@figma/rest-api-spec";
|
|
5
|
+
type Context = {
|
|
6
|
+
sys: DevToolsSys;
|
|
7
|
+
args: CLIArgs;
|
|
8
|
+
debug: (msg: unknown) => void;
|
|
9
|
+
figmaAuth: {
|
|
10
|
+
access_token: string;
|
|
11
|
+
oauth: boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A component or component set
|
|
16
|
+
*/
|
|
17
|
+
type FigmaTeamComponent = {
|
|
18
|
+
/** The unique identifier for the component. */
|
|
19
|
+
key: string;
|
|
20
|
+
/** The unique identifier of the Figma file that contains the component. */
|
|
21
|
+
file_key: string;
|
|
22
|
+
/** The unique identifier of the component node within the Figma file. */
|
|
23
|
+
node_id: string;
|
|
24
|
+
/** A URL to a thumbnail image of the component. */
|
|
25
|
+
thumbnail_url?: string;
|
|
26
|
+
/** The name of the component. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** The description of the component as entered by the publisher. */
|
|
29
|
+
description: string;
|
|
30
|
+
/** The component data. */
|
|
31
|
+
componentData?: FigmaComponentInfo;
|
|
32
|
+
/** Whether the component is published. */
|
|
33
|
+
isPublished?: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare function extractFigmaIds(url: string): {
|
|
36
|
+
teamId?: string;
|
|
37
|
+
fileKey?: string;
|
|
38
|
+
nodeId?: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function fetchTeamComponents(context: Context, teamId: string, onProgress: () => void): Promise<PublishedComponent[]>;
|
|
41
|
+
export declare function fetchTeamComponentSets(context: Context, teamId: string, onProgress: () => void): Promise<PublishedComponentSet[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a list of components and component sets that are present in the file or selection as
|
|
44
|
+
* well as a set of remote keys for components that are referenced but not present.
|
|
45
|
+
*/
|
|
46
|
+
export declare function processFileOrSelection(context: Context, fileKey: string, nodeId?: string): Promise<{
|
|
47
|
+
fileComponents: FigmaTeamComponent[];
|
|
48
|
+
remoteKeys: Set<string>;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function fetchRemoteComponentData(context: Context, remoteKeys: Set<string>): Promise<(FigmaTeamComponent | undefined)[]>;
|
|
51
|
+
export declare function resolveComponentData(context: Context, components: FigmaTeamComponent[]): Promise<FigmaTeamComponent[]>;
|
|
52
|
+
export declare function generateComponentReport(component: FigmaTeamComponent, baseDir: string): Promise<void>;
|
|
53
|
+
export declare const runFigmaReport: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Duplex } from "node:stream";
|
|
2
|
+
import type { IncomingMessage } from "node:http";
|
|
3
|
+
export type SocketRequest = {
|
|
4
|
+
id: number;
|
|
5
|
+
jsonrpc: string;
|
|
6
|
+
method: string;
|
|
7
|
+
params: any;
|
|
8
|
+
};
|
|
9
|
+
export type SocketResponse<T = any> = {
|
|
10
|
+
id?: number | null;
|
|
11
|
+
jsonrpc: string;
|
|
12
|
+
result?: T;
|
|
13
|
+
notification?: string;
|
|
14
|
+
params?: any;
|
|
15
|
+
error?: {
|
|
16
|
+
code: number;
|
|
17
|
+
message: string;
|
|
18
|
+
data?: any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type SocketSendOptions = {
|
|
22
|
+
timeout?: number;
|
|
23
|
+
};
|
|
24
|
+
export type SocketQueue = {
|
|
25
|
+
type: "request" | "notification";
|
|
26
|
+
result?: SocketResponse["result"];
|
|
27
|
+
error?: SocketResponse["error"];
|
|
28
|
+
};
|
|
29
|
+
import type { ServerOptions } from "ws";
|
|
30
|
+
import type { WebSocket } from "ws";
|
|
31
|
+
type RegisterFn<T = any> = (params: T, socketId: string) => Promise<any> | any;
|
|
32
|
+
type SocketEvents = {
|
|
33
|
+
listening: () => Promise<void> | void;
|
|
34
|
+
connection: (socket: WebSocket, socketId: string) => Promise<void> | void;
|
|
35
|
+
disconnection: (socketId: string) => Promise<void> | void;
|
|
36
|
+
error: (error: Error) => Promise<void> | void;
|
|
37
|
+
"socket-error": (socketId: string, error: Error) => Promise<void> | void;
|
|
38
|
+
close: () => Promise<void> | void;
|
|
39
|
+
};
|
|
40
|
+
export declare function RPCWebSocketServer(opts: ServerOptions): {
|
|
41
|
+
on: <EventKey extends keyof SocketEvents>(event: EventKey, cb: SocketEvents[EventKey]) => void;
|
|
42
|
+
event: (e: string) => void;
|
|
43
|
+
handleUpgrade: (req: IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback?: (client: WebSocket, request: IncomingMessage) => void) => Promise<void>;
|
|
44
|
+
clients: () => Map<string, WebSocket>;
|
|
45
|
+
register: <T = any>(method: string, fn: RegisterFn<T>) => void;
|
|
46
|
+
emit: (name: string, ...params: any[]) => void;
|
|
47
|
+
notify: (name: string, socketId: string, ...params: any[]) => void;
|
|
48
|
+
close: () => Promise<unknown>;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AddCliOptions, DevToolsSys, FileNode, SyncInfo } from "../types";
|
|
2
|
+
export declare function extractSignatureInfo(content: string): {
|
|
3
|
+
contentId?: string;
|
|
4
|
+
sessionKey?: string;
|
|
5
|
+
snippetId?: string;
|
|
6
|
+
};
|
|
7
|
+
export interface GetAllProjectFilesOptions {
|
|
8
|
+
basePath: string;
|
|
9
|
+
globPattern?: string | string[];
|
|
10
|
+
extraIgnorePatterns?: string[];
|
|
11
|
+
dot?: boolean;
|
|
12
|
+
deep?: number;
|
|
13
|
+
gitignore?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function getAllProjectFiles({ basePath, globPattern, extraIgnorePatterns, dot, deep, gitignore, }: GetAllProjectFilesOptions): Promise<string[]>;
|
|
16
|
+
export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
|
|
17
|
+
export declare function filterNonImportantFiles(files: string[]): string[];
|
|
18
|
+
export declare function getIgnorePatterns(basePath: string): (path: string) => boolean;
|
|
19
|
+
export declare function watchDirectory(basePath: string, syncInfo: SyncInfo, onChange: (updatedSyncInfo: SyncInfo) => void): () => Promise<void>;
|
|
20
|
+
export declare function setupSyncServer(sys: DevToolsSys, initialSyncInfo?: SyncInfo): Promise<void>;
|
|
21
|
+
export declare function syncCommand(opts: AddCliOptions): Promise<SyncInfo | undefined>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Amplitude from "@amplitude/analytics-node";
|
|
2
|
+
import * as Sentry from "@sentry/node";
|
|
3
|
+
export declare function initTracking(verbose: boolean): Promise<typeof Sentry>;
|
|
4
|
+
export declare function track(eventName: string, options: Record<string, any>): Promise<Amplitude.Types.Result>;
|
|
5
|
+
export declare function setUserId(id: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COMPONENT_GROUP_MDX_PROMPT = "# Component Documentation Generation\n\n## Objective\nGenerate comprehensive MDX documentation for a specific component, analyzing their interfaces, relationships, and usage patterns using the relevant files provided in the input.\n\n## Instructions\n\n### 1. Component Analysis\nFor the given component, analyze each relevant file by:\n- **Interdependency mapping** - Document how components depend on each other\n- **Interface examination** - Extract and document all props, their types, and descriptions\n- **Context analysis** - Identify shared state, contexts, or communication patterns\n- **Compositional patterns** - Document required parent-child relationships\n- **Usage pattern analysis** - Identify how components work together\n- **Example extraction** - Find real usage examples from the codebase\n\n{{COMPONENT_NAME}} has the following related components: {{RELATED_COMPONENTS}}\nThe following files are associated with {{COMPONENT_NAME}}: {{FILE_LIST}}\n\n### 2. Documentation Structure\nCreate comprehensive documentation covering:\n- **Component rationale** - Why these components work together and when to use them\n- **Architectural overview** - How the components form a cohesive system\n- **Component interfaces** - Detailed prop documentation with interdependencies\n- **Composition patterns** - Required and optional usage combinations\n- **Integration examples** - Real-world scenarios showing the component in action\n- **Best practices** - Recommended usage patterns and guidelines\n\n## Required Output Format\n\nGenerate an MDX file with this structure:\n\n```mdx\n---\n# {{COMPONENT_NAME}}\n\n## Overview\n\n### Purpose\n{{COMPONENT_DESCRIPTION}}\n\n### When to Use\n[Expand on the use cases mentioned in the description - be specific about scenarios, user needs, and implementation contexts]\n\n### Architecture\n[Explain the architectural pattern based on coupling strength:]\n- **Critical/Strong Coupling**: Describe the required relationships, shared context, or compositional hierarchy\n- **Moderate Coupling**: Explain how components enhance each other\n- **No Coupling**: Note that this is a standalone component\n\n### Component Interdependencies\n[Map out component relationships - only for components with coupling:]\n- Required parent-child relationships\n- Shared context dependencies \n- Communication patterns between components\n- Related components\n\n## Components\n\n### [PrimaryComponent] {Primary Component for components with coupling}\n[Mark the main/root component for coupled components]\n\n**Purpose:** [What this specific component does]\n\n**Interface:**\n```typescript\ninterface [PrimaryComponent]Props {\n // Document all props with types and descriptions\n children: React.ReactNode; // Required child components (for coupled components)\n property: string; // Description of what this prop does\n onAction?: () => void; // Optional callback description\n}\n```\n\n**Dependencies:** [For coupled components - what this component requires]\n**Provides:** [For coupled components - what context/state this component provides to children]\n\n**Usage Example:**\n```tsx\nimport { [PrimaryComponent] } from '@your-library/components';\n\nfunction Example() {\n return (\n <[PrimaryComponent]\n property=\"value\"\n onAction={() => console.log('action')}\n >\n {/* Required children for coupled components */}\n </[PrimaryComponent]>\n );\n}\n```\n\n### [DependentComponent] {Dependent Component for components with coupling}\n[Mark components that depend on the primary component]\n\n**Purpose:** [What this specific component does]\n\n**Interface:**\n```typescript\ninterface [DependentComponent]Props {\n // Props specific to this component\n // Note any props that are passed down from parent context\n}\n```\n\n**Context Dependencies:** [What context/state this component requires from parent]\n**Parent Requirements:** [Required parent components for proper functionality]\n\n**Usage Example:**\n```tsx\n// Must be used within [PrimaryComponent] for coupled components\n<[PrimaryComponent]>\n <[DependentComponent] prop=\"value\">\n Content\n </[DependentComponent]>\n</[PrimaryComponent]>\n```\n\n### [StandaloneComponent] {For uncoupled components}\n[For components with no coupling]\n\n**Purpose:** [What this component does and when to use it]\n\n**Interface:**\n```typescript\ninterface [StandaloneComponent]Props {\n // All props with types and descriptions\n}\n```\n\n**Usage Example:**\n```tsx\nimport { [StandaloneComponent] } from '@your-library/components';\n\nfunction Example() {\n return (\n <[StandaloneComponent]\n property=\"value\"\n onAction={() => console.log('action')}\n />\n );\n}\n```\n\n## Integration Patterns\n\n### Basic Usage {Only for coupled components}\n```tsx\nimport { [PrimaryComponent], [DependentComponent1], [DependentComponent2] } from '@your-library/components';\n\n// Minimal required structure\nfunction BasicExample() {\n return (\n <[PrimaryComponent]>\n <[DependentComponent1]>Required content</[DependentComponent1]>\n <[DependentComponent2]>More content</[DependentComponent2]>\n </[PrimaryComponent]>\n );\n}\n```\n\n### Advanced Usage {Only for coupled components}\n```tsx\n// Complex usage with all features\nfunction AdvancedExample() {\n return (\n <[PrimaryComponent] \n property=\"value\" \n onAction={handleAction}\n >\n <[DependentComponent1] prop=\"value\">\n <Content />\n </[DependentComponent1]>\n <[DependentComponent2] prop=\"value\">\n <MoreContent />\n </[DependentComponent2]>\n </[PrimaryComponent]>\n );\n}\n```\n\n### Common Variations {Adapt based on component types}\n```tsx\n// Show different ways to use the component(s)\n// Include conditional rendering, different prop combinations, etc.\n```\n\n## Component Relationships {Only for coupled components}\n\n### Data Flow\n[Explain how data flows between the component and related components}\n\n### Context Sharing\n[Document shared contexts, providers, or state management]\n\n### Event Handling\n[Describe how events bubble up or propagate between components]\n\n## Best Practices\n\n### Usage Guidelines\n- [Specific recommendation based on component purpose and use cases]\n- [Another recommendation focusing on accessibility or performance]\n- [Usage pattern guidance based on the component's architecture]\n\n### Accessibility {When relevant}\n- [ARIA relationships between components]\n- [Keyboard navigation patterns]\n- [Screen reader considerations]\n\n### Performance {When relevant}\n- [Optimization recommendations]\n- [State management best practices]\n- [Rendering performance considerations]\n\n## Common Patterns {Expand based on component functionality}\n\n### Pattern 1: [Specific Pattern Name]\n```tsx\n// Example showing a specific usage pattern\n// Include comments explaining why this pattern is recommended\n```\n\n### Pattern 2: [Another Pattern Name]\n```tsx\n// Another common pattern with explanation\n```\n\n```\n\n## File Generation Requirements\n\n**File Naming:**\n- Use kebab-case derived from component name: `{{COMPONENT_NAME_KEBAB}}.mdx`\n- Place in `repo-indexing/` folder\n- Example: `repo-indexing/{{COMPONENT_NAME_KEBAB}}.mdx`\n\n**Content Requirements:**\n1. **Use coupling strength context** - Adapt documentation structure based on couplingStrength value\n2. **Extract real interfaces** - Don't create placeholder interfaces, extract actual TypeScript interfaces from the codebase\n3. **Leverage component description** - Expand on the provided description with specific use cases and implementation guidance\n4. **Document interdependencies** - For coupled components, clearly explain component relationships and requirements\n5. **Include practical examples** - Use realistic, working code examples that demonstrate proper usage\n6. **Show integration patterns** - For coupled components, demonstrate required composition patterns\n**Coupling-Specific Requirements:**\n- **Critical/Strong Coupling**: Focus on required relationships, composition patterns, and shared context\n- **Moderate Coupling**: Show how components enhance each other and optional usage patterns \n- **No Coupling**: Document standalone usage, variants, and individual component capabilities\n\n## Output\nReturn only the complete MDX file content, ready to be saved as `repo-indexing/{{COMPONENT_NAME_KEBAB}}.mdx`. You must use the Write tool in your response.";
|