Skip to content

Commit 4eef440

Browse files
committed
refactor(cli): remove unused code
1 parent 6a68cf8 commit 4eef440

51 files changed

Lines changed: 70 additions & 1471 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/cli-v3/src/build/buildWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { logBuildWorkerStart } from "./buildWorkerLogging.js";
2424
import { SdkVersionExtractor } from "./plugins.js";
2525
import { spinner } from "../utilities/windows.js";
2626

27-
export type BuildWorkerEventListener = {
27+
type BuildWorkerEventListener = {
2828
onBundleStart?: () => void;
2929
onBundleComplete?: (result: BundleResult) => void;
3030
};
@@ -142,7 +142,7 @@ export async function buildWorker(options: BuildWorkerOptions) {
142142
return buildManifest;
143143
}
144144

145-
export function rewriteBuildManifestPaths(
145+
function rewriteBuildManifestPaths(
146146
buildManifest: BuildManifest,
147147
destinationDir: string
148148
): BuildManifest {

packages/cli-v3/src/build/externals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ async function isExternalResolvable(
124124
}
125125
}
126126

127-
export type CollectedExternal = {
127+
type CollectedExternal = {
128128
name: string;
129129
path: string;
130130
version: string;
131131
};
132132

133-
export type ExternalsCollector = {
133+
type ExternalsCollector = {
134134
externals: Array<CollectedExternal>;
135135
plugin: esbuild.Plugin;
136136
};

packages/cli-v3/src/build/packageModules.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ import { basename, dirname, join, resolve } from "node:path";
33
import { sourceDir } from "../sourceDir.js";
44
import { assertExhaustive } from "../utilities/assertExhaustive.js";
55

6-
export const devRunWorker = join(sourceDir, "entryPoints", "dev-run-worker.js");
7-
export const devIndexWorker = join(sourceDir, "entryPoints", "dev-index-worker.js");
6+
const devRunWorker = join(sourceDir, "entryPoints", "dev-run-worker.js");
7+
const devIndexWorker = join(sourceDir, "entryPoints", "dev-index-worker.js");
88

9-
export const managedRunController = join(sourceDir, "entryPoints", "managed-run-controller.js");
10-
export const managedRunWorker = join(sourceDir, "entryPoints", "managed-run-worker.js");
11-
export const managedIndexController = join(sourceDir, "entryPoints", "managed-index-controller.js");
12-
export const managedIndexWorker = join(sourceDir, "entryPoints", "managed-index-worker.js");
9+
const managedRunController = join(sourceDir, "entryPoints", "managed-run-controller.js");
10+
const managedRunWorker = join(sourceDir, "entryPoints", "managed-run-worker.js");
11+
const managedIndexController = join(sourceDir, "entryPoints", "managed-index-controller.js");
12+
const managedIndexWorker = join(sourceDir, "entryPoints", "managed-index-worker.js");
1313

14-
export const unmanagedRunController = join(sourceDir, "entryPoints", "unmanaged-run-controller.js");
15-
export const unmanagedRunWorker = join(sourceDir, "entryPoints", "unmanaged-run-worker.js");
16-
export const unmanagedIndexController = join(
14+
const unmanagedRunController = join(sourceDir, "entryPoints", "unmanaged-run-controller.js");
15+
const unmanagedRunWorker = join(sourceDir, "entryPoints", "unmanaged-run-worker.js");
16+
const unmanagedIndexController = join(
1717
sourceDir,
1818
"entryPoints",
1919
"unmanaged-index-controller.js"
2020
);
21-
export const unmanagedIndexWorker = join(sourceDir, "entryPoints", "unmanaged-index-worker.js");
21+
const unmanagedIndexWorker = join(sourceDir, "entryPoints", "unmanaged-index-worker.js");
2222

2323
export const telemetryEntryPoint = join(sourceDir, "entryPoints", "loader.js");
2424

@@ -36,7 +36,7 @@ export const unmanagedEntryPoints = [
3636
unmanagedIndexWorker,
3737
];
3838

39-
export const esmShimPath = join(sourceDir, "shims", "esm.js");
39+
const esmShimPath = join(sourceDir, "shims", "esm.js");
4040

4141
export const shims = [esmShimPath];
4242

@@ -232,7 +232,7 @@ export function getIndexControllerForTarget(target: BuildTarget) {
232232
}
233233
}
234234

235-
export function isConfigEntryPoint(entryPoint: string) {
235+
function isConfigEntryPoint(entryPoint: string) {
236236
return entryPoint.startsWith("trigger.config.ts");
237237
}
238238

packages/cli-v3/src/build/plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function buildPlugins(
3232
return plugins;
3333
}
3434

35-
export function analyzeMetadataPlugin(): esbuild.Plugin {
35+
function analyzeMetadataPlugin(): esbuild.Plugin {
3636
return {
3737
name: "analyze-metafile",
3838
setup(build) {
@@ -58,7 +58,7 @@ const polysheds = [
5858
},
5959
];
6060

61-
export function polyshedPlugin(): esbuild.Plugin {
61+
function polyshedPlugin(): esbuild.Plugin {
6262
return {
6363
name: "polyshed",
6464
setup(build) {

packages/cli-v3/src/commands/analyze.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ export function configureAnalyzeCommand(program: Command) {
3737
});
3838
}
3939

40-
export async function analyzeCommand(dir: string | undefined, options: unknown) {
40+
async function analyzeCommand(dir: string | undefined, options: unknown) {
4141
return await wrapCommandAction("analyze", AnalyzeOptions, options, async (opts) => {
4242
await printInitialBanner(false);
4343
return await analyze(dir, opts);
4444
});
4545
}
4646

47-
export async function analyze(dir: string | undefined, options: AnalyzeOptions) {
47+
async function analyze(dir: string | undefined, options: AnalyzeOptions) {
4848
const cwd = process.cwd();
4949
const targetDir = dir ? path.resolve(cwd, dir) : cwd;
5050
const metafilePath = path.join(targetDir, "metafile.json");

packages/cli-v3/src/commands/deploy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export function configureDeployCommand(program: Command) {
249249
);
250250
}
251251

252-
export async function deployCommand(dir: string, options: unknown) {
252+
async function deployCommand(dir: string, options: unknown) {
253253
return await wrapCommandAction("deployCommand", DeployCommandOptions, options, async (opts) => {
254254
return await _deployCommand(dir, opts);
255255
});
@@ -774,7 +774,7 @@ async function _deployCommand(dir: string, options: DeployCommandOptions) {
774774
});
775775
}
776776

777-
export async function syncEnvVarsWithServer(
777+
async function syncEnvVarsWithServer(
778778
apiClient: CliApiClient,
779779
projectRef: string,
780780
environmentSlug: string,

packages/cli-v3/src/commands/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export function configureDevCommand(program: Command) {
154154
});
155155
}
156156

157-
export async function devCommand(options: DevCommandOptions) {
157+
async function devCommand(options: DevCommandOptions) {
158158
runtimeChecks();
159159

160160
// Only show these install prompts if the user is in a terminal (not in a Coding Agent)

packages/cli-v3/src/commands/init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Examples:
123123
});
124124
}
125125

126-
export async function initCommand(dir: string, options: unknown) {
126+
async function initCommand(dir: string, options: unknown) {
127127
return await wrapCommandAction("initCommand", InitCommandOptions, options, async (opts) => {
128128
return await _initCommand(dir, opts);
129129
});
@@ -595,7 +595,7 @@ async function addConfigFileToTsConfig(tsconfigPath: string, options: InitComman
595595
});
596596
}
597597

598-
export interface InstallPackagesOutputter {
598+
interface InstallPackagesOutputter {
599599
startSDK: () => void;
600600
installedSDK: () => void;
601601
startBuild: () => void;
@@ -648,7 +648,7 @@ class SilentInstallPackagesOutputter implements InstallPackagesOutputter {
648648
stoppedWithError() {}
649649
}
650650

651-
export async function installPackages(
651+
async function installPackages(
652652
projectDir: string,
653653
tag: string,
654654
outputter: InstallPackagesOutputter = new SilentInstallPackagesOutputter()

packages/cli-v3/src/commands/install-mcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export function configureInstallMcpCommand(program: Command) {
161161
});
162162
}
163163

164-
export async function installMcpCommand(options: unknown) {
164+
async function installMcpCommand(options: unknown) {
165165
return await wrapCommandAction(
166166
"installMcpCommand",
167167
InstallMcpCommandOptions,

packages/cli-v3/src/commands/list-profiles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export function configureListProfilesCommand(program: Command) {
3131
});
3232
}
3333

34-
export async function listProfilesCommand(options: unknown) {
34+
async function listProfilesCommand(options: unknown) {
3535
return await wrapCommandAction("listProfiles", ListProfilesOptions, options, async (opts) => {
3636
await printInitialBanner(false);
3737
return await listProfiles(opts);
3838
});
3939
}
4040

41-
export async function listProfiles(options: ListProfilesOptions) {
41+
async function listProfiles(options: ListProfilesOptions) {
4242
const authConfig = readAuthConfigFile();
4343

4444
if (!authConfig) {

0 commit comments

Comments
 (0)