Skip to content

Commit eef649c

Browse files
authored
Pull out all exported functions from Wrangler's index (#7734)
* Refactor * Fix checks
1 parent 5955dac commit eef649c

Some content is hidden

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

41 files changed

+188
-178
lines changed

packages/wrangler/src/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { vi } from "vitest";
2-
import { logPossibleBugMessage } from "..";
32
import { getPackageManager } from "../package-manager";
43
import { updateCheck } from "../update-check";
4+
import { logPossibleBugMessage } from "../utils/logPossibleBugMessage";
55
import { endEventLoop } from "./helpers/end-event-loop";
66
import { mockConsoleMethods } from "./helpers/mock-console";
77
import { runInTempDir } from "./helpers/run-in-tmp";

packages/wrangler/src/api/startDevWorker/ConfigController.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
import assert from "node:assert";
22
import path from "node:path";
33
import { watch } from "chokidar";
4-
import {
5-
DEFAULT_INSPECTOR_PORT,
6-
DEFAULT_LOCAL_PORT,
7-
getDevCompatibilityDate,
8-
getRules,
9-
getScriptName,
10-
isLegacyEnv,
11-
} from "../..";
124
import { getAssetsOptions, validateAssetsArgsAndConfig } from "../../assets";
135
import { readConfig } from "../../config";
146
import { getEntry } from "../../deployment-bundle/entry";
@@ -23,6 +15,14 @@ import { getLocalPersistencePath } from "../../dev/get-local-persistence-path";
2315
import { UserError } from "../../errors";
2416
import { logger } from "../../logger";
2517
import { requireApiToken, requireAuth } from "../../user";
18+
import {
19+
DEFAULT_INSPECTOR_PORT,
20+
DEFAULT_LOCAL_PORT,
21+
} from "../../utils/constants";
22+
import { getDevCompatibilityDate } from "../../utils/getDevCompatibilityDate";
23+
import { getRules } from "../../utils/getRules";
24+
import { getScriptName } from "../../utils/getScriptName";
25+
import { isLegacyEnv } from "../../utils/isLegacyEnv";
2626
import { memoizeGetPort } from "../../utils/memoizeGetPort";
2727
import { printBindings } from "../../utils/print-bindings";
2828
import { getZoneIdForPreview } from "../../zones";

packages/wrangler/src/d1/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import TOML from "@iarna/toml";
2-
import { printWranglerBanner } from "..";
32
import { fetchResult } from "../cfetch";
43
import { withConfig } from "../config";
54
import { UserError } from "../errors";
65
import { logger } from "../logger";
76
import { requireAuth } from "../user";
7+
import { printWranglerBanner } from "../wrangler-banner";
88
import { LOCATION_CHOICES } from "./constants";
99
import type {
1010
CommonYargsArgv,

packages/wrangler/src/d1/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { printWranglerBanner } from "..";
21
import { fetchResult } from "../cfetch";
32
import { withConfig } from "../config";
43
import { confirm } from "../dialogs";
54
import { logger } from "../logger";
65
import { requireAuth } from "../user";
6+
import { printWranglerBanner } from "../wrangler-banner";
77
import { Name } from "./options";
88
import { getDatabaseByNameOrBinding } from "./utils";
99
import type {

packages/wrangler/src/d1/execute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import chalk from "chalk";
66
import md5File from "md5-file";
77
import { Miniflare } from "miniflare";
88
import { fetch } from "undici";
9-
import { printWranglerBanner } from "..";
109
import { fetchResult } from "../cfetch";
1110
import { configFileName, readConfig } from "../config";
1211
import { getLocalPersistencePath } from "../dev/get-local-persistence-path";
@@ -16,6 +15,7 @@ import { logger } from "../logger";
1615
import { APIError, readFileSync } from "../parse";
1716
import { readableRelative } from "../paths";
1817
import { requireAuth } from "../user";
18+
import { printWranglerBanner } from "../wrangler-banner";
1919
import * as options from "./options";
2020
import splitSqlQuery from "./splitter";
2121
import { getDatabaseByNameOrBinding, getDatabaseInfoFromConfig } from "./utils";

packages/wrangler/src/d1/export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { spinner, spinnerWhile } from "@cloudflare/cli/interactive";
44
import chalk from "chalk";
55
import { Miniflare } from "miniflare";
66
import { fetch } from "undici";
7-
import { printWranglerBanner } from "..";
87
import { fetchResult } from "../cfetch";
98
import { configFileName, readConfig } from "../config";
109
import { getLocalPersistencePath } from "../dev/get-local-persistence-path";
@@ -13,6 +12,7 @@ import { logger } from "../logger";
1312
import { APIError } from "../parse";
1413
import { readableRelative } from "../paths";
1514
import { requireAuth } from "../user";
15+
import { printWranglerBanner } from "../wrangler-banner";
1616
import { Name } from "./options";
1717
import { getDatabaseByNameOrBinding, getDatabaseInfoFromConfig } from "./utils";
1818
import type { Config } from "../config";

packages/wrangler/src/d1/info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import prettyBytes from "pretty-bytes";
2-
import { printWranglerBanner } from "..";
32
import { fetchGraphqlResult } from "../cfetch";
43
import { withConfig } from "../config";
54
import { logger } from "../logger";
65
import { requireAuth } from "../user";
6+
import { printWranglerBanner } from "../wrangler-banner";
77
import { getDatabaseByNameOrBinding, getDatabaseInfoFromId } from "./utils";
88
import type {
99
CommonYargsArgv,

packages/wrangler/src/d1/insights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { printWranglerBanner } from "..";
21
import { fetchGraphqlResult } from "../cfetch";
32
import { withConfig } from "../config";
43
import { logger } from "../logger";
54
import { requireAuth } from "../user";
5+
import { printWranglerBanner } from "../wrangler-banner";
66
import { getDatabaseByNameOrBinding, getDatabaseInfoFromId } from "./utils";
77
import type {
88
CommonYargsArgv,

packages/wrangler/src/d1/list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { printWranglerBanner } from "..";
21
import { fetchResult } from "../cfetch";
32
import { withConfig } from "../config";
43
import { logger } from "../logger";
54
import { requireAuth } from "../user";
5+
import { printWranglerBanner } from "../wrangler-banner";
66
import type {
77
CommonYargsArgv,
88
StrictYargsOptionsToInterface,

packages/wrangler/src/d1/migrations/apply.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import assert from "node:assert";
22
import fs from "node:fs";
33
import path from "path";
4-
import { printWranglerBanner } from "../..";
54
import { configFileName, withConfig } from "../../config";
65
import { confirm } from "../../dialogs";
76
import { UserError } from "../../errors";
87
import { isNonInteractiveOrCI } from "../../is-interactive";
98
import { logger } from "../../logger";
109
import { requireAuth } from "../../user";
10+
import { printWranglerBanner } from "../../wrangler-banner";
1111
import { createBackup } from "../backups";
1212
import { DEFAULT_MIGRATION_PATH, DEFAULT_MIGRATION_TABLE } from "../constants";
1313
import { executeSql } from "../execute";

0 commit comments

Comments
 (0)