wrangler 4.14.0 → 4.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/wrangler-dist/cli.d.ts +2 -0
- package/wrangler-dist/cli.js +218 -173
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.14.
|
3
|
+
"version": "4.14.1",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"unenv": "2.0.0-rc.15",
|
58
58
|
"workerd": "1.20250428.0",
|
59
59
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
60
|
-
"miniflare": "4.20250428.
|
60
|
+
"miniflare": "4.20250428.1"
|
61
61
|
},
|
62
62
|
"devDependencies": {
|
63
63
|
"@aws-sdk/client-s3": "^3.721.0",
|
@@ -136,10 +136,10 @@
|
|
136
136
|
"xxhash-wasm": "^1.0.1",
|
137
137
|
"yargs": "^17.7.2",
|
138
138
|
"@cloudflare/cli": "1.1.1",
|
139
|
-
"@cloudflare/
|
140
|
-
"@cloudflare/pages-shared": "^0.13.34",
|
139
|
+
"@cloudflare/pages-shared": "^0.13.35",
|
141
140
|
"@cloudflare/workers-shared": "0.17.5",
|
142
|
-
"@cloudflare/workers-tsconfig": "0.0.0"
|
141
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
142
|
+
"@cloudflare/eslint-config-worker": "1.1.0"
|
143
143
|
},
|
144
144
|
"peerDependencies": {
|
145
145
|
"@cloudflare/workers-types": "^4.20250428.0"
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -1589,6 +1589,8 @@ declare type Entry = {
|
|
1589
1589
|
file: string;
|
1590
1590
|
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
1591
1591
|
projectRoot: string;
|
1592
|
+
/** The path to the config file, if it exists. */
|
1593
|
+
configPath: string | undefined;
|
1592
1594
|
/** Is this a module worker or a service worker? */
|
1593
1595
|
format: CfScriptFormat;
|
1594
1596
|
/** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
|
package/wrangler-dist/cli.js
CHANGED
@@ -81399,7 +81399,7 @@ var import_miniflare8 = require("miniflare");
|
|
81399
81399
|
init_import_meta_url();
|
81400
81400
|
var import_node_assert5 = __toESM(require("node:assert"));
|
81401
81401
|
var import_node_crypto4 = require("node:crypto");
|
81402
|
-
var
|
81402
|
+
var import_node_path16 = __toESM(require("node:path"));
|
81403
81403
|
var import_miniflare6 = require("miniflare");
|
81404
81404
|
|
81405
81405
|
// src/ai/fetcher.ts
|
@@ -81413,7 +81413,7 @@ var import_undici3 = __toESM(require_undici());
|
|
81413
81413
|
|
81414
81414
|
// package.json
|
81415
81415
|
var name = "wrangler";
|
81416
|
-
var version = "4.14.
|
81416
|
+
var version = "4.14.1";
|
81417
81417
|
|
81418
81418
|
// src/environment-variables/misc-variables.ts
|
81419
81419
|
init_import_meta_url();
|
@@ -90548,7 +90548,10 @@ function validateScopeKeys(scopes) {
|
|
90548
90548
|
return scopes.every((scope) => scope in DefaultScopes);
|
90549
90549
|
}
|
90550
90550
|
__name(validateScopeKeys, "validateScopeKeys");
|
90551
|
-
|
90551
|
+
function getCallbackUrl(host = "localhost", port = 8976) {
|
90552
|
+
return `http://${host}:${port}/oauth/callback`;
|
90553
|
+
}
|
90554
|
+
__name(getCallbackUrl, "getCallbackUrl");
|
90552
90555
|
var LocalState = {
|
90553
90556
|
...getAuthTokens()
|
90554
90557
|
};
|
@@ -90790,7 +90793,7 @@ function isReturningFromAuthServer(query) {
|
|
90790
90793
|
return true;
|
90791
90794
|
}
|
90792
90795
|
__name(isReturningFromAuthServer, "isReturningFromAuthServer");
|
90793
|
-
async function getAuthURL(scopes, clientId) {
|
90796
|
+
async function getAuthURL(scopes, clientId, callbackHost, callbackPort) {
|
90794
90797
|
const { codeChallenge, codeVerifier } = await generatePKCECodes();
|
90795
90798
|
const stateQueryParam = generateRandomState(RECOMMENDED_STATE_LENGTH);
|
90796
90799
|
Object.assign(LocalState, {
|
@@ -90801,7 +90804,7 @@ async function getAuthURL(scopes, clientId) {
|
|
90801
90804
|
return generateAuthUrl({
|
90802
90805
|
authUrl: getAuthUrlFromEnv(),
|
90803
90806
|
clientId,
|
90804
|
-
callbackUrl:
|
90807
|
+
callbackUrl: getCallbackUrl(callbackHost, callbackPort),
|
90805
90808
|
scopes,
|
90806
90809
|
stateQueryParam,
|
90807
90810
|
codeChallenge
|
@@ -90880,7 +90883,7 @@ async function exchangeAuthCodeForAccessToken() {
|
|
90880
90883
|
const params = new URLSearchParams({
|
90881
90884
|
grant_type: `authorization_code`,
|
90882
90885
|
code: authorizationCode ?? "",
|
90883
|
-
redirect_uri:
|
90886
|
+
redirect_uri: getCallbackUrl(),
|
90884
90887
|
client_id: getClientIdFromEnv(),
|
90885
90888
|
code_verifier: codeVerifier
|
90886
90889
|
});
|
@@ -90988,7 +90991,12 @@ async function loginOrRefreshIfRequired(props) {
|
|
90988
90991
|
}
|
90989
90992
|
__name(loginOrRefreshIfRequired, "loginOrRefreshIfRequired");
|
90990
90993
|
async function getOauthToken(options) {
|
90991
|
-
const urlToOpen = await getAuthURL(
|
90994
|
+
const urlToOpen = await getAuthURL(
|
90995
|
+
options.scopes,
|
90996
|
+
options.clientId,
|
90997
|
+
options.callbackHost,
|
90998
|
+
options.callbackPort
|
90999
|
+
);
|
90992
91000
|
let server;
|
90993
91001
|
let loginTimeoutHandle;
|
90994
91002
|
const timerPromise = new Promise((_4, reject) => {
|
@@ -91524,18 +91532,78 @@ __name(AIFetcher, "AIFetcher");
|
|
91524
91532
|
// src/deployment-bundle/module-collection.ts
|
91525
91533
|
init_import_meta_url();
|
91526
91534
|
var import_node_crypto3 = __toESM(require("node:crypto"));
|
91527
|
-
var
|
91535
|
+
var import_node_fs8 = require("node:fs");
|
91528
91536
|
var import_promises4 = require("node:fs/promises");
|
91529
|
-
var
|
91537
|
+
var import_node_path15 = __toESM(require("node:path"));
|
91530
91538
|
var import_glob_to_regexp2 = __toESM(require_glob_to_regexp());
|
91531
91539
|
var import_resolve = __toESM(require_resolve());
|
91532
91540
|
|
91533
91541
|
// src/deployment-bundle/find-additional-modules.ts
|
91534
91542
|
init_import_meta_url();
|
91535
91543
|
var import_promises3 = require("node:fs/promises");
|
91536
|
-
var
|
91544
|
+
var import_node_path14 = __toESM(require("node:path"));
|
91537
91545
|
var import_glob_to_regexp = __toESM(require_glob_to_regexp());
|
91538
91546
|
|
91547
|
+
// src/paths.ts
|
91548
|
+
init_import_meta_url();
|
91549
|
+
var import_node_console = require("node:console");
|
91550
|
+
var import_node_fs6 = __toESM(require("node:fs"));
|
91551
|
+
var import_node_path12 = __toESM(require("node:path"));
|
91552
|
+
var import_signal_exit3 = __toESM(require_signal_exit());
|
91553
|
+
function toUrlPath(filePath) {
|
91554
|
+
(0, import_node_console.assert)(
|
91555
|
+
!/^[a-z]:/i.test(filePath),
|
91556
|
+
"Tried to convert a Windows file path with a drive to a URL path."
|
91557
|
+
);
|
91558
|
+
return filePath.replace(/\\/g, "/");
|
91559
|
+
}
|
91560
|
+
__name(toUrlPath, "toUrlPath");
|
91561
|
+
function readableRelative(to) {
|
91562
|
+
const relativePath = import_node_path12.default.relative(process.cwd(), to);
|
91563
|
+
if (
|
91564
|
+
// No directory nesting, return as-is
|
91565
|
+
import_node_path12.default.basename(relativePath) === relativePath || // Outside current directory
|
91566
|
+
relativePath.startsWith(".")
|
91567
|
+
) {
|
91568
|
+
return relativePath;
|
91569
|
+
} else {
|
91570
|
+
return "./" + relativePath;
|
91571
|
+
}
|
91572
|
+
}
|
91573
|
+
__name(readableRelative, "readableRelative");
|
91574
|
+
function getBasePath() {
|
91575
|
+
return import_node_path12.default.resolve(__dirname, "..");
|
91576
|
+
}
|
91577
|
+
__name(getBasePath, "getBasePath");
|
91578
|
+
function getWranglerHiddenDirPath(projectRoot) {
|
91579
|
+
projectRoot ??= process.cwd();
|
91580
|
+
return import_node_path12.default.join(projectRoot, ".wrangler");
|
91581
|
+
}
|
91582
|
+
__name(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
|
91583
|
+
function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
|
91584
|
+
const tmpRoot = import_node_path12.default.join(getWranglerHiddenDirPath(projectRoot), "tmp");
|
91585
|
+
import_node_fs6.default.mkdirSync(tmpRoot, { recursive: true });
|
91586
|
+
const tmpPrefix = import_node_path12.default.join(tmpRoot, `${prefix}-`);
|
91587
|
+
const tmpDir = import_node_fs6.default.realpathSync(import_node_fs6.default.mkdtempSync(tmpPrefix));
|
91588
|
+
const removeDir = /* @__PURE__ */ __name(() => {
|
91589
|
+
if (cleanup) {
|
91590
|
+
try {
|
91591
|
+
return import_node_fs6.default.rmSync(tmpDir, { recursive: true, force: true });
|
91592
|
+
} catch (e7) {
|
91593
|
+
}
|
91594
|
+
}
|
91595
|
+
}, "removeDir");
|
91596
|
+
const removeExitListener = (0, import_signal_exit3.default)(removeDir);
|
91597
|
+
return {
|
91598
|
+
path: tmpDir,
|
91599
|
+
remove() {
|
91600
|
+
removeExitListener();
|
91601
|
+
removeDir();
|
91602
|
+
}
|
91603
|
+
};
|
91604
|
+
}
|
91605
|
+
__name(getWranglerTmpDir, "getWranglerTmpDir");
|
91606
|
+
|
91539
91607
|
// src/deployment-bundle/bundle-type.ts
|
91540
91608
|
init_import_meta_url();
|
91541
91609
|
function getBundleType(format9, file) {
|
@@ -91608,8 +91676,8 @@ __name(parseRules, "parseRules");
|
|
91608
91676
|
|
91609
91677
|
// src/deployment-bundle/source-maps.ts
|
91610
91678
|
init_import_meta_url();
|
91611
|
-
var
|
91612
|
-
var
|
91679
|
+
var import_node_fs7 = __toESM(require("node:fs"));
|
91680
|
+
var import_node_path13 = __toESM(require("node:path"));
|
91613
91681
|
function loadSourceMaps(main2, modules, bundle) {
|
91614
91682
|
const { sourceMapPath, sourceMapMetadata } = bundle;
|
91615
91683
|
if (sourceMapPath && sourceMapMetadata) {
|
@@ -91624,18 +91692,18 @@ function loadSourceMap({ name: name2, filePath }, sourceMapPath, { entryDirector
|
|
91624
91692
|
return [];
|
91625
91693
|
}
|
91626
91694
|
const map2 = JSON.parse(
|
91627
|
-
|
91695
|
+
import_node_fs7.default.readFileSync(import_node_path13.default.join(entryDirectory, sourceMapPath), "utf8")
|
91628
91696
|
);
|
91629
91697
|
map2.file = name2;
|
91630
91698
|
if (map2.sourceRoot) {
|
91631
|
-
const sourceRootPath =
|
91632
|
-
|
91699
|
+
const sourceRootPath = import_node_path13.default.dirname(
|
91700
|
+
import_node_path13.default.join(entryDirectory, sourceMapPath)
|
91633
91701
|
);
|
91634
|
-
map2.sourceRoot =
|
91702
|
+
map2.sourceRoot = import_node_path13.default.relative(sourceRootPath, map2.sourceRoot);
|
91635
91703
|
}
|
91636
91704
|
map2.sources = map2.sources.map((source) => {
|
91637
|
-
const originalPath =
|
91638
|
-
return
|
91705
|
+
const originalPath = import_node_path13.default.join(import_node_path13.default.dirname(filePath), source);
|
91706
|
+
return import_node_path13.default.relative(entryDirectory, originalPath);
|
91639
91707
|
});
|
91640
91708
|
return [
|
91641
91709
|
{
|
@@ -91695,14 +91763,14 @@ function sourceMapForModule(module3) {
|
|
91695
91763
|
if (sourceMapUrl === void 0) {
|
91696
91764
|
return;
|
91697
91765
|
}
|
91698
|
-
const sourcemapPath =
|
91699
|
-
if (!
|
91766
|
+
const sourcemapPath = import_node_path13.default.join(import_node_path13.default.dirname(module3.filePath), sourceMapUrl);
|
91767
|
+
if (!import_node_fs7.default.existsSync(sourcemapPath)) {
|
91700
91768
|
throw new Error(
|
91701
91769
|
`Invalid source map path in ${module3.filePath}: ${sourcemapPath} does not exist.`
|
91702
91770
|
);
|
91703
91771
|
}
|
91704
91772
|
const map2 = JSON.parse(
|
91705
|
-
|
91773
|
+
import_node_fs7.default.readFileSync(sourcemapPath, "utf8")
|
91706
91774
|
);
|
91707
91775
|
map2.file = module3.name;
|
91708
91776
|
if (map2.sourceRoot) {
|
@@ -91732,12 +91800,18 @@ function stripPrefix(prefix, input) {
|
|
91732
91800
|
__name(stripPrefix, "stripPrefix");
|
91733
91801
|
|
91734
91802
|
// src/deployment-bundle/find-additional-modules.ts
|
91735
|
-
async function* getFiles(
|
91736
|
-
|
91803
|
+
async function* getFiles(configPath, moduleRoot, relativeTo, projectRoot) {
|
91804
|
+
const wranglerHiddenDirPath = getWranglerHiddenDirPath(projectRoot);
|
91805
|
+
for (const file of await (0, import_promises3.readdir)(moduleRoot, { withFileTypes: true })) {
|
91806
|
+
const absPath = import_node_path14.default.join(moduleRoot, file.name);
|
91737
91807
|
if (file.isDirectory()) {
|
91738
|
-
|
91808
|
+
if (absPath !== wranglerHiddenDirPath) {
|
91809
|
+
yield* getFiles(configPath, absPath, relativeTo, projectRoot);
|
91810
|
+
}
|
91739
91811
|
} else {
|
91740
|
-
|
91812
|
+
if (absPath !== configPath) {
|
91813
|
+
yield import_node_path14.default.relative(relativeTo, absPath).replaceAll("\\", "/");
|
91814
|
+
}
|
91741
91815
|
}
|
91742
91816
|
}
|
91743
91817
|
}
|
@@ -91748,8 +91822,13 @@ function isValidPythonPackageName(name2) {
|
|
91748
91822
|
}
|
91749
91823
|
__name(isValidPythonPackageName, "isValidPythonPackageName");
|
91750
91824
|
async function findAdditionalModules(entry, rules, attachSourcemaps = false) {
|
91751
|
-
const files = getFiles(
|
91752
|
-
|
91825
|
+
const files = getFiles(
|
91826
|
+
entry.configPath,
|
91827
|
+
entry.moduleRoot,
|
91828
|
+
entry.moduleRoot,
|
91829
|
+
entry.projectRoot
|
91830
|
+
);
|
91831
|
+
const relativeEntryPoint = import_node_path14.default.relative(entry.moduleRoot, entry.file).replaceAll("\\", "/");
|
91753
91832
|
if (Array.isArray(rules)) {
|
91754
91833
|
rules = parseRules(rules);
|
91755
91834
|
}
|
@@ -91762,7 +91841,7 @@ async function findAdditionalModules(entry, rules, attachSourcemaps = false) {
|
|
91762
91841
|
let pythonRequirements = "";
|
91763
91842
|
try {
|
91764
91843
|
pythonRequirements = await (0, import_promises3.readFile)(
|
91765
|
-
|
91844
|
+
import_node_path14.default.resolve(entry.projectRoot, "requirements.txt"),
|
91766
91845
|
"utf-8"
|
91767
91846
|
);
|
91768
91847
|
} catch (e7) {
|
@@ -91826,7 +91905,7 @@ async function matchFiles(files, relativeTo, { rules, removedRules }) {
|
|
91826
91905
|
if (!regexp.test(filePath)) {
|
91827
91906
|
continue;
|
91828
91907
|
}
|
91829
|
-
const absoluteFilePath =
|
91908
|
+
const absoluteFilePath = import_node_path14.default.join(relativeTo, filePath);
|
91830
91909
|
const fileContent = await (0, import_promises3.readFile)(
|
91831
91910
|
absoluteFilePath
|
91832
91911
|
);
|
@@ -91871,19 +91950,19 @@ async function* findAdditionalModuleWatchDirs(root) {
|
|
91871
91950
|
if (entry.name === "node_modules" || entry.name === ".git") {
|
91872
91951
|
continue;
|
91873
91952
|
}
|
91874
|
-
yield* findAdditionalModuleWatchDirs(
|
91953
|
+
yield* findAdditionalModuleWatchDirs(import_node_path14.default.join(root, entry.name));
|
91875
91954
|
}
|
91876
91955
|
}
|
91877
91956
|
}
|
91878
91957
|
__name(findAdditionalModuleWatchDirs, "findAdditionalModuleWatchDirs");
|
91879
91958
|
async function writeAdditionalModules(modules, destination) {
|
91880
91959
|
for (const module3 of modules) {
|
91881
|
-
const modulePath =
|
91960
|
+
const modulePath = import_node_path14.default.resolve(destination, module3.name);
|
91882
91961
|
logger.debug("Writing additional module to output", modulePath);
|
91883
|
-
await (0, import_promises3.mkdir)(
|
91962
|
+
await (0, import_promises3.mkdir)(import_node_path14.default.dirname(modulePath), { recursive: true });
|
91884
91963
|
await (0, import_promises3.writeFile)(modulePath, module3.content);
|
91885
91964
|
if (module3.sourceMap) {
|
91886
|
-
const sourcemapPath =
|
91965
|
+
const sourcemapPath = import_node_path14.default.resolve(destination, module3.sourceMap.name);
|
91887
91966
|
await (0, import_promises3.writeFile)(sourcemapPath, module3.sourceMap.content);
|
91888
91967
|
}
|
91889
91968
|
}
|
@@ -91942,7 +92021,7 @@ function createModuleCollector(props) {
|
|
91942
92021
|
}
|
91943
92022
|
const found = await findAdditionalModules(props.entry, parsedRules);
|
91944
92023
|
foundModulePaths = found.map(
|
91945
|
-
({ name: name2 }) =>
|
92024
|
+
({ name: name2 }) => import_node_path15.default.resolve(props.entry.moduleRoot, name2)
|
91946
92025
|
);
|
91947
92026
|
modules.push(...found);
|
91948
92027
|
}
|
@@ -91957,7 +92036,7 @@ function createModuleCollector(props) {
|
|
91957
92036
|
const watchDirs = [];
|
91958
92037
|
if (props.findAdditionalModules) {
|
91959
92038
|
watchFiles = foundModulePaths;
|
91960
|
-
const root =
|
92039
|
+
const root = import_node_path15.default.resolve(props.entry.moduleRoot);
|
91961
92040
|
for await (const dir of findAdditionalModuleWatchDirs(root)) {
|
91962
92041
|
watchDirs.push(dir);
|
91963
92042
|
}
|
@@ -91986,12 +92065,12 @@ function createModuleCollector(props) {
|
|
91986
92065
|
return;
|
91987
92066
|
}
|
91988
92067
|
logger.warn(
|
91989
|
-
`Deprecation: detected a legacy module import in "./${
|
92068
|
+
`Deprecation: detected a legacy module import in "./${import_node_path15.default.relative(
|
91990
92069
|
process.cwd(),
|
91991
92070
|
args.importer
|
91992
92071
|
)}". This will stop working in the future. Replace references to "${args.path}" with "./${args.path}";`
|
91993
92072
|
);
|
91994
|
-
const filePath =
|
92073
|
+
const filePath = import_node_path15.default.join(
|
91995
92074
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
91996
92075
|
props.wrangler1xLegacyModuleReferences.rootDirectory,
|
91997
92076
|
args.path
|
@@ -92000,7 +92079,7 @@ function createModuleCollector(props) {
|
|
92000
92079
|
filePath
|
92001
92080
|
);
|
92002
92081
|
const fileHash = import_node_crypto3.default.createHash("sha1").update(fileContent).digest("hex");
|
92003
|
-
const fileName = props.preserveFileNames ? args.path : `./${fileHash}-${
|
92082
|
+
const fileName = props.preserveFileNames ? args.path : `./${fileHash}-${import_node_path15.default.basename(args.path)}`;
|
92004
92083
|
const { rule } = rulesMatchers.find(({ regex: regex2 }) => regex2.test(fileName)) || {};
|
92005
92084
|
if (rule) {
|
92006
92085
|
modules.push({
|
@@ -92034,7 +92113,7 @@ function createModuleCollector(props) {
|
|
92034
92113
|
if (args.pluginData?.skip) {
|
92035
92114
|
return;
|
92036
92115
|
}
|
92037
|
-
let filePath =
|
92116
|
+
let filePath = import_node_path15.default.join(args.resolveDir, args.path);
|
92038
92117
|
if (foundModulePaths.includes(filePath)) {
|
92039
92118
|
return { path: args.path, external: true };
|
92040
92119
|
}
|
@@ -92065,7 +92144,7 @@ function createModuleCollector(props) {
|
|
92065
92144
|
filePath
|
92066
92145
|
);
|
92067
92146
|
const fileHash = import_node_crypto3.default.createHash("sha1").update(fileContent).digest("hex");
|
92068
|
-
const fileName = props.preserveFileNames ? args.path : `./${fileHash}-${
|
92147
|
+
const fileName = props.preserveFileNames ? args.path : `./${fileHash}-${import_node_path15.default.basename(args.path)}`;
|
92069
92148
|
modules.push({
|
92070
92149
|
name: fileName,
|
92071
92150
|
filePath,
|
@@ -92127,8 +92206,8 @@ function getWrangler1xLegacyModuleReferences(rootDirectory, entryPath) {
|
|
92127
92206
|
return {
|
92128
92207
|
rootDirectory,
|
92129
92208
|
fileNames: new Set(
|
92130
|
-
(0,
|
92131
|
-
(dirEntry) => dirEntry.isFile() && dirEntry.name !==
|
92209
|
+
(0, import_node_fs8.readdirSync)(rootDirectory, { withFileTypes: true }).filter(
|
92210
|
+
(dirEntry) => dirEntry.isFile() && dirEntry.name !== import_node_path15.default.basename(entryPath)
|
92132
92211
|
).map((dirEnt) => dirEnt.name)
|
92133
92212
|
)
|
92134
92213
|
};
|
@@ -92895,7 +92974,7 @@ async function buildSourceOptions(config) {
|
|
92895
92974
|
config.bundle.modules
|
92896
92975
|
);
|
92897
92976
|
const entrypointNames = isPython ? [] : config.bundle.entry.exports;
|
92898
|
-
const modulesRoot =
|
92977
|
+
const modulesRoot = import_node_path16.default.dirname(scriptPath3);
|
92899
92978
|
const sourceOptions = {
|
92900
92979
|
modulesRoot,
|
92901
92980
|
modules: [
|
@@ -92908,7 +92987,7 @@ async function buildSourceOptions(config) {
|
|
92908
92987
|
// Misc (WebAssembly, etc, ...)
|
92909
92988
|
...modules.map((module3) => ({
|
92910
92989
|
type: ModuleTypeToRuleType[module3.type ?? "esm"],
|
92911
|
-
path:
|
92990
|
+
path: import_node_path16.default.resolve(modulesRoot, module3.name),
|
92912
92991
|
contents: module3.content
|
92913
92992
|
}))
|
92914
92993
|
]
|
@@ -92989,14 +93068,14 @@ function buildMiniflareBindingOptions(config) {
|
|
92989
93068
|
const wasmBindings = { ...bindings.wasm_modules };
|
92990
93069
|
if (config.format === "service-worker" && config.bundle) {
|
92991
93070
|
const scriptPath3 = config.bundle.path;
|
92992
|
-
const modulesRoot =
|
93071
|
+
const modulesRoot = import_node_path16.default.dirname(scriptPath3);
|
92993
93072
|
for (const { type, name: name2 } of config.bundle.modules) {
|
92994
93073
|
if (type === "text") {
|
92995
|
-
textBlobBindings[getIdentifier(name2)] =
|
93074
|
+
textBlobBindings[getIdentifier(name2)] = import_node_path16.default.resolve(modulesRoot, name2);
|
92996
93075
|
} else if (type === "buffer") {
|
92997
|
-
dataBlobBindings[getIdentifier(name2)] =
|
93076
|
+
dataBlobBindings[getIdentifier(name2)] = import_node_path16.default.resolve(modulesRoot, name2);
|
92998
93077
|
} else if (type === "compiled-wasm") {
|
92999
|
-
wasmBindings[getIdentifier(name2)] =
|
93078
|
+
wasmBindings[getIdentifier(name2)] = import_node_path16.default.resolve(modulesRoot, name2);
|
93000
93079
|
}
|
93001
93080
|
}
|
93002
93081
|
}
|
@@ -93310,16 +93389,16 @@ function buildMiniflareBindingOptions(config) {
|
|
93310
93389
|
__name(buildMiniflareBindingOptions, "buildMiniflareBindingOptions");
|
93311
93390
|
function buildPersistOptions(localPersistencePath) {
|
93312
93391
|
if (localPersistencePath !== null) {
|
93313
|
-
const v3Path =
|
93392
|
+
const v3Path = import_node_path16.default.join(localPersistencePath, "v3");
|
93314
93393
|
return {
|
93315
|
-
cachePersist:
|
93316
|
-
durableObjectsPersist:
|
93317
|
-
kvPersist:
|
93318
|
-
r2Persist:
|
93319
|
-
d1Persist:
|
93320
|
-
workflowsPersist:
|
93321
|
-
secretsStorePersist:
|
93322
|
-
analyticsEngineDatasetsPersist:
|
93394
|
+
cachePersist: import_node_path16.default.join(v3Path, "cache"),
|
93395
|
+
durableObjectsPersist: import_node_path16.default.join(v3Path, "do"),
|
93396
|
+
kvPersist: import_node_path16.default.join(v3Path, "kv"),
|
93397
|
+
r2Persist: import_node_path16.default.join(v3Path, "r2"),
|
93398
|
+
d1Persist: import_node_path16.default.join(v3Path, "d1"),
|
93399
|
+
workflowsPersist: import_node_path16.default.join(v3Path, "workflows"),
|
93400
|
+
secretsStorePersist: import_node_path16.default.join(v3Path, "secrets-store"),
|
93401
|
+
analyticsEngineDatasetsPersist: import_node_path16.default.join(v3Path, "analytics-engine")
|
93323
93402
|
};
|
93324
93403
|
}
|
93325
93404
|
}
|
@@ -93343,7 +93422,7 @@ function buildSitesOptions({
|
|
93343
93422
|
if (legacyAssetPaths !== void 0) {
|
93344
93423
|
const { baseDirectory, assetDirectory, includePatterns, excludePatterns } = legacyAssetPaths;
|
93345
93424
|
return {
|
93346
|
-
sitePath:
|
93425
|
+
sitePath: import_node_path16.default.join(baseDirectory, assetDirectory),
|
93347
93426
|
siteInclude: includePatterns.length > 0 ? includePatterns : void 0,
|
93348
93427
|
siteExclude: excludePatterns.length > 0 ? excludePatterns : void 0
|
93349
93428
|
};
|
@@ -94318,19 +94397,19 @@ init_import_meta_url();
|
|
94318
94397
|
var import_node_assert9 = __toESM(require("node:assert"));
|
94319
94398
|
var import_node_crypto7 = require("node:crypto");
|
94320
94399
|
var import_node_events2 = __toESM(require("node:events"));
|
94321
|
-
var
|
94400
|
+
var import_node_path20 = __toESM(require("node:path"));
|
94322
94401
|
var import_miniflare10 = require("miniflare");
|
94323
94402
|
|
94324
94403
|
// embed-worker:/home/runner/work/workers-sdk/workers-sdk/packages/wrangler/templates/startDevWorker/InspectorProxyWorker.ts
|
94325
94404
|
init_import_meta_url();
|
94326
|
-
var
|
94327
|
-
var scriptPath =
|
94405
|
+
var import_node_path17 = __toESM(require("node:path"));
|
94406
|
+
var scriptPath = import_node_path17.default.resolve(__dirname, "..", "wrangler-dist/InspectorProxyWorker.js");
|
94328
94407
|
var InspectorProxyWorker_default = scriptPath;
|
94329
94408
|
|
94330
94409
|
// embed-worker:/home/runner/work/workers-sdk/workers-sdk/packages/wrangler/templates/startDevWorker/ProxyWorker.ts
|
94331
94410
|
init_import_meta_url();
|
94332
|
-
var
|
94333
|
-
var scriptPath2 =
|
94411
|
+
var import_node_path18 = __toESM(require("node:path"));
|
94412
|
+
var scriptPath2 = import_node_path18.default.resolve(__dirname, "..", "wrangler-dist/ProxyWorker.js");
|
94334
94413
|
var ProxyWorker_default = scriptPath2;
|
94335
94414
|
|
94336
94415
|
// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/wrapper.mjs
|
@@ -94353,8 +94432,8 @@ var import_open2 = __toESM(require_open());
|
|
94353
94432
|
// src/api/startDevWorker/bundle-allowed-paths.ts
|
94354
94433
|
init_import_meta_url();
|
94355
94434
|
var import_node_assert8 = __toESM(require("node:assert"));
|
94356
|
-
var
|
94357
|
-
var
|
94435
|
+
var import_node_fs9 = __toESM(require("node:fs"));
|
94436
|
+
var import_node_path19 = __toESM(require("node:path"));
|
94358
94437
|
var import_node_url6 = require("node:url");
|
94359
94438
|
function isAllowedSourcePath(bundle, filePath) {
|
94360
94439
|
const allowed = getBundleReferencedPaths(bundle);
|
@@ -94381,12 +94460,12 @@ function getBundleReferencedPaths(bundle) {
|
|
94381
94460
|
}
|
94382
94461
|
const sourceMappingPath = (0, import_node_url6.fileURLToPath)(sourceMappingURL);
|
94383
94462
|
allowed.sourceMapPaths.add(sourceMappingPath);
|
94384
|
-
const sourceMapData =
|
94463
|
+
const sourceMapData = import_node_fs9.default.readFileSync(sourceMappingPath, "utf8");
|
94385
94464
|
const sourceMap = JSON.parse(sourceMapData);
|
94386
94465
|
const sourceRoot = sourceMap.sourceRoot ?? "";
|
94387
94466
|
for (const source of sourceMap.sources) {
|
94388
94467
|
const sourceURL = new URL(
|
94389
|
-
|
94468
|
+
import_node_path19.default.posix.join(sourceRoot, source),
|
94390
94469
|
sourceMappingURL
|
94391
94470
|
);
|
94392
94471
|
allowed.sourcePaths.add((0, import_node_url6.fileURLToPath)(sourceURL));
|
@@ -94409,7 +94488,7 @@ function* getBundleSourcePaths(bundle) {
|
|
94409
94488
|
}
|
94410
94489
|
__name(getBundleSourcePaths, "getBundleSourcePaths");
|
94411
94490
|
function maybeGetSourceMappingURL(sourcePath) {
|
94412
|
-
const source =
|
94491
|
+
const source = import_node_fs9.default.readFileSync(sourcePath, "utf8");
|
94413
94492
|
const sourceMappingURLIndex = source.lastIndexOf("//# sourceMappingURL=");
|
94414
94493
|
if (sourceMappingURLIndex === -1) {
|
94415
94494
|
return;
|
@@ -94628,8 +94707,8 @@ var openInspector = /* @__PURE__ */ __name(async (inspectorPort, worker) => {
|
|
94628
94707
|
|
94629
94708
|
// src/https-options.ts
|
94630
94709
|
init_import_meta_url();
|
94631
|
-
var
|
94632
|
-
var
|
94710
|
+
var fs8 = __toESM(require("node:fs"));
|
94711
|
+
var path21 = __toESM(require("node:path"));
|
94633
94712
|
var import_miniflare9 = require("miniflare");
|
94634
94713
|
var CERT_EXPIRY_DAYS = 30;
|
94635
94714
|
var ONE_DAY_IN_MS = 864e5;
|
@@ -94646,37 +94725,37 @@ function getHttpsOptions(customHttpsKeyPath = getHttpsKeyPathFromEnv(), customHt
|
|
94646
94725
|
"Must specify both certificate path and key path to use a Custom Certificate."
|
94647
94726
|
);
|
94648
94727
|
}
|
94649
|
-
if (!
|
94728
|
+
if (!fs8.existsSync(customHttpsKeyPath)) {
|
94650
94729
|
throw new UserError(
|
94651
94730
|
"Missing Custom Certificate Key at " + customHttpsKeyPath
|
94652
94731
|
);
|
94653
94732
|
}
|
94654
|
-
if (!
|
94733
|
+
if (!fs8.existsSync(customHttpsCertPath)) {
|
94655
94734
|
throw new UserError(
|
94656
94735
|
"Missing Custom Certificate File at " + customHttpsCertPath
|
94657
94736
|
);
|
94658
94737
|
}
|
94659
94738
|
logger.log("Using custom certificate at ", customHttpsKeyPath);
|
94660
94739
|
return {
|
94661
|
-
key:
|
94662
|
-
cert:
|
94740
|
+
key: fs8.readFileSync(customHttpsKeyPath, "utf8"),
|
94741
|
+
cert: fs8.readFileSync(customHttpsCertPath, "utf8")
|
94663
94742
|
};
|
94664
94743
|
}
|
94665
|
-
const certDirectory =
|
94666
|
-
const keyPath =
|
94667
|
-
const certPath =
|
94668
|
-
const regenerate = !
|
94744
|
+
const certDirectory = path21.join(getGlobalWranglerConfigPath(), "local-cert");
|
94745
|
+
const keyPath = path21.join(certDirectory, "key.pem");
|
94746
|
+
const certPath = path21.join(certDirectory, "cert.pem");
|
94747
|
+
const regenerate = !fs8.existsSync(keyPath) || !fs8.existsSync(certPath) || hasCertificateExpired(keyPath, certPath);
|
94669
94748
|
if (regenerate) {
|
94670
94749
|
logger.log("Generating new self-signed certificate...");
|
94671
94750
|
const { key, cert } = generateCertificate();
|
94672
94751
|
try {
|
94673
|
-
|
94674
|
-
|
94675
|
-
|
94752
|
+
fs8.mkdirSync(certDirectory, { recursive: true });
|
94753
|
+
fs8.writeFileSync(keyPath, key, "utf8");
|
94754
|
+
fs8.writeFileSync(certPath, cert, "utf8");
|
94676
94755
|
} catch (e7) {
|
94677
94756
|
const message = e7 instanceof Error ? e7.message : `${e7}`;
|
94678
94757
|
logger.warn(
|
94679
|
-
`Unable to cache generated self-signed certificate in ${
|
94758
|
+
`Unable to cache generated self-signed certificate in ${path21.relative(
|
94680
94759
|
process.cwd(),
|
94681
94760
|
certDirectory
|
94682
94761
|
)}.
|
@@ -94686,15 +94765,15 @@ ${message}`
|
|
94686
94765
|
return { key, cert };
|
94687
94766
|
} else {
|
94688
94767
|
return {
|
94689
|
-
key:
|
94690
|
-
cert:
|
94768
|
+
key: fs8.readFileSync(keyPath, "utf8"),
|
94769
|
+
cert: fs8.readFileSync(certPath, "utf8")
|
94691
94770
|
};
|
94692
94771
|
}
|
94693
94772
|
}
|
94694
94773
|
__name(getHttpsOptions, "getHttpsOptions");
|
94695
94774
|
function hasCertificateExpired(keyPath, certPath) {
|
94696
|
-
const keyStat =
|
94697
|
-
const certStat =
|
94775
|
+
const keyStat = fs8.statSync(keyPath);
|
94776
|
+
const certStat = fs8.statSync(certPath);
|
94698
94777
|
const created = Math.max(keyStat.mtimeMs, certStat.mtimeMs);
|
94699
94778
|
return Date.now() - created > (CERT_EXPIRY_DAYS - 2) * ONE_DAY_IN_MS;
|
94700
94779
|
}
|
@@ -94772,7 +94851,7 @@ var ProxyController = class extends Controller {
|
|
94772
94851
|
name: "ProxyWorker",
|
94773
94852
|
compatibilityDate: "2023-12-18",
|
94774
94853
|
compatibilityFlags: ["nodejs_compat"],
|
94775
|
-
modulesRoot:
|
94854
|
+
modulesRoot: import_node_path20.default.dirname(ProxyWorker_default),
|
94776
94855
|
modules: [{ type: "ESModule", path: ProxyWorker_default }],
|
94777
94856
|
durableObjects: {
|
94778
94857
|
DURABLE_OBJECT: {
|
@@ -94801,7 +94880,7 @@ var ProxyController = class extends Controller {
|
|
94801
94880
|
"nodejs_compat",
|
94802
94881
|
"increase_websocket_message_size"
|
94803
94882
|
],
|
94804
|
-
modulesRoot:
|
94883
|
+
modulesRoot: import_node_path20.default.dirname(InspectorProxyWorker_default),
|
94805
94884
|
modules: [{ type: "ESModule", path: InspectorProxyWorker_default }],
|
94806
94885
|
durableObjects: {
|
94807
94886
|
DURABLE_OBJECT: {
|
@@ -99894,16 +99973,16 @@ var import_undici4 = __toESM(require_undici());
|
|
99894
99973
|
|
99895
99974
|
// src/dev/get-local-persistence-path.ts
|
99896
99975
|
init_import_meta_url();
|
99897
|
-
var
|
99976
|
+
var import_node_path21 = __toESM(require("node:path"));
|
99898
99977
|
function getLocalPersistencePath(persistTo, { userConfigPath }) {
|
99899
99978
|
return persistTo ? (
|
99900
99979
|
// If path specified, always treat it as relative to cwd()
|
99901
|
-
|
99980
|
+
import_node_path21.default.resolve(process.cwd(), persistTo)
|
99902
99981
|
) : (
|
99903
99982
|
// Otherwise, treat it as relative to the Wrangler configuration file,
|
99904
99983
|
// if one can be found, otherwise cwd()
|
99905
|
-
|
99906
|
-
userConfigPath ?
|
99984
|
+
import_node_path21.default.resolve(
|
99985
|
+
userConfigPath ? import_node_path21.default.dirname(userConfigPath) : process.cwd(),
|
99907
99986
|
".wrangler/state"
|
99908
99987
|
)
|
99909
99988
|
);
|
@@ -100201,7 +100280,7 @@ var import_node_process9 = require("node:process");
|
|
100201
100280
|
// ../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/index.js
|
100202
100281
|
init_import_meta_url();
|
100203
100282
|
var import_node_buffer2 = require("node:buffer");
|
100204
|
-
var
|
100283
|
+
var import_node_path23 = __toESM(require("node:path"), 1);
|
100205
100284
|
var import_node_child_process = __toESM(require("node:child_process"), 1);
|
100206
100285
|
var import_node_process8 = __toESM(require("node:process"), 1);
|
100207
100286
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
@@ -100224,7 +100303,7 @@ __name(stripFinalNewline, "stripFinalNewline");
|
|
100224
100303
|
// ../../node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js
|
100225
100304
|
init_import_meta_url();
|
100226
100305
|
var import_node_process7 = __toESM(require("node:process"), 1);
|
100227
|
-
var
|
100306
|
+
var import_node_path22 = __toESM(require("node:path"), 1);
|
100228
100307
|
var import_node_url9 = __toESM(require("node:url"), 1);
|
100229
100308
|
|
100230
100309
|
// ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
@@ -100250,15 +100329,15 @@ function npmRunPath(options = {}) {
|
|
100250
100329
|
} = options;
|
100251
100330
|
let previous;
|
100252
100331
|
const cwdString = cwd2 instanceof URL ? import_node_url9.default.fileURLToPath(cwd2) : cwd2;
|
100253
|
-
let cwdPath =
|
100332
|
+
let cwdPath = import_node_path22.default.resolve(cwdString);
|
100254
100333
|
const result = [];
|
100255
100334
|
while (previous !== cwdPath) {
|
100256
|
-
result.push(
|
100335
|
+
result.push(import_node_path22.default.join(cwdPath, "node_modules/.bin"));
|
100257
100336
|
previous = cwdPath;
|
100258
|
-
cwdPath =
|
100337
|
+
cwdPath = import_node_path22.default.resolve(cwdPath, "..");
|
100259
100338
|
}
|
100260
|
-
result.push(
|
100261
|
-
return [...result, path_].join(
|
100339
|
+
result.push(import_node_path22.default.resolve(cwdString, execPath, ".."));
|
100340
|
+
return [...result, path_].join(import_node_path22.default.delimiter);
|
100262
100341
|
}
|
100263
100342
|
__name(npmRunPath, "npmRunPath");
|
100264
100343
|
function npmRunPathEnv({ env: env6 = import_node_process7.default.env, ...options } = {}) {
|
@@ -100819,7 +100898,7 @@ var normalizeStdio = /* @__PURE__ */ __name((options) => {
|
|
100819
100898
|
// ../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/kill.js
|
100820
100899
|
init_import_meta_url();
|
100821
100900
|
var import_node_os4 = __toESM(require("node:os"), 1);
|
100822
|
-
var
|
100901
|
+
var import_signal_exit4 = __toESM(require_signal_exit(), 1);
|
100823
100902
|
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
100824
100903
|
var spawnedKill = /* @__PURE__ */ __name((kill, signal = "SIGTERM", options = {}) => {
|
100825
100904
|
const killResult = kill(signal);
|
@@ -100883,7 +100962,7 @@ var setExitHandler = /* @__PURE__ */ __name(async (spawned, { cleanup, detached
|
|
100883
100962
|
if (!cleanup || detached) {
|
100884
100963
|
return timedPromise;
|
100885
100964
|
}
|
100886
|
-
const removeExitHandler = (0,
|
100965
|
+
const removeExitHandler = (0, import_signal_exit4.default)(() => {
|
100887
100966
|
spawned.kill();
|
100888
100967
|
});
|
100889
100968
|
return timedPromise.finally(() => {
|
@@ -101060,7 +101139,7 @@ var handleArguments = /* @__PURE__ */ __name((file, args, options = {}) => {
|
|
101060
101139
|
};
|
101061
101140
|
options.env = getEnv(options);
|
101062
101141
|
options.stdio = normalizeStdio(options);
|
101063
|
-
if (import_node_process8.default.platform === "win32" &&
|
101142
|
+
if (import_node_process8.default.platform === "win32" && import_node_path23.default.basename(file, ".exe") === "cmd") {
|
101064
101143
|
args.unshift("/q");
|
101065
101144
|
}
|
101066
101145
|
return { file, args, options, parsed };
|
@@ -101334,8 +101413,8 @@ __name(getNodeVersion, "getNodeVersion");
|
|
101334
101413
|
// src/metrics/metrics-config.ts
|
101335
101414
|
init_import_meta_url();
|
101336
101415
|
var import_node_crypto8 = require("node:crypto");
|
101337
|
-
var
|
101338
|
-
var
|
101416
|
+
var import_node_fs10 = require("node:fs");
|
101417
|
+
var import_node_path24 = __toESM(require("node:path"));
|
101339
101418
|
var CURRENT_METRICS_DATE = new Date(2022, 6, 4);
|
101340
101419
|
function getMetricsConfig({
|
101341
101420
|
sendMetrics
|
@@ -101374,8 +101453,8 @@ function getMetricsConfig({
|
|
101374
101453
|
}
|
101375
101454
|
__name(getMetricsConfig, "getMetricsConfig");
|
101376
101455
|
function writeMetricsConfig(config) {
|
101377
|
-
(0,
|
101378
|
-
(0,
|
101456
|
+
(0, import_node_fs10.mkdirSync)(import_node_path24.default.dirname(getMetricsConfigPath()), { recursive: true });
|
101457
|
+
(0, import_node_fs10.writeFileSync)(
|
101379
101458
|
getMetricsConfigPath(),
|
101380
101459
|
JSON.stringify(
|
101381
101460
|
config,
|
@@ -101387,7 +101466,7 @@ function writeMetricsConfig(config) {
|
|
101387
101466
|
__name(writeMetricsConfig, "writeMetricsConfig");
|
101388
101467
|
function readMetricsConfig() {
|
101389
101468
|
try {
|
101390
|
-
const config = (0,
|
101469
|
+
const config = (0, import_node_fs10.readFileSync)(getMetricsConfigPath(), "utf8");
|
101391
101470
|
return JSON.parse(
|
101392
101471
|
config,
|
101393
101472
|
(key, value) => key === "date" ? new Date(value) : value
|
@@ -101407,7 +101486,7 @@ function updateMetricsPermission(enabled) {
|
|
101407
101486
|
}
|
101408
101487
|
__name(updateMetricsPermission, "updateMetricsPermission");
|
101409
101488
|
function getMetricsConfigPath() {
|
101410
|
-
return
|
101489
|
+
return import_node_path24.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
|
101411
101490
|
}
|
101412
101491
|
__name(getMetricsConfigPath, "getMetricsConfigPath");
|
101413
101492
|
function getDeviceId(config) {
|
@@ -101675,7 +101754,7 @@ __name(getMetricsUsageHeaders, "getMetricsUsageHeaders");
|
|
101675
101754
|
|
101676
101755
|
// src/r2/helpers.ts
|
101677
101756
|
init_import_meta_url();
|
101678
|
-
var
|
101757
|
+
var fs9 = __toESM(require("node:fs"));
|
101679
101758
|
var import_web = require("node:stream/web");
|
101680
101759
|
var import_miniflare14 = require("miniflare");
|
101681
101760
|
|
@@ -102720,7 +102799,7 @@ function isValidR2BucketName(name2) {
|
|
102720
102799
|
__name(isValidR2BucketName, "isValidR2BucketName");
|
102721
102800
|
var CHUNK_SIZE = 1024;
|
102722
102801
|
async function createFileReadableStream(filePath) {
|
102723
|
-
const handle = await
|
102802
|
+
const handle = await fs9.promises.open(filePath, "r");
|
102724
102803
|
let position = 0;
|
102725
102804
|
return new import_web.ReadableStream({
|
102726
102805
|
async pull(controller) {
|
@@ -103159,62 +103238,6 @@ var fs11 = __toESM(require("node:fs"));
|
|
103159
103238
|
var path28 = __toESM(require("node:path"));
|
103160
103239
|
var esbuild = __toESM(require("esbuild"));
|
103161
103240
|
|
103162
|
-
// src/paths.ts
|
103163
|
-
init_import_meta_url();
|
103164
|
-
var import_node_console = require("node:console");
|
103165
|
-
var import_node_fs10 = __toESM(require("node:fs"));
|
103166
|
-
var import_node_path24 = __toESM(require("node:path"));
|
103167
|
-
var import_signal_exit4 = __toESM(require_signal_exit());
|
103168
|
-
function toUrlPath(filePath) {
|
103169
|
-
(0, import_node_console.assert)(
|
103170
|
-
!/^[a-z]:/i.test(filePath),
|
103171
|
-
"Tried to convert a Windows file path with a drive to a URL path."
|
103172
|
-
);
|
103173
|
-
return filePath.replace(/\\/g, "/");
|
103174
|
-
}
|
103175
|
-
__name(toUrlPath, "toUrlPath");
|
103176
|
-
function readableRelative(to) {
|
103177
|
-
const relativePath = import_node_path24.default.relative(process.cwd(), to);
|
103178
|
-
if (
|
103179
|
-
// No directory nesting, return as-is
|
103180
|
-
import_node_path24.default.basename(relativePath) === relativePath || // Outside current directory
|
103181
|
-
relativePath.startsWith(".")
|
103182
|
-
) {
|
103183
|
-
return relativePath;
|
103184
|
-
} else {
|
103185
|
-
return "./" + relativePath;
|
103186
|
-
}
|
103187
|
-
}
|
103188
|
-
__name(readableRelative, "readableRelative");
|
103189
|
-
function getBasePath() {
|
103190
|
-
return import_node_path24.default.resolve(__dirname, "..");
|
103191
|
-
}
|
103192
|
-
__name(getBasePath, "getBasePath");
|
103193
|
-
function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
|
103194
|
-
projectRoot ??= process.cwd();
|
103195
|
-
const tmpRoot = import_node_path24.default.join(projectRoot, ".wrangler", "tmp");
|
103196
|
-
import_node_fs10.default.mkdirSync(tmpRoot, { recursive: true });
|
103197
|
-
const tmpPrefix = import_node_path24.default.join(tmpRoot, `${prefix}-`);
|
103198
|
-
const tmpDir = import_node_fs10.default.realpathSync(import_node_fs10.default.mkdtempSync(tmpPrefix));
|
103199
|
-
const removeDir = /* @__PURE__ */ __name(() => {
|
103200
|
-
if (cleanup) {
|
103201
|
-
try {
|
103202
|
-
return import_node_fs10.default.rmSync(tmpDir, { recursive: true, force: true });
|
103203
|
-
} catch (e7) {
|
103204
|
-
}
|
103205
|
-
}
|
103206
|
-
}, "removeDir");
|
103207
|
-
const removeExitListener = (0, import_signal_exit4.default)(removeDir);
|
103208
|
-
return {
|
103209
|
-
path: tmpDir,
|
103210
|
-
remove() {
|
103211
|
-
removeExitListener();
|
103212
|
-
removeDir();
|
103213
|
-
}
|
103214
|
-
};
|
103215
|
-
}
|
103216
|
-
__name(getWranglerTmpDir, "getWranglerTmpDir");
|
103217
|
-
|
103218
103241
|
// src/deployment-bundle/apply-middleware.ts
|
103219
103242
|
init_import_meta_url();
|
103220
103243
|
var fs10 = __toESM(require("node:fs"));
|
@@ -115139,7 +115162,8 @@ function createHandler(def) {
|
|
115139
115162
|
}
|
115140
115163
|
const experimentalFlags = def.behaviour?.overrideExperimentalFlags ? def.behaviour?.overrideExperimentalFlags(args) : {
|
115141
115164
|
MULTIWORKER: false,
|
115142
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
115165
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
115166
|
+
MIXED_MODE: args.experimentalMixedMode ?? false
|
115143
115167
|
};
|
115144
115168
|
await run(
|
115145
115169
|
experimentalFlags,
|
@@ -117496,6 +117520,7 @@ ${migrateUrl}`
|
|
117496
117520
|
return {
|
117497
117521
|
file: paths.absolutePath,
|
117498
117522
|
projectRoot,
|
117523
|
+
configPath: config.configPath,
|
117499
117524
|
format: format9,
|
117500
117525
|
moduleRoot: args.moduleRoot ?? config.base_dir ?? import_node_path32.default.dirname(paths.absolutePath),
|
117501
117526
|
name: config.name ?? "worker",
|
@@ -117848,7 +117873,8 @@ var deployCommand = createCommand({
|
|
117848
117873
|
useConfigRedirectIfAvailable: true,
|
117849
117874
|
overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
|
117850
117875
|
MULTIWORKER: false,
|
117851
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
117876
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
117877
|
+
MIXED_MODE: false
|
117852
117878
|
}), "overrideExperimentalFlags")
|
117853
117879
|
},
|
117854
117880
|
validateArgs(args) {
|
@@ -120539,6 +120565,7 @@ function buildWorkerFromFunctions({
|
|
120539
120565
|
const entry = {
|
120540
120566
|
file: (0, import_node_path38.resolve)(getBasePath(), "templates/pages-template-worker.ts"),
|
120541
120567
|
projectRoot: functionsDirectory,
|
120568
|
+
configPath: void 0,
|
120542
120569
|
format: "modules",
|
120543
120570
|
moduleRoot: functionsDirectory,
|
120544
120571
|
exports: []
|
@@ -120605,6 +120632,7 @@ function buildRawWorker({
|
|
120605
120632
|
const entry = {
|
120606
120633
|
file: workerScriptPath,
|
120607
120634
|
projectRoot: (0, import_node_path38.resolve)(directory),
|
120635
|
+
configPath: void 0,
|
120608
120636
|
format: "modules",
|
120609
120637
|
moduleRoot: (0, import_node_path38.resolve)(directory),
|
120610
120638
|
exports: []
|
@@ -120675,6 +120703,7 @@ async function produceWorkerBundleForWorkerJSDirectory({
|
|
120675
120703
|
{
|
120676
120704
|
file: entrypoint,
|
120677
120705
|
projectRoot: (0, import_node_path38.resolve)(workerJSDirectory),
|
120706
|
+
configPath: void 0,
|
120678
120707
|
format: "modules",
|
120679
120708
|
moduleRoot: (0, import_node_path38.resolve)(workerJSDirectory),
|
120680
120709
|
exports: []
|
@@ -120871,6 +120900,7 @@ function buildPluginFromFunctions({
|
|
120871
120900
|
const entry = {
|
120872
120901
|
file: (0, import_node_path39.resolve)(getBasePath(), "templates/pages-template-plugin.ts"),
|
120873
120902
|
projectRoot: functionsDirectory,
|
120903
|
+
configPath: void 0,
|
120874
120904
|
format: "modules",
|
120875
120905
|
moduleRoot: functionsDirectory,
|
120876
120906
|
exports: []
|
@@ -124588,7 +124618,8 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
124588
124618
|
const devServer = await run(
|
124589
124619
|
{
|
124590
124620
|
MULTIWORKER: Array.isArray(args.config),
|
124591
|
-
RESOURCES_PROVISION: false
|
124621
|
+
RESOURCES_PROVISION: false,
|
124622
|
+
MIXED_MODE: false
|
124592
124623
|
},
|
124593
124624
|
() => startDev({
|
124594
124625
|
script: scriptEntrypoint,
|
@@ -124651,6 +124682,7 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
124651
124682
|
persistTo: args.persistTo,
|
124652
124683
|
logLevel: args.logLevel ?? "log",
|
124653
124684
|
experimentalProvision: void 0,
|
124685
|
+
experimentalMixedMode: false,
|
124654
124686
|
experimentalVectorizeBindToProd: false,
|
124655
124687
|
experimentalImagesLocalMode: false,
|
124656
124688
|
enableIpc: true,
|
@@ -148432,7 +148464,8 @@ var versionsUploadCommand = createCommand({
|
|
148432
148464
|
useConfigRedirectIfAvailable: true,
|
148433
148465
|
overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
|
148434
148466
|
MULTIWORKER: false,
|
148435
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
148467
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
148468
|
+
MIXED_MODE: false
|
148436
148469
|
}), "overrideExperimentalFlags")
|
148437
148470
|
},
|
148438
148471
|
handler: /* @__PURE__ */ __name(async function versionsUploadHandler(args, { config }) {
|
@@ -150667,6 +150700,11 @@ function createCLIParser(argv) {
|
|
150667
150700
|
type: "boolean",
|
150668
150701
|
hidden: true,
|
150669
150702
|
alias: ["x-provision"]
|
150703
|
+
}).option("experimental-mixed-mode", {
|
150704
|
+
describe: `Experimental: Enable Mixed Mode`,
|
150705
|
+
type: "boolean",
|
150706
|
+
hidden: true,
|
150707
|
+
alias: ["x-mixed-mode"]
|
150670
150708
|
}).epilogue(
|
150671
150709
|
`Please report any issues to ${source_default.hex("#3B818D")(
|
150672
150710
|
"https://github.com/cloudflare/workers-sdk/issues/new/choose"
|
@@ -153588,7 +153626,8 @@ var dev = createCommand({
|
|
153588
153626
|
provideConfig: false,
|
153589
153627
|
overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
|
153590
153628
|
MULTIWORKER: Array.isArray(args.config),
|
153591
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
153629
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
153630
|
+
MIXED_MODE: args.experimentalMixedMode ?? false
|
153592
153631
|
}), "overrideExperimentalFlags")
|
153593
153632
|
},
|
153594
153633
|
metadata: {
|
@@ -154459,6 +154498,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
154459
154498
|
logLevel: options?.logLevel ?? defaultLogLevel,
|
154460
154499
|
port: options?.port ?? 0,
|
154461
154500
|
experimentalProvision: void 0,
|
154501
|
+
experimentalMixedMode: false,
|
154462
154502
|
experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
|
154463
154503
|
experimentalImagesLocalMode: imagesLocalMode ?? false,
|
154464
154504
|
enableIpc: options?.experimental?.enableIpc,
|
@@ -154468,7 +154508,8 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
154468
154508
|
{
|
154469
154509
|
// TODO: can we make this work?
|
154470
154510
|
MULTIWORKER: false,
|
154471
|
-
RESOURCES_PROVISION: false
|
154511
|
+
RESOURCES_PROVISION: false,
|
154512
|
+
MIXED_MODE: false
|
154472
154513
|
},
|
154473
154514
|
() => startDev(devOptions)
|
154474
154515
|
);
|
@@ -154714,6 +154755,7 @@ var BundlerController = class extends Controller {
|
|
154714
154755
|
const entry = {
|
154715
154756
|
file: config.entrypoint,
|
154716
154757
|
projectRoot: config.projectRoot,
|
154758
|
+
configPath: config.config,
|
154717
154759
|
format: config.build.format,
|
154718
154760
|
moduleRoot: config.build.moduleRoot,
|
154719
154761
|
exports: config.build.exports
|
@@ -154837,6 +154879,7 @@ var BundlerController = class extends Controller {
|
|
154837
154879
|
const entry = {
|
154838
154880
|
file: config.entrypoint,
|
154839
154881
|
projectRoot: config.projectRoot,
|
154882
|
+
configPath: config.config,
|
154840
154883
|
format: config.build.format,
|
154841
154884
|
moduleRoot: config.build.moduleRoot,
|
154842
154885
|
exports: config.build.exports,
|
@@ -156425,7 +156468,9 @@ async function getPlatformProxy(options = {}) {
|
|
156425
156468
|
const miniflareOptions = await run(
|
156426
156469
|
{
|
156427
156470
|
MULTIWORKER: false,
|
156428
|
-
RESOURCES_PROVISION: false
|
156471
|
+
RESOURCES_PROVISION: false,
|
156472
|
+
// TODO: when possible mixed mode should be made available for getPlatformProxy
|
156473
|
+
MIXED_MODE: false
|
156429
156474
|
},
|
156430
156475
|
() => getMiniflareOptionsFromConfig(rawConfig, env6, options)
|
156431
156476
|
);
|