wrangler 4.68.0 → 4.69.0
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/config-schema.json +30 -0
- package/package.json +11 -11
- package/wrangler-dist/cli.d.ts +30 -0
- package/wrangler-dist/cli.js +1059 -983
- package/wrangler-dist/metafile-cjs.json +1 -1
package/wrangler-dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var assert50 = require('assert');
|
|
4
4
|
var module2 = require('module');
|
|
5
5
|
var path3 = require('path');
|
|
6
|
-
var
|
|
6
|
+
var fs23 = require('fs');
|
|
7
7
|
var os10 = require('os');
|
|
8
8
|
var util2 = require('util');
|
|
9
9
|
var Url = require('url');
|
|
@@ -11,7 +11,7 @@ var process7 = require('process');
|
|
|
11
11
|
var tty = require('tty');
|
|
12
12
|
var childProcess = require('child_process');
|
|
13
13
|
var crypto2 = require('crypto');
|
|
14
|
-
var
|
|
14
|
+
var fs12 = require('fs/promises');
|
|
15
15
|
var esbuild = require('esbuild');
|
|
16
16
|
var miniflare = require('miniflare');
|
|
17
17
|
var async_hooks = require('async_hooks');
|
|
@@ -55,7 +55,7 @@ function _interopNamespace(e) {
|
|
|
55
55
|
var assert50__default = /*#__PURE__*/_interopDefault(assert50);
|
|
56
56
|
var module2__default = /*#__PURE__*/_interopDefault(module2);
|
|
57
57
|
var path3__namespace = /*#__PURE__*/_interopNamespace(path3);
|
|
58
|
-
var
|
|
58
|
+
var fs23__namespace = /*#__PURE__*/_interopNamespace(fs23);
|
|
59
59
|
var os10__namespace = /*#__PURE__*/_interopNamespace(os10);
|
|
60
60
|
var util2__namespace = /*#__PURE__*/_interopNamespace(util2);
|
|
61
61
|
var Url__default = /*#__PURE__*/_interopDefault(Url);
|
|
@@ -63,7 +63,7 @@ var process7__default = /*#__PURE__*/_interopDefault(process7);
|
|
|
63
63
|
var tty__default = /*#__PURE__*/_interopDefault(tty);
|
|
64
64
|
var childProcess__default = /*#__PURE__*/_interopDefault(childProcess);
|
|
65
65
|
var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
|
|
66
|
-
var
|
|
66
|
+
var fs12__default = /*#__PURE__*/_interopDefault(fs12);
|
|
67
67
|
var esbuild__namespace = /*#__PURE__*/_interopNamespace(esbuild);
|
|
68
68
|
var async_hooks__namespace = /*#__PURE__*/_interopNamespace(async_hooks);
|
|
69
69
|
var S__default = /*#__PURE__*/_interopDefault(S);
|
|
@@ -2722,7 +2722,7 @@ function parseJSONC(input, file22, options = { allowTrailingComma: true }) {
|
|
|
2722
2722
|
}
|
|
2723
2723
|
function readFileSyncToBuffer(file22) {
|
|
2724
2724
|
try {
|
|
2725
|
-
return
|
|
2725
|
+
return fs23.readFileSync(file22);
|
|
2726
2726
|
} catch (err) {
|
|
2727
2727
|
const { message } = err;
|
|
2728
2728
|
throw new ParseError({
|
|
@@ -2737,7 +2737,7 @@ function readFileSyncToBuffer(file22) {
|
|
|
2737
2737
|
}
|
|
2738
2738
|
function readFileSync(file22) {
|
|
2739
2739
|
try {
|
|
2740
|
-
const buffer =
|
|
2740
|
+
const buffer = fs23.readFileSync(file22);
|
|
2741
2741
|
return removeBOMAndValidate(buffer, file22);
|
|
2742
2742
|
} catch (err) {
|
|
2743
2743
|
if (err instanceof ParseError) {
|
|
@@ -2888,7 +2888,7 @@ function file(name2, options) {
|
|
|
2888
2888
|
for (dir2 of up(start, options)) {
|
|
2889
2889
|
try {
|
|
2890
2890
|
tmp = path3.join(dir2, name2);
|
|
2891
|
-
if (
|
|
2891
|
+
if (fs23.statSync(tmp).isFile()) return tmp;
|
|
2892
2892
|
} catch {
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
@@ -2990,7 +2990,7 @@ function findRedirectedWranglerConfig(cwd2, userConfigPath) {
|
|
|
2990
2990
|
\`\`\`
|
|
2991
2991
|
`);
|
|
2992
2992
|
}
|
|
2993
|
-
if (!
|
|
2993
|
+
if (!fs23.existsSync(redirectedConfigPath)) {
|
|
2994
2994
|
throw new UserError(esm_default`
|
|
2995
2995
|
There is a deploy configuration at "${path3__namespace.default.relative(".", deployConfigPath)}".
|
|
2996
2996
|
But the redirected configuration path it points to, "${path3__namespace.default.relative(".", redirectedConfigPath)}", does not exist.
|
|
@@ -3047,9 +3047,34 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
|
|
|
3047
3047
|
return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet);
|
|
3048
3048
|
}
|
|
3049
3049
|
}
|
|
3050
|
+
function isDirectory(path210) {
|
|
3051
|
+
return fs23__namespace.default.statSync(path210, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
3052
|
+
}
|
|
3053
|
+
function removeDir(dirPath, { fireAndForget = false } = {}) {
|
|
3054
|
+
const result = fs23__namespace.default.promises.rm(dirPath, {
|
|
3055
|
+
recursive: true,
|
|
3056
|
+
force: true,
|
|
3057
|
+
maxRetries: 5,
|
|
3058
|
+
retryDelay: 100
|
|
3059
|
+
});
|
|
3060
|
+
if (fireAndForget) {
|
|
3061
|
+
void result.catch(() => {
|
|
3062
|
+
});
|
|
3063
|
+
} else {
|
|
3064
|
+
return result;
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
function removeDirSync(dirPath) {
|
|
3068
|
+
fs23__namespace.default.rmSync(dirPath, {
|
|
3069
|
+
recursive: true,
|
|
3070
|
+
force: true,
|
|
3071
|
+
maxRetries: 5,
|
|
3072
|
+
retryDelay: 100
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3050
3075
|
var UserError, FatalError, CommandLineArgsError, JsonFriendlyFatalError, MissingConfigError, CharacterCodes, ParseOptions, ScanError, SyntaxKind, parse2, ParseErrorCode, TomlError, DATE_TIME_RE, TomlDate, INT_REGEX, FLOAT_REGEX, LEADING_ZERO, ESCAPE_REGEX, ESC_MAP, KEY_PART_RE, BARE_KEY, dist_default, ParseError, APIError, units, UNSUPPORTED_BOMS, esm_default, parseRawConfigFile; exports.experimental_readRawConfig = void 0;
|
|
3051
|
-
var
|
|
3052
|
-
"../workers-utils/dist/chunk-
|
|
3076
|
+
var init_chunk_NNMRVG4F = __esm({
|
|
3077
|
+
"../workers-utils/dist/chunk-NNMRVG4F.mjs"() {
|
|
3053
3078
|
init_import_meta_url();
|
|
3054
3079
|
init_chunk_LDFBMPMW();
|
|
3055
3080
|
UserError = class extends Error {
|
|
@@ -3665,6 +3690,12 @@ ${codeblock}`, options);
|
|
|
3665
3690
|
redirected
|
|
3666
3691
|
};
|
|
3667
3692
|
}, "experimental_readRawConfig");
|
|
3693
|
+
__name(isDirectory, "isDirectory");
|
|
3694
|
+
__name2(isDirectory, "isDirectory");
|
|
3695
|
+
__name(removeDir, "removeDir");
|
|
3696
|
+
__name2(removeDir, "removeDir");
|
|
3697
|
+
__name(removeDirSync, "removeDirSync");
|
|
3698
|
+
__name2(removeDirSync, "removeDirSync");
|
|
3668
3699
|
}
|
|
3669
3700
|
});
|
|
3670
3701
|
function isValidWorkflowName(name2) {
|
|
@@ -3676,9 +3707,6 @@ function isValidWorkflowName(name2) {
|
|
|
3676
3707
|
}
|
|
3677
3708
|
return ALLOWED_WORKFLOW_NAME_REGEX.test(name2);
|
|
3678
3709
|
}
|
|
3679
|
-
function isDirectory(path410) {
|
|
3680
|
-
return fs22__namespace.default.statSync(path410, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
3681
|
-
}
|
|
3682
3710
|
function getGlobalWranglerConfigPath() {
|
|
3683
3711
|
const configDir = mod_esm_default(".wrangler").config();
|
|
3684
3712
|
const legacyConfigDir = path3__namespace.default.join(os10__namespace.default.homedir(), ".wrangler");
|
|
@@ -4577,6 +4605,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
4577
4605
|
"error"
|
|
4578
4606
|
);
|
|
4579
4607
|
experimental(diagnostics, rawEnv, "unsafe");
|
|
4608
|
+
experimental(diagnostics, rawEnv, "secrets");
|
|
4580
4609
|
const route = normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv);
|
|
4581
4610
|
const account_id = inheritableInWranglerEnvironments(
|
|
4582
4611
|
diagnostics,
|
|
@@ -4735,6 +4764,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
4735
4764
|
validateVars(envName),
|
|
4736
4765
|
{}
|
|
4737
4766
|
),
|
|
4767
|
+
secrets: notInheritable(
|
|
4768
|
+
diagnostics,
|
|
4769
|
+
topLevelEnv,
|
|
4770
|
+
rawConfig,
|
|
4771
|
+
rawEnv,
|
|
4772
|
+
envName,
|
|
4773
|
+
"secrets",
|
|
4774
|
+
validateSecrets(envName),
|
|
4775
|
+
void 0
|
|
4776
|
+
),
|
|
4738
4777
|
define: notInheritable(
|
|
4739
4778
|
diagnostics,
|
|
4740
4779
|
topLevelEnv,
|
|
@@ -5114,6 +5153,14 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
5114
5153
|
validateObservability,
|
|
5115
5154
|
void 0
|
|
5116
5155
|
),
|
|
5156
|
+
cache: inheritable(
|
|
5157
|
+
diagnostics,
|
|
5158
|
+
topLevelEnv,
|
|
5159
|
+
rawEnv,
|
|
5160
|
+
"cache",
|
|
5161
|
+
validateCache,
|
|
5162
|
+
void 0
|
|
5163
|
+
),
|
|
5117
5164
|
compliance_region: inheritable(
|
|
5118
5165
|
diagnostics,
|
|
5119
5166
|
topLevelEnv,
|
|
@@ -5700,7 +5747,7 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
|
|
|
5700
5747
|
function isDockerfile(imagePath, configPath) {
|
|
5701
5748
|
const baseDir = configPath ? path3__namespace.default.dirname(configPath) : process.cwd();
|
|
5702
5749
|
const maybeDockerfile = path3__namespace.default.resolve(baseDir, imagePath);
|
|
5703
|
-
if (
|
|
5750
|
+
if (fs23__namespace.default.existsSync(maybeDockerfile)) {
|
|
5704
5751
|
if (isDirectory(maybeDockerfile)) {
|
|
5705
5752
|
throw new UserError(
|
|
5706
5753
|
`${imagePath} is a directory, you should specify a path to the Dockerfile`
|
|
@@ -5818,13 +5865,13 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
|
|
|
5818
5865
|
}
|
|
5819
5866
|
}
|
|
5820
5867
|
}
|
|
5821
|
-
var require_XDGAppPaths, require_XDG, require_OSPaths, require_node, require_mod_cjs, require_node2, require_mod_cjs2, require_node3, require_mod_cjs3; exports.unstable_defaultWranglerConfig = void 0; exports.experimental_patchConfig = void 0; var getJSONPath, PatchConfigError, MAX_WORKFLOW_NAME_LENGTH, ALLOWED_STRING_ID_PATTERN, ALLOWED_WORKFLOW_INSTANCE_ID_REGEX, ALLOWED_WORKFLOW_NAME_REGEX, mod_esm_exports, import_mod_cjs, mod_esm_default, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getWranglerSendErrorReportsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getWorkersCIBranchName, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getD1ExtraLocationChoices, getDockerPath, getSubdomainMixedStateCheckDisabled, getCloudflareLoadDevVarsFromDotEnv, getCloudflareIncludeProcessEnvFromEnv, getTraceHeader, getDisableConfigWatching, getWranglerHideBanner, getCloudflareEnv, getOpenNextDeployFromEnv, getLocalExplorerEnabledFromEnv, getWranglerCacheDirFromEnv, Diagnostics, appendEnvName, isString, isValidName, isValidDateTimeStringFormat, isStringArray, isOneOf, all, isMutuallyExclusiveWith, isBoolean, validateRequiredProperty, validateAtLeastOnePropertyRequired, validateOptionalProperty, validateTypedArray, validateOptionalTypedArray, isRequiredProperty, isOptionalProperty, hasProperty, validateAdditionalProperties, getBindingNames, isBindingList, isNamespaceList, isRecord, validateUniqueNameProperty, bucketFormatMessage, friendlyBindingNames, bindingTypeFriendlyNames, ENGLISH, ALLOWED_INSTANCE_TYPES, isRoute, isRouteArray, validateTailConsumers, validateStreamingTailConsumers, validateAndNormalizeRules, validateTriggers, validateRules, validateRule, validateDefines, validateVars, validateBindingsProperty, validateUnsafeSettings, validateDurableObjectBinding, workflowNameFormatMessage, validateWorkflowBinding, validateCflogfwdrObject, validateCflogfwdrBinding, validateAssetsConfig, validateNamedSimpleBinding, validateAIBinding, validateVersionMetadataBinding, validateUnsafeBinding, validateBindingArray, validateCloudchamberConfig, validateKVBinding, validateSendEmailBinding, validateQueueBinding, validateR2Binding, validateD1Binding, validateVectorizeBinding, validateHyperdriveBinding, validateVpcServiceBinding, validateBindingsHaveUniqueNames, validateServiceBinding, validateAnalyticsEngineBinding, validateWorkerNamespaceBinding, validateMTlsCertificateBinding, validateConsumer, validateCompatibilityDate, validatePipelineBinding, validateSecretsStoreSecretBinding, validateHelloWorldBinding, validateWorkerLoaderBinding, validateRateLimitBinding, validateMigrations, validateObservability, validatePythonModules, supportedPagesConfigFields;
|
|
5868
|
+
var require_XDGAppPaths, require_XDG, require_OSPaths, require_node, require_mod_cjs, require_node2, require_mod_cjs2, require_node3, require_mod_cjs3; exports.unstable_defaultWranglerConfig = void 0; exports.experimental_patchConfig = void 0; var getJSONPath, PatchConfigError, MAX_WORKFLOW_NAME_LENGTH, ALLOWED_STRING_ID_PATTERN, ALLOWED_WORKFLOW_INSTANCE_ID_REGEX, ALLOWED_WORKFLOW_NAME_REGEX, mod_esm_exports, import_mod_cjs, mod_esm_default, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getWranglerSendErrorReportsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getWorkersCIBranchName, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getD1ExtraLocationChoices, getDockerPath, getSubdomainMixedStateCheckDisabled, getCloudflareLoadDevVarsFromDotEnv, getCloudflareIncludeProcessEnvFromEnv, getTraceHeader, getDisableConfigWatching, getWranglerHideBanner, getCloudflareEnv, getOpenNextDeployFromEnv, getLocalExplorerEnabledFromEnv, getWranglerCacheDirFromEnv, Diagnostics, appendEnvName, isString, isValidName, isValidDateTimeStringFormat, isStringArray, isOneOf, all, isMutuallyExclusiveWith, isBoolean, validateRequiredProperty, validateAtLeastOnePropertyRequired, validateOptionalProperty, validateTypedArray, validateOptionalTypedArray, isRequiredProperty, isOptionalProperty, hasProperty, validateAdditionalProperties, getBindingNames, isBindingList, isNamespaceList, isRecord, validateUniqueNameProperty, bucketFormatMessage, friendlyBindingNames, bindingTypeFriendlyNames, ENGLISH, ALLOWED_INSTANCE_TYPES, isRoute, isRouteArray, validateTailConsumers, validateStreamingTailConsumers, validateAndNormalizeRules, validateTriggers, validateRules, validateRule, validateDefines, validateVars, validateSecrets, validateBindingsProperty, validateUnsafeSettings, validateDurableObjectBinding, workflowNameFormatMessage, validateWorkflowBinding, validateCflogfwdrObject, validateCflogfwdrBinding, validateAssetsConfig, validateNamedSimpleBinding, validateAIBinding, validateVersionMetadataBinding, validateUnsafeBinding, validateBindingArray, validateCloudchamberConfig, validateKVBinding, validateSendEmailBinding, validateQueueBinding, validateR2Binding, validateD1Binding, validateVectorizeBinding, validateHyperdriveBinding, validateVpcServiceBinding, validateBindingsHaveUniqueNames, validateServiceBinding, validateAnalyticsEngineBinding, validateWorkerNamespaceBinding, validateMTlsCertificateBinding, validateConsumer, validateCompatibilityDate, validatePipelineBinding, validateSecretsStoreSecretBinding, validateHelloWorldBinding, validateWorkerLoaderBinding, validateRateLimitBinding, validateMigrations, validateObservability, validateCache, validatePythonModules, supportedPagesConfigFields;
|
|
5822
5869
|
var init_dist = __esm({
|
|
5823
5870
|
"../workers-utils/dist/index.mjs"() {
|
|
5824
5871
|
init_import_meta_url();
|
|
5825
5872
|
init_chunk_4233U5MA();
|
|
5826
|
-
|
|
5827
|
-
|
|
5873
|
+
init_chunk_NNMRVG4F();
|
|
5874
|
+
init_chunk_NNMRVG4F();
|
|
5828
5875
|
init_chunk_LDFBMPMW();
|
|
5829
5876
|
init_chunk_LDFBMPMW();
|
|
5830
5877
|
require_XDGAppPaths = __commonJS2({
|
|
@@ -6440,6 +6487,7 @@ var init_dist = __esm({
|
|
|
6440
6487
|
upload_source_maps: void 0,
|
|
6441
6488
|
assets: void 0,
|
|
6442
6489
|
observability: { enabled: true },
|
|
6490
|
+
cache: void 0,
|
|
6443
6491
|
/** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */
|
|
6444
6492
|
compliance_region: void 0,
|
|
6445
6493
|
python_modules: { exclude: ["**/*.pyc"] },
|
|
@@ -6481,7 +6529,7 @@ var init_dist = __esm({
|
|
|
6481
6529
|
if (configPath.endsWith(".toml")) {
|
|
6482
6530
|
configString = dist_default.stringify(parseJSONC(configString));
|
|
6483
6531
|
}
|
|
6484
|
-
|
|
6532
|
+
fs23.writeFileSync(configPath, configString);
|
|
6485
6533
|
return configString;
|
|
6486
6534
|
}, "experimental_patchConfig");
|
|
6487
6535
|
getJSONPath = /* @__PURE__ */ __name2((obj, allPaths, isArrayInsertion, prevPath = []) => {
|
|
@@ -6527,8 +6575,6 @@ var init_dist = __esm({
|
|
|
6527
6575
|
import_mod_cjs = __toESM2(require_mod_cjs3(), 1);
|
|
6528
6576
|
__reExport2(mod_esm_exports, __toESM2(require_mod_cjs3(), 1));
|
|
6529
6577
|
mod_esm_default = import_mod_cjs.default;
|
|
6530
|
-
__name(isDirectory, "isDirectory");
|
|
6531
|
-
__name2(isDirectory, "isDirectory");
|
|
6532
6578
|
__name(getGlobalWranglerConfigPath, "getGlobalWranglerConfigPath");
|
|
6533
6579
|
__name2(getGlobalWranglerConfigPath, "getGlobalWranglerConfigPath");
|
|
6534
6580
|
__name(getBooleanEnvironmentVariableFactory, "getBooleanEnvironmentVariableFactory");
|
|
@@ -7372,6 +7418,29 @@ Please add "vars.${varName}" to "env.${envName}".`
|
|
|
7372
7418
|
}
|
|
7373
7419
|
return isValid2;
|
|
7374
7420
|
}, "validateVars");
|
|
7421
|
+
validateSecrets = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
|
|
7422
|
+
const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
|
|
7423
|
+
if (value === void 0) {
|
|
7424
|
+
return true;
|
|
7425
|
+
}
|
|
7426
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
7427
|
+
diagnostics.errors.push(
|
|
7428
|
+
`The field "${fieldPath}" should be an object but got ${JSON.stringify(value)}.`
|
|
7429
|
+
);
|
|
7430
|
+
return false;
|
|
7431
|
+
}
|
|
7432
|
+
let isValid2 = true;
|
|
7433
|
+
validateAdditionalProperties(diagnostics, fieldPath, Object.keys(value), [
|
|
7434
|
+
"required"
|
|
7435
|
+
]);
|
|
7436
|
+
isValid2 = validateOptionalTypedArray(
|
|
7437
|
+
diagnostics,
|
|
7438
|
+
`${fieldPath}.required`,
|
|
7439
|
+
value.required,
|
|
7440
|
+
"string"
|
|
7441
|
+
) && isValid2;
|
|
7442
|
+
return isValid2;
|
|
7443
|
+
}, "validateSecrets");
|
|
7375
7444
|
validateBindingsProperty = /* @__PURE__ */ __name2((envName, validateBinding) => (diagnostics, field, value, config) => {
|
|
7376
7445
|
let isValid2 = true;
|
|
7377
7446
|
const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
|
|
@@ -8310,6 +8379,7 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
|
|
|
8310
8379
|
)
|
|
8311
8380
|
])
|
|
8312
8381
|
);
|
|
8382
|
+
bindingsGroupedByType["Secret"] = config.secrets?.required ?? [];
|
|
8313
8383
|
const bindingsGroupedByName = {};
|
|
8314
8384
|
for (const bindingType in bindingsGroupedByType) {
|
|
8315
8385
|
const bindingNames = bindingsGroupedByType[bindingType];
|
|
@@ -8996,6 +9066,30 @@ ${resolution}`);
|
|
|
8996
9066
|
}
|
|
8997
9067
|
return isValid2;
|
|
8998
9068
|
}, "validateObservability");
|
|
9069
|
+
validateCache = /* @__PURE__ */ __name2((diagnostics, field, value) => {
|
|
9070
|
+
if (value === void 0) {
|
|
9071
|
+
return true;
|
|
9072
|
+
}
|
|
9073
|
+
if (typeof value !== "object" || value === null) {
|
|
9074
|
+
diagnostics.errors.push(
|
|
9075
|
+
`"${field}" should be an object but got ${JSON.stringify(value)}.`
|
|
9076
|
+
);
|
|
9077
|
+
return false;
|
|
9078
|
+
}
|
|
9079
|
+
const val2 = value;
|
|
9080
|
+
let isValid2 = true;
|
|
9081
|
+
isValid2 = validateRequiredProperty(
|
|
9082
|
+
diagnostics,
|
|
9083
|
+
field,
|
|
9084
|
+
"enabled",
|
|
9085
|
+
val2.enabled,
|
|
9086
|
+
"boolean"
|
|
9087
|
+
) && isValid2;
|
|
9088
|
+
isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(val2), [
|
|
9089
|
+
"enabled"
|
|
9090
|
+
]) && isValid2;
|
|
9091
|
+
return isValid2;
|
|
9092
|
+
}, "validateCache");
|
|
8999
9093
|
__name(warnIfDurableObjectsHaveNoMigrations, "warnIfDurableObjectsHaveNoMigrations");
|
|
9000
9094
|
__name2(warnIfDurableObjectsHaveNoMigrations, "warnIfDurableObjectsHaveNoMigrations");
|
|
9001
9095
|
validatePythonModules = /* @__PURE__ */ __name2((diagnostics, field, value, topLevelEnv) => {
|
|
@@ -10204,7 +10298,7 @@ var init_lib = __esm({
|
|
|
10204
10298
|
if (typeof __require !== "undefined") {
|
|
10205
10299
|
return __require(path82);
|
|
10206
10300
|
} else if (path82.match(/\.json$/)) {
|
|
10207
|
-
return JSON.parse(
|
|
10301
|
+
return JSON.parse(fs23.readFileSync(path82, "utf8"));
|
|
10208
10302
|
} else {
|
|
10209
10303
|
throw Error("only .json config files are supported in ESM");
|
|
10210
10304
|
}
|
|
@@ -10543,12 +10637,12 @@ var init_cliui = __esm({
|
|
|
10543
10637
|
});
|
|
10544
10638
|
function sync_default(start, callback) {
|
|
10545
10639
|
let dir2 = path3.resolve(".", start);
|
|
10546
|
-
let tmp, stats =
|
|
10640
|
+
let tmp, stats = fs23.statSync(dir2);
|
|
10547
10641
|
if (!stats.isDirectory()) {
|
|
10548
10642
|
dir2 = path3.dirname(dir2);
|
|
10549
10643
|
}
|
|
10550
10644
|
while (true) {
|
|
10551
|
-
tmp = callback(dir2,
|
|
10645
|
+
tmp = callback(dir2, fs23.readdirSync(dir2));
|
|
10552
10646
|
if (tmp) return path3.resolve(dir2, tmp);
|
|
10553
10647
|
dir2 = path3.dirname(tmp = dir2);
|
|
10554
10648
|
if (tmp === dir2) break;
|
|
@@ -10566,14 +10660,14 @@ var init_node = __esm({
|
|
|
10566
10660
|
init_import_meta_url();
|
|
10567
10661
|
node_default = {
|
|
10568
10662
|
fs: {
|
|
10569
|
-
readFileSync:
|
|
10570
|
-
writeFile:
|
|
10663
|
+
readFileSync: fs23.readFileSync,
|
|
10664
|
+
writeFile: fs23.writeFile
|
|
10571
10665
|
},
|
|
10572
10666
|
format: util2.format,
|
|
10573
10667
|
resolve: path3.resolve,
|
|
10574
10668
|
exists: /* @__PURE__ */ __name((file3) => {
|
|
10575
10669
|
try {
|
|
10576
|
-
return
|
|
10670
|
+
return fs23.statSync(file3).isFile();
|
|
10577
10671
|
} catch (err) {
|
|
10578
10672
|
return false;
|
|
10579
10673
|
}
|
|
@@ -10816,7 +10910,7 @@ var init_esm = __esm({
|
|
|
10816
10910
|
nextTick: process.nextTick,
|
|
10817
10911
|
stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
|
|
10818
10912
|
},
|
|
10819
|
-
readFileSync:
|
|
10913
|
+
readFileSync: fs23.readFileSync,
|
|
10820
10914
|
require: /* @__PURE__ */ __name(() => {
|
|
10821
10915
|
throw new YError(REQUIRE_ERROR);
|
|
10822
10916
|
}, "require"),
|
|
@@ -23908,7 +24002,7 @@ var require_snapshot_utils = __commonJS({
|
|
|
23908
24002
|
var require_snapshot_recorder = __commonJS({
|
|
23909
24003
|
"../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module4) {
|
|
23910
24004
|
init_import_meta_url();
|
|
23911
|
-
var { writeFile: writeFile15, readFile: readFile19, mkdir:
|
|
24005
|
+
var { writeFile: writeFile15, readFile: readFile19, mkdir: mkdir5 } = __require("fs/promises");
|
|
23912
24006
|
var { dirname: dirname21, resolve: resolve31 } = __require("path");
|
|
23913
24007
|
var { setTimeout: setTimeout8, clearTimeout: clearTimeout2 } = __require("timers");
|
|
23914
24008
|
var { InvalidArgumentError, UndiciError } = require_errors();
|
|
@@ -24147,7 +24241,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
24147
24241
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
24148
24242
|
}
|
|
24149
24243
|
const resolvedPath2 = resolve31(path82);
|
|
24150
|
-
await
|
|
24244
|
+
await mkdir5(dirname21(resolvedPath2), { recursive: true });
|
|
24151
24245
|
const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
24152
24246
|
hash,
|
|
24153
24247
|
snapshot
|
|
@@ -37722,7 +37816,7 @@ async function constructBuildCommand(options, logger4) {
|
|
|
37722
37816
|
if (options.setNetworkToHost) {
|
|
37723
37817
|
buildCmd.push("--network", "host");
|
|
37724
37818
|
}
|
|
37725
|
-
const dockerfile =
|
|
37819
|
+
const dockerfile = fs23.readFileSync(options.pathToDockerfile, "utf-8");
|
|
37726
37820
|
buildCmd.push("-f", "-");
|
|
37727
37821
|
buildCmd.push(options.buildContext);
|
|
37728
37822
|
logger4?.debug(`Building image with command: ${buildCmd.join(" ")}`);
|
|
@@ -38373,7 +38467,7 @@ async function getBinaryFileContents(file3) {
|
|
|
38373
38467
|
}
|
|
38374
38468
|
return Buffer.from(file3.contents);
|
|
38375
38469
|
}
|
|
38376
|
-
return
|
|
38470
|
+
return fs12.readFile(file3.path);
|
|
38377
38471
|
}
|
|
38378
38472
|
function convertConfigBindingsToStartWorkerBindings(configBindings) {
|
|
38379
38473
|
return convertConfigToBindings(configBindings, {
|
|
@@ -39427,14 +39521,14 @@ var require_is_core_module = __commonJS({
|
|
|
39427
39521
|
var require_async = __commonJS({
|
|
39428
39522
|
"../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/async.js"(exports, module4) {
|
|
39429
39523
|
init_import_meta_url();
|
|
39430
|
-
var
|
|
39524
|
+
var fs27 = __require("fs");
|
|
39431
39525
|
var getHomedir = require_homedir();
|
|
39432
39526
|
var path82 = __require("path");
|
|
39433
39527
|
var caller = require_caller();
|
|
39434
39528
|
var nodeModulesPaths = require_node_modules_paths();
|
|
39435
39529
|
var normalizeOptions = require_normalize_options();
|
|
39436
39530
|
var isCore = require_is_core_module();
|
|
39437
|
-
var realpathFS = process.platform !== "win32" &&
|
|
39531
|
+
var realpathFS = process.platform !== "win32" && fs27.realpath && typeof fs27.realpath.native === "function" ? fs27.realpath.native : fs27.realpath;
|
|
39438
39532
|
var homedir3 = getHomedir();
|
|
39439
39533
|
var defaultPaths = /* @__PURE__ */ __name(function() {
|
|
39440
39534
|
return [
|
|
@@ -39443,7 +39537,7 @@ var require_async = __commonJS({
|
|
|
39443
39537
|
];
|
|
39444
39538
|
}, "defaultPaths");
|
|
39445
39539
|
var defaultIsFile = /* @__PURE__ */ __name(function isFile2(file3, cb2) {
|
|
39446
|
-
|
|
39540
|
+
fs27.stat(file3, function(err, stat9) {
|
|
39447
39541
|
if (!err) {
|
|
39448
39542
|
return cb2(null, stat9.isFile() || stat9.isFIFO());
|
|
39449
39543
|
}
|
|
@@ -39452,7 +39546,7 @@ var require_async = __commonJS({
|
|
|
39452
39546
|
});
|
|
39453
39547
|
}, "isFile");
|
|
39454
39548
|
var defaultIsDir = /* @__PURE__ */ __name(function isDirectory3(dir2, cb2) {
|
|
39455
|
-
|
|
39549
|
+
fs27.stat(dir2, function(err, stat9) {
|
|
39456
39550
|
if (!err) {
|
|
39457
39551
|
return cb2(null, stat9.isDirectory());
|
|
39458
39552
|
}
|
|
@@ -39509,7 +39603,7 @@ var require_async = __commonJS({
|
|
|
39509
39603
|
opts = normalizeOptions(x7, opts);
|
|
39510
39604
|
var isFile2 = opts.isFile || defaultIsFile;
|
|
39511
39605
|
var isDirectory3 = opts.isDirectory || defaultIsDir;
|
|
39512
|
-
var readFile19 = opts.readFile ||
|
|
39606
|
+
var readFile19 = opts.readFile || fs27.readFile;
|
|
39513
39607
|
var realpath2 = opts.realpath || defaultRealpath;
|
|
39514
39608
|
var readPackage = opts.readPackage || defaultReadPackage;
|
|
39515
39609
|
if (opts.readFile && opts.readPackage) {
|
|
@@ -39929,13 +40023,13 @@ var require_sync = __commonJS({
|
|
|
39929
40023
|
"../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/sync.js"(exports, module4) {
|
|
39930
40024
|
init_import_meta_url();
|
|
39931
40025
|
var isCore = require_is_core_module();
|
|
39932
|
-
var
|
|
40026
|
+
var fs27 = __require("fs");
|
|
39933
40027
|
var path82 = __require("path");
|
|
39934
40028
|
var getHomedir = require_homedir();
|
|
39935
40029
|
var caller = require_caller();
|
|
39936
40030
|
var nodeModulesPaths = require_node_modules_paths();
|
|
39937
40031
|
var normalizeOptions = require_normalize_options();
|
|
39938
|
-
var realpathFS = process.platform !== "win32" &&
|
|
40032
|
+
var realpathFS = process.platform !== "win32" && fs27.realpathSync && typeof fs27.realpathSync.native === "function" ? fs27.realpathSync.native : fs27.realpathSync;
|
|
39939
40033
|
var homedir3 = getHomedir();
|
|
39940
40034
|
var defaultPaths = /* @__PURE__ */ __name(function() {
|
|
39941
40035
|
return [
|
|
@@ -39945,7 +40039,7 @@ var require_sync = __commonJS({
|
|
|
39945
40039
|
}, "defaultPaths");
|
|
39946
40040
|
var defaultIsFile = /* @__PURE__ */ __name(function isFile2(file3) {
|
|
39947
40041
|
try {
|
|
39948
|
-
var stat9 =
|
|
40042
|
+
var stat9 = fs27.statSync(file3, { throwIfNoEntry: false });
|
|
39949
40043
|
} catch (e9) {
|
|
39950
40044
|
if (e9 && (e9.code === "ENOENT" || e9.code === "ENOTDIR")) return false;
|
|
39951
40045
|
throw e9;
|
|
@@ -39954,7 +40048,7 @@ var require_sync = __commonJS({
|
|
|
39954
40048
|
}, "isFile");
|
|
39955
40049
|
var defaultIsDir = /* @__PURE__ */ __name(function isDirectory3(dir2) {
|
|
39956
40050
|
try {
|
|
39957
|
-
var stat9 =
|
|
40051
|
+
var stat9 = fs27.statSync(dir2, { throwIfNoEntry: false });
|
|
39958
40052
|
} catch (e9) {
|
|
39959
40053
|
if (e9 && (e9.code === "ENOENT" || e9.code === "ENOTDIR")) return false;
|
|
39960
40054
|
throw e9;
|
|
@@ -39998,7 +40092,7 @@ var require_sync = __commonJS({
|
|
|
39998
40092
|
}
|
|
39999
40093
|
var opts = normalizeOptions(x7, options);
|
|
40000
40094
|
var isFile2 = opts.isFile || defaultIsFile;
|
|
40001
|
-
var readFileSync33 = opts.readFileSync ||
|
|
40095
|
+
var readFileSync33 = opts.readFileSync || fs27.readFileSync;
|
|
40002
40096
|
var isDirectory3 = opts.isDirectory || defaultIsDir;
|
|
40003
40097
|
var realpathSync4 = opts.realpathSync || defaultRealpathSync;
|
|
40004
40098
|
var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
|
|
@@ -42223,11 +42317,11 @@ var require_signal_exit = __commonJS({
|
|
|
42223
42317
|
});
|
|
42224
42318
|
async function ensureDirectoryExists(filepath) {
|
|
42225
42319
|
const dirpath = path3__namespace.default.dirname(filepath);
|
|
42226
|
-
await
|
|
42320
|
+
await fs12.mkdir(dirpath, { recursive: true });
|
|
42227
42321
|
}
|
|
42228
42322
|
function ensureDirectoryExistsSync(filepath) {
|
|
42229
42323
|
const dirpath = path3__namespace.default.dirname(filepath);
|
|
42230
|
-
|
|
42324
|
+
fs23.mkdirSync(dirpath, { recursive: true });
|
|
42231
42325
|
}
|
|
42232
42326
|
var init_filesystem = __esm({
|
|
42233
42327
|
"src/utils/filesystem.ts"() {
|
|
@@ -42266,7 +42360,7 @@ ${util2.stripVTControlCharacters(message)}
|
|
|
42266
42360
|
await mutex.runWith(async () => {
|
|
42267
42361
|
try {
|
|
42268
42362
|
await ensureDirectoryExists(debugLogFilepath);
|
|
42269
|
-
await
|
|
42363
|
+
await fs12.appendFile(debugLogFilepath, entry);
|
|
42270
42364
|
} catch (err) {
|
|
42271
42365
|
if (!hasLoggedError) {
|
|
42272
42366
|
hasLoggedError = true;
|
|
@@ -42523,23 +42617,23 @@ function getWranglerHiddenDirPath(projectRoot) {
|
|
|
42523
42617
|
}
|
|
42524
42618
|
function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
|
|
42525
42619
|
const tmpRoot = path3__namespace.default.join(getWranglerHiddenDirPath(projectRoot), "tmp");
|
|
42526
|
-
|
|
42620
|
+
fs23__namespace.default.mkdirSync(tmpRoot, { recursive: true });
|
|
42527
42621
|
const tmpPrefix = path3__namespace.default.join(tmpRoot, `${prefix}-`);
|
|
42528
|
-
const tmpDir =
|
|
42529
|
-
const
|
|
42622
|
+
const tmpDir = fs23__namespace.default.realpathSync(fs23__namespace.default.mkdtempSync(tmpPrefix));
|
|
42623
|
+
const cleanupDir = /* @__PURE__ */ __name(() => {
|
|
42530
42624
|
if (cleanup) {
|
|
42531
42625
|
try {
|
|
42532
|
-
|
|
42626
|
+
removeDirSync(tmpDir);
|
|
42533
42627
|
} catch {
|
|
42534
42628
|
}
|
|
42535
42629
|
}
|
|
42536
|
-
}, "
|
|
42537
|
-
const removeExitListener = (0, import_signal_exit2.default)(
|
|
42630
|
+
}, "cleanupDir");
|
|
42631
|
+
const removeExitListener = (0, import_signal_exit2.default)(cleanupDir);
|
|
42538
42632
|
return {
|
|
42539
42633
|
path: tmpDir,
|
|
42540
42634
|
remove() {
|
|
42541
42635
|
removeExitListener();
|
|
42542
|
-
|
|
42636
|
+
cleanupDir();
|
|
42543
42637
|
}
|
|
42544
42638
|
};
|
|
42545
42639
|
}
|
|
@@ -42547,6 +42641,7 @@ var import_signal_exit2;
|
|
|
42547
42641
|
var init_paths = __esm({
|
|
42548
42642
|
"src/paths.ts"() {
|
|
42549
42643
|
init_import_meta_url();
|
|
42644
|
+
init_dist();
|
|
42550
42645
|
import_signal_exit2 = __toESM(require_signal_exit());
|
|
42551
42646
|
__name(toUrlPath, "toUrlPath");
|
|
42552
42647
|
__name(readableRelative, "readableRelative");
|
|
@@ -42648,7 +42743,7 @@ function loadSourceMap({ name: name2, filePath }, sourceMapPath, { entryDirector
|
|
|
42648
42743
|
return [];
|
|
42649
42744
|
}
|
|
42650
42745
|
const map2 = JSON.parse(
|
|
42651
|
-
|
|
42746
|
+
fs23__namespace.default.readFileSync(path3__namespace.default.join(entryDirectory, sourceMapPath), "utf8")
|
|
42652
42747
|
);
|
|
42653
42748
|
map2.file = name2;
|
|
42654
42749
|
if (map2.sourceRoot) {
|
|
@@ -42716,13 +42811,13 @@ function sourceMapForModule(module4) {
|
|
|
42716
42811
|
return;
|
|
42717
42812
|
}
|
|
42718
42813
|
const sourcemapPath = path3__namespace.default.join(path3__namespace.default.dirname(module4.filePath), sourceMapUrl);
|
|
42719
|
-
if (!
|
|
42814
|
+
if (!fs23__namespace.default.existsSync(sourcemapPath)) {
|
|
42720
42815
|
throw new Error(
|
|
42721
42816
|
`Invalid source map path in ${module4.filePath}: ${sourcemapPath} does not exist.`
|
|
42722
42817
|
);
|
|
42723
42818
|
}
|
|
42724
42819
|
const map2 = JSON.parse(
|
|
42725
|
-
|
|
42820
|
+
fs23__namespace.default.readFileSync(sourcemapPath, "utf8")
|
|
42726
42821
|
);
|
|
42727
42822
|
map2.file = module4.name;
|
|
42728
42823
|
if (map2.sourceRoot) {
|
|
@@ -42762,7 +42857,7 @@ var init_source_maps = __esm({
|
|
|
42762
42857
|
});
|
|
42763
42858
|
async function* getFiles(configPath, moduleRoot, relativeTo, projectRoot) {
|
|
42764
42859
|
const wranglerHiddenDirPath = getWranglerHiddenDirPath(projectRoot);
|
|
42765
|
-
for (const file3 of await
|
|
42860
|
+
for (const file3 of await fs12.readdir(moduleRoot, { withFileTypes: true })) {
|
|
42766
42861
|
const absPath = path3__namespace.default.join(moduleRoot, file3.name);
|
|
42767
42862
|
if (file3.isDirectory()) {
|
|
42768
42863
|
if (absPath !== wranglerHiddenDirPath) {
|
|
@@ -42811,7 +42906,7 @@ async function findAdditionalModules(entry, rules, attachSourcemaps = false, pyt
|
|
|
42811
42906
|
if (isPythonEntrypoint) {
|
|
42812
42907
|
let pythonRequirements = "";
|
|
42813
42908
|
try {
|
|
42814
|
-
pythonRequirements = await
|
|
42909
|
+
pythonRequirements = await fs12.readFile(
|
|
42815
42910
|
path3__namespace.default.resolve(entry.projectRoot, "cf-requirements.txt"),
|
|
42816
42911
|
"utf-8"
|
|
42817
42912
|
);
|
|
@@ -42820,7 +42915,7 @@ async function findAdditionalModules(entry, rules, attachSourcemaps = false, pyt
|
|
|
42820
42915
|
"Python entrypoint detected, but no cf-requirements.txt file found."
|
|
42821
42916
|
);
|
|
42822
42917
|
}
|
|
42823
|
-
if (
|
|
42918
|
+
if (fs23.existsSync(path3__namespace.default.resolve(entry.projectRoot, "requirements.txt"))) {
|
|
42824
42919
|
logger.warn(
|
|
42825
42920
|
"Found a `requirements.txt` file. Python requirements should now be in a `cf-requirements.txt` file."
|
|
42826
42921
|
);
|
|
@@ -42846,7 +42941,7 @@ async function findAdditionalModules(entry, rules, attachSourcemaps = false, pyt
|
|
|
42846
42941
|
entry.moduleRoot,
|
|
42847
42942
|
"python_modules"
|
|
42848
42943
|
);
|
|
42849
|
-
const pythonModulesExistsInModuleRoot =
|
|
42944
|
+
const pythonModulesExistsInModuleRoot = fs23.existsSync(
|
|
42850
42945
|
pythonModulesDirInModuleRoot
|
|
42851
42946
|
);
|
|
42852
42947
|
if (pythonModulesExistsInModuleRoot && entry.projectRoot !== entry.moduleRoot) {
|
|
@@ -42854,7 +42949,7 @@ async function findAdditionalModules(entry, rules, attachSourcemaps = false, pyt
|
|
|
42854
42949
|
"The 'python_modules' directory cannot exist in your module root. Delete it to continue."
|
|
42855
42950
|
);
|
|
42856
42951
|
}
|
|
42857
|
-
const pythonModulesExists =
|
|
42952
|
+
const pythonModulesExists = fs23.existsSync(pythonModulesDir);
|
|
42858
42953
|
if (pythonModulesExists) {
|
|
42859
42954
|
const pythonModulesFiles = getFiles(
|
|
42860
42955
|
entry.file,
|
|
@@ -42942,7 +43037,7 @@ async function matchFiles(files, relativeTo, { rules, removedRules }) {
|
|
|
42942
43037
|
continue;
|
|
42943
43038
|
}
|
|
42944
43039
|
const absoluteFilePath = path3__namespace.default.join(relativeTo, filePath);
|
|
42945
|
-
const fileContent = await
|
|
43040
|
+
const fileContent = await fs12.readFile(
|
|
42946
43041
|
absoluteFilePath
|
|
42947
43042
|
);
|
|
42948
43043
|
const module4 = {
|
|
@@ -42980,7 +43075,7 @@ async function matchFiles(files, relativeTo, { rules, removedRules }) {
|
|
|
42980
43075
|
}
|
|
42981
43076
|
async function* findAdditionalModuleWatchDirs(root) {
|
|
42982
43077
|
yield root;
|
|
42983
|
-
for (const entry of await
|
|
43078
|
+
for (const entry of await fs12.readdir(root, { withFileTypes: true })) {
|
|
42984
43079
|
if (entry.isDirectory()) {
|
|
42985
43080
|
if (entry.name === "node_modules" || entry.name === ".git") {
|
|
42986
43081
|
continue;
|
|
@@ -42993,11 +43088,11 @@ async function writeAdditionalModules(modules, destination) {
|
|
|
42993
43088
|
for (const module4 of modules) {
|
|
42994
43089
|
const modulePath = path3__namespace.default.resolve(destination, module4.name);
|
|
42995
43090
|
logger.debug("Writing additional module to output", modulePath);
|
|
42996
|
-
await
|
|
42997
|
-
await
|
|
43091
|
+
await fs12.mkdir(path3__namespace.default.dirname(modulePath), { recursive: true });
|
|
43092
|
+
await fs12.writeFile(modulePath, module4.content);
|
|
42998
43093
|
if (module4.sourceMap) {
|
|
42999
43094
|
const sourcemapPath = path3__namespace.default.resolve(destination, module4.sourceMap.name);
|
|
43000
|
-
await
|
|
43095
|
+
await fs12.writeFile(sourcemapPath, module4.sourceMap.content);
|
|
43001
43096
|
}
|
|
43002
43097
|
}
|
|
43003
43098
|
}
|
|
@@ -43102,7 +43197,7 @@ function createModuleCollector(props) {
|
|
|
43102
43197
|
props.wrangler1xLegacyModuleReferences.rootDirectory,
|
|
43103
43198
|
args.path
|
|
43104
43199
|
);
|
|
43105
|
-
const fileContent = await
|
|
43200
|
+
const fileContent = await fs12.readFile(
|
|
43106
43201
|
filePath
|
|
43107
43202
|
);
|
|
43108
43203
|
const fileHash = crypto2__default.default.createHash("sha1").update(fileContent).digest("hex");
|
|
@@ -43168,7 +43263,7 @@ function createModuleCollector(props) {
|
|
|
43168
43263
|
filePath = resolved;
|
|
43169
43264
|
} catch {
|
|
43170
43265
|
}
|
|
43171
|
-
const fileContent = await
|
|
43266
|
+
const fileContent = await fs12.readFile(
|
|
43172
43267
|
filePath
|
|
43173
43268
|
);
|
|
43174
43269
|
const fileHash = crypto2__default.default.createHash("sha1").update(fileContent).digest("hex");
|
|
@@ -43233,7 +43328,7 @@ function getWrangler1xLegacyModuleReferences(rootDirectory, entryPath) {
|
|
|
43233
43328
|
return {
|
|
43234
43329
|
rootDirectory,
|
|
43235
43330
|
fileNames: new Set(
|
|
43236
|
-
|
|
43331
|
+
fs23.readdirSync(rootDirectory, { withFileTypes: true }).filter(
|
|
43237
43332
|
(dirEntry) => dirEntry.isFile() && dirEntry.name !== path3__namespace.default.basename(entryPath)
|
|
43238
43333
|
).map((dirEnt) => dirEnt.name)
|
|
43239
43334
|
)
|
|
@@ -49255,7 +49350,7 @@ function thrownIsDoesNotExistError(thrown) {
|
|
|
49255
49350
|
}
|
|
49256
49351
|
function maybeGetFile(filePath) {
|
|
49257
49352
|
try {
|
|
49258
|
-
return
|
|
49353
|
+
return fs23.readFileSync(filePath, "utf8");
|
|
49259
49354
|
} catch (e9) {
|
|
49260
49355
|
if (!thrownIsDoesNotExistError(e9)) {
|
|
49261
49356
|
throw e9;
|
|
@@ -50170,7 +50265,7 @@ var require_strip_json_comments = __commonJS({
|
|
|
50170
50265
|
var require_utils3 = __commonJS({
|
|
50171
50266
|
"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports) {
|
|
50172
50267
|
init_import_meta_url();
|
|
50173
|
-
var
|
|
50268
|
+
var fs27 = __require("fs");
|
|
50174
50269
|
var ini = require_ini();
|
|
50175
50270
|
var path82 = __require("path");
|
|
50176
50271
|
var stripJsonComments = require_strip_json_comments();
|
|
@@ -50188,7 +50283,7 @@ var require_utils3 = __commonJS({
|
|
|
50188
50283
|
return;
|
|
50189
50284
|
var file4 = path82.join.apply(null, args);
|
|
50190
50285
|
try {
|
|
50191
|
-
return
|
|
50286
|
+
return fs27.readFileSync(file4, "utf-8");
|
|
50192
50287
|
} catch (err) {
|
|
50193
50288
|
return;
|
|
50194
50289
|
}
|
|
@@ -50227,7 +50322,7 @@ var require_utils3 = __commonJS({
|
|
|
50227
50322
|
function find3(start, rel2) {
|
|
50228
50323
|
var file4 = path82.join(start, rel2);
|
|
50229
50324
|
try {
|
|
50230
|
-
|
|
50325
|
+
fs27.statSync(file4);
|
|
50231
50326
|
return file4;
|
|
50232
50327
|
} catch (err) {
|
|
50233
50328
|
if (path82.dirname(start) !== start)
|
|
@@ -50781,20 +50876,20 @@ var require_update_check = __commonJS({
|
|
|
50781
50876
|
init_import_meta_url();
|
|
50782
50877
|
var { URL: URL8 } = __require("url");
|
|
50783
50878
|
var { join: join32 } = __require("path");
|
|
50784
|
-
var
|
|
50879
|
+
var fs27 = __require("fs");
|
|
50785
50880
|
var { promisify: promisify3 } = __require("util");
|
|
50786
50881
|
var { tmpdir } = __require("os");
|
|
50787
50882
|
var registryUrl = require_registry_url();
|
|
50788
|
-
var writeFile15 = promisify3(
|
|
50789
|
-
var
|
|
50790
|
-
var readFile19 = promisify3(
|
|
50883
|
+
var writeFile15 = promisify3(fs27.writeFile);
|
|
50884
|
+
var mkdir5 = promisify3(fs27.mkdir);
|
|
50885
|
+
var readFile19 = promisify3(fs27.readFile);
|
|
50791
50886
|
var compareVersions = /* @__PURE__ */ __name((a7, b11) => a7.localeCompare(b11, "en-US", { numeric: true }), "compareVersions");
|
|
50792
50887
|
var encode2 = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/^%40/, "@"), "encode");
|
|
50793
50888
|
var getFile = /* @__PURE__ */ __name(async (details, distTag) => {
|
|
50794
50889
|
const rootDir = tmpdir();
|
|
50795
50890
|
const subDir = join32(rootDir, "update-check");
|
|
50796
|
-
if (!
|
|
50797
|
-
await
|
|
50891
|
+
if (!fs27.existsSync(subDir)) {
|
|
50892
|
+
await mkdir5(subDir);
|
|
50798
50893
|
}
|
|
50799
50894
|
let name2 = `${details.name}-${distTag}.json`;
|
|
50800
50895
|
if (details.scope) {
|
|
@@ -50803,7 +50898,7 @@ var require_update_check = __commonJS({
|
|
|
50803
50898
|
return join32(subDir, name2);
|
|
50804
50899
|
}, "getFile");
|
|
50805
50900
|
var evaluateCache = /* @__PURE__ */ __name(async (file3, time, interval) => {
|
|
50806
|
-
if (
|
|
50901
|
+
if (fs27.existsSync(file3)) {
|
|
50807
50902
|
const content = await readFile19(file3, "utf8");
|
|
50808
50903
|
const { lastUpdate, latest } = JSON.parse(content);
|
|
50809
50904
|
const nextCheck = lastUpdate + interval;
|
|
@@ -50935,7 +51030,7 @@ var name, version;
|
|
|
50935
51030
|
var init_package = __esm({
|
|
50936
51031
|
"package.json"() {
|
|
50937
51032
|
name = "wrangler";
|
|
50938
|
-
version = "4.
|
|
51033
|
+
version = "4.69.0";
|
|
50939
51034
|
}
|
|
50940
51035
|
});
|
|
50941
51036
|
|
|
@@ -52832,6 +52927,458 @@ var init_config = __esm({
|
|
|
52832
52927
|
}
|
|
52833
52928
|
});
|
|
52834
52929
|
|
|
52930
|
+
// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json
|
|
52931
|
+
var require_vendors = __commonJS({
|
|
52932
|
+
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports, module4) {
|
|
52933
|
+
module4.exports = [
|
|
52934
|
+
{
|
|
52935
|
+
name: "Agola CI",
|
|
52936
|
+
constant: "AGOLA",
|
|
52937
|
+
env: "AGOLA_GIT_REF",
|
|
52938
|
+
pr: "AGOLA_PULL_REQUEST_ID"
|
|
52939
|
+
},
|
|
52940
|
+
{
|
|
52941
|
+
name: "Alpic",
|
|
52942
|
+
constant: "ALPIC",
|
|
52943
|
+
env: "ALPIC_HOST"
|
|
52944
|
+
},
|
|
52945
|
+
{
|
|
52946
|
+
name: "Appcircle",
|
|
52947
|
+
constant: "APPCIRCLE",
|
|
52948
|
+
env: "AC_APPCIRCLE",
|
|
52949
|
+
pr: {
|
|
52950
|
+
env: "AC_GIT_PR",
|
|
52951
|
+
ne: "false"
|
|
52952
|
+
}
|
|
52953
|
+
},
|
|
52954
|
+
{
|
|
52955
|
+
name: "AppVeyor",
|
|
52956
|
+
constant: "APPVEYOR",
|
|
52957
|
+
env: "APPVEYOR",
|
|
52958
|
+
pr: "APPVEYOR_PULL_REQUEST_NUMBER"
|
|
52959
|
+
},
|
|
52960
|
+
{
|
|
52961
|
+
name: "AWS CodeBuild",
|
|
52962
|
+
constant: "CODEBUILD",
|
|
52963
|
+
env: "CODEBUILD_BUILD_ARN",
|
|
52964
|
+
pr: {
|
|
52965
|
+
env: "CODEBUILD_WEBHOOK_EVENT",
|
|
52966
|
+
any: [
|
|
52967
|
+
"PULL_REQUEST_CREATED",
|
|
52968
|
+
"PULL_REQUEST_UPDATED",
|
|
52969
|
+
"PULL_REQUEST_REOPENED"
|
|
52970
|
+
]
|
|
52971
|
+
}
|
|
52972
|
+
},
|
|
52973
|
+
{
|
|
52974
|
+
name: "Azure Pipelines",
|
|
52975
|
+
constant: "AZURE_PIPELINES",
|
|
52976
|
+
env: "TF_BUILD",
|
|
52977
|
+
pr: {
|
|
52978
|
+
BUILD_REASON: "PullRequest"
|
|
52979
|
+
}
|
|
52980
|
+
},
|
|
52981
|
+
{
|
|
52982
|
+
name: "Bamboo",
|
|
52983
|
+
constant: "BAMBOO",
|
|
52984
|
+
env: "bamboo_planKey"
|
|
52985
|
+
},
|
|
52986
|
+
{
|
|
52987
|
+
name: "Bitbucket Pipelines",
|
|
52988
|
+
constant: "BITBUCKET",
|
|
52989
|
+
env: "BITBUCKET_COMMIT",
|
|
52990
|
+
pr: "BITBUCKET_PR_ID"
|
|
52991
|
+
},
|
|
52992
|
+
{
|
|
52993
|
+
name: "Bitrise",
|
|
52994
|
+
constant: "BITRISE",
|
|
52995
|
+
env: "BITRISE_IO",
|
|
52996
|
+
pr: "BITRISE_PULL_REQUEST"
|
|
52997
|
+
},
|
|
52998
|
+
{
|
|
52999
|
+
name: "Buddy",
|
|
53000
|
+
constant: "BUDDY",
|
|
53001
|
+
env: "BUDDY_WORKSPACE_ID",
|
|
53002
|
+
pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
|
|
53003
|
+
},
|
|
53004
|
+
{
|
|
53005
|
+
name: "Buildkite",
|
|
53006
|
+
constant: "BUILDKITE",
|
|
53007
|
+
env: "BUILDKITE",
|
|
53008
|
+
pr: {
|
|
53009
|
+
env: "BUILDKITE_PULL_REQUEST",
|
|
53010
|
+
ne: "false"
|
|
53011
|
+
}
|
|
53012
|
+
},
|
|
53013
|
+
{
|
|
53014
|
+
name: "CircleCI",
|
|
53015
|
+
constant: "CIRCLE",
|
|
53016
|
+
env: "CIRCLECI",
|
|
53017
|
+
pr: "CIRCLE_PULL_REQUEST"
|
|
53018
|
+
},
|
|
53019
|
+
{
|
|
53020
|
+
name: "Cirrus CI",
|
|
53021
|
+
constant: "CIRRUS",
|
|
53022
|
+
env: "CIRRUS_CI",
|
|
53023
|
+
pr: "CIRRUS_PR"
|
|
53024
|
+
},
|
|
53025
|
+
{
|
|
53026
|
+
name: "Cloudflare Pages",
|
|
53027
|
+
constant: "CLOUDFLARE_PAGES",
|
|
53028
|
+
env: "CF_PAGES"
|
|
53029
|
+
},
|
|
53030
|
+
{
|
|
53031
|
+
name: "Cloudflare Workers",
|
|
53032
|
+
constant: "CLOUDFLARE_WORKERS",
|
|
53033
|
+
env: "WORKERS_CI"
|
|
53034
|
+
},
|
|
53035
|
+
{
|
|
53036
|
+
name: "Codefresh",
|
|
53037
|
+
constant: "CODEFRESH",
|
|
53038
|
+
env: "CF_BUILD_ID",
|
|
53039
|
+
pr: {
|
|
53040
|
+
any: [
|
|
53041
|
+
"CF_PULL_REQUEST_NUMBER",
|
|
53042
|
+
"CF_PULL_REQUEST_ID"
|
|
53043
|
+
]
|
|
53044
|
+
}
|
|
53045
|
+
},
|
|
53046
|
+
{
|
|
53047
|
+
name: "Codemagic",
|
|
53048
|
+
constant: "CODEMAGIC",
|
|
53049
|
+
env: "CM_BUILD_ID",
|
|
53050
|
+
pr: "CM_PULL_REQUEST"
|
|
53051
|
+
},
|
|
53052
|
+
{
|
|
53053
|
+
name: "Codeship",
|
|
53054
|
+
constant: "CODESHIP",
|
|
53055
|
+
env: {
|
|
53056
|
+
CI_NAME: "codeship"
|
|
53057
|
+
}
|
|
53058
|
+
},
|
|
53059
|
+
{
|
|
53060
|
+
name: "Drone",
|
|
53061
|
+
constant: "DRONE",
|
|
53062
|
+
env: "DRONE",
|
|
53063
|
+
pr: {
|
|
53064
|
+
DRONE_BUILD_EVENT: "pull_request"
|
|
53065
|
+
}
|
|
53066
|
+
},
|
|
53067
|
+
{
|
|
53068
|
+
name: "dsari",
|
|
53069
|
+
constant: "DSARI",
|
|
53070
|
+
env: "DSARI"
|
|
53071
|
+
},
|
|
53072
|
+
{
|
|
53073
|
+
name: "Earthly",
|
|
53074
|
+
constant: "EARTHLY",
|
|
53075
|
+
env: "EARTHLY_CI"
|
|
53076
|
+
},
|
|
53077
|
+
{
|
|
53078
|
+
name: "Expo Application Services",
|
|
53079
|
+
constant: "EAS",
|
|
53080
|
+
env: "EAS_BUILD"
|
|
53081
|
+
},
|
|
53082
|
+
{
|
|
53083
|
+
name: "Gerrit",
|
|
53084
|
+
constant: "GERRIT",
|
|
53085
|
+
env: "GERRIT_PROJECT"
|
|
53086
|
+
},
|
|
53087
|
+
{
|
|
53088
|
+
name: "Gitea Actions",
|
|
53089
|
+
constant: "GITEA_ACTIONS",
|
|
53090
|
+
env: "GITEA_ACTIONS"
|
|
53091
|
+
},
|
|
53092
|
+
{
|
|
53093
|
+
name: "GitHub Actions",
|
|
53094
|
+
constant: "GITHUB_ACTIONS",
|
|
53095
|
+
env: "GITHUB_ACTIONS",
|
|
53096
|
+
pr: {
|
|
53097
|
+
GITHUB_EVENT_NAME: "pull_request"
|
|
53098
|
+
}
|
|
53099
|
+
},
|
|
53100
|
+
{
|
|
53101
|
+
name: "GitLab CI",
|
|
53102
|
+
constant: "GITLAB",
|
|
53103
|
+
env: "GITLAB_CI",
|
|
53104
|
+
pr: "CI_MERGE_REQUEST_ID"
|
|
53105
|
+
},
|
|
53106
|
+
{
|
|
53107
|
+
name: "GoCD",
|
|
53108
|
+
constant: "GOCD",
|
|
53109
|
+
env: "GO_PIPELINE_LABEL"
|
|
53110
|
+
},
|
|
53111
|
+
{
|
|
53112
|
+
name: "Google Cloud Build",
|
|
53113
|
+
constant: "GOOGLE_CLOUD_BUILD",
|
|
53114
|
+
env: "BUILDER_OUTPUT"
|
|
53115
|
+
},
|
|
53116
|
+
{
|
|
53117
|
+
name: "Harness CI",
|
|
53118
|
+
constant: "HARNESS",
|
|
53119
|
+
env: "HARNESS_BUILD_ID"
|
|
53120
|
+
},
|
|
53121
|
+
{
|
|
53122
|
+
name: "Heroku",
|
|
53123
|
+
constant: "HEROKU",
|
|
53124
|
+
env: {
|
|
53125
|
+
env: "NODE",
|
|
53126
|
+
includes: "/app/.heroku/node/bin/node"
|
|
53127
|
+
}
|
|
53128
|
+
},
|
|
53129
|
+
{
|
|
53130
|
+
name: "Hudson",
|
|
53131
|
+
constant: "HUDSON",
|
|
53132
|
+
env: "HUDSON_URL"
|
|
53133
|
+
},
|
|
53134
|
+
{
|
|
53135
|
+
name: "Jenkins",
|
|
53136
|
+
constant: "JENKINS",
|
|
53137
|
+
env: [
|
|
53138
|
+
"JENKINS_URL",
|
|
53139
|
+
"BUILD_ID"
|
|
53140
|
+
],
|
|
53141
|
+
pr: {
|
|
53142
|
+
any: [
|
|
53143
|
+
"ghprbPullId",
|
|
53144
|
+
"CHANGE_ID"
|
|
53145
|
+
]
|
|
53146
|
+
}
|
|
53147
|
+
},
|
|
53148
|
+
{
|
|
53149
|
+
name: "LayerCI",
|
|
53150
|
+
constant: "LAYERCI",
|
|
53151
|
+
env: "LAYERCI",
|
|
53152
|
+
pr: "LAYERCI_PULL_REQUEST"
|
|
53153
|
+
},
|
|
53154
|
+
{
|
|
53155
|
+
name: "Magnum CI",
|
|
53156
|
+
constant: "MAGNUM",
|
|
53157
|
+
env: "MAGNUM"
|
|
53158
|
+
},
|
|
53159
|
+
{
|
|
53160
|
+
name: "Netlify CI",
|
|
53161
|
+
constant: "NETLIFY",
|
|
53162
|
+
env: "NETLIFY",
|
|
53163
|
+
pr: {
|
|
53164
|
+
env: "PULL_REQUEST",
|
|
53165
|
+
ne: "false"
|
|
53166
|
+
}
|
|
53167
|
+
},
|
|
53168
|
+
{
|
|
53169
|
+
name: "Nevercode",
|
|
53170
|
+
constant: "NEVERCODE",
|
|
53171
|
+
env: "NEVERCODE",
|
|
53172
|
+
pr: {
|
|
53173
|
+
env: "NEVERCODE_PULL_REQUEST",
|
|
53174
|
+
ne: "false"
|
|
53175
|
+
}
|
|
53176
|
+
},
|
|
53177
|
+
{
|
|
53178
|
+
name: "Prow",
|
|
53179
|
+
constant: "PROW",
|
|
53180
|
+
env: "PROW_JOB_ID"
|
|
53181
|
+
},
|
|
53182
|
+
{
|
|
53183
|
+
name: "ReleaseHub",
|
|
53184
|
+
constant: "RELEASEHUB",
|
|
53185
|
+
env: "RELEASE_BUILD_ID"
|
|
53186
|
+
},
|
|
53187
|
+
{
|
|
53188
|
+
name: "Render",
|
|
53189
|
+
constant: "RENDER",
|
|
53190
|
+
env: "RENDER",
|
|
53191
|
+
pr: {
|
|
53192
|
+
IS_PULL_REQUEST: "true"
|
|
53193
|
+
}
|
|
53194
|
+
},
|
|
53195
|
+
{
|
|
53196
|
+
name: "Sail CI",
|
|
53197
|
+
constant: "SAIL",
|
|
53198
|
+
env: "SAILCI",
|
|
53199
|
+
pr: "SAIL_PULL_REQUEST_NUMBER"
|
|
53200
|
+
},
|
|
53201
|
+
{
|
|
53202
|
+
name: "Screwdriver",
|
|
53203
|
+
constant: "SCREWDRIVER",
|
|
53204
|
+
env: "SCREWDRIVER",
|
|
53205
|
+
pr: {
|
|
53206
|
+
env: "SD_PULL_REQUEST",
|
|
53207
|
+
ne: "false"
|
|
53208
|
+
}
|
|
53209
|
+
},
|
|
53210
|
+
{
|
|
53211
|
+
name: "Semaphore",
|
|
53212
|
+
constant: "SEMAPHORE",
|
|
53213
|
+
env: "SEMAPHORE",
|
|
53214
|
+
pr: "PULL_REQUEST_NUMBER"
|
|
53215
|
+
},
|
|
53216
|
+
{
|
|
53217
|
+
name: "Sourcehut",
|
|
53218
|
+
constant: "SOURCEHUT",
|
|
53219
|
+
env: {
|
|
53220
|
+
CI_NAME: "sourcehut"
|
|
53221
|
+
}
|
|
53222
|
+
},
|
|
53223
|
+
{
|
|
53224
|
+
name: "Strider CD",
|
|
53225
|
+
constant: "STRIDER",
|
|
53226
|
+
env: "STRIDER"
|
|
53227
|
+
},
|
|
53228
|
+
{
|
|
53229
|
+
name: "TaskCluster",
|
|
53230
|
+
constant: "TASKCLUSTER",
|
|
53231
|
+
env: [
|
|
53232
|
+
"TASK_ID",
|
|
53233
|
+
"RUN_ID"
|
|
53234
|
+
]
|
|
53235
|
+
},
|
|
53236
|
+
{
|
|
53237
|
+
name: "TeamCity",
|
|
53238
|
+
constant: "TEAMCITY",
|
|
53239
|
+
env: "TEAMCITY_VERSION"
|
|
53240
|
+
},
|
|
53241
|
+
{
|
|
53242
|
+
name: "Travis CI",
|
|
53243
|
+
constant: "TRAVIS",
|
|
53244
|
+
env: "TRAVIS",
|
|
53245
|
+
pr: {
|
|
53246
|
+
env: "TRAVIS_PULL_REQUEST",
|
|
53247
|
+
ne: "false"
|
|
53248
|
+
}
|
|
53249
|
+
},
|
|
53250
|
+
{
|
|
53251
|
+
name: "Vela",
|
|
53252
|
+
constant: "VELA",
|
|
53253
|
+
env: "VELA",
|
|
53254
|
+
pr: {
|
|
53255
|
+
VELA_PULL_REQUEST: "1"
|
|
53256
|
+
}
|
|
53257
|
+
},
|
|
53258
|
+
{
|
|
53259
|
+
name: "Vercel",
|
|
53260
|
+
constant: "VERCEL",
|
|
53261
|
+
env: {
|
|
53262
|
+
any: [
|
|
53263
|
+
"NOW_BUILDER",
|
|
53264
|
+
"VERCEL"
|
|
53265
|
+
]
|
|
53266
|
+
},
|
|
53267
|
+
pr: "VERCEL_GIT_PULL_REQUEST_ID"
|
|
53268
|
+
},
|
|
53269
|
+
{
|
|
53270
|
+
name: "Visual Studio App Center",
|
|
53271
|
+
constant: "APPCENTER",
|
|
53272
|
+
env: "APPCENTER_BUILD_ID"
|
|
53273
|
+
},
|
|
53274
|
+
{
|
|
53275
|
+
name: "Woodpecker",
|
|
53276
|
+
constant: "WOODPECKER",
|
|
53277
|
+
env: {
|
|
53278
|
+
CI: "woodpecker"
|
|
53279
|
+
},
|
|
53280
|
+
pr: {
|
|
53281
|
+
CI_BUILD_EVENT: "pull_request"
|
|
53282
|
+
}
|
|
53283
|
+
},
|
|
53284
|
+
{
|
|
53285
|
+
name: "Xcode Cloud",
|
|
53286
|
+
constant: "XCODE_CLOUD",
|
|
53287
|
+
env: "CI_XCODE_PROJECT",
|
|
53288
|
+
pr: "CI_PULL_REQUEST_NUMBER"
|
|
53289
|
+
},
|
|
53290
|
+
{
|
|
53291
|
+
name: "Xcode Server",
|
|
53292
|
+
constant: "XCODE_SERVER",
|
|
53293
|
+
env: "XCS"
|
|
53294
|
+
}
|
|
53295
|
+
];
|
|
53296
|
+
}
|
|
53297
|
+
});
|
|
53298
|
+
|
|
53299
|
+
// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js
|
|
53300
|
+
var require_ci_info = __commonJS({
|
|
53301
|
+
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports) {
|
|
53302
|
+
init_import_meta_url();
|
|
53303
|
+
var vendors = require_vendors();
|
|
53304
|
+
var env6 = process.env;
|
|
53305
|
+
Object.defineProperty(exports, "_vendors", {
|
|
53306
|
+
value: vendors.map(function(v8) {
|
|
53307
|
+
return v8.constant;
|
|
53308
|
+
})
|
|
53309
|
+
});
|
|
53310
|
+
exports.name = null;
|
|
53311
|
+
exports.isPR = null;
|
|
53312
|
+
exports.id = null;
|
|
53313
|
+
if (env6.CI !== "false") {
|
|
53314
|
+
vendors.forEach(function(vendor) {
|
|
53315
|
+
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
|
|
53316
|
+
const isCI = envs.every(function(obj) {
|
|
53317
|
+
return checkEnv(obj);
|
|
53318
|
+
});
|
|
53319
|
+
exports[vendor.constant] = isCI;
|
|
53320
|
+
if (!isCI) {
|
|
53321
|
+
return;
|
|
53322
|
+
}
|
|
53323
|
+
exports.name = vendor.name;
|
|
53324
|
+
exports.isPR = checkPR(vendor);
|
|
53325
|
+
exports.id = vendor.constant;
|
|
53326
|
+
});
|
|
53327
|
+
}
|
|
53328
|
+
exports.isCI = !!(env6.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
|
53329
|
+
(env6.BUILD_ID || // Jenkins, Cloudbees
|
|
53330
|
+
env6.BUILD_NUMBER || // Jenkins, TeamCity
|
|
53331
|
+
env6.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers
|
|
53332
|
+
env6.CI_APP_ID || // Appflow
|
|
53333
|
+
env6.CI_BUILD_ID || // Appflow
|
|
53334
|
+
env6.CI_BUILD_NUMBER || // Appflow
|
|
53335
|
+
env6.CI_NAME || // Codeship and others
|
|
53336
|
+
env6.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
|
|
53337
|
+
env6.RUN_ID || // TaskCluster, dsari
|
|
53338
|
+
exports.name || false));
|
|
53339
|
+
function checkEnv(obj) {
|
|
53340
|
+
if (typeof obj === "string") return !!env6[obj];
|
|
53341
|
+
if ("env" in obj) {
|
|
53342
|
+
return env6[obj.env] && env6[obj.env].includes(obj.includes);
|
|
53343
|
+
}
|
|
53344
|
+
if ("any" in obj) {
|
|
53345
|
+
return obj.any.some(function(k7) {
|
|
53346
|
+
return !!env6[k7];
|
|
53347
|
+
});
|
|
53348
|
+
}
|
|
53349
|
+
return Object.keys(obj).every(function(k7) {
|
|
53350
|
+
return env6[k7] === obj[k7];
|
|
53351
|
+
});
|
|
53352
|
+
}
|
|
53353
|
+
__name(checkEnv, "checkEnv");
|
|
53354
|
+
function checkPR(vendor) {
|
|
53355
|
+
switch (typeof vendor.pr) {
|
|
53356
|
+
case "string":
|
|
53357
|
+
return !!env6[vendor.pr];
|
|
53358
|
+
case "object":
|
|
53359
|
+
if ("env" in vendor.pr) {
|
|
53360
|
+
if ("any" in vendor.pr) {
|
|
53361
|
+
return vendor.pr.any.some(function(key) {
|
|
53362
|
+
return env6[vendor.pr.env] === key;
|
|
53363
|
+
});
|
|
53364
|
+
} else {
|
|
53365
|
+
return vendor.pr.env in env6 && env6[vendor.pr.env] !== vendor.pr.ne;
|
|
53366
|
+
}
|
|
53367
|
+
} else if ("any" in vendor.pr) {
|
|
53368
|
+
return vendor.pr.any.some(function(key) {
|
|
53369
|
+
return !!env6[key];
|
|
53370
|
+
});
|
|
53371
|
+
} else {
|
|
53372
|
+
return checkEnv(vendor.pr);
|
|
53373
|
+
}
|
|
53374
|
+
default:
|
|
53375
|
+
return null;
|
|
53376
|
+
}
|
|
53377
|
+
}
|
|
53378
|
+
__name(checkPR, "checkPR");
|
|
53379
|
+
}
|
|
53380
|
+
});
|
|
53381
|
+
|
|
52835
53382
|
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/error.js
|
|
52836
53383
|
function getLineColFromPtr2(string, ptr) {
|
|
52837
53384
|
let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
@@ -53813,7 +54360,7 @@ function file2(name2, options) {
|
|
|
53813
54360
|
for (dir2 of up2(start, options)) {
|
|
53814
54361
|
try {
|
|
53815
54362
|
tmp = path3.join(dir2, name2);
|
|
53816
|
-
if (
|
|
54363
|
+
if (fs23.statSync(tmp).isFile()) return tmp;
|
|
53817
54364
|
} catch {
|
|
53818
54365
|
}
|
|
53819
54366
|
}
|
|
@@ -53824,7 +54371,7 @@ function dir(name2, options) {
|
|
|
53824
54371
|
for (dir2 of up2(start, options)) {
|
|
53825
54372
|
try {
|
|
53826
54373
|
tmp = path3.join(dir2, name2);
|
|
53827
|
-
if (
|
|
54374
|
+
if (fs23.statSync(tmp).isDirectory()) return tmp;
|
|
53828
54375
|
} catch {
|
|
53829
54376
|
}
|
|
53830
54377
|
}
|
|
@@ -55412,458 +55959,6 @@ var init_streams = __esm({
|
|
|
55412
55959
|
stderr = process.stderr;
|
|
55413
55960
|
}
|
|
55414
55961
|
});
|
|
55415
|
-
|
|
55416
|
-
// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json
|
|
55417
|
-
var require_vendors = __commonJS({
|
|
55418
|
-
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports, module4) {
|
|
55419
|
-
module4.exports = [
|
|
55420
|
-
{
|
|
55421
|
-
name: "Agola CI",
|
|
55422
|
-
constant: "AGOLA",
|
|
55423
|
-
env: "AGOLA_GIT_REF",
|
|
55424
|
-
pr: "AGOLA_PULL_REQUEST_ID"
|
|
55425
|
-
},
|
|
55426
|
-
{
|
|
55427
|
-
name: "Alpic",
|
|
55428
|
-
constant: "ALPIC",
|
|
55429
|
-
env: "ALPIC_HOST"
|
|
55430
|
-
},
|
|
55431
|
-
{
|
|
55432
|
-
name: "Appcircle",
|
|
55433
|
-
constant: "APPCIRCLE",
|
|
55434
|
-
env: "AC_APPCIRCLE",
|
|
55435
|
-
pr: {
|
|
55436
|
-
env: "AC_GIT_PR",
|
|
55437
|
-
ne: "false"
|
|
55438
|
-
}
|
|
55439
|
-
},
|
|
55440
|
-
{
|
|
55441
|
-
name: "AppVeyor",
|
|
55442
|
-
constant: "APPVEYOR",
|
|
55443
|
-
env: "APPVEYOR",
|
|
55444
|
-
pr: "APPVEYOR_PULL_REQUEST_NUMBER"
|
|
55445
|
-
},
|
|
55446
|
-
{
|
|
55447
|
-
name: "AWS CodeBuild",
|
|
55448
|
-
constant: "CODEBUILD",
|
|
55449
|
-
env: "CODEBUILD_BUILD_ARN",
|
|
55450
|
-
pr: {
|
|
55451
|
-
env: "CODEBUILD_WEBHOOK_EVENT",
|
|
55452
|
-
any: [
|
|
55453
|
-
"PULL_REQUEST_CREATED",
|
|
55454
|
-
"PULL_REQUEST_UPDATED",
|
|
55455
|
-
"PULL_REQUEST_REOPENED"
|
|
55456
|
-
]
|
|
55457
|
-
}
|
|
55458
|
-
},
|
|
55459
|
-
{
|
|
55460
|
-
name: "Azure Pipelines",
|
|
55461
|
-
constant: "AZURE_PIPELINES",
|
|
55462
|
-
env: "TF_BUILD",
|
|
55463
|
-
pr: {
|
|
55464
|
-
BUILD_REASON: "PullRequest"
|
|
55465
|
-
}
|
|
55466
|
-
},
|
|
55467
|
-
{
|
|
55468
|
-
name: "Bamboo",
|
|
55469
|
-
constant: "BAMBOO",
|
|
55470
|
-
env: "bamboo_planKey"
|
|
55471
|
-
},
|
|
55472
|
-
{
|
|
55473
|
-
name: "Bitbucket Pipelines",
|
|
55474
|
-
constant: "BITBUCKET",
|
|
55475
|
-
env: "BITBUCKET_COMMIT",
|
|
55476
|
-
pr: "BITBUCKET_PR_ID"
|
|
55477
|
-
},
|
|
55478
|
-
{
|
|
55479
|
-
name: "Bitrise",
|
|
55480
|
-
constant: "BITRISE",
|
|
55481
|
-
env: "BITRISE_IO",
|
|
55482
|
-
pr: "BITRISE_PULL_REQUEST"
|
|
55483
|
-
},
|
|
55484
|
-
{
|
|
55485
|
-
name: "Buddy",
|
|
55486
|
-
constant: "BUDDY",
|
|
55487
|
-
env: "BUDDY_WORKSPACE_ID",
|
|
55488
|
-
pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
|
|
55489
|
-
},
|
|
55490
|
-
{
|
|
55491
|
-
name: "Buildkite",
|
|
55492
|
-
constant: "BUILDKITE",
|
|
55493
|
-
env: "BUILDKITE",
|
|
55494
|
-
pr: {
|
|
55495
|
-
env: "BUILDKITE_PULL_REQUEST",
|
|
55496
|
-
ne: "false"
|
|
55497
|
-
}
|
|
55498
|
-
},
|
|
55499
|
-
{
|
|
55500
|
-
name: "CircleCI",
|
|
55501
|
-
constant: "CIRCLE",
|
|
55502
|
-
env: "CIRCLECI",
|
|
55503
|
-
pr: "CIRCLE_PULL_REQUEST"
|
|
55504
|
-
},
|
|
55505
|
-
{
|
|
55506
|
-
name: "Cirrus CI",
|
|
55507
|
-
constant: "CIRRUS",
|
|
55508
|
-
env: "CIRRUS_CI",
|
|
55509
|
-
pr: "CIRRUS_PR"
|
|
55510
|
-
},
|
|
55511
|
-
{
|
|
55512
|
-
name: "Cloudflare Pages",
|
|
55513
|
-
constant: "CLOUDFLARE_PAGES",
|
|
55514
|
-
env: "CF_PAGES"
|
|
55515
|
-
},
|
|
55516
|
-
{
|
|
55517
|
-
name: "Cloudflare Workers",
|
|
55518
|
-
constant: "CLOUDFLARE_WORKERS",
|
|
55519
|
-
env: "WORKERS_CI"
|
|
55520
|
-
},
|
|
55521
|
-
{
|
|
55522
|
-
name: "Codefresh",
|
|
55523
|
-
constant: "CODEFRESH",
|
|
55524
|
-
env: "CF_BUILD_ID",
|
|
55525
|
-
pr: {
|
|
55526
|
-
any: [
|
|
55527
|
-
"CF_PULL_REQUEST_NUMBER",
|
|
55528
|
-
"CF_PULL_REQUEST_ID"
|
|
55529
|
-
]
|
|
55530
|
-
}
|
|
55531
|
-
},
|
|
55532
|
-
{
|
|
55533
|
-
name: "Codemagic",
|
|
55534
|
-
constant: "CODEMAGIC",
|
|
55535
|
-
env: "CM_BUILD_ID",
|
|
55536
|
-
pr: "CM_PULL_REQUEST"
|
|
55537
|
-
},
|
|
55538
|
-
{
|
|
55539
|
-
name: "Codeship",
|
|
55540
|
-
constant: "CODESHIP",
|
|
55541
|
-
env: {
|
|
55542
|
-
CI_NAME: "codeship"
|
|
55543
|
-
}
|
|
55544
|
-
},
|
|
55545
|
-
{
|
|
55546
|
-
name: "Drone",
|
|
55547
|
-
constant: "DRONE",
|
|
55548
|
-
env: "DRONE",
|
|
55549
|
-
pr: {
|
|
55550
|
-
DRONE_BUILD_EVENT: "pull_request"
|
|
55551
|
-
}
|
|
55552
|
-
},
|
|
55553
|
-
{
|
|
55554
|
-
name: "dsari",
|
|
55555
|
-
constant: "DSARI",
|
|
55556
|
-
env: "DSARI"
|
|
55557
|
-
},
|
|
55558
|
-
{
|
|
55559
|
-
name: "Earthly",
|
|
55560
|
-
constant: "EARTHLY",
|
|
55561
|
-
env: "EARTHLY_CI"
|
|
55562
|
-
},
|
|
55563
|
-
{
|
|
55564
|
-
name: "Expo Application Services",
|
|
55565
|
-
constant: "EAS",
|
|
55566
|
-
env: "EAS_BUILD"
|
|
55567
|
-
},
|
|
55568
|
-
{
|
|
55569
|
-
name: "Gerrit",
|
|
55570
|
-
constant: "GERRIT",
|
|
55571
|
-
env: "GERRIT_PROJECT"
|
|
55572
|
-
},
|
|
55573
|
-
{
|
|
55574
|
-
name: "Gitea Actions",
|
|
55575
|
-
constant: "GITEA_ACTIONS",
|
|
55576
|
-
env: "GITEA_ACTIONS"
|
|
55577
|
-
},
|
|
55578
|
-
{
|
|
55579
|
-
name: "GitHub Actions",
|
|
55580
|
-
constant: "GITHUB_ACTIONS",
|
|
55581
|
-
env: "GITHUB_ACTIONS",
|
|
55582
|
-
pr: {
|
|
55583
|
-
GITHUB_EVENT_NAME: "pull_request"
|
|
55584
|
-
}
|
|
55585
|
-
},
|
|
55586
|
-
{
|
|
55587
|
-
name: "GitLab CI",
|
|
55588
|
-
constant: "GITLAB",
|
|
55589
|
-
env: "GITLAB_CI",
|
|
55590
|
-
pr: "CI_MERGE_REQUEST_ID"
|
|
55591
|
-
},
|
|
55592
|
-
{
|
|
55593
|
-
name: "GoCD",
|
|
55594
|
-
constant: "GOCD",
|
|
55595
|
-
env: "GO_PIPELINE_LABEL"
|
|
55596
|
-
},
|
|
55597
|
-
{
|
|
55598
|
-
name: "Google Cloud Build",
|
|
55599
|
-
constant: "GOOGLE_CLOUD_BUILD",
|
|
55600
|
-
env: "BUILDER_OUTPUT"
|
|
55601
|
-
},
|
|
55602
|
-
{
|
|
55603
|
-
name: "Harness CI",
|
|
55604
|
-
constant: "HARNESS",
|
|
55605
|
-
env: "HARNESS_BUILD_ID"
|
|
55606
|
-
},
|
|
55607
|
-
{
|
|
55608
|
-
name: "Heroku",
|
|
55609
|
-
constant: "HEROKU",
|
|
55610
|
-
env: {
|
|
55611
|
-
env: "NODE",
|
|
55612
|
-
includes: "/app/.heroku/node/bin/node"
|
|
55613
|
-
}
|
|
55614
|
-
},
|
|
55615
|
-
{
|
|
55616
|
-
name: "Hudson",
|
|
55617
|
-
constant: "HUDSON",
|
|
55618
|
-
env: "HUDSON_URL"
|
|
55619
|
-
},
|
|
55620
|
-
{
|
|
55621
|
-
name: "Jenkins",
|
|
55622
|
-
constant: "JENKINS",
|
|
55623
|
-
env: [
|
|
55624
|
-
"JENKINS_URL",
|
|
55625
|
-
"BUILD_ID"
|
|
55626
|
-
],
|
|
55627
|
-
pr: {
|
|
55628
|
-
any: [
|
|
55629
|
-
"ghprbPullId",
|
|
55630
|
-
"CHANGE_ID"
|
|
55631
|
-
]
|
|
55632
|
-
}
|
|
55633
|
-
},
|
|
55634
|
-
{
|
|
55635
|
-
name: "LayerCI",
|
|
55636
|
-
constant: "LAYERCI",
|
|
55637
|
-
env: "LAYERCI",
|
|
55638
|
-
pr: "LAYERCI_PULL_REQUEST"
|
|
55639
|
-
},
|
|
55640
|
-
{
|
|
55641
|
-
name: "Magnum CI",
|
|
55642
|
-
constant: "MAGNUM",
|
|
55643
|
-
env: "MAGNUM"
|
|
55644
|
-
},
|
|
55645
|
-
{
|
|
55646
|
-
name: "Netlify CI",
|
|
55647
|
-
constant: "NETLIFY",
|
|
55648
|
-
env: "NETLIFY",
|
|
55649
|
-
pr: {
|
|
55650
|
-
env: "PULL_REQUEST",
|
|
55651
|
-
ne: "false"
|
|
55652
|
-
}
|
|
55653
|
-
},
|
|
55654
|
-
{
|
|
55655
|
-
name: "Nevercode",
|
|
55656
|
-
constant: "NEVERCODE",
|
|
55657
|
-
env: "NEVERCODE",
|
|
55658
|
-
pr: {
|
|
55659
|
-
env: "NEVERCODE_PULL_REQUEST",
|
|
55660
|
-
ne: "false"
|
|
55661
|
-
}
|
|
55662
|
-
},
|
|
55663
|
-
{
|
|
55664
|
-
name: "Prow",
|
|
55665
|
-
constant: "PROW",
|
|
55666
|
-
env: "PROW_JOB_ID"
|
|
55667
|
-
},
|
|
55668
|
-
{
|
|
55669
|
-
name: "ReleaseHub",
|
|
55670
|
-
constant: "RELEASEHUB",
|
|
55671
|
-
env: "RELEASE_BUILD_ID"
|
|
55672
|
-
},
|
|
55673
|
-
{
|
|
55674
|
-
name: "Render",
|
|
55675
|
-
constant: "RENDER",
|
|
55676
|
-
env: "RENDER",
|
|
55677
|
-
pr: {
|
|
55678
|
-
IS_PULL_REQUEST: "true"
|
|
55679
|
-
}
|
|
55680
|
-
},
|
|
55681
|
-
{
|
|
55682
|
-
name: "Sail CI",
|
|
55683
|
-
constant: "SAIL",
|
|
55684
|
-
env: "SAILCI",
|
|
55685
|
-
pr: "SAIL_PULL_REQUEST_NUMBER"
|
|
55686
|
-
},
|
|
55687
|
-
{
|
|
55688
|
-
name: "Screwdriver",
|
|
55689
|
-
constant: "SCREWDRIVER",
|
|
55690
|
-
env: "SCREWDRIVER",
|
|
55691
|
-
pr: {
|
|
55692
|
-
env: "SD_PULL_REQUEST",
|
|
55693
|
-
ne: "false"
|
|
55694
|
-
}
|
|
55695
|
-
},
|
|
55696
|
-
{
|
|
55697
|
-
name: "Semaphore",
|
|
55698
|
-
constant: "SEMAPHORE",
|
|
55699
|
-
env: "SEMAPHORE",
|
|
55700
|
-
pr: "PULL_REQUEST_NUMBER"
|
|
55701
|
-
},
|
|
55702
|
-
{
|
|
55703
|
-
name: "Sourcehut",
|
|
55704
|
-
constant: "SOURCEHUT",
|
|
55705
|
-
env: {
|
|
55706
|
-
CI_NAME: "sourcehut"
|
|
55707
|
-
}
|
|
55708
|
-
},
|
|
55709
|
-
{
|
|
55710
|
-
name: "Strider CD",
|
|
55711
|
-
constant: "STRIDER",
|
|
55712
|
-
env: "STRIDER"
|
|
55713
|
-
},
|
|
55714
|
-
{
|
|
55715
|
-
name: "TaskCluster",
|
|
55716
|
-
constant: "TASKCLUSTER",
|
|
55717
|
-
env: [
|
|
55718
|
-
"TASK_ID",
|
|
55719
|
-
"RUN_ID"
|
|
55720
|
-
]
|
|
55721
|
-
},
|
|
55722
|
-
{
|
|
55723
|
-
name: "TeamCity",
|
|
55724
|
-
constant: "TEAMCITY",
|
|
55725
|
-
env: "TEAMCITY_VERSION"
|
|
55726
|
-
},
|
|
55727
|
-
{
|
|
55728
|
-
name: "Travis CI",
|
|
55729
|
-
constant: "TRAVIS",
|
|
55730
|
-
env: "TRAVIS",
|
|
55731
|
-
pr: {
|
|
55732
|
-
env: "TRAVIS_PULL_REQUEST",
|
|
55733
|
-
ne: "false"
|
|
55734
|
-
}
|
|
55735
|
-
},
|
|
55736
|
-
{
|
|
55737
|
-
name: "Vela",
|
|
55738
|
-
constant: "VELA",
|
|
55739
|
-
env: "VELA",
|
|
55740
|
-
pr: {
|
|
55741
|
-
VELA_PULL_REQUEST: "1"
|
|
55742
|
-
}
|
|
55743
|
-
},
|
|
55744
|
-
{
|
|
55745
|
-
name: "Vercel",
|
|
55746
|
-
constant: "VERCEL",
|
|
55747
|
-
env: {
|
|
55748
|
-
any: [
|
|
55749
|
-
"NOW_BUILDER",
|
|
55750
|
-
"VERCEL"
|
|
55751
|
-
]
|
|
55752
|
-
},
|
|
55753
|
-
pr: "VERCEL_GIT_PULL_REQUEST_ID"
|
|
55754
|
-
},
|
|
55755
|
-
{
|
|
55756
|
-
name: "Visual Studio App Center",
|
|
55757
|
-
constant: "APPCENTER",
|
|
55758
|
-
env: "APPCENTER_BUILD_ID"
|
|
55759
|
-
},
|
|
55760
|
-
{
|
|
55761
|
-
name: "Woodpecker",
|
|
55762
|
-
constant: "WOODPECKER",
|
|
55763
|
-
env: {
|
|
55764
|
-
CI: "woodpecker"
|
|
55765
|
-
},
|
|
55766
|
-
pr: {
|
|
55767
|
-
CI_BUILD_EVENT: "pull_request"
|
|
55768
|
-
}
|
|
55769
|
-
},
|
|
55770
|
-
{
|
|
55771
|
-
name: "Xcode Cloud",
|
|
55772
|
-
constant: "XCODE_CLOUD",
|
|
55773
|
-
env: "CI_XCODE_PROJECT",
|
|
55774
|
-
pr: "CI_PULL_REQUEST_NUMBER"
|
|
55775
|
-
},
|
|
55776
|
-
{
|
|
55777
|
-
name: "Xcode Server",
|
|
55778
|
-
constant: "XCODE_SERVER",
|
|
55779
|
-
env: "XCS"
|
|
55780
|
-
}
|
|
55781
|
-
];
|
|
55782
|
-
}
|
|
55783
|
-
});
|
|
55784
|
-
|
|
55785
|
-
// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js
|
|
55786
|
-
var require_ci_info = __commonJS({
|
|
55787
|
-
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports) {
|
|
55788
|
-
init_import_meta_url();
|
|
55789
|
-
var vendors = require_vendors();
|
|
55790
|
-
var env6 = process.env;
|
|
55791
|
-
Object.defineProperty(exports, "_vendors", {
|
|
55792
|
-
value: vendors.map(function(v8) {
|
|
55793
|
-
return v8.constant;
|
|
55794
|
-
})
|
|
55795
|
-
});
|
|
55796
|
-
exports.name = null;
|
|
55797
|
-
exports.isPR = null;
|
|
55798
|
-
exports.id = null;
|
|
55799
|
-
if (env6.CI !== "false") {
|
|
55800
|
-
vendors.forEach(function(vendor) {
|
|
55801
|
-
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
|
|
55802
|
-
const isCI = envs.every(function(obj) {
|
|
55803
|
-
return checkEnv(obj);
|
|
55804
|
-
});
|
|
55805
|
-
exports[vendor.constant] = isCI;
|
|
55806
|
-
if (!isCI) {
|
|
55807
|
-
return;
|
|
55808
|
-
}
|
|
55809
|
-
exports.name = vendor.name;
|
|
55810
|
-
exports.isPR = checkPR(vendor);
|
|
55811
|
-
exports.id = vendor.constant;
|
|
55812
|
-
});
|
|
55813
|
-
}
|
|
55814
|
-
exports.isCI = !!(env6.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
|
55815
|
-
(env6.BUILD_ID || // Jenkins, Cloudbees
|
|
55816
|
-
env6.BUILD_NUMBER || // Jenkins, TeamCity
|
|
55817
|
-
env6.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers
|
|
55818
|
-
env6.CI_APP_ID || // Appflow
|
|
55819
|
-
env6.CI_BUILD_ID || // Appflow
|
|
55820
|
-
env6.CI_BUILD_NUMBER || // Appflow
|
|
55821
|
-
env6.CI_NAME || // Codeship and others
|
|
55822
|
-
env6.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
|
|
55823
|
-
env6.RUN_ID || // TaskCluster, dsari
|
|
55824
|
-
exports.name || false));
|
|
55825
|
-
function checkEnv(obj) {
|
|
55826
|
-
if (typeof obj === "string") return !!env6[obj];
|
|
55827
|
-
if ("env" in obj) {
|
|
55828
|
-
return env6[obj.env] && env6[obj.env].includes(obj.includes);
|
|
55829
|
-
}
|
|
55830
|
-
if ("any" in obj) {
|
|
55831
|
-
return obj.any.some(function(k7) {
|
|
55832
|
-
return !!env6[k7];
|
|
55833
|
-
});
|
|
55834
|
-
}
|
|
55835
|
-
return Object.keys(obj).every(function(k7) {
|
|
55836
|
-
return env6[k7] === obj[k7];
|
|
55837
|
-
});
|
|
55838
|
-
}
|
|
55839
|
-
__name(checkEnv, "checkEnv");
|
|
55840
|
-
function checkPR(vendor) {
|
|
55841
|
-
switch (typeof vendor.pr) {
|
|
55842
|
-
case "string":
|
|
55843
|
-
return !!env6[vendor.pr];
|
|
55844
|
-
case "object":
|
|
55845
|
-
if ("env" in vendor.pr) {
|
|
55846
|
-
if ("any" in vendor.pr) {
|
|
55847
|
-
return vendor.pr.any.some(function(key) {
|
|
55848
|
-
return env6[vendor.pr.env] === key;
|
|
55849
|
-
});
|
|
55850
|
-
} else {
|
|
55851
|
-
return vendor.pr.env in env6 && env6[vendor.pr.env] !== vendor.pr.ne;
|
|
55852
|
-
}
|
|
55853
|
-
} else if ("any" in vendor.pr) {
|
|
55854
|
-
return vendor.pr.any.some(function(key) {
|
|
55855
|
-
return !!env6[key];
|
|
55856
|
-
});
|
|
55857
|
-
} else {
|
|
55858
|
-
return checkEnv(vendor.pr);
|
|
55859
|
-
}
|
|
55860
|
-
default:
|
|
55861
|
-
return null;
|
|
55862
|
-
}
|
|
55863
|
-
}
|
|
55864
|
-
__name(checkPR, "checkPR");
|
|
55865
|
-
}
|
|
55866
|
-
});
|
|
55867
55962
|
function checkMacOSVersion(options) {
|
|
55868
55963
|
if (process.platform !== "darwin") {
|
|
55869
55964
|
return;
|
|
@@ -56651,10 +56746,10 @@ function getCacheFolder() {
|
|
|
56651
56746
|
const closestNodeModulesDirectory = dir("node_modules");
|
|
56652
56747
|
const nodeModulesCache = closestNodeModulesDirectory ? path3__namespace.join(closestNodeModulesDirectory, ".cache", "wrangler") : null;
|
|
56653
56748
|
const wranglerCache = path3__namespace.join(process.cwd(), ".wrangler", "cache");
|
|
56654
|
-
if (nodeModulesCache &&
|
|
56749
|
+
if (nodeModulesCache && fs23.existsSync(nodeModulesCache)) {
|
|
56655
56750
|
return nodeModulesCache;
|
|
56656
56751
|
}
|
|
56657
|
-
if (
|
|
56752
|
+
if (fs23.existsSync(wranglerCache)) {
|
|
56658
56753
|
return wranglerCache;
|
|
56659
56754
|
}
|
|
56660
56755
|
if (nodeModulesCache) {
|
|
@@ -56678,7 +56773,7 @@ function getConfigCache(fileName) {
|
|
|
56678
56773
|
try {
|
|
56679
56774
|
const cacheFolder = getCacheFolder();
|
|
56680
56775
|
const configCacheLocation = path3__namespace.join(cacheFolder, fileName);
|
|
56681
|
-
const configCache = JSON.parse(
|
|
56776
|
+
const configCache = JSON.parse(fs23.readFileSync(configCacheLocation, "utf-8"));
|
|
56682
56777
|
showCacheMessage(Object.keys(configCache), cacheFolder);
|
|
56683
56778
|
return configCache;
|
|
56684
56779
|
} catch {
|
|
@@ -56691,8 +56786,8 @@ function saveToConfigCache(fileName, newValues) {
|
|
|
56691
56786
|
logger.debug(`Saving to cache: ${JSON.stringify(newValues)}`);
|
|
56692
56787
|
const configCacheLocation = path3__namespace.join(cacheFolder, fileName);
|
|
56693
56788
|
const existingValues = getConfigCache(fileName);
|
|
56694
|
-
|
|
56695
|
-
|
|
56789
|
+
fs23.mkdirSync(path3__namespace.dirname(configCacheLocation), { recursive: true });
|
|
56790
|
+
fs23.writeFileSync(
|
|
56696
56791
|
configCacheLocation,
|
|
56697
56792
|
JSON.stringify({ ...existingValues, ...newValues }, null, 2)
|
|
56698
56793
|
);
|
|
@@ -56701,7 +56796,7 @@ function saveToConfigCache(fileName, newValues) {
|
|
|
56701
56796
|
function purgeConfigCaches() {
|
|
56702
56797
|
const cacheFolder = getCacheFolder();
|
|
56703
56798
|
if (cacheFolder) {
|
|
56704
|
-
|
|
56799
|
+
removeDirSync(cacheFolder);
|
|
56705
56800
|
}
|
|
56706
56801
|
}
|
|
56707
56802
|
var cacheMessageShown, arrayFormatter;
|
|
@@ -61831,11 +61926,11 @@ var init_dialogs = __esm({
|
|
|
61831
61926
|
var require_is_docker = __commonJS({
|
|
61832
61927
|
"../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js"(exports, module4) {
|
|
61833
61928
|
init_import_meta_url();
|
|
61834
|
-
var
|
|
61929
|
+
var fs27 = __require("fs");
|
|
61835
61930
|
var isDocker;
|
|
61836
61931
|
function hasDockerEnv() {
|
|
61837
61932
|
try {
|
|
61838
|
-
|
|
61933
|
+
fs27.statSync("/.dockerenv");
|
|
61839
61934
|
return true;
|
|
61840
61935
|
} catch (_5) {
|
|
61841
61936
|
return false;
|
|
@@ -61844,7 +61939,7 @@ var require_is_docker = __commonJS({
|
|
|
61844
61939
|
__name(hasDockerEnv, "hasDockerEnv");
|
|
61845
61940
|
function hasDockerCGroup() {
|
|
61846
61941
|
try {
|
|
61847
|
-
return
|
|
61942
|
+
return fs27.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
61848
61943
|
} catch (_5) {
|
|
61849
61944
|
return false;
|
|
61850
61945
|
}
|
|
@@ -61864,7 +61959,7 @@ var require_is_wsl = __commonJS({
|
|
|
61864
61959
|
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports, module4) {
|
|
61865
61960
|
init_import_meta_url();
|
|
61866
61961
|
var os12 = __require("os");
|
|
61867
|
-
var
|
|
61962
|
+
var fs27 = __require("fs");
|
|
61868
61963
|
var isDocker = require_is_docker();
|
|
61869
61964
|
var isWsl = /* @__PURE__ */ __name(() => {
|
|
61870
61965
|
if (process.platform !== "linux") {
|
|
@@ -61877,7 +61972,7 @@ var require_is_wsl = __commonJS({
|
|
|
61877
61972
|
return true;
|
|
61878
61973
|
}
|
|
61879
61974
|
try {
|
|
61880
|
-
return
|
|
61975
|
+
return fs27.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
|
|
61881
61976
|
} catch (_5) {
|
|
61882
61977
|
return false;
|
|
61883
61978
|
}
|
|
@@ -61919,7 +62014,7 @@ var require_open = __commonJS({
|
|
|
61919
62014
|
init_import_meta_url();
|
|
61920
62015
|
var path82 = __require("path");
|
|
61921
62016
|
var childProcess2 = __require("child_process");
|
|
61922
|
-
var { promises:
|
|
62017
|
+
var { promises: fs27, constants: fsConstants } = __require("fs");
|
|
61923
62018
|
var isWsl = require_is_wsl();
|
|
61924
62019
|
var isDocker = require_is_docker();
|
|
61925
62020
|
var defineLazyProperty = require_define_lazy_prop();
|
|
@@ -61935,14 +62030,14 @@ var require_open = __commonJS({
|
|
|
61935
62030
|
const configFilePath = "/etc/wsl.conf";
|
|
61936
62031
|
let isConfigFileExists = false;
|
|
61937
62032
|
try {
|
|
61938
|
-
await
|
|
62033
|
+
await fs27.access(configFilePath, fsConstants.F_OK);
|
|
61939
62034
|
isConfigFileExists = true;
|
|
61940
62035
|
} catch {
|
|
61941
62036
|
}
|
|
61942
62037
|
if (!isConfigFileExists) {
|
|
61943
62038
|
return defaultMountPoint;
|
|
61944
62039
|
}
|
|
61945
|
-
const configContent = await
|
|
62040
|
+
const configContent = await fs27.readFile(configFilePath, { encoding: "utf8" });
|
|
61946
62041
|
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
61947
62042
|
if (!configMountPoint) {
|
|
61948
62043
|
return defaultMountPoint;
|
|
@@ -62042,7 +62137,7 @@ var require_open = __commonJS({
|
|
|
62042
62137
|
const isBundled = !__dirname || __dirname === "/";
|
|
62043
62138
|
let exeLocalXdgOpen = false;
|
|
62044
62139
|
try {
|
|
62045
|
-
await
|
|
62140
|
+
await fs27.access(localXdgOpenPath, fsConstants.X_OK);
|
|
62046
62141
|
exeLocalXdgOpen = true;
|
|
62047
62142
|
} catch {
|
|
62048
62143
|
}
|
|
@@ -73712,11 +73807,11 @@ function createFileFromPath(path82, { mtimeMs, size }, filenameOrOptions, option
|
|
|
73712
73807
|
});
|
|
73713
73808
|
}
|
|
73714
73809
|
function fileFromPathSync(path82, filenameOrOptions, options = {}) {
|
|
73715
|
-
const stats =
|
|
73810
|
+
const stats = fs23.statSync(path82);
|
|
73716
73811
|
return createFileFromPath(path82, stats, filenameOrOptions, options);
|
|
73717
73812
|
}
|
|
73718
73813
|
async function fileFromPath2(path82, filenameOrOptions, options) {
|
|
73719
|
-
const stats = await
|
|
73814
|
+
const stats = await fs23.promises.stat(path82);
|
|
73720
73815
|
return createFileFromPath(path82, stats, filenameOrOptions, options);
|
|
73721
73816
|
}
|
|
73722
73817
|
var import_node_domexception, __classPrivateFieldSet4, __classPrivateFieldGet6, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath;
|
|
@@ -73761,12 +73856,12 @@ var init_fileFromPath = __esm({
|
|
|
73761
73856
|
});
|
|
73762
73857
|
}
|
|
73763
73858
|
async *stream() {
|
|
73764
|
-
const { mtimeMs } = await
|
|
73859
|
+
const { mtimeMs } = await fs23.promises.stat(__classPrivateFieldGet6(this, _FileFromPath_path, "f"));
|
|
73765
73860
|
if (mtimeMs > this.lastModified) {
|
|
73766
73861
|
throw new import_node_domexception.default(MESSAGE, "NotReadableError");
|
|
73767
73862
|
}
|
|
73768
73863
|
if (this.size) {
|
|
73769
|
-
yield*
|
|
73864
|
+
yield* fs23.createReadStream(__classPrivateFieldGet6(this, _FileFromPath_path, "f"), {
|
|
73770
73865
|
start: __classPrivateFieldGet6(this, _FileFromPath_start, "f"),
|
|
73771
73866
|
end: __classPrivateFieldGet6(this, _FileFromPath_start, "f") + this.size - 1
|
|
73772
73867
|
});
|
|
@@ -73817,7 +73912,7 @@ function getRuntime2() {
|
|
|
73817
73912
|
getMultipartRequestOptions: getMultipartRequestOptions2,
|
|
73818
73913
|
getDefaultAgent: /* @__PURE__ */ __name((url4) => url4.startsWith("https") ? defaultHttpsAgent : defaultHttpAgent, "getDefaultAgent"),
|
|
73819
73914
|
fileFromPath: fileFromPath3,
|
|
73820
|
-
isFsReadStream: /* @__PURE__ */ __name((value) => value instanceof
|
|
73915
|
+
isFsReadStream: /* @__PURE__ */ __name((value) => value instanceof fs23.ReadStream, "isFsReadStream")
|
|
73821
73916
|
};
|
|
73822
73917
|
}
|
|
73823
73918
|
var import_agentkeepalive, import_abort_controller, fileFromPathWarned, defaultHttpAgent, defaultHttpsAgent;
|
|
@@ -122740,10 +122835,10 @@ function getAuthConfigFilePath() {
|
|
|
122740
122835
|
}
|
|
122741
122836
|
function writeAuthConfigFile(config) {
|
|
122742
122837
|
const configPath = getAuthConfigFilePath();
|
|
122743
|
-
|
|
122838
|
+
fs23.mkdirSync(path3__namespace.default.dirname(configPath), {
|
|
122744
122839
|
recursive: true
|
|
122745
122840
|
});
|
|
122746
|
-
|
|
122841
|
+
fs23.writeFileSync(path3__namespace.default.join(configPath), dist_default2.stringify(config), {
|
|
122747
122842
|
encoding: "utf-8"
|
|
122748
122843
|
});
|
|
122749
122844
|
reinitialiseAuthTokens();
|
|
@@ -122969,7 +123064,7 @@ async function logout() {
|
|
|
122969
123064
|
}
|
|
122970
123065
|
});
|
|
122971
123066
|
await response.text();
|
|
122972
|
-
|
|
123067
|
+
fs23.rmSync(getAuthConfigFilePath());
|
|
122973
123068
|
logger.log(`Successfully logged out.`);
|
|
122974
123069
|
}
|
|
122975
123070
|
function listScopes(message = "\u{1F481} Available scopes:") {
|
|
@@ -123001,7 +123096,7 @@ async function getAccountId(config) {
|
|
|
123001
123096
|
return accountID;
|
|
123002
123097
|
} catch (e9) {
|
|
123003
123098
|
if (e9 instanceof NoDefaultValueProvided) {
|
|
123004
|
-
const redactAccountName =
|
|
123099
|
+
const redactAccountName = import_ci_info3.default.isCI;
|
|
123005
123100
|
throw new UserError(
|
|
123006
123101
|
`More than one account available but unable to select one in non-interactive mode.
|
|
123007
123102
|
Please set the appropriate \`account_id\` in your ${configFileName(void 0)} file or assign it to the \`CLOUDFLARE_ACCOUNT_ID\` environment variable.
|
|
@@ -123111,11 +123206,12 @@ async function getJSONFromResponse(response) {
|
|
|
123111
123206
|
);
|
|
123112
123207
|
}
|
|
123113
123208
|
}
|
|
123114
|
-
var import_undici3, USER_AUTH_CONFIG_PATH, DefaultScopes, DefaultScopeKeys, localState, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET;
|
|
123209
|
+
var import_ci_info3, import_undici3, USER_AUTH_CONFIG_PATH, DefaultScopes, DefaultScopeKeys, localState, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET;
|
|
123115
123210
|
var init_user2 = __esm({
|
|
123116
123211
|
"src/user/user.ts"() {
|
|
123117
123212
|
init_import_meta_url();
|
|
123118
123213
|
init_dist();
|
|
123214
|
+
import_ci_info3 = __toESM(require_ci_info());
|
|
123119
123215
|
init_dist2();
|
|
123120
123216
|
init_esm2();
|
|
123121
123217
|
import_undici3 = __toESM(require_undici());
|
|
@@ -123404,7 +123500,7 @@ var init_esm5 = __esm({
|
|
|
123404
123500
|
const { root, type } = opts;
|
|
123405
123501
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
123406
123502
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
123407
|
-
const statMethod = opts.lstat ?
|
|
123503
|
+
const statMethod = opts.lstat ? fs23.lstatSync : fs23.statSync;
|
|
123408
123504
|
if (wantBigintFsStats) {
|
|
123409
123505
|
this._stat = (path82) => statMethod(path82, { bigint: true });
|
|
123410
123506
|
} else {
|
|
@@ -123476,7 +123572,7 @@ var init_esm5 = __esm({
|
|
|
123476
123572
|
async _exploreDir(path82, depth) {
|
|
123477
123573
|
let files;
|
|
123478
123574
|
try {
|
|
123479
|
-
files = await
|
|
123575
|
+
files = await fs12.readdir(path82, this._rdOptions);
|
|
123480
123576
|
} catch (error2) {
|
|
123481
123577
|
this._onError(error2);
|
|
123482
123578
|
}
|
|
@@ -123514,8 +123610,8 @@ var init_esm5 = __esm({
|
|
|
123514
123610
|
if (stats && stats.isSymbolicLink()) {
|
|
123515
123611
|
const full = entry.fullPath;
|
|
123516
123612
|
try {
|
|
123517
|
-
const entryRealPath = await
|
|
123518
|
-
const entryRealPathStats =
|
|
123613
|
+
const entryRealPath = await fs12.realpath(full);
|
|
123614
|
+
const entryRealPathStats = fs23.lstatSync(entryRealPath);
|
|
123519
123615
|
if (entryRealPathStats.isFile()) {
|
|
123520
123616
|
return "file";
|
|
123521
123617
|
}
|
|
@@ -123566,7 +123662,7 @@ function createFsWatchInstance(path82, options, listener, errHandler, emitRaw) {
|
|
|
123566
123662
|
}
|
|
123567
123663
|
}, "handleEvent");
|
|
123568
123664
|
try {
|
|
123569
|
-
return
|
|
123665
|
+
return fs23.watch(path82, {
|
|
123570
123666
|
persistent: options.persistent
|
|
123571
123667
|
}, handleEvent);
|
|
123572
123668
|
} catch (error2) {
|
|
@@ -123601,7 +123697,7 @@ var init_handler = __esm({
|
|
|
123601
123697
|
};
|
|
123602
123698
|
EV = EVENTS;
|
|
123603
123699
|
THROTTLE_MODE_WATCH = "watch";
|
|
123604
|
-
statMethods = { lstat:
|
|
123700
|
+
statMethods = { lstat: fs12.lstat, stat: fs12.stat };
|
|
123605
123701
|
KEY_LISTENERS = "listeners";
|
|
123606
123702
|
KEY_ERR = "errHandlers";
|
|
123607
123703
|
KEY_RAW = "rawEmitters";
|
|
@@ -123942,7 +124038,7 @@ var init_handler = __esm({
|
|
|
123942
124038
|
cont.watcherUnusable = true;
|
|
123943
124039
|
if (isWindows2 && error2.code === "EPERM") {
|
|
123944
124040
|
try {
|
|
123945
|
-
const fd = await
|
|
124041
|
+
const fd = await fs12.open(path82, "r");
|
|
123946
124042
|
await fd.close();
|
|
123947
124043
|
broadcastErr(error2);
|
|
123948
124044
|
} catch (err) {
|
|
@@ -123978,7 +124074,7 @@ var init_handler = __esm({
|
|
|
123978
124074
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
123979
124075
|
const copts = cont && cont.options;
|
|
123980
124076
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
123981
|
-
|
|
124077
|
+
fs23.unwatchFile(fullPath);
|
|
123982
124078
|
cont = void 0;
|
|
123983
124079
|
}
|
|
123984
124080
|
if (cont) {
|
|
@@ -123989,7 +124085,7 @@ var init_handler = __esm({
|
|
|
123989
124085
|
listeners: listener,
|
|
123990
124086
|
rawEmitters: rawEmitter,
|
|
123991
124087
|
options,
|
|
123992
|
-
watcher:
|
|
124088
|
+
watcher: fs23.watchFile(fullPath, options, (curr, prev) => {
|
|
123993
124089
|
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
123994
124090
|
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
123995
124091
|
});
|
|
@@ -124006,7 +124102,7 @@ var init_handler = __esm({
|
|
|
124006
124102
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
124007
124103
|
if (isEmptySet(cont.listeners)) {
|
|
124008
124104
|
FsWatchFileInstances.delete(fullPath);
|
|
124009
|
-
|
|
124105
|
+
fs23.unwatchFile(fullPath);
|
|
124010
124106
|
cont.options = cont.watcher = void 0;
|
|
124011
124107
|
Object.freeze(cont);
|
|
124012
124108
|
}
|
|
@@ -124074,7 +124170,7 @@ var init_handler = __esm({
|
|
|
124074
124170
|
return;
|
|
124075
124171
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
124076
124172
|
try {
|
|
124077
|
-
const newStats2 = await
|
|
124173
|
+
const newStats2 = await fs12.stat(file3);
|
|
124078
124174
|
if (this.fsw.closed)
|
|
124079
124175
|
return;
|
|
124080
124176
|
const at3 = newStats2.atimeMs;
|
|
@@ -124129,7 +124225,7 @@ var init_handler = __esm({
|
|
|
124129
124225
|
this.fsw._incrReadyCount();
|
|
124130
124226
|
let linkPath;
|
|
124131
124227
|
try {
|
|
124132
|
-
linkPath = await
|
|
124228
|
+
linkPath = await fs12.realpath(path82);
|
|
124133
124229
|
} catch (e9) {
|
|
124134
124230
|
this.fsw._emitReady();
|
|
124135
124231
|
return true;
|
|
@@ -124277,7 +124373,7 @@ var init_handler = __esm({
|
|
|
124277
124373
|
let closer;
|
|
124278
124374
|
if (stats.isDirectory()) {
|
|
124279
124375
|
const absPath = path3__namespace.resolve(path82);
|
|
124280
|
-
const targetPath = follow ? await
|
|
124376
|
+
const targetPath = follow ? await fs12.realpath(path82) : path82;
|
|
124281
124377
|
if (this.fsw.closed)
|
|
124282
124378
|
return;
|
|
124283
124379
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -124287,7 +124383,7 @@ var init_handler = __esm({
|
|
|
124287
124383
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
124288
124384
|
}
|
|
124289
124385
|
} else if (stats.isSymbolicLink()) {
|
|
124290
|
-
const targetPath = follow ? await
|
|
124386
|
+
const targetPath = follow ? await fs12.realpath(path82) : path82;
|
|
124291
124387
|
if (this.fsw.closed)
|
|
124292
124388
|
return;
|
|
124293
124389
|
const parent = path3__namespace.dirname(wh.watchPath);
|
|
@@ -124467,7 +124563,7 @@ var init_esm6 = __esm({
|
|
|
124467
124563
|
return;
|
|
124468
124564
|
const dir2 = this.path;
|
|
124469
124565
|
try {
|
|
124470
|
-
await
|
|
124566
|
+
await fs12.readdir(dir2);
|
|
124471
124567
|
} catch (err) {
|
|
124472
124568
|
if (this._removeWatcher) {
|
|
124473
124569
|
this._removeWatcher(path3__namespace.dirname(dir2), path3__namespace.basename(dir2));
|
|
@@ -124798,7 +124894,7 @@ var init_esm6 = __esm({
|
|
|
124798
124894
|
const fullPath = opts.cwd ? path3__namespace.join(opts.cwd, path82) : path82;
|
|
124799
124895
|
let stats2;
|
|
124800
124896
|
try {
|
|
124801
|
-
stats2 = await
|
|
124897
|
+
stats2 = await fs12.stat(fullPath);
|
|
124802
124898
|
} catch (err) {
|
|
124803
124899
|
}
|
|
124804
124900
|
if (!stats2 || this.closed)
|
|
@@ -124877,7 +124973,7 @@ var init_esm6 = __esm({
|
|
|
124877
124973
|
const now = /* @__PURE__ */ new Date();
|
|
124878
124974
|
const writes = this._pendingWrites;
|
|
124879
124975
|
function awaitWriteFinishFn(prevStat) {
|
|
124880
|
-
|
|
124976
|
+
fs23.stat(fullPath, (err, curStat) => {
|
|
124881
124977
|
if (err || !writes.has(path82)) {
|
|
124882
124978
|
if (err && err.code !== "ENOENT")
|
|
124883
124979
|
awfEmit(err);
|
|
@@ -125078,7 +125174,7 @@ var init_dedent = __esm({
|
|
|
125078
125174
|
}
|
|
125079
125175
|
});
|
|
125080
125176
|
async function applyMiddlewareLoaderFacade(entry, tmpDirPath, middleware) {
|
|
125081
|
-
tmpDirPath =
|
|
125177
|
+
tmpDirPath = fs23__namespace.realpathSync(tmpDirPath);
|
|
125082
125178
|
const middlewareIdentifiers = middleware.map((m7, index) => [
|
|
125083
125179
|
`__MIDDLEWARE_${index}__`,
|
|
125084
125180
|
path3__namespace.resolve(getBasePath(), m7.path)
|
|
@@ -125097,7 +125193,7 @@ async function applyMiddlewareLoaderFacade(entry, tmpDirPath, middleware) {
|
|
|
125097
125193
|
).join("\n");
|
|
125098
125194
|
const middlewareFns = middlewareIdentifiers.map(([m7]) => `${m7}.default`).join(",");
|
|
125099
125195
|
if (entry.format === "modules") {
|
|
125100
|
-
await
|
|
125196
|
+
await fs23__namespace.promises.writeFile(
|
|
125101
125197
|
dynamicFacadePath,
|
|
125102
125198
|
dedent3`
|
|
125103
125199
|
import worker, * as OTHER_EXPORTS from "${prepareFilePath(entry.file)}";
|
|
@@ -125120,14 +125216,14 @@ async function applyMiddlewareLoaderFacade(entry, tmpDirPath, middleware) {
|
|
|
125120
125216
|
getBasePath(),
|
|
125121
125217
|
"templates/middleware/loader-modules.ts"
|
|
125122
125218
|
);
|
|
125123
|
-
const baseLoader = await
|
|
125219
|
+
const baseLoader = await fs23__namespace.promises.readFile(loaderPath, "utf-8");
|
|
125124
125220
|
const transformedLoader = baseLoader.replaceAll("__ENTRY_POINT__", prepareFilePath(dynamicFacadePath)).replace(
|
|
125125
125221
|
"./common",
|
|
125126
125222
|
prepareFilePath(
|
|
125127
125223
|
path3__namespace.resolve(getBasePath(), "templates/middleware/common.ts")
|
|
125128
125224
|
)
|
|
125129
125225
|
);
|
|
125130
|
-
await
|
|
125226
|
+
await fs23__namespace.promises.writeFile(targetPathLoader, transformedLoader);
|
|
125131
125227
|
return {
|
|
125132
125228
|
entry: {
|
|
125133
125229
|
...entry,
|
|
@@ -125139,7 +125235,7 @@ async function applyMiddlewareLoaderFacade(entry, tmpDirPath, middleware) {
|
|
|
125139
125235
|
getBasePath(),
|
|
125140
125236
|
"templates/middleware/loader-sw.ts"
|
|
125141
125237
|
);
|
|
125142
|
-
await
|
|
125238
|
+
await fs23__namespace.promises.writeFile(
|
|
125143
125239
|
dynamicFacadePath,
|
|
125144
125240
|
dedent3`
|
|
125145
125241
|
import { __facade_registerInternal__ } from "${prepareFilePath(loaderSwPath)}";
|
|
@@ -125718,10 +125814,10 @@ async function bundleWorker(entry, destination, {
|
|
|
125718
125814
|
const inject = injectOption ?? [];
|
|
125719
125815
|
if (checkFetch) {
|
|
125720
125816
|
const checkedFetchFileToInject = path3__namespace.join(tmpDir.path, "checked-fetch.js");
|
|
125721
|
-
if (checkFetch && !
|
|
125722
|
-
|
|
125817
|
+
if (checkFetch && !fs23__namespace.existsSync(checkedFetchFileToInject)) {
|
|
125818
|
+
fs23__namespace.writeFileSync(
|
|
125723
125819
|
checkedFetchFileToInject,
|
|
125724
|
-
|
|
125820
|
+
fs23__namespace.readFileSync(
|
|
125725
125821
|
path3__namespace.resolve(getBasePath(), "templates/checked-fetch.js")
|
|
125726
125822
|
)
|
|
125727
125823
|
);
|
|
@@ -125876,7 +125972,7 @@ async function bundleWorker(entry, destination, {
|
|
|
125876
125972
|
metaFilePath = path3__namespace.join(destination, "bundle-meta.json");
|
|
125877
125973
|
}
|
|
125878
125974
|
const metaJson = JSON.stringify(result.metafile, null, 2);
|
|
125879
|
-
|
|
125975
|
+
fs23__namespace.writeFileSync(metaFilePath, metaJson);
|
|
125880
125976
|
}
|
|
125881
125977
|
stop = /* @__PURE__ */ __name(async function() {
|
|
125882
125978
|
tmpDir.remove();
|
|
@@ -126022,7 +126118,7 @@ var require_windows = __commonJS({
|
|
|
126022
126118
|
init_import_meta_url();
|
|
126023
126119
|
module4.exports = isexe;
|
|
126024
126120
|
isexe.sync = sync;
|
|
126025
|
-
var
|
|
126121
|
+
var fs27 = __require("fs");
|
|
126026
126122
|
function checkPathExt(path82, options) {
|
|
126027
126123
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
126028
126124
|
if (!pathext) {
|
|
@@ -126049,13 +126145,13 @@ var require_windows = __commonJS({
|
|
|
126049
126145
|
}
|
|
126050
126146
|
__name(checkStat, "checkStat");
|
|
126051
126147
|
function isexe(path82, options, cb2) {
|
|
126052
|
-
|
|
126148
|
+
fs27.stat(path82, function(er2, stat9) {
|
|
126053
126149
|
cb2(er2, er2 ? false : checkStat(stat9, path82, options));
|
|
126054
126150
|
});
|
|
126055
126151
|
}
|
|
126056
126152
|
__name(isexe, "isexe");
|
|
126057
126153
|
function sync(path82, options) {
|
|
126058
|
-
return checkStat(
|
|
126154
|
+
return checkStat(fs27.statSync(path82), path82, options);
|
|
126059
126155
|
}
|
|
126060
126156
|
__name(sync, "sync");
|
|
126061
126157
|
}
|
|
@@ -126067,15 +126163,15 @@ var require_mode = __commonJS({
|
|
|
126067
126163
|
init_import_meta_url();
|
|
126068
126164
|
module4.exports = isexe;
|
|
126069
126165
|
isexe.sync = sync;
|
|
126070
|
-
var
|
|
126166
|
+
var fs27 = __require("fs");
|
|
126071
126167
|
function isexe(path82, options, cb2) {
|
|
126072
|
-
|
|
126168
|
+
fs27.stat(path82, function(er2, stat9) {
|
|
126073
126169
|
cb2(er2, er2 ? false : checkStat(stat9, options));
|
|
126074
126170
|
});
|
|
126075
126171
|
}
|
|
126076
126172
|
__name(isexe, "isexe");
|
|
126077
126173
|
function sync(path82, options) {
|
|
126078
|
-
return checkStat(
|
|
126174
|
+
return checkStat(fs27.statSync(path82), options);
|
|
126079
126175
|
}
|
|
126080
126176
|
__name(sync, "sync");
|
|
126081
126177
|
function checkStat(stat9, options) {
|
|
@@ -126374,16 +126470,16 @@ var require_shebang_command = __commonJS({
|
|
|
126374
126470
|
var require_readShebang = __commonJS({
|
|
126375
126471
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module4) {
|
|
126376
126472
|
init_import_meta_url();
|
|
126377
|
-
var
|
|
126473
|
+
var fs27 = __require("fs");
|
|
126378
126474
|
var shebangCommand = require_shebang_command();
|
|
126379
126475
|
function readShebang(command2) {
|
|
126380
126476
|
const size = 150;
|
|
126381
126477
|
const buffer = Buffer.alloc(size);
|
|
126382
126478
|
let fd;
|
|
126383
126479
|
try {
|
|
126384
|
-
fd =
|
|
126385
|
-
|
|
126386
|
-
|
|
126480
|
+
fd = fs27.openSync(command2, "r");
|
|
126481
|
+
fs27.readSync(fd, buffer, 0, size, 0);
|
|
126482
|
+
fs27.closeSync(fd);
|
|
126387
126483
|
} catch (e9) {
|
|
126388
126484
|
}
|
|
126389
126485
|
return shebangCommand(buffer.toString());
|
|
@@ -127840,7 +127936,7 @@ function assertEntryPointExists(expectedEntryAbsolute, expectedEntryRelative, cu
|
|
|
127840
127936
|
}
|
|
127841
127937
|
}
|
|
127842
127938
|
function getMissingEntryPointMessage(absoluteEntryPointPath, relativeEntryPointPath, customBuildCommand, configPath) {
|
|
127843
|
-
if (
|
|
127939
|
+
if (fs23.existsSync(absoluteEntryPointPath) && fs23.statSync(absoluteEntryPointPath).isDirectory()) {
|
|
127844
127940
|
let message = `The provided entry-point path, "${relativeEntryPointPath}", points to a directory, rather than a file.
|
|
127845
127941
|
`;
|
|
127846
127942
|
const possiblePaths = [];
|
|
@@ -127888,11 +127984,11 @@ wrangler deploy --assets=./${relativeEntryPointPath}
|
|
|
127888
127984
|
function fileExists(filePath) {
|
|
127889
127985
|
const SOURCE_FILE_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
|
|
127890
127986
|
if (path3__namespace.default.extname(filePath) !== "") {
|
|
127891
|
-
return
|
|
127987
|
+
return fs23.existsSync(filePath);
|
|
127892
127988
|
}
|
|
127893
127989
|
const base = path3__namespace.default.join(path3__namespace.default.dirname(filePath), path3__namespace.default.basename(filePath));
|
|
127894
127990
|
for (const ext2 of SOURCE_FILE_EXTENSIONS) {
|
|
127895
|
-
if (
|
|
127991
|
+
if (fs23.existsSync(base + ext2)) {
|
|
127896
127992
|
return true;
|
|
127897
127993
|
}
|
|
127898
127994
|
}
|
|
@@ -130669,7 +130765,7 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
|
|
|
130669
130765
|
}
|
|
130670
130766
|
}
|
|
130671
130767
|
async function buildCommand(args) {
|
|
130672
|
-
if (
|
|
130768
|
+
if (fs23.existsSync(args.PATH) && !isDirectory(args.PATH)) {
|
|
130673
130769
|
throw new UserError(
|
|
130674
130770
|
`${args.PATH} is not a directory. Please specify a valid directory path.`
|
|
130675
130771
|
);
|
|
@@ -130927,12 +131023,12 @@ var require_visit = __commonJS({
|
|
|
130927
131023
|
if (identity.isCollection(node2)) {
|
|
130928
131024
|
path82 = Object.freeze(path82.concat(node2));
|
|
130929
131025
|
for (let i7 = 0; i7 < node2.items.length; ++i7) {
|
|
130930
|
-
const
|
|
130931
|
-
if (typeof
|
|
130932
|
-
i7 =
|
|
130933
|
-
else if (
|
|
131026
|
+
const ci7 = visit_(i7, node2.items[i7], visitor, path82);
|
|
131027
|
+
if (typeof ci7 === "number")
|
|
131028
|
+
i7 = ci7 - 1;
|
|
131029
|
+
else if (ci7 === BREAK)
|
|
130934
131030
|
return BREAK;
|
|
130935
|
-
else if (
|
|
131031
|
+
else if (ci7 === REMOVE) {
|
|
130936
131032
|
node2.items.splice(i7, 1);
|
|
130937
131033
|
i7 -= 1;
|
|
130938
131034
|
}
|
|
@@ -130977,12 +131073,12 @@ var require_visit = __commonJS({
|
|
|
130977
131073
|
if (identity.isCollection(node2)) {
|
|
130978
131074
|
path82 = Object.freeze(path82.concat(node2));
|
|
130979
131075
|
for (let i7 = 0; i7 < node2.items.length; ++i7) {
|
|
130980
|
-
const
|
|
130981
|
-
if (typeof
|
|
130982
|
-
i7 =
|
|
130983
|
-
else if (
|
|
131076
|
+
const ci7 = await visitAsync_(i7, node2.items[i7], visitor, path82);
|
|
131077
|
+
if (typeof ci7 === "number")
|
|
131078
|
+
i7 = ci7 - 1;
|
|
131079
|
+
else if (ci7 === BREAK)
|
|
130984
131080
|
return BREAK;
|
|
130985
|
-
else if (
|
|
131081
|
+
else if (ci7 === REMOVE) {
|
|
130986
131082
|
node2.items.splice(i7, 1);
|
|
130987
131083
|
i7 -= 1;
|
|
130988
131084
|
}
|
|
@@ -134625,16 +134721,16 @@ var require_errors2 = __commonJS({
|
|
|
134625
134721
|
error2.linePos = error2.pos.map((pos) => lc.linePos(pos));
|
|
134626
134722
|
const { line, col } = error2.linePos[0];
|
|
134627
134723
|
error2.message += ` at line ${line}, column ${col}`;
|
|
134628
|
-
let
|
|
134724
|
+
let ci7 = col - 1;
|
|
134629
134725
|
let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, "");
|
|
134630
|
-
if (
|
|
134631
|
-
const trimStart = Math.min(
|
|
134726
|
+
if (ci7 >= 60 && lineStr.length > 80) {
|
|
134727
|
+
const trimStart = Math.min(ci7 - 39, lineStr.length - 79);
|
|
134632
134728
|
lineStr = "\u2026" + lineStr.substring(trimStart);
|
|
134633
|
-
|
|
134729
|
+
ci7 -= trimStart - 1;
|
|
134634
134730
|
}
|
|
134635
134731
|
if (lineStr.length > 80)
|
|
134636
134732
|
lineStr = lineStr.substring(0, 79) + "\u2026";
|
|
134637
|
-
if (line > 1 && /^ *$/.test(lineStr.substring(0,
|
|
134733
|
+
if (line > 1 && /^ *$/.test(lineStr.substring(0, ci7))) {
|
|
134638
134734
|
let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
|
|
134639
134735
|
if (prev.length > 80)
|
|
134640
134736
|
prev = prev.substring(0, 79) + "\u2026\n";
|
|
@@ -134644,9 +134740,9 @@ var require_errors2 = __commonJS({
|
|
|
134644
134740
|
let count = 1;
|
|
134645
134741
|
const end = error2.linePos[1];
|
|
134646
134742
|
if (end && end.line === line && end.col > col) {
|
|
134647
|
-
count = Math.max(1, Math.min(end.col - col, 80 -
|
|
134743
|
+
count = Math.max(1, Math.min(end.col - col, 80 - ci7));
|
|
134648
134744
|
}
|
|
134649
|
-
const pointer = " ".repeat(
|
|
134745
|
+
const pointer = " ".repeat(ci7) + "^".repeat(count);
|
|
134650
134746
|
error2.message += `:
|
|
134651
134747
|
|
|
134652
134748
|
${lineStr}
|
|
@@ -136525,12 +136621,12 @@ var require_cst_visit = __commonJS({
|
|
|
136525
136621
|
const token = item[field];
|
|
136526
136622
|
if (token && "items" in token) {
|
|
136527
136623
|
for (let i7 = 0; i7 < token.items.length; ++i7) {
|
|
136528
|
-
const
|
|
136529
|
-
if (typeof
|
|
136530
|
-
i7 =
|
|
136531
|
-
else if (
|
|
136624
|
+
const ci7 = _visit(Object.freeze(path82.concat([[field, i7]])), token.items[i7], visitor);
|
|
136625
|
+
if (typeof ci7 === "number")
|
|
136626
|
+
i7 = ci7 - 1;
|
|
136627
|
+
else if (ci7 === BREAK)
|
|
136532
136628
|
return BREAK;
|
|
136533
|
-
else if (
|
|
136629
|
+
else if (ci7 === REMOVE) {
|
|
136534
136630
|
token.items.splice(i7, 1);
|
|
136535
136631
|
i7 -= 1;
|
|
136536
136632
|
}
|
|
@@ -137843,14 +137939,14 @@ var require_parser = __commonJS({
|
|
|
137843
137939
|
case "scalar":
|
|
137844
137940
|
case "single-quoted-scalar":
|
|
137845
137941
|
case "double-quoted-scalar": {
|
|
137846
|
-
const
|
|
137942
|
+
const fs27 = this.flowScalar(this.type);
|
|
137847
137943
|
if (atNextItem || it2.value) {
|
|
137848
|
-
map2.items.push({ start, key:
|
|
137944
|
+
map2.items.push({ start, key: fs27, sep: [] });
|
|
137849
137945
|
this.onKeyLine = true;
|
|
137850
137946
|
} else if (it2.sep) {
|
|
137851
|
-
this.stack.push(
|
|
137947
|
+
this.stack.push(fs27);
|
|
137852
137948
|
} else {
|
|
137853
|
-
Object.assign(it2, { key:
|
|
137949
|
+
Object.assign(it2, { key: fs27, sep: [] });
|
|
137854
137950
|
this.onKeyLine = true;
|
|
137855
137951
|
}
|
|
137856
137952
|
return;
|
|
@@ -137978,13 +138074,13 @@ var require_parser = __commonJS({
|
|
|
137978
138074
|
case "scalar":
|
|
137979
138075
|
case "single-quoted-scalar":
|
|
137980
138076
|
case "double-quoted-scalar": {
|
|
137981
|
-
const
|
|
138077
|
+
const fs27 = this.flowScalar(this.type);
|
|
137982
138078
|
if (!it2 || it2.value)
|
|
137983
|
-
fc.items.push({ start: [], key:
|
|
138079
|
+
fc.items.push({ start: [], key: fs27, sep: [] });
|
|
137984
138080
|
else if (it2.sep)
|
|
137985
|
-
this.stack.push(
|
|
138081
|
+
this.stack.push(fs27);
|
|
137986
138082
|
else
|
|
137987
|
-
Object.assign(it2, { key:
|
|
138083
|
+
Object.assign(it2, { key: fs27, sep: [] });
|
|
137988
138084
|
return;
|
|
137989
138085
|
}
|
|
137990
138086
|
case "flow-map-end":
|
|
@@ -148705,7 +148801,7 @@ var init_createFinetune = __esm({
|
|
|
148705
148801
|
`\u{1F300} Creating new finetune "${finetune_name}" for model "${model_name}"...`
|
|
148706
148802
|
);
|
|
148707
148803
|
try {
|
|
148708
|
-
const files =
|
|
148804
|
+
const files = fs23__namespace.default.readdirSync(folder_path, {
|
|
148709
148805
|
withFileTypes: true
|
|
148710
148806
|
});
|
|
148711
148807
|
if (requiredAssets.every(
|
|
@@ -148734,7 +148830,7 @@ var init_createFinetune = __esm({
|
|
|
148734
148830
|
try {
|
|
148735
148831
|
const formdata = new import_undici5.FormData();
|
|
148736
148832
|
formdata.set("file_name", file3.name);
|
|
148737
|
-
formdata.set("file", new Blob([
|
|
148833
|
+
formdata.set("file", new Blob([fs23__namespace.default.readFileSync(filePath)]));
|
|
148738
148834
|
await fetchResult(
|
|
148739
148835
|
config,
|
|
148740
148836
|
`/accounts/${accountId}/ai/finetunes/${finetune.id}/finetune-assets`,
|
|
@@ -149214,11 +149310,11 @@ var require_command_exists = __commonJS({
|
|
|
149214
149310
|
init_import_meta_url();
|
|
149215
149311
|
var exec3 = __require("child_process").exec;
|
|
149216
149312
|
var execSync7 = __require("child_process").execSync;
|
|
149217
|
-
var
|
|
149313
|
+
var fs27 = __require("fs");
|
|
149218
149314
|
var path82 = __require("path");
|
|
149219
|
-
var access4 =
|
|
149220
|
-
var accessSync =
|
|
149221
|
-
var constants4 =
|
|
149315
|
+
var access4 = fs27.access;
|
|
149316
|
+
var accessSync = fs27.accessSync;
|
|
149317
|
+
var constants4 = fs27.constants || fs27;
|
|
149222
149318
|
var isUsingWindows = process.platform == "win32";
|
|
149223
149319
|
var fileNotExists = /* @__PURE__ */ __name(function(commandName, callback) {
|
|
149224
149320
|
access4(
|
|
@@ -149365,7 +149461,7 @@ var require_command_exists2 = __commonJS({
|
|
|
149365
149461
|
});
|
|
149366
149462
|
function handleUnsafeCapnp(capnp) {
|
|
149367
149463
|
if (capnp.compiled_schema) {
|
|
149368
|
-
return
|
|
149464
|
+
return fs23.readFileSync(path3.resolve(capnp.compiled_schema));
|
|
149369
149465
|
}
|
|
149370
149466
|
const { base_path, source_schemas } = capnp;
|
|
149371
149467
|
const capnpSchemas = (source_schemas ?? []).map(
|
|
@@ -149437,7 +149533,8 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
149437
149533
|
annotations,
|
|
149438
149534
|
keep_assets,
|
|
149439
149535
|
assets,
|
|
149440
|
-
observability
|
|
149536
|
+
observability,
|
|
149537
|
+
cache: cache6
|
|
149441
149538
|
} = worker;
|
|
149442
149539
|
const assetConfig = {
|
|
149443
149540
|
html_handling: assets?.assetConfig?.html_handling,
|
|
@@ -149762,7 +149859,7 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
149762
149859
|
name2,
|
|
149763
149860
|
new File(
|
|
149764
149861
|
[
|
|
149765
|
-
"contents" in source ? source.contents :
|
|
149862
|
+
"contents" in source ? source.contents : fs23.readFileSync(source.path)
|
|
149766
149863
|
],
|
|
149767
149864
|
"path" in source ? source.path ?? name2 : name2,
|
|
149768
149865
|
{ type: "application/wasm" }
|
|
@@ -149826,7 +149923,7 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
149826
149923
|
} else {
|
|
149827
149924
|
formData.set(
|
|
149828
149925
|
name2,
|
|
149829
|
-
new File([
|
|
149926
|
+
new File([fs23.readFileSync(source.path)], source.path, {
|
|
149830
149927
|
type: "text/plain"
|
|
149831
149928
|
})
|
|
149832
149929
|
);
|
|
@@ -149843,7 +149940,7 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
149843
149940
|
name2,
|
|
149844
149941
|
new File(
|
|
149845
149942
|
[
|
|
149846
|
-
"contents" in source ? source.contents :
|
|
149943
|
+
"contents" in source ? source.contents : fs23.readFileSync(source.path)
|
|
149847
149944
|
],
|
|
149848
149945
|
"path" in source ? source.path ?? name2 : name2,
|
|
149849
149946
|
{ type: "application/octet-stream" }
|
|
@@ -149956,7 +150053,8 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
149956
150053
|
config: assetConfig
|
|
149957
150054
|
}
|
|
149958
150055
|
},
|
|
149959
|
-
...observability && { observability }
|
|
150056
|
+
...observability && { observability },
|
|
150057
|
+
...cache6 && { cache_options: cache6 }
|
|
149960
150058
|
};
|
|
149961
150059
|
if (options?.unsafe?.metadata !== void 0) {
|
|
149962
150060
|
for (const key of Object.keys(options.unsafe.metadata)) {
|
|
@@ -150053,7 +150151,7 @@ async function checkStartupHandler({
|
|
|
150053
150151
|
startMessage: "Analysing",
|
|
150054
150152
|
endMessage: source_default.green("Startup phase analysed")
|
|
150055
150153
|
});
|
|
150056
|
-
await
|
|
150154
|
+
await fs12.writeFile(outfile, JSON.stringify(await cpuProfileResult));
|
|
150057
150155
|
log(
|
|
150058
150156
|
[
|
|
150059
150157
|
`CPU Profile has been written to ${outfile}. Load it into the Chrome DevTools profiler (or directly in VSCode) to view a flamegraph.`,
|
|
@@ -150098,7 +150196,7 @@ async function convertWorkerBundleToModules(workerBundle) {
|
|
|
150098
150196
|
);
|
|
150099
150197
|
}
|
|
150100
150198
|
async function parseFormDataFromFile(file3) {
|
|
150101
|
-
const bundle = await
|
|
150199
|
+
const bundle = await fs12.readFile(file3);
|
|
150102
150200
|
const firstLine = bundle.findIndex((v8) => v8 === 10);
|
|
150103
150201
|
const boundary = Uint8Array.prototype.slice.call(bundle, 2, firstLine).toString();
|
|
150104
150202
|
return await new Response(bundle, {
|
|
@@ -151079,7 +151177,7 @@ var init_validate2 = __esm({
|
|
|
151079
151177
|
});
|
|
151080
151178
|
async function retrieveSSHKey(sshKeyPath, { json } = { json: false }) {
|
|
151081
151179
|
try {
|
|
151082
|
-
const file3 = (await
|
|
151180
|
+
const file3 = (await fs12.readFile(sshKeyPath)).toString();
|
|
151083
151181
|
validatePublicSSHKeyCLI(file3, { json });
|
|
151084
151182
|
return file3;
|
|
151085
151183
|
} catch {
|
|
@@ -151143,10 +151241,10 @@ async function tryToRetrieveAllDefaultSSHKeyPaths() {
|
|
|
151143
151241
|
const path82 = `${HOME}/.ssh`;
|
|
151144
151242
|
const paths = [];
|
|
151145
151243
|
try {
|
|
151146
|
-
const dirList = await
|
|
151244
|
+
const dirList = await fs12.readdir(path82);
|
|
151147
151245
|
for (const file3 of dirList) {
|
|
151148
151246
|
if (file3.endsWith(".pub")) {
|
|
151149
|
-
const s7 = await
|
|
151247
|
+
const s7 = await fs12.stat(`${path82}/${file3}`);
|
|
151150
151248
|
if (s7.isFile()) {
|
|
151151
151249
|
paths.push(`${path82}/${file3}`);
|
|
151152
151250
|
}
|
|
@@ -151185,7 +151283,7 @@ async function shouldPromptForNewSSHKeyAppear(keys = void 0) {
|
|
|
151185
151283
|
}
|
|
151186
151284
|
let foundValidSSHKeyThatDontExist = false;
|
|
151187
151285
|
for (const defaultSSHKeyPath of defaultSSHKeyPaths) {
|
|
151188
|
-
const file3 = (await
|
|
151286
|
+
const file3 = (await fs12.readFile(defaultSSHKeyPath)).toString().trim();
|
|
151189
151287
|
try {
|
|
151190
151288
|
validateSSHKey(file3);
|
|
151191
151289
|
} catch {
|
|
@@ -154477,7 +154575,7 @@ var require_package = __commonJS({
|
|
|
154477
154575
|
var require_main = __commonJS({
|
|
154478
154576
|
"../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/lib/main.js"(exports, module4) {
|
|
154479
154577
|
init_import_meta_url();
|
|
154480
|
-
var
|
|
154578
|
+
var fs27 = __require("fs");
|
|
154481
154579
|
var path82 = __require("path");
|
|
154482
154580
|
var os12 = __require("os");
|
|
154483
154581
|
var crypto9 = __require("crypto");
|
|
@@ -154612,7 +154710,7 @@ var require_main = __commonJS({
|
|
|
154612
154710
|
}
|
|
154613
154711
|
}
|
|
154614
154712
|
try {
|
|
154615
|
-
const parsed = DotenvModule.parse(
|
|
154713
|
+
const parsed = DotenvModule.parse(fs27.readFileSync(dotenvPath, { encoding }));
|
|
154616
154714
|
let processEnv = process.env;
|
|
154617
154715
|
if (options && options.processEnv != null) {
|
|
154618
154716
|
processEnv = options.processEnv;
|
|
@@ -154632,7 +154730,7 @@ var require_main = __commonJS({
|
|
|
154632
154730
|
if (_dotenvKey(options).length === 0) {
|
|
154633
154731
|
return DotenvModule.configDotenv(options);
|
|
154634
154732
|
}
|
|
154635
|
-
if (!
|
|
154733
|
+
if (!fs27.existsSync(vaultPath)) {
|
|
154636
154734
|
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
154637
154735
|
return DotenvModule.configDotenv(options);
|
|
154638
154736
|
}
|
|
@@ -155015,6 +155113,7 @@ var init_config6 = __esm({
|
|
|
155015
155113
|
upload_source_maps: void 0,
|
|
155016
155114
|
assets: void 0,
|
|
155017
155115
|
observability: { enabled: true },
|
|
155116
|
+
cache: void 0,
|
|
155018
155117
|
/** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */
|
|
155019
155118
|
compliance_region: void 0,
|
|
155020
155119
|
python_modules: { exclude: ["**/*.pyc"] },
|
|
@@ -155998,7 +156097,7 @@ function parseJSONC2(input, file3, options = { allowTrailingComma: true }) {
|
|
|
155998
156097
|
}
|
|
155999
156098
|
function readFileSync11(file3) {
|
|
156000
156099
|
try {
|
|
156001
|
-
const buffer =
|
|
156100
|
+
const buffer = fs23.readFileSync(file3);
|
|
156002
156101
|
return removeBOMAndValidate2(buffer, file3);
|
|
156003
156102
|
} catch (err) {
|
|
156004
156103
|
if (err instanceof ParseError2) {
|
|
@@ -156168,7 +156267,7 @@ function findRedirectedWranglerConfig2(cwd2, userConfigPath) {
|
|
|
156168
156267
|
\`\`\`
|
|
156169
156268
|
`);
|
|
156170
156269
|
}
|
|
156171
|
-
if (!
|
|
156270
|
+
if (!fs23.existsSync(redirectedConfigPath)) {
|
|
156172
156271
|
throw new UserError2(esm_default3`
|
|
156173
156272
|
There is a deploy configuration at "${path3__namespace.default.relative(".", deployConfigPath)}".
|
|
156174
156273
|
But the redirected configuration path it points to, "${path3__namespace.default.relative(".", redirectedConfigPath)}", does not exist.
|
|
@@ -156791,7 +156890,7 @@ var init_mod_esm = __esm({
|
|
|
156791
156890
|
}
|
|
156792
156891
|
});
|
|
156793
156892
|
function isDirectory2(path82) {
|
|
156794
|
-
return
|
|
156893
|
+
return fs23__namespace.default.statSync(path82, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
156795
156894
|
}
|
|
156796
156895
|
var init_fs_helpers = __esm({
|
|
156797
156896
|
"../workers-utils/src/fs-helpers.ts"() {
|
|
@@ -157518,8 +157617,8 @@ function getMetricsConfig({
|
|
|
157518
157617
|
return { enabled: true, deviceId };
|
|
157519
157618
|
}
|
|
157520
157619
|
function writeMetricsConfig(config) {
|
|
157521
|
-
|
|
157522
|
-
|
|
157620
|
+
fs23.mkdirSync(path3__namespace.default.dirname(getMetricsConfigPath()), { recursive: true });
|
|
157621
|
+
fs23.writeFileSync(
|
|
157523
157622
|
getMetricsConfigPath(),
|
|
157524
157623
|
JSON.stringify(
|
|
157525
157624
|
config,
|
|
@@ -157530,7 +157629,7 @@ function writeMetricsConfig(config) {
|
|
|
157530
157629
|
}
|
|
157531
157630
|
function readMetricsConfig() {
|
|
157532
157631
|
try {
|
|
157533
|
-
const config =
|
|
157632
|
+
const config = fs23.readFileSync(getMetricsConfigPath(), "utf8");
|
|
157534
157633
|
return JSON.parse(
|
|
157535
157634
|
config,
|
|
157536
157635
|
(key, value) => key === "date" ? new Date(value) : value
|
|
@@ -157604,9 +157703,9 @@ function getMetricsDispatcher(options) {
|
|
|
157604
157703
|
packageManager: sniffUserAgent(),
|
|
157605
157704
|
isFirstUsage: readMetricsConfig().permission === void 0,
|
|
157606
157705
|
configFileType: configFormat(options.configPath),
|
|
157607
|
-
isCI:
|
|
157608
|
-
isPagesCI:
|
|
157609
|
-
isWorkersCI:
|
|
157706
|
+
isCI: import_ci_info4.default.isCI,
|
|
157707
|
+
isPagesCI: import_ci_info4.default.CLOUDFLARE_PAGES,
|
|
157708
|
+
isWorkersCI: import_ci_info4.default.CLOUDFLARE_WORKERS,
|
|
157610
157709
|
isInteractive: isInteractive2(),
|
|
157611
157710
|
hasAssets: options.hasAssets ?? false,
|
|
157612
157711
|
agent
|
|
@@ -157729,14 +157828,14 @@ Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more
|
|
|
157729
157828
|
}
|
|
157730
157829
|
}
|
|
157731
157830
|
}
|
|
157732
|
-
var
|
|
157831
|
+
var import_ci_info4, import_undici8, SPARROW_URL, pendingRequests;
|
|
157733
157832
|
var init_metrics_dispatcher = __esm({
|
|
157734
157833
|
"src/metrics/metrics-dispatcher.ts"() {
|
|
157735
157834
|
init_import_meta_url();
|
|
157736
157835
|
init_dist();
|
|
157737
157836
|
init_dist6();
|
|
157738
157837
|
init_source();
|
|
157739
|
-
|
|
157838
|
+
import_ci_info4 = __toESM(require_ci_info());
|
|
157740
157839
|
import_undici8 = __toESM(require_undici());
|
|
157741
157840
|
init_is_interactive();
|
|
157742
157841
|
init_logger();
|
|
@@ -157888,7 +157987,7 @@ function writeOutput(entry) {
|
|
|
157888
157987
|
...entry,
|
|
157889
157988
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
157890
157989
|
});
|
|
157891
|
-
|
|
157990
|
+
fs23.appendFileSync(outputFilePath, entryJSON + "\n");
|
|
157892
157991
|
}
|
|
157893
157992
|
}
|
|
157894
157993
|
function getOutputFilePath() {
|
|
@@ -167311,11 +167410,11 @@ function collectModules() {
|
|
|
167311
167410
|
}
|
|
167312
167411
|
const pkgfile = path3.join(orig, "package.json");
|
|
167313
167412
|
seen[orig] = true;
|
|
167314
|
-
if (!
|
|
167413
|
+
if (!fs23.existsSync(pkgfile)) {
|
|
167315
167414
|
return updir();
|
|
167316
167415
|
}
|
|
167317
167416
|
try {
|
|
167318
|
-
const info = JSON.parse(
|
|
167417
|
+
const info = JSON.parse(fs23.readFileSync(pkgfile, "utf8"));
|
|
167319
167418
|
infos[info.name] = info.version;
|
|
167320
167419
|
} catch (_oO) {
|
|
167321
167420
|
}
|
|
@@ -167379,7 +167478,7 @@ var init_modules = __esm({
|
|
|
167379
167478
|
});
|
|
167380
167479
|
function readTextFileAsync(path82) {
|
|
167381
167480
|
return new Promise((resolve31, reject) => {
|
|
167382
|
-
|
|
167481
|
+
fs23.readFile(path82, "utf8", (err, data) => {
|
|
167383
167482
|
if (err) reject(err);
|
|
167384
167483
|
else resolve31(data);
|
|
167385
167484
|
});
|
|
@@ -167670,8 +167769,8 @@ var init_context = __esm({
|
|
|
167670
167769
|
"../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/context.js"() {
|
|
167671
167770
|
init_import_meta_url();
|
|
167672
167771
|
init_esm7();
|
|
167673
|
-
readFileAsync = util2.promisify(
|
|
167674
|
-
readDirAsync = util2.promisify(
|
|
167772
|
+
readFileAsync = util2.promisify(fs23.readFile);
|
|
167773
|
+
readDirAsync = util2.promisify(fs23.readdir);
|
|
167675
167774
|
Context = class _Context {
|
|
167676
167775
|
static {
|
|
167677
167776
|
__name(this, "Context");
|
|
@@ -169506,20 +169605,20 @@ var require_md5_file = __commonJS({
|
|
|
169506
169605
|
"../../node_modules/.pnpm/md5-file@5.0.0/node_modules/md5-file/index.js"(exports, module4) {
|
|
169507
169606
|
init_import_meta_url();
|
|
169508
169607
|
var crypto9 = __require("crypto");
|
|
169509
|
-
var
|
|
169608
|
+
var fs27 = __require("fs");
|
|
169510
169609
|
var BUFFER_SIZE = 8192;
|
|
169511
169610
|
function md5FileSync(path82) {
|
|
169512
|
-
const fd =
|
|
169611
|
+
const fd = fs27.openSync(path82, "r");
|
|
169513
169612
|
const hash = crypto9.createHash("md5");
|
|
169514
169613
|
const buffer = Buffer.alloc(BUFFER_SIZE);
|
|
169515
169614
|
try {
|
|
169516
169615
|
let bytesRead;
|
|
169517
169616
|
do {
|
|
169518
|
-
bytesRead =
|
|
169617
|
+
bytesRead = fs27.readSync(fd, buffer, 0, BUFFER_SIZE);
|
|
169519
169618
|
hash.update(buffer.slice(0, bytesRead));
|
|
169520
169619
|
} while (bytesRead === BUFFER_SIZE);
|
|
169521
169620
|
} finally {
|
|
169522
|
-
|
|
169621
|
+
fs27.closeSync(fd);
|
|
169523
169622
|
}
|
|
169524
169623
|
return hash.digest("hex");
|
|
169525
169624
|
}
|
|
@@ -169527,7 +169626,7 @@ var require_md5_file = __commonJS({
|
|
|
169527
169626
|
function md5File2(path82) {
|
|
169528
169627
|
return new Promise((resolve31, reject) => {
|
|
169529
169628
|
const output = crypto9.createHash("md5");
|
|
169530
|
-
const input =
|
|
169629
|
+
const input = fs27.createReadStream(path82);
|
|
169531
169630
|
input.on("error", (err) => {
|
|
169532
169631
|
reject(err);
|
|
169533
169632
|
});
|
|
@@ -169927,14 +170026,14 @@ async function executeRemotely({
|
|
|
169927
170026
|
}
|
|
169928
170027
|
async function uploadAndBeginIngestion(complianceConfig, accountId, db, file3, etag, initResponse) {
|
|
169929
170028
|
const { upload_url, filename } = initResponse;
|
|
169930
|
-
const { size } = await
|
|
170029
|
+
const { size } = await fs23.promises.stat(file3);
|
|
169931
170030
|
const uploadResponse = await spinnerWhile({
|
|
169932
170031
|
promise: (0, import_undici12.fetch)(upload_url, {
|
|
169933
170032
|
method: "PUT",
|
|
169934
170033
|
headers: {
|
|
169935
170034
|
"Content-length": `${size}`
|
|
169936
170035
|
},
|
|
169937
|
-
body:
|
|
170036
|
+
body: fs23.createReadStream(file3),
|
|
169938
170037
|
duplex: "half"
|
|
169939
170038
|
// required for NodeJS streams over .fetch ?
|
|
169940
170039
|
}),
|
|
@@ -170030,7 +170129,7 @@ async function checkForSQLiteBinary(filename) {
|
|
|
170030
170129
|
const buffer = Buffer.alloc(15);
|
|
170031
170130
|
let fd;
|
|
170032
170131
|
try {
|
|
170033
|
-
fd = await
|
|
170132
|
+
fd = await fs23.promises.open(filename, "r");
|
|
170034
170133
|
await fd.read(buffer, 0, 15);
|
|
170035
170134
|
} catch {
|
|
170036
170135
|
throw new UserError(
|
|
@@ -170236,7 +170335,7 @@ async function exportLocal(config, name2, output, tables, noSchema, noData) {
|
|
|
170236
170335
|
logger.log(`\u{1F300} Exporting SQL to ${output}...`);
|
|
170237
170336
|
try {
|
|
170238
170337
|
const dump = await db.prepare(`PRAGMA miniflare_d1_export(?,?,?);`).bind(noSchema, noData, ...tables).raw();
|
|
170239
|
-
await
|
|
170338
|
+
await fs12__default.default.writeFile(output, dump[0].join("\n"));
|
|
170240
170339
|
} catch (e9) {
|
|
170241
170340
|
throw new UserError(e9.message);
|
|
170242
170341
|
} finally {
|
|
@@ -170280,7 +170379,7 @@ async function exportRemotely(config, name2, output, tables, noSchema, noData) {
|
|
|
170280
170379
|
`There was an error while downloading from the presigned URL with status code: ${contents.status}`
|
|
170281
170380
|
);
|
|
170282
170381
|
}
|
|
170283
|
-
await
|
|
170382
|
+
await fs12__default.default.writeFile(output, contents.body || "");
|
|
170284
170383
|
}
|
|
170285
170384
|
});
|
|
170286
170385
|
logger.log(`\u{1F300} Downloaded to ${output} successfully!`);
|
|
@@ -170409,7 +170508,7 @@ var init_export2 = __esm({
|
|
|
170409
170508
|
if (!schema && !data) {
|
|
170410
170509
|
throw new UserError(`You cannot specify both --no-schema and --no-data`);
|
|
170411
170510
|
}
|
|
170412
|
-
const stats =
|
|
170511
|
+
const stats = fs23.statSync(output, { throwIfNoEntry: false });
|
|
170413
170512
|
if (stats?.isDirectory()) {
|
|
170414
170513
|
throw new UserError(
|
|
170415
170514
|
`Please specify a file path for --output, not a directory.`
|
|
@@ -170805,13 +170904,13 @@ async function getMigrationsPath({
|
|
|
170805
170904
|
configPath
|
|
170806
170905
|
}) {
|
|
170807
170906
|
const dir2 = path3__namespace.default.resolve(projectPath, migrationsFolderPath);
|
|
170808
|
-
if (
|
|
170907
|
+
if (fs23__namespace.default.existsSync(dir2)) {
|
|
170809
170908
|
return dir2;
|
|
170810
170909
|
}
|
|
170811
170910
|
const warning = `No migrations folder found.${migrationsFolderPath === DEFAULT_MIGRATION_PATH ? ` Set \`migrations_dir\` in your ${configFileName(configPath)} file to choose a different path.` : ""}`;
|
|
170812
170911
|
if (createIfMissing && await confirm(`${warning}
|
|
170813
170912
|
Ok to create ${dir2}?`)) {
|
|
170814
|
-
|
|
170913
|
+
fs23__namespace.default.mkdirSync(dir2, { recursive: true });
|
|
170815
170914
|
return dir2;
|
|
170816
170915
|
} else {
|
|
170817
170916
|
logger.warn(warning);
|
|
@@ -170850,7 +170949,7 @@ async function getUnappliedMigrations({
|
|
|
170850
170949
|
}
|
|
170851
170950
|
function getMigrationNames(migrationsPath) {
|
|
170852
170951
|
const migrations = [];
|
|
170853
|
-
const dir2 =
|
|
170952
|
+
const dir2 = fs23__namespace.default.opendirSync(migrationsPath);
|
|
170854
170953
|
let dirent;
|
|
170855
170954
|
while ((dirent = dir2.readSync()) !== null) {
|
|
170856
170955
|
if (dirent.name.endsWith(".sql")) {
|
|
@@ -171069,7 +171168,7 @@ Your database may not be available to serve requests during the migration, conti
|
|
|
171069
171168
|
return;
|
|
171070
171169
|
}
|
|
171071
171170
|
for (const migration of unappliedMigrations) {
|
|
171072
|
-
let query =
|
|
171171
|
+
let query = fs23__namespace.default.readFileSync(
|
|
171073
171172
|
`${migrationsPath}/${migration.name}`,
|
|
171074
171173
|
"utf8"
|
|
171075
171174
|
);
|
|
@@ -171209,7 +171308,7 @@ var init_create3 = __esm({
|
|
|
171209
171308
|
const nextMigrationNumber = pad(getNextMigrationNumber(migrationsPath), 4);
|
|
171210
171309
|
const migrationName = message.replaceAll(" ", "_");
|
|
171211
171310
|
const newMigrationName = `${nextMigrationNumber}_${migrationName}.sql`;
|
|
171212
|
-
|
|
171311
|
+
fs23__namespace.default.writeFileSync(
|
|
171213
171312
|
`${migrationsPath}/${newMigrationName}`,
|
|
171214
171313
|
`-- Migration number: ${nextMigrationNumber} ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
171215
171314
|
`
|
|
@@ -180102,9 +180201,9 @@ var init_nx = __esm({
|
|
|
180102
180201
|
}
|
|
180103
180202
|
/** detect workspace packages with the workspace.json file */
|
|
180104
180203
|
async detectWorkspaceFile() {
|
|
180105
|
-
const
|
|
180204
|
+
const fs27 = this.project.fs;
|
|
180106
180205
|
try {
|
|
180107
|
-
const { projects } = await
|
|
180206
|
+
const { projects } = await fs27.readJSON(fs27.join(this.project.jsWorkspaceRoot, "workspace.json"), {
|
|
180108
180207
|
fail: true
|
|
180109
180208
|
});
|
|
180110
180209
|
const pkgs = [];
|
|
@@ -180114,8 +180213,8 @@ var init_nx = __esm({
|
|
|
180114
180213
|
}
|
|
180115
180214
|
const targets = Object.entries(architect || {}).map(([name2, target]) => ({ ...target, name: name2 }));
|
|
180116
180215
|
const forcedFramework = await this.detectFramework(targets);
|
|
180117
|
-
this.targets.set(
|
|
180118
|
-
pkgs.push({ name: key, path:
|
|
180216
|
+
this.targets.set(fs27.join(root), targets);
|
|
180217
|
+
pkgs.push({ name: key, path: fs27.join(root), forcedFramework });
|
|
180119
180218
|
}
|
|
180120
180219
|
return pkgs;
|
|
180121
180220
|
} catch {
|
|
@@ -180124,21 +180223,21 @@ var init_nx = __esm({
|
|
|
180124
180223
|
}
|
|
180125
180224
|
/** detect workspace packages with the project.json files */
|
|
180126
180225
|
async detectProjectJson() {
|
|
180127
|
-
const
|
|
180226
|
+
const fs27 = this.project.fs;
|
|
180128
180227
|
try {
|
|
180129
|
-
const { workspaceLayout } = await
|
|
180228
|
+
const { workspaceLayout } = await fs27.readJSON(fs27.join(this.project.jsWorkspaceRoot, "nx.json"), {
|
|
180130
180229
|
fail: true
|
|
180131
180230
|
});
|
|
180132
180231
|
const appDirs = workspaceLayout?.appsDir ? [workspaceLayout.appsDir] : ["apps", "packages"];
|
|
180133
180232
|
const identifyPkg = /* @__PURE__ */ __name(async ({ entry, directory, packagePath }) => {
|
|
180134
180233
|
if (entry === "project.json" && !packagePath.endsWith("-e2e")) {
|
|
180135
180234
|
try {
|
|
180136
|
-
const { projectType, name: name2, targets } = await
|
|
180235
|
+
const { projectType, name: name2, targets } = await fs27.readJSON(fs27.join(directory, entry));
|
|
180137
180236
|
if (projectType === "application") {
|
|
180138
180237
|
const targetsWithName = Object.entries(targets || {}).map(([name3, target]) => ({ ...target, name: name3 }));
|
|
180139
180238
|
const forcedFramework = await this.detectFramework(targetsWithName);
|
|
180140
|
-
this.targets.set(
|
|
180141
|
-
return { name: name2, path:
|
|
180239
|
+
this.targets.set(fs27.join(packagePath), targetsWithName);
|
|
180240
|
+
return { name: name2, path: fs27.join(packagePath), forcedFramework };
|
|
180142
180241
|
}
|
|
180143
180242
|
} catch {
|
|
180144
180243
|
}
|
|
@@ -180953,7 +181052,7 @@ var require_pump = __commonJS({
|
|
|
180953
181052
|
init_import_meta_url();
|
|
180954
181053
|
var once = require_once();
|
|
180955
181054
|
var eos = require_end_of_stream();
|
|
180956
|
-
var
|
|
181055
|
+
var fs27 = __require("fs");
|
|
180957
181056
|
var noop = /* @__PURE__ */ __name(function() {
|
|
180958
181057
|
}, "noop");
|
|
180959
181058
|
var ancient = /^v?\.0/.test(process.version);
|
|
@@ -180962,8 +181061,8 @@ var require_pump = __commonJS({
|
|
|
180962
181061
|
}, "isFn");
|
|
180963
181062
|
var isFS = /* @__PURE__ */ __name(function(stream2) {
|
|
180964
181063
|
if (!ancient) return false;
|
|
180965
|
-
if (!
|
|
180966
|
-
return (stream2 instanceof (
|
|
181064
|
+
if (!fs27) return false;
|
|
181065
|
+
return (stream2 instanceof (fs27.ReadStream || noop) || stream2 instanceof (fs27.WriteStream || noop)) && isFn(stream2.close);
|
|
180967
181066
|
}, "isFS");
|
|
180968
181067
|
var isRequest2 = /* @__PURE__ */ __name(function(stream2) {
|
|
180969
181068
|
return stream2.setHeader && isFn(stream2.abort);
|
|
@@ -184044,13 +184143,13 @@ var init_project = __esm({
|
|
|
184044
184143
|
async isRedwoodProject() {
|
|
184045
184144
|
return await this.fs.fileExists(this.fs.resolve(this.fs.cwd, "redwood.toml"));
|
|
184046
184145
|
}
|
|
184047
|
-
constructor(
|
|
184048
|
-
this.fs =
|
|
184049
|
-
this.baseDirectory =
|
|
184050
|
-
this.root = root ?
|
|
184051
|
-
this.relativeBaseDirectory = baseDirectory !== void 0 && !
|
|
184146
|
+
constructor(fs27, baseDirectory, root) {
|
|
184147
|
+
this.fs = fs27;
|
|
184148
|
+
this.baseDirectory = fs27.resolve(root || "", baseDirectory !== void 0 ? baseDirectory : fs27.cwd);
|
|
184149
|
+
this.root = root ? fs27.resolve(fs27.cwd, root) : void 0;
|
|
184150
|
+
this.relativeBaseDirectory = baseDirectory !== void 0 && !fs27.isAbsolute(baseDirectory) ? baseDirectory : fs27.relative(this.root || fs27.cwd, this.baseDirectory);
|
|
184052
184151
|
this.fs.cwd = this.baseDirectory;
|
|
184053
|
-
this.logger =
|
|
184152
|
+
this.logger = fs27.logger;
|
|
184054
184153
|
}
|
|
184055
184154
|
/** Set's the environment for the project */
|
|
184056
184155
|
setEnvironment(env6) {
|
|
@@ -184432,7 +184531,7 @@ async function locatePath(paths, {
|
|
|
184432
184531
|
} = {}) {
|
|
184433
184532
|
checkType(type);
|
|
184434
184533
|
cwd2 = toPath(cwd2);
|
|
184435
|
-
const statFunction = allowSymlinks ?
|
|
184534
|
+
const statFunction = allowSymlinks ? fs23.promises.stat : fs23.promises.lstat;
|
|
184436
184535
|
return pLocate(paths, async (path_) => {
|
|
184437
184536
|
try {
|
|
184438
184537
|
const stat9 = await statFunction(path3__namespace.default.resolve(cwd2, path_));
|
|
@@ -184564,7 +184663,7 @@ var init_file_system2 = __esm({
|
|
|
184564
184663
|
}
|
|
184565
184664
|
async fileExists(path82) {
|
|
184566
184665
|
try {
|
|
184567
|
-
await
|
|
184666
|
+
await fs23.promises.stat(path3.resolve(path82));
|
|
184568
184667
|
return true;
|
|
184569
184668
|
} catch {
|
|
184570
184669
|
return false;
|
|
@@ -184573,16 +184672,16 @@ var init_file_system2 = __esm({
|
|
|
184573
184672
|
async readDir(path82, withFileTypes) {
|
|
184574
184673
|
try {
|
|
184575
184674
|
if (!withFileTypes) {
|
|
184576
|
-
return
|
|
184675
|
+
return fs23.promises.readdir(path3.resolve(path82));
|
|
184577
184676
|
}
|
|
184578
|
-
const result = await
|
|
184677
|
+
const result = await fs23.promises.readdir(path3.resolve(path82), { withFileTypes: true });
|
|
184579
184678
|
return result.reduce((prev, cur) => ({ ...prev, [cur.name]: cur.isDirectory() ? "directory" : "file" }), {});
|
|
184580
184679
|
} catch {
|
|
184581
184680
|
return [];
|
|
184582
184681
|
}
|
|
184583
184682
|
}
|
|
184584
184683
|
async readFile(path82) {
|
|
184585
|
-
return (await
|
|
184684
|
+
return (await fs23.promises.readFile(path3.resolve(path82), "utf-8")).toString();
|
|
184586
184685
|
}
|
|
184587
184686
|
/** Node implementation of finding a file or directory by walking up parent directories. */
|
|
184588
184687
|
findUp(name2, options = {}) {
|
|
@@ -215923,7 +216022,7 @@ var init_codemod = __esm({
|
|
|
215923
216022
|
const ast = parseFile(filePath);
|
|
215924
216023
|
if (ast) {
|
|
215925
216024
|
recast.visit(ast, methods);
|
|
215926
|
-
|
|
216025
|
+
fs23.writeFileSync(filePath, recast.print(ast).code);
|
|
215927
216026
|
}
|
|
215928
216027
|
}, "transformFile");
|
|
215929
216028
|
mergeObjectProperties = /* @__PURE__ */ __name((sourceObject, newProperties) => {
|
|
@@ -216028,9 +216127,9 @@ async function updateViteConfig(projectPath) {
|
|
|
216028
216127
|
const viteConfigTsPAth = path3.join(projectPath, "vite.config.ts");
|
|
216029
216128
|
const viteConfigJsPath = path3.join(projectPath, "vite.config.js");
|
|
216030
216129
|
let viteConfigPath;
|
|
216031
|
-
if (
|
|
216130
|
+
if (fs23.existsSync(viteConfigTsPAth)) {
|
|
216032
216131
|
viteConfigPath = viteConfigTsPAth;
|
|
216033
|
-
} else if (
|
|
216132
|
+
} else if (fs23.existsSync(viteConfigJsPath)) {
|
|
216034
216133
|
viteConfigPath = viteConfigJsPath;
|
|
216035
216134
|
} else {
|
|
216036
216135
|
throw new Error("Could not find Vite config file to modify");
|
|
@@ -216319,7 +216418,7 @@ var init_packages3 = __esm({
|
|
|
216319
216418
|
}
|
|
216320
216419
|
}
|
|
216321
216420
|
}
|
|
216322
|
-
await
|
|
216421
|
+
await fs12.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
|
|
216323
216422
|
}
|
|
216324
216423
|
}, "installPackages");
|
|
216325
216424
|
installWrangler = /* @__PURE__ */ __name(async (packageManager) => {
|
|
@@ -216340,25 +216439,29 @@ async function updateAngularJson(projectName) {
|
|
|
216340
216439
|
const s7 = spinner();
|
|
216341
216440
|
s7.start(`Updating angular.json config`);
|
|
216342
216441
|
const angularJson = parseJSONC(
|
|
216343
|
-
await
|
|
216442
|
+
await fs12.readFile(path3.resolve("angular.json"), "utf8")
|
|
216344
216443
|
);
|
|
216345
216444
|
const architectSection = angularJson.projects[projectName].architect;
|
|
216346
216445
|
architectSection.build.options.outputPath = "dist";
|
|
216347
216446
|
architectSection.build.options.outputMode = "server";
|
|
216348
216447
|
architectSection.build.options.ssr.experimentalPlatform = "neutral";
|
|
216349
|
-
await
|
|
216448
|
+
await fs12.writeFile(
|
|
216350
216449
|
path3.resolve("angular.json"),
|
|
216351
216450
|
JSON.stringify(angularJson, null, 2)
|
|
216352
216451
|
);
|
|
216353
216452
|
s7.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
216354
216453
|
}
|
|
216355
216454
|
async function overrideServerFile() {
|
|
216356
|
-
await
|
|
216455
|
+
await fs12.writeFile(
|
|
216357
216456
|
path3.resolve("src/server.ts"),
|
|
216358
216457
|
dedent3`
|
|
216359
216458
|
import { AngularAppEngine, createRequestHandler } from '@angular/ssr';
|
|
216360
216459
|
|
|
216361
|
-
const angularApp = new AngularAppEngine(
|
|
216460
|
+
const angularApp = new AngularAppEngine({
|
|
216461
|
+
// It is safe to set allow \`localhost\`, so that SSR can run in local development,
|
|
216462
|
+
// as, in production, Cloudflare will ensure that \`localhost\` is not the host.
|
|
216463
|
+
allowedHosts: ['localhost'],
|
|
216464
|
+
});
|
|
216362
216465
|
|
|
216363
216466
|
/**
|
|
216364
216467
|
* This is a request handler used by the Angular CLI (dev-server and during build).
|
|
@@ -216446,7 +216549,7 @@ var init_astro2 = __esm({
|
|
|
216446
216549
|
`via \`${npx} astro add cloudflare\``
|
|
216447
216550
|
)}`
|
|
216448
216551
|
});
|
|
216449
|
-
|
|
216552
|
+
fs23.writeFileSync("public/.assetsignore", "_worker.js\n_routes.json");
|
|
216450
216553
|
}
|
|
216451
216554
|
return {
|
|
216452
216555
|
wranglerConfig: {
|
|
@@ -216664,7 +216767,7 @@ var init_pages3 = __esm({
|
|
|
216664
216767
|
}
|
|
216665
216768
|
});
|
|
216666
216769
|
function usesTypescript(projectPath) {
|
|
216667
|
-
return
|
|
216770
|
+
return fs23.existsSync(path3.join(projectPath, `tsconfig.json`));
|
|
216668
216771
|
}
|
|
216669
216772
|
var init_uses_typescript = __esm({
|
|
216670
216773
|
"src/autoconfig/uses-typescript.ts"() {
|
|
@@ -216727,7 +216830,7 @@ function addBindingsProxy(projectPath) {
|
|
|
216727
216830
|
}
|
|
216728
216831
|
async function addAssetsIgnoreFile(projectPath) {
|
|
216729
216832
|
const toAdd = ["_worker.js", "_routes.json", "_headers", "_redirects"];
|
|
216730
|
-
await
|
|
216833
|
+
await fs12.writeFile(
|
|
216731
216834
|
`${projectPath}/public/.assetsignore`,
|
|
216732
216835
|
`${toAdd.join("\n")}
|
|
216733
216836
|
`
|
|
@@ -216863,9 +216966,9 @@ function getViteConfigPath(projectPath) {
|
|
|
216863
216966
|
const filePathTS = path3__namespace.default.join(projectPath, `vite.config.ts`);
|
|
216864
216967
|
const filePathJS = path3__namespace.default.join(projectPath, `vite.config.js`);
|
|
216865
216968
|
let filePath;
|
|
216866
|
-
if (
|
|
216969
|
+
if (fs23.existsSync(filePathTS)) {
|
|
216867
216970
|
filePath = filePathTS;
|
|
216868
|
-
} else if (
|
|
216971
|
+
} else if (fs23.existsSync(filePathJS)) {
|
|
216869
216972
|
filePath = filePathJS;
|
|
216870
216973
|
} else {
|
|
216871
216974
|
throw new Error("Could not find Vite config file to modify");
|
|
@@ -216991,9 +217094,9 @@ function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
|
|
|
216991
217094
|
const filePathTS = path3__namespace.default.join(projectPath, `react-router.config.ts`);
|
|
216992
217095
|
const filePathJS = path3__namespace.default.join(projectPath, `react-router.config.js`);
|
|
216993
217096
|
let filePath;
|
|
216994
|
-
if (
|
|
217097
|
+
if (fs23.existsSync(filePathTS)) {
|
|
216995
217098
|
filePath = filePathTS;
|
|
216996
|
-
} else if (
|
|
217099
|
+
} else if (fs23.existsSync(filePathJS)) {
|
|
216997
217100
|
filePath = filePathJS;
|
|
216998
217101
|
} else {
|
|
216999
217102
|
throw new Error("Could not find React Router config file to modify");
|
|
@@ -217117,8 +217220,8 @@ var init_react_router2 = __esm({
|
|
|
217117
217220
|
startText: "Installing the Cloudflare Vite plugin",
|
|
217118
217221
|
doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`
|
|
217119
217222
|
});
|
|
217120
|
-
|
|
217121
|
-
|
|
217223
|
+
fs23.mkdirSync("workers");
|
|
217224
|
+
fs23.writeFileSync(
|
|
217122
217225
|
"workers/app.ts",
|
|
217123
217226
|
esm_default3`
|
|
217124
217227
|
import { createRequestHandler } from "react-router";
|
|
@@ -217151,8 +217254,8 @@ var init_react_router2 = __esm({
|
|
|
217151
217254
|
startText: "Installing the isbot package",
|
|
217152
217255
|
doneText: `${brandColor(`installed`)} ${dim("isbot")}`
|
|
217153
217256
|
});
|
|
217154
|
-
if (!
|
|
217155
|
-
|
|
217257
|
+
if (!fs23.existsSync("app/entry.server.tsx")) {
|
|
217258
|
+
fs23.writeFileSync(
|
|
217156
217259
|
`app/entry.server.tsx`,
|
|
217157
217260
|
esm_default3`
|
|
217158
217261
|
import type { AppLoadContext, EntryContext } from "react-router";
|
|
@@ -217349,7 +217452,7 @@ var init_sveltekit = __esm({
|
|
|
217349
217452
|
)}`
|
|
217350
217453
|
}
|
|
217351
217454
|
);
|
|
217352
|
-
|
|
217455
|
+
fs23.writeFileSync("static/.assetsignore", "_worker.js\n_routes.json");
|
|
217353
217456
|
await installPackages(packageManager, [], {
|
|
217354
217457
|
startText: "Installing packages",
|
|
217355
217458
|
doneText: `${brandColor("installed")}`
|
|
@@ -217466,9 +217569,9 @@ function getConfigPath(projectPath) {
|
|
|
217466
217569
|
const filePathTS = path3__namespace.default.join(projectPath, "pages", "+config.ts");
|
|
217467
217570
|
const filePathJS = path3__namespace.default.join(projectPath, "pages", "+config.js");
|
|
217468
217571
|
let filePath;
|
|
217469
|
-
if (
|
|
217572
|
+
if (fs23.existsSync(filePathTS)) {
|
|
217470
217573
|
filePath = filePathTS;
|
|
217471
|
-
} else if (
|
|
217574
|
+
} else if (fs23.existsSync(filePathJS)) {
|
|
217472
217575
|
filePath = filePathJS;
|
|
217473
217576
|
} else {
|
|
217474
217577
|
throw new Error("Could not find config file to modify");
|
|
@@ -217583,8 +217686,17 @@ var init_vite2 = __esm({
|
|
|
217583
217686
|
};
|
|
217584
217687
|
}
|
|
217585
217688
|
});
|
|
217689
|
+
function validateMinimumWakuVersion(projectPath) {
|
|
217690
|
+
const wakuVersion = getInstalledPackageVersion("waku", projectPath);
|
|
217691
|
+
const minumumWakuVersion = "1.0.0-alpha.4";
|
|
217692
|
+
if (wakuVersion && semiver_default(wakuVersion, minumumWakuVersion) < 0) {
|
|
217693
|
+
throw new AutoConfigFrameworkConfigurationError(
|
|
217694
|
+
`The version of Waku used in the project (${JSON.stringify(wakuVersion)}) is not supported by the Wrangler automatic configuration. Please update the Waku version to at least ${JSON.stringify(minumumWakuVersion)} and try again.`
|
|
217695
|
+
);
|
|
217696
|
+
}
|
|
217697
|
+
}
|
|
217586
217698
|
async function createWakuServerFile(projectPath) {
|
|
217587
|
-
await
|
|
217699
|
+
await fs12.writeFile(
|
|
217588
217700
|
`${projectPath}/src/waku.server.tsx`,
|
|
217589
217701
|
esm_default3`
|
|
217590
217702
|
import { fsRouter } from 'waku';
|
|
@@ -217611,52 +217723,9 @@ async function createWakuServerFile(projectPath) {
|
|
|
217611
217723
|
`
|
|
217612
217724
|
);
|
|
217613
217725
|
}
|
|
217614
|
-
async function createCloudflareMiddleware(projectPath) {
|
|
217615
|
-
const middlewareDir = `${projectPath}/src/middleware`;
|
|
217616
|
-
await fs11.mkdir(middlewareDir, { recursive: true });
|
|
217617
|
-
await fs11.writeFile(
|
|
217618
|
-
`${middlewareDir}/cloudflare.ts`,
|
|
217619
|
-
esm_default3`
|
|
217620
|
-
import type { Context, MiddlewareHandler } from 'hono';
|
|
217621
|
-
|
|
217622
|
-
function isWranglerDev(c: Context): boolean {
|
|
217623
|
-
// This header seems to only be set for production cloudflare workers
|
|
217624
|
-
return !c.req.header('cf-visitor');
|
|
217625
|
-
}
|
|
217626
|
-
|
|
217627
|
-
const cloudflareMiddleware = (): MiddlewareHandler => {
|
|
217628
|
-
return async (c, next) => {
|
|
217629
|
-
await next();
|
|
217630
|
-
if (!import.meta.env?.PROD) {
|
|
217631
|
-
return;
|
|
217632
|
-
}
|
|
217633
|
-
if (!isWranglerDev(c)) {
|
|
217634
|
-
return;
|
|
217635
|
-
}
|
|
217636
|
-
const contentType = c.res.headers.get('content-type');
|
|
217637
|
-
if (
|
|
217638
|
-
!contentType ||
|
|
217639
|
-
contentType.includes('text/html') ||
|
|
217640
|
-
contentType.includes('text/plain')
|
|
217641
|
-
) {
|
|
217642
|
-
const headers = new Headers(c.res.headers);
|
|
217643
|
-
headers.set('content-encoding', 'Identity');
|
|
217644
|
-
c.res = new Response(c.res.body, {
|
|
217645
|
-
status: c.res.status,
|
|
217646
|
-
statusText: c.res.statusText,
|
|
217647
|
-
headers: c.res.headers,
|
|
217648
|
-
});
|
|
217649
|
-
}
|
|
217650
|
-
};
|
|
217651
|
-
};
|
|
217652
|
-
|
|
217653
|
-
export default cloudflareMiddleware;
|
|
217654
|
-
`
|
|
217655
|
-
);
|
|
217656
|
-
}
|
|
217657
217726
|
async function updateWakuConfig(projectPath) {
|
|
217658
217727
|
const wakuConfigPath = path3.join(projectPath, "waku.config.ts");
|
|
217659
|
-
if (!
|
|
217728
|
+
if (!fs23.existsSync(wakuConfigPath)) {
|
|
217660
217729
|
throw new Error("Could not find Waku config file to modify");
|
|
217661
217730
|
}
|
|
217662
217731
|
updateStatus(`Updating Waku configuration in ${blue(wakuConfigPath)}`);
|
|
@@ -217667,11 +217736,11 @@ async function updateWakuConfig(projectPath) {
|
|
|
217667
217736
|
);
|
|
217668
217737
|
const lastImport = n8.get("body", lastImportIndex);
|
|
217669
217738
|
if (!n8.node.body.some(
|
|
217670
|
-
(s7) => s7.type === "ImportDeclaration" && s7.source.value === "@
|
|
217739
|
+
(s7) => s7.type === "ImportDeclaration" && s7.source.value === "@cloudflare/vite-plugin"
|
|
217671
217740
|
)) {
|
|
217672
217741
|
const importAst = b6.importDeclaration(
|
|
217673
|
-
[b6.
|
|
217674
|
-
b6.stringLiteral("@
|
|
217742
|
+
[b6.importSpecifier(b6.identifier("cloudflare"))],
|
|
217743
|
+
b6.stringLiteral("@cloudflare/vite-plugin")
|
|
217675
217744
|
);
|
|
217676
217745
|
lastImport.insertAfter(importAst);
|
|
217677
217746
|
}
|
|
@@ -217693,29 +217762,27 @@ async function updateWakuConfig(projectPath) {
|
|
|
217693
217762
|
);
|
|
217694
217763
|
assert50__default.default(pluginsProp && t5.ArrayExpression.check(pluginsProp.value));
|
|
217695
217764
|
if (!pluginsProp.value.elements.some(
|
|
217696
|
-
(el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "
|
|
217765
|
+
(el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "cloudflare"
|
|
217697
217766
|
)) {
|
|
217698
217767
|
pluginsProp.value.elements.push(
|
|
217699
|
-
b6.callExpression(b6.identifier("
|
|
217768
|
+
b6.callExpression(b6.identifier("cloudflare"), [
|
|
217700
217769
|
b6.objectExpression([
|
|
217701
217770
|
b6.objectProperty(
|
|
217702
|
-
b6.identifier("
|
|
217703
|
-
b6.arrayExpression([b6.stringLiteral("rsc")])
|
|
217704
|
-
),
|
|
217705
|
-
b6.objectProperty(b6.identifier("build"), b6.booleanLiteral(true)),
|
|
217706
|
-
b6.objectProperty(
|
|
217707
|
-
b6.identifier("getPlatformProxyOptions"),
|
|
217771
|
+
b6.identifier("viteEnvironment"),
|
|
217708
217772
|
b6.objectExpression([
|
|
217709
217773
|
b6.objectProperty(
|
|
217710
|
-
b6.identifier("
|
|
217711
|
-
b6.
|
|
217712
|
-
|
|
217713
|
-
|
|
217714
|
-
|
|
217715
|
-
|
|
217716
|
-
])
|
|
217774
|
+
b6.identifier("name"),
|
|
217775
|
+
b6.stringLiteral("rsc")
|
|
217776
|
+
),
|
|
217777
|
+
b6.objectProperty(
|
|
217778
|
+
b6.identifier("childEnvironments"),
|
|
217779
|
+
b6.arrayExpression([b6.stringLiteral("ssr")])
|
|
217717
217780
|
)
|
|
217718
217781
|
])
|
|
217782
|
+
),
|
|
217783
|
+
b6.objectProperty(
|
|
217784
|
+
b6.identifier("inspectorPort"),
|
|
217785
|
+
b6.booleanLiteral(false)
|
|
217719
217786
|
)
|
|
217720
217787
|
])
|
|
217721
217788
|
])
|
|
@@ -217738,9 +217805,12 @@ var init_waku2 = __esm({
|
|
|
217738
217805
|
init_cli();
|
|
217739
217806
|
init_colors();
|
|
217740
217807
|
recast9 = __toESM(require_main4());
|
|
217808
|
+
init_semiver();
|
|
217741
217809
|
init_esm2();
|
|
217742
217810
|
init_codemod();
|
|
217743
217811
|
init_packages3();
|
|
217812
|
+
init_errors6();
|
|
217813
|
+
init_packages2();
|
|
217744
217814
|
init_frameworks2();
|
|
217745
217815
|
b6 = recast9.types.builders;
|
|
217746
217816
|
t5 = recast9.types.namedTypes;
|
|
@@ -217753,23 +217823,23 @@ var init_waku2 = __esm({
|
|
|
217753
217823
|
projectPath,
|
|
217754
217824
|
packageManager
|
|
217755
217825
|
}) {
|
|
217826
|
+
validateMinimumWakuVersion(projectPath);
|
|
217756
217827
|
if (!dryRun) {
|
|
217757
217828
|
await installPackages(
|
|
217758
217829
|
packageManager,
|
|
217759
|
-
["hono", "@
|
|
217830
|
+
["hono", "@cloudflare/vite-plugin"],
|
|
217760
217831
|
{
|
|
217761
217832
|
dev: true,
|
|
217762
217833
|
startText: "Installing additional dependencies",
|
|
217763
217834
|
doneText: `${brandColor("installed")}`
|
|
217764
217835
|
}
|
|
217765
217836
|
);
|
|
217766
|
-
await createCloudflareMiddleware(projectPath);
|
|
217767
217837
|
await createWakuServerFile(projectPath);
|
|
217768
217838
|
await updateWakuConfig(projectPath);
|
|
217769
217839
|
}
|
|
217770
217840
|
return {
|
|
217771
217841
|
wranglerConfig: {
|
|
217772
|
-
main: "./
|
|
217842
|
+
main: "./src/waku.server",
|
|
217773
217843
|
assets: {
|
|
217774
217844
|
binding: "ASSETS",
|
|
217775
217845
|
directory: "./dist/public",
|
|
@@ -217779,8 +217849,8 @@ var init_waku2 = __esm({
|
|
|
217779
217849
|
};
|
|
217780
217850
|
}
|
|
217781
217851
|
};
|
|
217852
|
+
__name(validateMinimumWakuVersion, "validateMinimumWakuVersion");
|
|
217782
217853
|
__name(createWakuServerFile, "createWakuServerFile");
|
|
217783
|
-
__name(createCloudflareMiddleware, "createCloudflareMiddleware");
|
|
217784
217854
|
__name(updateWakuConfig, "updateWakuConfig");
|
|
217785
217855
|
__name(isViteProp, "isViteProp");
|
|
217786
217856
|
__name(isPluginsProp2, "isPluginsProp");
|
|
@@ -217925,9 +217995,9 @@ function throwMultipleFrameworksNonInteractiveError(settings) {
|
|
|
217925
217995
|
throw new MultipleFrameworksCIError(settings.map((b11) => b11.name));
|
|
217926
217996
|
}
|
|
217927
217997
|
async function hasIndexHtml(dir2) {
|
|
217928
|
-
const children = await
|
|
217998
|
+
const children = await fs12.readdir(dir2);
|
|
217929
217999
|
for (const child of children) {
|
|
217930
|
-
const stats = await
|
|
218000
|
+
const stats = await fs12.stat(path3.join(dir2, child));
|
|
217931
218001
|
if (stats.isFile() && child === "index.html") {
|
|
217932
218002
|
return true;
|
|
217933
218003
|
}
|
|
@@ -217938,10 +218008,10 @@ async function findAssetsDir(from) {
|
|
|
217938
218008
|
if (await hasIndexHtml(from)) {
|
|
217939
218009
|
return ".";
|
|
217940
218010
|
}
|
|
217941
|
-
const children = await
|
|
218011
|
+
const children = await fs12.readdir(from);
|
|
217942
218012
|
for (const child of children) {
|
|
217943
218013
|
const path82 = path3.join(from, child);
|
|
217944
|
-
const stats = await
|
|
218014
|
+
const stats = await fs12.stat(path82);
|
|
217945
218015
|
if (stats.isDirectory() && await hasIndexHtml(path82)) {
|
|
217946
218016
|
return path3.relative(from, path82);
|
|
217947
218017
|
}
|
|
@@ -217959,14 +218029,14 @@ async function isPagesProject(projectPath, wranglerConfig, detectedFramework) {
|
|
|
217959
218029
|
const cacheFolder = getCacheFolder();
|
|
217960
218030
|
if (cacheFolder) {
|
|
217961
218031
|
const pagesConfigCache = path3.join(cacheFolder, PAGES_CONFIG_CACHE_FILENAME);
|
|
217962
|
-
if (
|
|
218032
|
+
if (fs23.existsSync(pagesConfigCache)) {
|
|
217963
218033
|
return true;
|
|
217964
218034
|
}
|
|
217965
218035
|
}
|
|
217966
218036
|
if (detectedFramework === void 0) {
|
|
217967
218037
|
const functionsPath = path3.join(projectPath, "functions");
|
|
217968
|
-
if (
|
|
217969
|
-
const functionsStat =
|
|
218038
|
+
if (fs23.existsSync(functionsPath)) {
|
|
218039
|
+
const functionsStat = fs23.statSync(functionsPath);
|
|
217970
218040
|
if (functionsStat.isDirectory()) {
|
|
217971
218041
|
const pagesConfirmed = await confirm(
|
|
217972
218042
|
"We have identified a `functions` directory in this project, which might indicate you have an active Cloudflare Pages deployment. Is this correct?",
|
|
@@ -217983,9 +218053,9 @@ async function isPagesProject(projectPath, wranglerConfig, detectedFramework) {
|
|
|
217983
218053
|
return false;
|
|
217984
218054
|
}
|
|
217985
218055
|
async function detectFramework(projectPath, wranglerConfig) {
|
|
217986
|
-
const
|
|
217987
|
-
|
|
217988
|
-
const project = new Project(
|
|
218056
|
+
const fs27 = new NodeFS();
|
|
218057
|
+
fs27.logger = logger;
|
|
218058
|
+
const project = new Project(fs27, projectPath, projectPath).setEnvironment(process.env).setNodeVersion(process.version).setReportFn((err) => {
|
|
217989
218059
|
captureException(err);
|
|
217990
218060
|
});
|
|
217991
218061
|
const buildSettings = await project.getBuildSettings();
|
|
@@ -217997,7 +218067,7 @@ async function detectFramework(projectPath, wranglerConfig) {
|
|
|
217997
218067
|
const detectedFramework = findDetectedFramework(buildSettings);
|
|
217998
218068
|
const packageManager = convertDetectedPackageManager(project.packageManager);
|
|
217999
218069
|
const lockFileExists = packageManager.lockFiles.some(
|
|
218000
|
-
(lockFile) =>
|
|
218070
|
+
(lockFile) => fs23.existsSync(path3.join(projectPath, lockFile))
|
|
218001
218071
|
);
|
|
218002
218072
|
if (!lockFileExists) {
|
|
218003
218073
|
logger.warn(
|
|
@@ -218288,7 +218358,7 @@ async function confirmAutoConfigDetails(autoConfigDetails) {
|
|
|
218288
218358
|
if (!value) {
|
|
218289
218359
|
return "Please provide a valid directory path";
|
|
218290
218360
|
}
|
|
218291
|
-
const valueStats =
|
|
218361
|
+
const valueStats = fs23.statSync(path3.resolve(value), { throwIfNoEntry: false });
|
|
218292
218362
|
if (!valueStats) {
|
|
218293
218363
|
return true;
|
|
218294
218364
|
}
|
|
@@ -218382,9 +218452,9 @@ var init_add_wrangler_assetsignore = __esm({
|
|
|
218382
218452
|
init_dist();
|
|
218383
218453
|
addWranglerToAssetsIgnore = /* @__PURE__ */ __name((projectPath) => {
|
|
218384
218454
|
const assetsIgnorePath = `${projectPath}/.assetsignore`;
|
|
218385
|
-
const assetsIgnorePreExisted =
|
|
218455
|
+
const assetsIgnorePreExisted = fs23.existsSync(assetsIgnorePath);
|
|
218386
218456
|
if (!assetsIgnorePreExisted) {
|
|
218387
|
-
|
|
218457
|
+
fs23.writeFileSync(assetsIgnorePath, "");
|
|
218388
218458
|
}
|
|
218389
218459
|
const existingAssetsIgnoreContent = readFileSync(assetsIgnorePath);
|
|
218390
218460
|
const wranglerAssetsIgnoreFilesToAdd = [];
|
|
@@ -218431,7 +218501,7 @@ var init_add_wrangler_assetsignore = __esm({
|
|
|
218431
218501
|
}
|
|
218432
218502
|
wranglerAssetsIgnoreFilesToAdd.forEach((line) => linesToAppend.push(line));
|
|
218433
218503
|
linesToAppend.push("");
|
|
218434
|
-
|
|
218504
|
+
fs23.appendFileSync(assetsIgnorePath, linesToAppend.join("\n"));
|
|
218435
218505
|
s7.stop(
|
|
218436
218506
|
`${brandColor(assetsIgnorePreExisted ? "updated" : "created")} ${dim(
|
|
218437
218507
|
".assetsignore file"
|
|
@@ -218449,7 +218519,7 @@ var init_add_wrangler_gitignore = __esm({
|
|
|
218449
218519
|
init_dist();
|
|
218450
218520
|
directoryExists = /* @__PURE__ */ __name((path82) => {
|
|
218451
218521
|
try {
|
|
218452
|
-
const stat9 =
|
|
218522
|
+
const stat9 = fs23.statSync(path82);
|
|
218453
218523
|
return stat9.isDirectory();
|
|
218454
218524
|
} catch (error2) {
|
|
218455
218525
|
if (error2.code === "ENOENT") {
|
|
@@ -218460,13 +218530,13 @@ var init_add_wrangler_gitignore = __esm({
|
|
|
218460
218530
|
}, "directoryExists");
|
|
218461
218531
|
addWranglerToGitIgnore = /* @__PURE__ */ __name((projectPath) => {
|
|
218462
218532
|
const gitIgnorePath = `${projectPath}/.gitignore`;
|
|
218463
|
-
const gitIgnorePreExisted =
|
|
218533
|
+
const gitIgnorePreExisted = fs23.existsSync(gitIgnorePath);
|
|
218464
218534
|
const gitDirExists = directoryExists(`${projectPath}/.git`);
|
|
218465
218535
|
if (!gitIgnorePreExisted && !gitDirExists) {
|
|
218466
218536
|
return;
|
|
218467
218537
|
}
|
|
218468
218538
|
if (!gitIgnorePreExisted) {
|
|
218469
|
-
|
|
218539
|
+
fs23.writeFileSync(gitIgnorePath, "");
|
|
218470
218540
|
}
|
|
218471
218541
|
const existingGitIgnoreContent = readFileSync(gitIgnorePath);
|
|
218472
218542
|
const wranglerGitIgnoreFilesToAdd = [];
|
|
@@ -218513,7 +218583,7 @@ var init_add_wrangler_gitignore = __esm({
|
|
|
218513
218583
|
}
|
|
218514
218584
|
wranglerGitIgnoreFilesToAdd.forEach((line) => linesToAppend.push(line));
|
|
218515
218585
|
linesToAppend.push("");
|
|
218516
|
-
|
|
218586
|
+
fs23.appendFileSync(gitIgnorePath, linesToAppend.join("\n"));
|
|
218517
218587
|
s7.stop(
|
|
218518
218588
|
`${brandColor(gitIgnorePreExisted ? "updated" : "created")} ${dim(
|
|
218519
218589
|
".gitignore file"
|
|
@@ -218631,9 +218701,9 @@ ${JSON.stringify(autoConfigDetails, null, 2)}...`
|
|
|
218631
218701
|
"package.json"
|
|
218632
218702
|
);
|
|
218633
218703
|
const existingPackageJson = JSON.parse(
|
|
218634
|
-
await
|
|
218704
|
+
await fs12.readFile(packageJsonPath, "utf8")
|
|
218635
218705
|
);
|
|
218636
|
-
await
|
|
218706
|
+
await fs12.writeFile(
|
|
218637
218707
|
packageJsonPath,
|
|
218638
218708
|
JSON.stringify(
|
|
218639
218709
|
{
|
|
@@ -218707,13 +218777,13 @@ async function saveWranglerJsonc(projectPath, wranglerConfig) {
|
|
|
218707
218777
|
let existingWranglerConfig = {};
|
|
218708
218778
|
const wranglerConfigPath = getDirWranglerJsonConfigPath(projectPath);
|
|
218709
218779
|
if (wranglerConfigPath) {
|
|
218710
|
-
const existingContent = await
|
|
218780
|
+
const existingContent = await fs12.readFile(wranglerConfigPath, "utf8");
|
|
218711
218781
|
existingWranglerConfig = parseJSONC(
|
|
218712
218782
|
existingContent,
|
|
218713
218783
|
wranglerConfigPath
|
|
218714
218784
|
);
|
|
218715
218785
|
}
|
|
218716
|
-
await
|
|
218786
|
+
await fs12.writeFile(
|
|
218717
218787
|
path3.resolve(projectPath, "wrangler.jsonc"),
|
|
218718
218788
|
JSON.stringify(
|
|
218719
218789
|
{
|
|
@@ -218767,7 +218837,7 @@ async function buildOperationsSummary(autoConfigDetails, wranglerConfigToWrite,
|
|
|
218767
218837
|
autoConfigDetails.projectPath,
|
|
218768
218838
|
"wrangler.jsonc"
|
|
218769
218839
|
);
|
|
218770
|
-
const configExists =
|
|
218840
|
+
const configExists = fs23.existsSync(wranglerConfigPath);
|
|
218771
218841
|
logger.log(
|
|
218772
218842
|
configExists ? "\u{1F4C4} Update wrangler.jsonc:" : "\u{1F4C4} Create wrangler.jsonc:"
|
|
218773
218843
|
);
|
|
@@ -218785,11 +218855,11 @@ async function buildOperationsSummary(autoConfigDetails, wranglerConfigToWrite,
|
|
|
218785
218855
|
}
|
|
218786
218856
|
function getDirWranglerJsonConfigPath(dir2) {
|
|
218787
218857
|
const filePathJsonC = path3.resolve(dir2, "wrangler.jsonc");
|
|
218788
|
-
if (
|
|
218858
|
+
if (fs23.existsSync(filePathJsonC)) {
|
|
218789
218859
|
return filePathJsonC;
|
|
218790
218860
|
}
|
|
218791
218861
|
const filePathJson = path3.resolve(dir2, "wrangler.json");
|
|
218792
|
-
if (
|
|
218862
|
+
if (fs23.existsSync(filePathJson)) {
|
|
218793
218863
|
return filePathJson;
|
|
218794
218864
|
}
|
|
218795
218865
|
return void 0;
|
|
@@ -219176,7 +219246,7 @@ var init_xxhash_wasm = __esm({
|
|
|
219176
219246
|
}
|
|
219177
219247
|
});
|
|
219178
219248
|
async function* getFilesInFolder(dirPath) {
|
|
219179
|
-
const files = await
|
|
219249
|
+
const files = await fs12.readdir(dirPath, { withFileTypes: true });
|
|
219180
219250
|
for (const file3 of files) {
|
|
219181
219251
|
if (ALWAYS_IGNORE.has(file3.name)) {
|
|
219182
219252
|
continue;
|
|
@@ -219273,7 +219343,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
|
|
|
219273
219343
|
if (!include(assetFile) || exclude(assetFile)) {
|
|
219274
219344
|
continue;
|
|
219275
219345
|
}
|
|
219276
|
-
const content = await
|
|
219346
|
+
const content = await fs12.readFile(absAssetFile, "base64");
|
|
219277
219347
|
const assetSize = Buffer.byteLength(content);
|
|
219278
219348
|
await validateAssetSize(absAssetFile, assetFile);
|
|
219279
219349
|
const assetKey = hashAsset(hasher, assetFile, content);
|
|
@@ -219328,7 +219398,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
|
|
|
219328
219398
|
for (const [absAssetFile, assetKey] of nextBucket) {
|
|
219329
219399
|
bucket.push({
|
|
219330
219400
|
key: assetKey,
|
|
219331
|
-
value: await
|
|
219401
|
+
value: await fs12.readFile(absAssetFile, "base64"),
|
|
219332
219402
|
base64: true
|
|
219333
219403
|
});
|
|
219334
219404
|
if (controller.signal.aborted) {
|
|
@@ -219412,7 +219482,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
|
|
|
219412
219482
|
return { manifest, namespace };
|
|
219413
219483
|
}
|
|
219414
219484
|
async function validateAssetSize(absFilePath, relativeFilePath) {
|
|
219415
|
-
const { size } = await
|
|
219485
|
+
const { size } = await fs12.stat(absFilePath);
|
|
219416
219486
|
if (size > 25 * 1024 * 1024) {
|
|
219417
219487
|
throw new UserError(
|
|
219418
219488
|
`File ${relativeFilePath} is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits`
|
|
@@ -219542,7 +219612,7 @@ async function maybeDelegateToOpenNextDeployCommand(projectRoot) {
|
|
|
219542
219612
|
}
|
|
219543
219613
|
async function isOpenNextProject(projectRoot) {
|
|
219544
219614
|
try {
|
|
219545
|
-
const dirFiles = await
|
|
219615
|
+
const dirFiles = await fs12.readdir(projectRoot);
|
|
219546
219616
|
const nextConfigFile = dirFiles.find(
|
|
219547
219617
|
(file3) => /^next\.config\.(m|c)?(ts|js)$/.test(file3)
|
|
219548
219618
|
);
|
|
@@ -219631,7 +219701,7 @@ ${source_default.dim("This will allow you to simply run `wrangler deploy` on fut
|
|
|
219631
219701
|
null,
|
|
219632
219702
|
2
|
|
219633
219703
|
);
|
|
219634
|
-
|
|
219704
|
+
fs23.writeFileSync(configPath, jsonString);
|
|
219635
219705
|
logger.log(`Wrote
|
|
219636
219706
|
${jsonString}
|
|
219637
219707
|
to ${source_default.bold(configPath)}.`);
|
|
@@ -219988,7 +220058,7 @@ var init_deploy2 = __esm({
|
|
|
219988
220058
|
if (!config.configPath) {
|
|
219989
220059
|
if (args.script) {
|
|
219990
220060
|
try {
|
|
219991
|
-
const stats =
|
|
220061
|
+
const stats = fs23.statSync(args.script);
|
|
219992
220062
|
if (stats.isDirectory()) {
|
|
219993
220063
|
args = await handleMaybeAssetsDeployment(args.script, args);
|
|
219994
220064
|
}
|
|
@@ -221608,12 +221678,12 @@ var init_init = __esm({
|
|
|
221608
221678
|
throw err;
|
|
221609
221679
|
}
|
|
221610
221680
|
const creationDir = path3__namespace.default.join(process.cwd(), args.fromDash);
|
|
221611
|
-
await
|
|
221681
|
+
await fs12.mkdir(creationDir, { recursive: true });
|
|
221612
221682
|
const { modules, config } = await downloadWorker(
|
|
221613
221683
|
accountId,
|
|
221614
221684
|
args.fromDash
|
|
221615
221685
|
);
|
|
221616
|
-
await
|
|
221686
|
+
await fs12.mkdir(path3__namespace.default.join(creationDir, "./src"), {
|
|
221617
221687
|
recursive: true
|
|
221618
221688
|
});
|
|
221619
221689
|
config.main = `src/${config.main}`;
|
|
@@ -221623,12 +221693,12 @@ var init_init = __esm({
|
|
|
221623
221693
|
files.map(async (file3) => {
|
|
221624
221694
|
const filepath = path3__namespace.default.join(creationDir, `./src/${file3.name}`);
|
|
221625
221695
|
const directory = path3.dirname(filepath);
|
|
221626
|
-
await
|
|
221627
|
-
await
|
|
221696
|
+
await fs12.mkdir(directory, { recursive: true });
|
|
221697
|
+
await fs12.writeFile(filepath, file3.stream());
|
|
221628
221698
|
})
|
|
221629
221699
|
);
|
|
221630
221700
|
}
|
|
221631
|
-
await
|
|
221701
|
+
await fs12.writeFile(
|
|
221632
221702
|
path3__namespace.default.join(creationDir, "wrangler.jsonc"),
|
|
221633
221703
|
JSON.stringify(config, null, 2)
|
|
221634
221704
|
);
|
|
@@ -223013,7 +223083,7 @@ function createWorkerBundleFormData(workerBundle, config) {
|
|
|
223013
223083
|
const mainModule = {
|
|
223014
223084
|
name: path3__namespace.default.basename(workerBundle.resolvedEntryPointPath),
|
|
223015
223085
|
filePath: workerBundle.resolvedEntryPointPath,
|
|
223016
|
-
content:
|
|
223086
|
+
content: fs23.readFileSync(workerBundle.resolvedEntryPointPath, {
|
|
223017
223087
|
encoding: "utf-8"
|
|
223018
223088
|
}),
|
|
223019
223089
|
type: workerBundle.bundleType || "esm"
|
|
@@ -223043,7 +223113,9 @@ function createWorkerBundleFormData(workerBundle, config) {
|
|
|
223043
223113
|
assets: void 0,
|
|
223044
223114
|
containers: void 0,
|
|
223045
223115
|
// containers are not supported in Pages
|
|
223046
|
-
observability: void 0
|
|
223116
|
+
observability: void 0,
|
|
223117
|
+
cache: void 0
|
|
223118
|
+
// cache is not supported in Pages
|
|
223047
223119
|
},
|
|
223048
223120
|
getBindings(config, { pages: true })
|
|
223049
223121
|
);
|
|
@@ -223399,8 +223471,8 @@ function assetsPlugin(buildOutputDirectory) {
|
|
|
223399
223471
|
args.resolveDir,
|
|
223400
223472
|
args.path.slice("assets:".length)
|
|
223401
223473
|
);
|
|
223402
|
-
const exists = await
|
|
223403
|
-
const isDirectory3 = exists && (await
|
|
223474
|
+
const exists = await fs12.access(directory).then(() => true).catch(() => false);
|
|
223475
|
+
const isDirectory3 = exists && (await fs12.lstat(directory)).isDirectory();
|
|
223404
223476
|
if (!isDirectory3) {
|
|
223405
223477
|
return {
|
|
223406
223478
|
errors: [
|
|
@@ -223429,11 +223501,8 @@ function assetsPlugin(buildOutputDirectory) {
|
|
|
223429
223501
|
"pages-plugins",
|
|
223430
223502
|
identifier
|
|
223431
223503
|
);
|
|
223432
|
-
await
|
|
223433
|
-
|
|
223434
|
-
recursive: true
|
|
223435
|
-
});
|
|
223436
|
-
await fs11.cp(args.path, staticAssetsOutputDirectory, {
|
|
223504
|
+
await removeDir(staticAssetsOutputDirectory);
|
|
223505
|
+
await fs12.cp(args.path, staticAssetsOutputDirectory, {
|
|
223437
223506
|
force: true,
|
|
223438
223507
|
recursive: true
|
|
223439
223508
|
});
|
|
@@ -223533,8 +223602,8 @@ function buildPluginFromFunctions({
|
|
|
223533
223602
|
args.resolveDir,
|
|
223534
223603
|
args.path.slice("assets:".length)
|
|
223535
223604
|
);
|
|
223536
|
-
const exists = await
|
|
223537
|
-
const isDirectory3 = exists && (await
|
|
223605
|
+
const exists = await fs12.access(directory).then(() => true).catch(() => false);
|
|
223606
|
+
const isDirectory3 = exists && (await fs12.lstat(directory)).isDirectory();
|
|
223538
223607
|
if (!isDirectory3) {
|
|
223539
223608
|
return {
|
|
223540
223609
|
errors: [
|
|
@@ -223717,7 +223786,7 @@ async function forEachFile(baseDir, fn2) {
|
|
|
223717
223786
|
const returnValues = [];
|
|
223718
223787
|
while (isNotEmpty(searchPaths)) {
|
|
223719
223788
|
const cwd2 = searchPaths.shift();
|
|
223720
|
-
const dir2 = await
|
|
223789
|
+
const dir2 = await fs12__default.default.readdir(cwd2, { withFileTypes: true });
|
|
223721
223790
|
for (const entry of dir2) {
|
|
223722
223791
|
const pathname = path3__namespace.default.join(cwd2, entry.name);
|
|
223723
223792
|
if (entry.isDirectory()) {
|
|
@@ -223849,7 +223918,7 @@ async function writeRoutesModule({
|
|
|
223849
223918
|
}) {
|
|
223850
223919
|
const { importMap, routes } = parseConfig(config, srcDir);
|
|
223851
223920
|
const routesModule = generateRoutesModule(importMap, routes);
|
|
223852
|
-
await
|
|
223921
|
+
await fs12__default.default.writeFile(outfile, routesModule);
|
|
223853
223922
|
return outfile;
|
|
223854
223923
|
}
|
|
223855
223924
|
function parseConfig(config, baseDir) {
|
|
@@ -224080,10 +224149,10 @@ async function buildFunctions({
|
|
|
224080
224149
|
}
|
|
224081
224150
|
if (routesOutputPath) {
|
|
224082
224151
|
const routesJSON = convertRoutesToRoutesJSONSpec(config.routes);
|
|
224083
|
-
|
|
224152
|
+
fs23.writeFileSync(routesOutputPath, JSON.stringify(routesJSON, null, 2));
|
|
224084
224153
|
}
|
|
224085
224154
|
if (outputConfigPath) {
|
|
224086
|
-
|
|
224155
|
+
fs23.writeFileSync(
|
|
224087
224156
|
outputConfigPath,
|
|
224088
224157
|
JSON.stringify({ ...config, baseURL }, null, 2)
|
|
224089
224158
|
);
|
|
@@ -224160,7 +224229,7 @@ async function maybeReadPagesConfig(args) {
|
|
|
224160
224229
|
const { configPath } = findWranglerConfig(args.projectDirectory, {
|
|
224161
224230
|
useRedirectIfAvailable: true
|
|
224162
224231
|
});
|
|
224163
|
-
if (!configPath || !
|
|
224232
|
+
if (!configPath || !fs23.existsSync(configPath)) {
|
|
224164
224233
|
return void 0;
|
|
224165
224234
|
}
|
|
224166
224235
|
try {
|
|
@@ -224172,7 +224241,7 @@ async function maybeReadPagesConfig(args) {
|
|
|
224172
224241
|
});
|
|
224173
224242
|
return {
|
|
224174
224243
|
...config,
|
|
224175
|
-
hash: crypto2.createHash("sha256").update(await
|
|
224244
|
+
hash: crypto2.createHash("sha256").update(await fs12.readFile(configPath)).digest("hex")
|
|
224176
224245
|
};
|
|
224177
224246
|
} catch (e9) {
|
|
224178
224247
|
if (e9 instanceof FatalError && e9.code === EXIT_CODE_INVALID_PAGES_CONFIG) {
|
|
@@ -224357,7 +224426,7 @@ var init_build5 = __esm({
|
|
|
224357
224426
|
}
|
|
224358
224427
|
}
|
|
224359
224428
|
if (outfile && outfile !== bundle.resolvedEntryPointPath) {
|
|
224360
|
-
|
|
224429
|
+
fs23.writeFileSync(
|
|
224361
224430
|
outfile,
|
|
224362
224431
|
`export { default } from './${path3.relative(
|
|
224363
224432
|
path3.dirname(outfile),
|
|
@@ -224389,7 +224458,7 @@ var init_build5 = __esm({
|
|
|
224389
224458
|
metafile
|
|
224390
224459
|
} = validatedArgs;
|
|
224391
224460
|
if (workerScriptPath) {
|
|
224392
|
-
if (
|
|
224461
|
+
if (fs23.lstatSync(workerScriptPath).isDirectory()) {
|
|
224393
224462
|
bundle = await produceWorkerBundleForWorkerJSDirectory({
|
|
224394
224463
|
workerJSDirectory: workerScriptPath,
|
|
224395
224464
|
bundle: true,
|
|
@@ -224452,14 +224521,14 @@ var init_build5 = __esm({
|
|
|
224452
224521
|
bundle,
|
|
224453
224522
|
config
|
|
224454
224523
|
);
|
|
224455
|
-
|
|
224456
|
-
|
|
224524
|
+
fs23.mkdirSync(path3.dirname(outfile), { recursive: true });
|
|
224525
|
+
fs23.writeFileSync(
|
|
224457
224526
|
outfile,
|
|
224458
224527
|
Buffer.from(await workerBundleContents.arrayBuffer())
|
|
224459
224528
|
);
|
|
224460
224529
|
}
|
|
224461
224530
|
if (buildMetadataPath && buildMetadata) {
|
|
224462
|
-
|
|
224531
|
+
fs23.writeFileSync(buildMetadataPath, JSON.stringify(buildMetadata));
|
|
224463
224532
|
}
|
|
224464
224533
|
}
|
|
224465
224534
|
sendMetricsEvent("build pages functions");
|
|
@@ -224538,10 +224607,10 @@ var init_build5 = __esm({
|
|
|
224538
224607
|
args.buildOutputDirectory,
|
|
224539
224608
|
"_worker.js"
|
|
224540
224609
|
);
|
|
224541
|
-
const foundWorkerScript =
|
|
224610
|
+
const foundWorkerScript = fs23.existsSync(prospectiveWorkerScriptPath);
|
|
224542
224611
|
if (foundWorkerScript) {
|
|
224543
224612
|
workerScriptPath = prospectiveWorkerScriptPath;
|
|
224544
|
-
} else if (!foundWorkerScript && !
|
|
224613
|
+
} else if (!foundWorkerScript && !fs23.existsSync(args.directory)) {
|
|
224545
224614
|
throw new FatalError(
|
|
224546
224615
|
`Could not find anything to build.
|
|
224547
224616
|
We first looked inside the build output directory (${path3.basename(
|
|
@@ -224554,7 +224623,7 @@ We first looked inside the build output directory (${path3.basename(
|
|
|
224554
224623
|
EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR
|
|
224555
224624
|
);
|
|
224556
224625
|
}
|
|
224557
|
-
} else if (!
|
|
224626
|
+
} else if (!fs23.existsSync(args.directory)) {
|
|
224558
224627
|
throw new FatalError(
|
|
224559
224628
|
`Could not find anything to build.
|
|
224560
224629
|
We looked for the Functions directory (${path3.basename(
|
|
@@ -224625,7 +224694,7 @@ var init_build_env = __esm({
|
|
|
224625
224694
|
const { configPath } = findWranglerConfig(args.projectDir, {
|
|
224626
224695
|
useRedirectIfAvailable: true
|
|
224627
224696
|
});
|
|
224628
|
-
if (!configPath || !
|
|
224697
|
+
if (!configPath || !fs23.existsSync(configPath)) {
|
|
224629
224698
|
logger.debug("No Wrangler configuration file found. Exiting.");
|
|
224630
224699
|
process.exitCode = EXIT_CODE_NO_CONFIG_FOUND;
|
|
224631
224700
|
return;
|
|
@@ -224661,7 +224730,7 @@ var init_build_env = __esm({
|
|
|
224661
224730
|
config.pages_build_output_dir
|
|
224662
224731
|
)
|
|
224663
224732
|
};
|
|
224664
|
-
|
|
224733
|
+
fs23.writeFileSync(args.outfile, JSON.stringify(buildConfiguration));
|
|
224665
224734
|
logger.debug(`Build configuration written to ${args.outfile}`);
|
|
224666
224735
|
logger.debug(JSON.stringify(buildConfiguration), null, 2);
|
|
224667
224736
|
const vars = Object.entries(buildConfiguration.vars);
|
|
@@ -225334,7 +225403,7 @@ var init_hash = __esm({
|
|
|
225334
225403
|
"src/pages/hash.ts"() {
|
|
225335
225404
|
init_import_meta_url();
|
|
225336
225405
|
hashFile = /* @__PURE__ */ __name((filepath) => {
|
|
225337
|
-
const contents =
|
|
225406
|
+
const contents = fs23.readFileSync(filepath);
|
|
225338
225407
|
const base64Contents = contents.toString("base64");
|
|
225339
225408
|
const extension = path3.extname(filepath).substring(1);
|
|
225340
225409
|
return blake3Wasm.hash(base64Contents + extension).toString("hex").slice(0, 32);
|
|
@@ -225399,7 +225468,7 @@ var init_validate3 = __esm({
|
|
|
225399
225468
|
const walk = /* @__PURE__ */ __name(async (dir2, fileMap2 = /* @__PURE__ */ new Map(), startingDir = dir2) => {
|
|
225400
225469
|
let files;
|
|
225401
225470
|
try {
|
|
225402
|
-
files = await
|
|
225471
|
+
files = await fs12.readdir(dir2);
|
|
225403
225472
|
} catch (e9) {
|
|
225404
225473
|
if (e9.code === "ENOENT") {
|
|
225405
225474
|
throw new FatalError(e9.message);
|
|
@@ -225410,7 +225479,7 @@ var init_validate3 = __esm({
|
|
|
225410
225479
|
files.map(async (file3) => {
|
|
225411
225480
|
const filepath = path3.join(dir2, file3);
|
|
225412
225481
|
const relativeFilepath = path3.relative(startingDir, filepath);
|
|
225413
|
-
const filestat = await
|
|
225482
|
+
const filestat = await fs12.stat(filepath);
|
|
225414
225483
|
for (const minimatch2 of IGNORE_LIST) {
|
|
225415
225484
|
if (minimatch2.match(relativeFilepath)) {
|
|
225416
225485
|
return;
|
|
@@ -225538,8 +225607,8 @@ var init_upload4 = __esm({
|
|
|
225538
225607
|
skipCaching: skipCaching ?? false
|
|
225539
225608
|
});
|
|
225540
225609
|
if (outputManifestPath) {
|
|
225541
|
-
await
|
|
225542
|
-
await
|
|
225610
|
+
await fs12.mkdir(path3.dirname(outputManifestPath), { recursive: true });
|
|
225611
|
+
await fs12.writeFile(outputManifestPath, JSON.stringify(manifest));
|
|
225543
225612
|
}
|
|
225544
225613
|
logger.log(`\u2728 Upload complete!`);
|
|
225545
225614
|
}
|
|
@@ -225634,7 +225703,7 @@ var init_upload4 = __esm({
|
|
|
225634
225703
|
const payload = await Promise.all(
|
|
225635
225704
|
bucket.files.map(async (file3) => ({
|
|
225636
225705
|
key: file3.hash,
|
|
225637
|
-
value: (await
|
|
225706
|
+
value: (await fs12.readFile(file3.path)).toString("base64"),
|
|
225638
225707
|
metadata: {
|
|
225639
225708
|
contentType: file3.contentType
|
|
225640
225709
|
},
|
|
@@ -225822,21 +225891,21 @@ async function deploy2({
|
|
|
225822
225891
|
bundle = bundle ?? true;
|
|
225823
225892
|
const _workerPath = path3.resolve(directory, "_worker.js");
|
|
225824
225893
|
try {
|
|
225825
|
-
_headers =
|
|
225894
|
+
_headers = fs23.readFileSync(path3.join(directory, "_headers"), "utf-8");
|
|
225826
225895
|
} catch {
|
|
225827
225896
|
}
|
|
225828
225897
|
try {
|
|
225829
|
-
_redirects =
|
|
225898
|
+
_redirects = fs23.readFileSync(path3.join(directory, "_redirects"), "utf-8");
|
|
225830
225899
|
} catch {
|
|
225831
225900
|
}
|
|
225832
225901
|
try {
|
|
225833
|
-
_routesCustom =
|
|
225902
|
+
_routesCustom = fs23.readFileSync(path3.join(directory, "_routes.json"), "utf-8");
|
|
225834
225903
|
} catch {
|
|
225835
225904
|
}
|
|
225836
|
-
const workerJSStats =
|
|
225905
|
+
const workerJSStats = fs23.lstatSync(_workerPath, { throwIfNoEntry: false });
|
|
225837
225906
|
_workerJSIsDirectory = workerJSStats?.isDirectory() ?? false;
|
|
225838
225907
|
if (workerJSStats !== void 0 && !_workerJSIsDirectory) {
|
|
225839
|
-
_workerJS =
|
|
225908
|
+
_workerJS = fs23.readFileSync(_workerPath, "utf-8");
|
|
225840
225909
|
}
|
|
225841
225910
|
const project = await fetchResult(
|
|
225842
225911
|
COMPLIANCE_REGION_CONFIG_PUBLIC,
|
|
@@ -225877,9 +225946,9 @@ async function deploy2({
|
|
|
225877
225946
|
let builtFunctions = void 0;
|
|
225878
225947
|
let workerBundle = void 0;
|
|
225879
225948
|
const functionsDirectory = customFunctionsDirectory || path3.join(process7.cwd(), "functions");
|
|
225880
|
-
const routesOutputPath = !
|
|
225949
|
+
const routesOutputPath = !fs23.existsSync(path3.join(directory, "_routes.json")) ? path3.join(getPagesTmpDir(), `_routes-${Math.random()}.json`) : void 0;
|
|
225881
225950
|
let filepathRoutingConfig;
|
|
225882
|
-
if (!_workerJS &&
|
|
225951
|
+
if (!_workerJS && fs23.existsSync(functionsDirectory)) {
|
|
225883
225952
|
const outputConfigPath = path3.join(
|
|
225884
225953
|
getPagesTmpDir(),
|
|
225885
225954
|
`functions-filepath-routing-config-${Math.random()}.json`
|
|
@@ -225898,11 +225967,11 @@ async function deploy2({
|
|
|
225898
225967
|
defineNavigatorUserAgent,
|
|
225899
225968
|
checkFetch
|
|
225900
225969
|
});
|
|
225901
|
-
builtFunctions =
|
|
225970
|
+
builtFunctions = fs23.readFileSync(
|
|
225902
225971
|
workerBundle.resolvedEntryPointPath,
|
|
225903
225972
|
"utf-8"
|
|
225904
225973
|
);
|
|
225905
|
-
filepathRoutingConfig =
|
|
225974
|
+
filepathRoutingConfig = fs23.readFileSync(outputConfigPath, "utf-8");
|
|
225906
225975
|
} catch (e9) {
|
|
225907
225976
|
if (e9 instanceof FunctionsNoRoutesError) {
|
|
225908
225977
|
logger.warn(
|
|
@@ -225960,7 +226029,7 @@ async function deploy2({
|
|
|
225960
226029
|
);
|
|
225961
226030
|
}
|
|
225962
226031
|
if (config !== void 0 && config.configPath !== void 0 && config.pages_build_output_dir) {
|
|
225963
|
-
const configHash = crypto2.createHash("sha256").update(await
|
|
226032
|
+
const configHash = crypto2.createHash("sha256").update(await fs12.readFile(config.configPath)).digest("hex");
|
|
225964
226033
|
const outputDir = path3__namespace.default.relative(
|
|
225965
226034
|
process.cwd(),
|
|
225966
226035
|
config.pages_build_output_dir
|
|
@@ -226061,7 +226130,7 @@ async function deploy2({
|
|
|
226061
226130
|
}
|
|
226062
226131
|
} else if (routesOutputPath) {
|
|
226063
226132
|
try {
|
|
226064
|
-
_routesGenerated =
|
|
226133
|
+
_routesGenerated = fs23.readFileSync(routesOutputPath, "utf-8");
|
|
226065
226134
|
if (_routesGenerated) {
|
|
226066
226135
|
formData.append(
|
|
226067
226136
|
"_routes.json",
|
|
@@ -226168,7 +226237,7 @@ async function diagnoseStartupError(err, workerBundle, projectRoot) {
|
|
|
226168
226237
|
projectRoot ?? process.cwd(),
|
|
226169
226238
|
path3__namespace.default.join(tmpDir.path, `worker.cpuprofile`)
|
|
226170
226239
|
);
|
|
226171
|
-
await
|
|
226240
|
+
await fs12.writeFile(profile, JSON.stringify(cpuProfile));
|
|
226172
226241
|
errorMessage += esm_default3`
|
|
226173
226242
|
|
|
226174
226243
|
A CPU Profile of your Worker's startup phase has been written to ${profile} - load it into the Chrome DevTools profiler (or directly in VSCode) to view a flamegraph.`;
|
|
@@ -227041,7 +227110,7 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
227041
227110
|
Object.assign(startupError, { code: 10021 });
|
|
227042
227111
|
const workerBundle = formData.get("_worker.bundle");
|
|
227043
227112
|
const filePath = path3__namespace.default.join(getPagesTmpDir(), "_worker.bundle");
|
|
227044
|
-
await
|
|
227113
|
+
await fs12.writeFile(filePath, workerBundle.stream());
|
|
227045
227114
|
throw new UserError(
|
|
227046
227115
|
await diagnoseStartupError(
|
|
227047
227116
|
startupError,
|
|
@@ -228971,11 +229040,11 @@ The Worker script should be named \`_worker.js\` and located in the build output
|
|
|
228971
229040
|
);
|
|
228972
229041
|
const singleWorkerScriptPath = args.scriptPath ?? DEFAULT_SCRIPT_PATH;
|
|
228973
229042
|
const workerScriptPath = directory !== void 0 ? path3.join(directory, singleWorkerScriptPath) : path3.resolve(singleWorkerScriptPath);
|
|
228974
|
-
const usingWorkerDirectory =
|
|
228975
|
-
const usingWorkerScript =
|
|
229043
|
+
const usingWorkerDirectory = fs23.lstatSync(workerScriptPath, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
229044
|
+
const usingWorkerScript = fs23.existsSync(workerScriptPath);
|
|
228976
229045
|
const enableBundling = args.bundle ?? !(args.noBundle ?? config.no_bundle);
|
|
228977
229046
|
const functionsDirectory = "./functions";
|
|
228978
|
-
let usingFunctions = !usingWorkerScript &&
|
|
229047
|
+
let usingFunctions = !usingWorkerScript && fs23.existsSync(functionsDirectory);
|
|
228979
229048
|
let scriptPath4 = "";
|
|
228980
229049
|
const nodejsCompatMode = validateNodeCompatMode(
|
|
228981
229050
|
args.compatibilityDate ?? config.compatibility_date,
|
|
@@ -229182,7 +229251,7 @@ The Worker script should be named \`_worker.js\` and located in the build output
|
|
|
229182
229251
|
let scriptEntrypoint = scriptPath4;
|
|
229183
229252
|
if (directory && (usingFunctions || usingWorkerScript || usingWorkerDirectory)) {
|
|
229184
229253
|
const routesJSONPath = path3.join(directory, "_routes.json");
|
|
229185
|
-
if (
|
|
229254
|
+
if (fs23.existsSync(routesJSONPath)) {
|
|
229186
229255
|
let routesJSONContents;
|
|
229187
229256
|
const runBuild2 = /* @__PURE__ */ __name(async (entrypointFile, outfile, routes) => {
|
|
229188
229257
|
await esbuild__namespace.build({
|
|
@@ -229208,7 +229277,7 @@ The Worker script should be named \`_worker.js\` and located in the build output
|
|
|
229208
229277
|
});
|
|
229209
229278
|
}, "runBuild");
|
|
229210
229279
|
try {
|
|
229211
|
-
routesJSONContents =
|
|
229280
|
+
routesJSONContents = fs23.readFileSync(routesJSONPath, "utf-8");
|
|
229212
229281
|
validateRoutes2(JSON.parse(routesJSONContents), directory);
|
|
229213
229282
|
scriptEntrypoint = path3.join(
|
|
229214
229283
|
getPagesTmpDir(),
|
|
@@ -229233,7 +229302,7 @@ The Worker script should be named \`_worker.js\` and located in the build output
|
|
|
229233
229302
|
if (event === "unlink") {
|
|
229234
229303
|
return;
|
|
229235
229304
|
}
|
|
229236
|
-
routesJSONContents =
|
|
229305
|
+
routesJSONContents = fs23.readFileSync(routesJSONPath, "utf-8");
|
|
229237
229306
|
validateRoutes2(JSON.parse(routesJSONContents), directory);
|
|
229238
229307
|
await runBuild2(scriptPath4, scriptEntrypoint, routesJSONContents);
|
|
229239
229308
|
} catch (err) {
|
|
@@ -229471,7 +229540,7 @@ async function toEnvironment(deploymentConfig, accountId) {
|
|
|
229471
229540
|
async function writeWranglerToml(toml) {
|
|
229472
229541
|
let tomlString = dist_default2.stringify(toml);
|
|
229473
229542
|
tomlString = tomlString.split("\n").map((line) => line.trimStart()).join("\n");
|
|
229474
|
-
await
|
|
229543
|
+
await fs12.writeFile(
|
|
229475
229544
|
"wrangler.toml",
|
|
229476
229545
|
`# Generated by Wrangler on ${/* @__PURE__ */ new Date()}
|
|
229477
229546
|
${tomlString}`
|
|
@@ -229579,7 +229648,7 @@ var init_download_config = __esm({
|
|
|
229579
229648
|
throw new FatalError("Must specify a project name.", 1);
|
|
229580
229649
|
}
|
|
229581
229650
|
const config = await downloadProject(accountId, projectName);
|
|
229582
|
-
if (!force &&
|
|
229651
|
+
if (!force && fs23.existsSync("wrangler.toml")) {
|
|
229583
229652
|
const overwrite = await confirm(
|
|
229584
229653
|
"Your existing Wrangler configuration file will be overwritten. Continue?",
|
|
229585
229654
|
{ fallbackValue: false }
|
|
@@ -229633,13 +229702,13 @@ var init_functions = __esm({
|
|
|
229633
229702
|
async handler({ routesPath, outputRoutesPath }) {
|
|
229634
229703
|
let routesFileContents;
|
|
229635
229704
|
const routesOutputDirectory = path3__namespace.default.dirname(outputRoutesPath);
|
|
229636
|
-
if (!
|
|
229705
|
+
if (!fs23.existsSync(routesPath)) {
|
|
229637
229706
|
throw new FatalError(
|
|
229638
229707
|
`Oops! File ${routesPath} does not exist. Please make sure --routes-path is a valid file path (for example "/public/_routes.json").`,
|
|
229639
229708
|
1
|
|
229640
229709
|
);
|
|
229641
229710
|
}
|
|
229642
|
-
if (!
|
|
229711
|
+
if (!fs23.lstatSync(routesOutputDirectory, {
|
|
229643
229712
|
throwIfNoEntry: false
|
|
229644
229713
|
})?.isDirectory()) {
|
|
229645
229714
|
throw new FatalError(
|
|
@@ -229648,7 +229717,7 @@ var init_functions = __esm({
|
|
|
229648
229717
|
);
|
|
229649
229718
|
}
|
|
229650
229719
|
try {
|
|
229651
|
-
routesFileContents =
|
|
229720
|
+
routesFileContents = fs23.readFileSync(routesPath, "utf-8");
|
|
229652
229721
|
} catch (err) {
|
|
229653
229722
|
throw new FatalError(`Error while reading ${routesPath} file: ${err}`);
|
|
229654
229723
|
}
|
|
@@ -229657,7 +229726,7 @@ var init_functions = __esm({
|
|
|
229657
229726
|
const optimizedRoutes = optimizeRoutesJSONSpec(routes);
|
|
229658
229727
|
const optimizedRoutesContents = JSON.stringify(optimizedRoutes);
|
|
229659
229728
|
try {
|
|
229660
|
-
|
|
229729
|
+
fs23.writeFileSync(outputRoutesPath, optimizedRoutesContents);
|
|
229661
229730
|
} catch (err) {
|
|
229662
229731
|
throw new FatalError(
|
|
229663
229732
|
`Error writing to ${outputRoutesPath} file: ${err}`,
|
|
@@ -229743,7 +229812,8 @@ async function createDraftWorker({
|
|
|
229743
229812
|
limits: void 0,
|
|
229744
229813
|
assets: void 0,
|
|
229745
229814
|
containers: void 0,
|
|
229746
|
-
observability: void 0
|
|
229815
|
+
observability: void 0,
|
|
229816
|
+
cache: void 0
|
|
229747
229817
|
},
|
|
229748
229818
|
{}
|
|
229749
229819
|
)
|
|
@@ -241789,7 +241859,7 @@ var init_getSSOTokenFromFile = __esm({
|
|
|
241789
241859
|
"../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js"() {
|
|
241790
241860
|
init_import_meta_url();
|
|
241791
241861
|
init_getSSOTokenFilepath();
|
|
241792
|
-
({ readFile: readFile14 } =
|
|
241862
|
+
({ readFile: readFile14 } = fs23.promises);
|
|
241793
241863
|
getSSOTokenFromFile = /* @__PURE__ */ __name(async (id) => {
|
|
241794
241864
|
const ssoTokenFilepath = getSSOTokenFilepath(id);
|
|
241795
241865
|
const ssoTokenText = await readFile14(ssoTokenFilepath, "utf8");
|
|
@@ -241900,7 +241970,7 @@ var readFile15, filePromisesHash, slurpFile;
|
|
|
241900
241970
|
var init_slurpFile = __esm({
|
|
241901
241971
|
"../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/slurpFile.js"() {
|
|
241902
241972
|
init_import_meta_url();
|
|
241903
|
-
({ readFile: readFile15 } =
|
|
241973
|
+
({ readFile: readFile15 } = fs23.promises);
|
|
241904
241974
|
filePromisesHash = {};
|
|
241905
241975
|
slurpFile = /* @__PURE__ */ __name((path82, options) => {
|
|
241906
241976
|
if (!filePromisesHash[path82] || options?.ignoreCache) {
|
|
@@ -243213,11 +243283,11 @@ var init_dist_es46 = __esm({
|
|
|
243213
243283
|
});
|
|
243214
243284
|
|
|
243215
243285
|
// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js
|
|
243216
|
-
var
|
|
243286
|
+
var ci5, cj, ck, cl, cm, cn, co, cp2, cq, cr2, cs, ct2, cu, cv, cw, cx, a3, b7, c4, d4, e4, f4, g3, h3, i3, j3, k3, l4, m3, n3, o3, p3, q3, r4, s3, t7, u3, v3, w3, x3, y3, z3, A2, B2, C2, D2, E2, F2, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, Q3, R3, S3, T3, U3, V3, W3, X3, Y3, Z3, aa, ab, ac, ad, ae2, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar2, as, at2, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, ba, bb, bc, bd, be2, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br2, bs, bt2, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, ca, cb, cc, cd, ce2, cf, cg, ch, _data, ruleSet;
|
|
243217
243287
|
var init_ruleset = __esm({
|
|
243218
243288
|
"../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js"() {
|
|
243219
243289
|
init_import_meta_url();
|
|
243220
|
-
|
|
243290
|
+
ci5 = "required";
|
|
243221
243291
|
cj = "type";
|
|
243222
243292
|
ck = "conditions";
|
|
243223
243293
|
cl = "fn";
|
|
@@ -243278,9 +243348,9 @@ var init_ruleset = __esm({
|
|
|
243278
243348
|
Q3 = "{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}";
|
|
243279
243349
|
R3 = "https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}";
|
|
243280
243350
|
S3 = "https://s3.{partitionResult#dnsSuffix}";
|
|
243281
|
-
T3 = { [
|
|
243282
|
-
U3 = { [
|
|
243283
|
-
V3 = { [
|
|
243351
|
+
T3 = { [ci5]: false, [cj]: "String" };
|
|
243352
|
+
U3 = { [ci5]: true, "default": false, [cj]: "Boolean" };
|
|
243353
|
+
V3 = { [ci5]: false, [cj]: "Boolean" };
|
|
243284
243354
|
W3 = { [cl]: e4, [cm]: [{ [cn]: "Accelerate" }, true] };
|
|
243285
243355
|
X3 = { [cl]: e4, [cm]: [{ [cn]: "UseFIPS" }, true] };
|
|
243286
243356
|
Y3 = { [cl]: e4, [cm]: [{ [cn]: "UseDualStack" }, true] };
|
|
@@ -252550,7 +252620,7 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
252550
252620
|
if (token) {
|
|
252551
252621
|
request4.headers.Authorization = token;
|
|
252552
252622
|
} else if (tokenFile) {
|
|
252553
|
-
request4.headers.Authorization = (await
|
|
252623
|
+
request4.headers.Authorization = (await fs12__default.default.readFile(tokenFile)).toString();
|
|
252554
252624
|
}
|
|
252555
252625
|
try {
|
|
252556
252626
|
const result = await requestHandler.handle(request4);
|
|
@@ -252957,9 +253027,9 @@ var init_calculateBodyLength = __esm({
|
|
|
252957
253027
|
} else if (typeof body.start === "number" && typeof body.end === "number") {
|
|
252958
253028
|
return body.end + 1 - body.start;
|
|
252959
253029
|
} else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) {
|
|
252960
|
-
return
|
|
253030
|
+
return fs23.lstatSync(body.path).size;
|
|
252961
253031
|
} else if (typeof body.fd === "number") {
|
|
252962
|
-
return
|
|
253032
|
+
return fs23.fstatSync(body.fd).size;
|
|
252963
253033
|
}
|
|
252964
253034
|
throw new Error(`Body Length computation failed for ${body}`);
|
|
252965
253035
|
}, "calculateBodyLength");
|
|
@@ -254426,7 +254496,7 @@ var init_writeSSOTokenToFile = __esm({
|
|
|
254426
254496
|
"../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js"() {
|
|
254427
254497
|
init_import_meta_url();
|
|
254428
254498
|
init_dist_es38();
|
|
254429
|
-
({ writeFile: writeFile14 } =
|
|
254499
|
+
({ writeFile: writeFile14 } = fs23.promises);
|
|
254430
254500
|
writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
|
|
254431
254501
|
const tokenFilepath = getSSOTokenFilepath(id);
|
|
254432
254502
|
const tokenString = JSON.stringify(ssoToken, null, 2);
|
|
@@ -258182,7 +258252,7 @@ var init_fromTokenFile = __esm({
|
|
|
258182
258252
|
}
|
|
258183
258253
|
const credentials = await fromWebToken({
|
|
258184
258254
|
...init4,
|
|
258185
|
-
webIdentityToken:
|
|
258255
|
+
webIdentityToken: fs23.readFileSync(webIdentityTokenFile, { encoding: "ascii" }),
|
|
258186
258256
|
roleArn,
|
|
258187
258257
|
roleSessionName
|
|
258188
258258
|
})();
|
|
@@ -263613,7 +263683,7 @@ var init_create5 = __esm({
|
|
|
263613
263683
|
sql = args.sql;
|
|
263614
263684
|
} else if (args.sqlFile) {
|
|
263615
263685
|
try {
|
|
263616
|
-
sql =
|
|
263686
|
+
sql = fs23.readFileSync(args.sqlFile, "utf-8").trim();
|
|
263617
263687
|
} catch (error2) {
|
|
263618
263688
|
throw new UserError(
|
|
263619
263689
|
`Failed to read SQL file '${args.sqlFile}': ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
@@ -265030,7 +265100,7 @@ Define item type for list '${name2}':`);
|
|
|
265030
265100
|
async function loadSchemaFromFile() {
|
|
265031
265101
|
const filePath = await prompt("Schema file path:");
|
|
265032
265102
|
try {
|
|
265033
|
-
const schemaContent =
|
|
265103
|
+
const schemaContent = fs23.readFileSync(filePath, "utf-8");
|
|
265034
265104
|
const parsedSchema = parseJSON(schemaContent, filePath);
|
|
265035
265105
|
if (!parsedSchema || !Array.isArray(parsedSchema.fields)) {
|
|
265036
265106
|
throw new UserError("Schema file must contain a 'fields' array");
|
|
@@ -265053,7 +265123,7 @@ async function loadSchemaFromFile() {
|
|
|
265053
265123
|
async function loadSqlFromFile() {
|
|
265054
265124
|
const filePath = await prompt("SQL file path:");
|
|
265055
265125
|
try {
|
|
265056
|
-
const sql =
|
|
265126
|
+
const sql = fs23.readFileSync(filePath, "utf-8").trim();
|
|
265057
265127
|
if (!sql) {
|
|
265058
265128
|
throw new UserError("SQL file is empty");
|
|
265059
265129
|
}
|
|
@@ -266200,7 +266270,7 @@ var init_create7 = __esm({
|
|
|
266200
266270
|
let schemaContent;
|
|
266201
266271
|
let parsedSchema;
|
|
266202
266272
|
try {
|
|
266203
|
-
schemaContent =
|
|
266273
|
+
schemaContent = fs23.readFileSync(args.schemaFile, "utf-8");
|
|
266204
266274
|
} catch (error2) {
|
|
266205
266275
|
throw new UserError(
|
|
266206
266276
|
`Failed to read schema file '${args.schemaFile}': ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
@@ -270771,7 +270841,7 @@ var init_notification2 = __esm({
|
|
|
270771
270841
|
}
|
|
270772
270842
|
});
|
|
270773
270843
|
function validateBulkPutFile(filename) {
|
|
270774
|
-
if (!
|
|
270844
|
+
if (!fs23__namespace.default.existsSync(filename)) {
|
|
270775
270845
|
throw new UserError(`The file "${filename}" does not exist.`);
|
|
270776
270846
|
}
|
|
270777
270847
|
let fileContent;
|
|
@@ -270797,10 +270867,10 @@ function validateBulkPutFile(filename) {
|
|
|
270797
270867
|
`Each entry in the file "${filename}" must be an object with "key" and "file" string properties.`
|
|
270798
270868
|
);
|
|
270799
270869
|
}
|
|
270800
|
-
if (!
|
|
270870
|
+
if (!fs23__namespace.default.existsSync(entry.file)) {
|
|
270801
270871
|
throw new UserError(`The file "${entry.file}" does not exist.`);
|
|
270802
270872
|
}
|
|
270803
|
-
const stat9 =
|
|
270873
|
+
const stat9 = fs23__namespace.default.statSync(entry.file, { throwIfNoEntry: false });
|
|
270804
270874
|
if (!stat9?.isFile()) {
|
|
270805
270875
|
throw new UserError(`The path "${entry.file}" is not a file.`);
|
|
270806
270876
|
}
|
|
@@ -271091,8 +271161,8 @@ var init_object3 = __esm({
|
|
|
271091
271161
|
}
|
|
271092
271162
|
let output;
|
|
271093
271163
|
if (file3) {
|
|
271094
|
-
|
|
271095
|
-
output =
|
|
271164
|
+
fs23__namespace.mkdirSync(path3__namespace.dirname(file3), { recursive: true });
|
|
271165
|
+
output = fs23__namespace.createWriteStream(file3);
|
|
271096
271166
|
} else {
|
|
271097
271167
|
output = process.stdout;
|
|
271098
271168
|
}
|
|
@@ -271235,12 +271305,12 @@ var init_object3 = __esm({
|
|
|
271235
271305
|
let sizeBytes;
|
|
271236
271306
|
if (file3) {
|
|
271237
271307
|
try {
|
|
271238
|
-
const stats =
|
|
271308
|
+
const stats = fs23__namespace.statSync(file3, { throwIfNoEntry: false });
|
|
271239
271309
|
if (!stats) {
|
|
271240
271310
|
throw new UserError(`The file "${file3}" does not exist.`);
|
|
271241
271311
|
}
|
|
271242
271312
|
sizeBytes = stats.size;
|
|
271243
|
-
objectStream = Stream__namespace.Readable.toWeb(
|
|
271313
|
+
objectStream = Stream__namespace.Readable.toWeb(fs23__namespace.createReadStream(file3));
|
|
271244
271314
|
} catch (err) {
|
|
271245
271315
|
if (err instanceof UserError) {
|
|
271246
271316
|
throw err;
|
|
@@ -271477,7 +271547,7 @@ var init_object3 = __esm({
|
|
|
271477
271547
|
}
|
|
271478
271548
|
await mf.dispatchFetch(`http://localhost/${entry.key}`, {
|
|
271479
271549
|
method: "PUT",
|
|
271480
|
-
body: Stream__namespace.Readable.toWeb(
|
|
271550
|
+
body: Stream__namespace.Readable.toWeb(fs23__namespace.createReadStream(entry.file)),
|
|
271481
271551
|
duplex: "half",
|
|
271482
271552
|
headers: {
|
|
271483
271553
|
"Content-Length": String(entry.size),
|
|
@@ -271515,7 +271585,7 @@ ${error2}`);
|
|
|
271515
271585
|
accountId,
|
|
271516
271586
|
yArgs.bucket,
|
|
271517
271587
|
entry.key,
|
|
271518
|
-
Stream__namespace.Readable.toWeb(
|
|
271588
|
+
Stream__namespace.Readable.toWeb(fs23__namespace.createReadStream(entry.file)),
|
|
271519
271589
|
{
|
|
271520
271590
|
"cache-control": yArgs.cacheControl,
|
|
271521
271591
|
"content-disposition": yArgs.contentDisposition,
|
|
@@ -273455,7 +273525,7 @@ async function generateRuntimeTypes({
|
|
|
273455
273525
|
compatibility_flags
|
|
273456
273526
|
);
|
|
273457
273527
|
try {
|
|
273458
|
-
const lines = (await
|
|
273528
|
+
const lines = (await fs12.readFile(outFile, "utf8")).split("\n");
|
|
273459
273529
|
const existingHeader = lines.find(
|
|
273460
273530
|
(line) => line.startsWith(RUNTIME_HEADER_COMMENT_PREFIX)
|
|
273461
273531
|
);
|
|
@@ -273487,7 +273557,7 @@ async function generate({
|
|
|
273487
273557
|
compatibilityDate,
|
|
273488
273558
|
compatibilityFlags = []
|
|
273489
273559
|
}) {
|
|
273490
|
-
const worker =
|
|
273560
|
+
const worker = fs23.readFileSync(__require.resolve("workerd/worker.mjs")).toString();
|
|
273491
273561
|
const mf = new miniflare.Miniflare({
|
|
273492
273562
|
compatibilityDate: "2024-01-01",
|
|
273493
273563
|
compatibilityFlags: ["nodejs_compat", "rtti_api"],
|
|
@@ -273587,7 +273657,7 @@ var init_helpers7 = __esm({
|
|
|
273587
273657
|
checkTypesUpToDate = /* @__PURE__ */ __name(async (primaryConfig, typesPath = DEFAULT_WORKERS_TYPES_FILE_PATH) => {
|
|
273588
273658
|
let typesFileLines = new Array();
|
|
273589
273659
|
try {
|
|
273590
|
-
typesFileLines =
|
|
273660
|
+
typesFileLines = fs23.readFileSync(typesPath, "utf-8").split("\n");
|
|
273591
273661
|
} catch (e9) {
|
|
273592
273662
|
if (e9.code === "ENOENT") {
|
|
273593
273663
|
throw new UserError(`Types file not found at ${typesPath}.`);
|
|
@@ -273655,7 +273725,7 @@ var init_helpers7 = __esm({
|
|
|
273655
273725
|
}
|
|
273656
273726
|
let maybeExistingTypesFileLines;
|
|
273657
273727
|
try {
|
|
273658
|
-
maybeExistingTypesFileLines =
|
|
273728
|
+
maybeExistingTypesFileLines = fs23.readFileSync(
|
|
273659
273729
|
DEFAULT_WORKERS_TYPES_FILE_PATH,
|
|
273660
273730
|
"utf-8"
|
|
273661
273731
|
).split("\n");
|
|
@@ -273722,7 +273792,7 @@ var init_helpers7 = __esm({
|
|
|
273722
273792
|
runtimeTypes
|
|
273723
273793
|
].join("\n");
|
|
273724
273794
|
try {
|
|
273725
|
-
|
|
273795
|
+
fs23.writeFileSync(DEFAULT_WORKERS_TYPES_FILE_PATH, newTypesFile);
|
|
273726
273796
|
logger.log(
|
|
273727
273797
|
`\u2753 Your types looked out of date. We've re-run \`wrangler types\` for you and updated ${DEFAULT_WORKERS_TYPES_FILE_PATH}`
|
|
273728
273798
|
);
|
|
@@ -273933,7 +274003,7 @@ function logRuntimeTypesMessage(tsconfigTypes, isNodeCompat = false) {
|
|
|
273933
274003
|
const isWorkersTypesInstalled = tsconfigTypes.find(
|
|
273934
274004
|
(type) => type.startsWith("@cloudflare/workers-types")
|
|
273935
274005
|
);
|
|
273936
|
-
const maybeHasOldRuntimeFile =
|
|
274006
|
+
const maybeHasOldRuntimeFile = fs23.existsSync("./.wrangler/types/runtime.d.ts");
|
|
273937
274007
|
if (maybeHasOldRuntimeFile) {
|
|
273938
274008
|
logAction("Remove the old runtime.d.ts file");
|
|
273939
274009
|
logger.log(
|
|
@@ -274658,12 +274728,12 @@ ${modulesContent}`
|
|
|
274658
274728
|
};
|
|
274659
274729
|
}
|
|
274660
274730
|
function readTsconfigTypes(tsconfigPath) {
|
|
274661
|
-
if (!
|
|
274731
|
+
if (!fs23__namespace.existsSync(tsconfigPath)) {
|
|
274662
274732
|
return [];
|
|
274663
274733
|
}
|
|
274664
274734
|
try {
|
|
274665
274735
|
const tsconfig = parseJSONC(
|
|
274666
|
-
|
|
274736
|
+
fs23__namespace.readFileSync(tsconfigPath, "utf-8")
|
|
274667
274737
|
);
|
|
274668
274738
|
return tsconfig.compilerOptions?.types || [];
|
|
274669
274739
|
} catch {
|
|
@@ -276015,7 +276085,7 @@ var init_type_generation = __esm({
|
|
|
276015
276085
|
config = readConfig(args);
|
|
276016
276086
|
}
|
|
276017
276087
|
const { envInterface, path: outputPath } = args;
|
|
276018
|
-
if (config.configPath == null || (
|
|
276088
|
+
if (config.configPath == null || (fs23__namespace.statSync(config.configPath, { throwIfNoEntry: false })?.isDirectory() ?? true)) {
|
|
276019
276089
|
throw new UserError(
|
|
276020
276090
|
`No config file detected${args.config ? ` (at ${args.config})` : ""}. This command requires a Wrangler configuration file.`,
|
|
276021
276091
|
{ telemetryMessage: "No config file detected" }
|
|
@@ -276098,7 +276168,7 @@ ${runtimeTypes}`);
|
|
|
276098
276168
|
}
|
|
276099
276169
|
logHorizontalRule();
|
|
276100
276170
|
if (header.length && content.length || entrypointFormat === "modules") {
|
|
276101
|
-
|
|
276171
|
+
fs23__namespace.writeFileSync(
|
|
276102
276172
|
outputPath,
|
|
276103
276173
|
`${header.join("\n")}
|
|
276104
276174
|
${content.join("\n")}`,
|
|
@@ -276137,7 +276207,7 @@ ${content.join("\n")}`,
|
|
|
276137
276207
|
return;
|
|
276138
276208
|
}
|
|
276139
276209
|
try {
|
|
276140
|
-
const fileContent =
|
|
276210
|
+
const fileContent = fs23__namespace.readFileSync(wranglerOverrideDTSPath, "utf8");
|
|
276141
276211
|
if (!fileContent.includes("Generated by Wrangler") && !fileContent.includes("Runtime types generated with workerd")) {
|
|
276142
276212
|
throw new UserError(
|
|
276143
276213
|
`A non-Wrangler ${path3.basename(path82)} already exists, please rename and try again.`,
|
|
@@ -276869,8 +276939,8 @@ var init_client10 = __esm({
|
|
|
276869
276939
|
});
|
|
276870
276940
|
async function isValidFile(path82) {
|
|
276871
276941
|
try {
|
|
276872
|
-
await
|
|
276873
|
-
const fileStat = await
|
|
276942
|
+
await fs12.access(path82, fs12.constants.R_OK);
|
|
276943
|
+
const fileStat = await fs12.stat(path82);
|
|
276874
276944
|
return fileStat.isFile() && fileStat.size > 0;
|
|
276875
276945
|
} catch {
|
|
276876
276946
|
return false;
|
|
@@ -277452,7 +277522,7 @@ var init_insert = __esm({
|
|
|
277452
277522
|
`\u{1F6A8} Cannot read invalid or empty file: ${args.file}.`
|
|
277453
277523
|
);
|
|
277454
277524
|
}
|
|
277455
|
-
const rl = S.createInterface({ input:
|
|
277525
|
+
const rl = S.createInterface({ input: fs23.createReadStream(args.file) });
|
|
277456
277526
|
if (args.deprecatedV1 && Number(args.batchSize) > VECTORIZE_V1_MAX_BATCH_SIZE) {
|
|
277457
277527
|
throw new UserError(
|
|
277458
277528
|
`\u{1F6A8} Vectorize currently limits upload batches to ${VECTORIZE_V1_MAX_BATCH_SIZE} records at a time.`
|
|
@@ -277962,7 +278032,7 @@ var init_upsert = __esm({
|
|
|
277962
278032
|
`\u{1F6A8} Cannot read invalid or empty file: ${args.file}.`
|
|
277963
278033
|
);
|
|
277964
278034
|
}
|
|
277965
|
-
const rl = S.createInterface({ input:
|
|
278035
|
+
const rl = S.createInterface({ input: fs23.createReadStream(args.file) });
|
|
277966
278036
|
if (Number(args.batchSize) > VECTORIZE_MAX_BATCH_SIZE) {
|
|
277967
278037
|
throw new UserError(
|
|
277968
278038
|
`\u{1F6A8} The global rate limit for the Cloudflare API is 1200 requests per five minutes. Vectorize indexes currently limit upload batches to ${VECTORIZE_MAX_BATCH_SIZE} records at a time to stay within the service limits.`
|
|
@@ -279197,7 +279267,8 @@ async function copyWorkerVersionWithNewSecrets({
|
|
|
279197
279267
|
},
|
|
279198
279268
|
keep_assets: true,
|
|
279199
279269
|
assets: void 0,
|
|
279200
|
-
observability: scriptSettings.observability
|
|
279270
|
+
observability: scriptSettings.observability,
|
|
279271
|
+
cache: versionInfo.cache_options
|
|
279201
279272
|
};
|
|
279202
279273
|
const body = createWorkerUploadForm(worker, bindings, {
|
|
279203
279274
|
unsafe: { metadata: unsafeMetadata }
|
|
@@ -280005,9 +280076,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
280005
280076
|
);
|
|
280006
280077
|
}
|
|
280007
280078
|
if (props.outDir) {
|
|
280008
|
-
|
|
280079
|
+
fs23.mkdirSync(props.outDir, { recursive: true });
|
|
280009
280080
|
const readmePath = path3__namespace.default.join(props.outDir, "README.md");
|
|
280010
|
-
|
|
280081
|
+
fs23.writeFileSync(
|
|
280011
280082
|
readmePath,
|
|
280012
280083
|
`This folder contains the built output assets for the worker "${scriptName}" generated at ${(/* @__PURE__ */ new Date()).toISOString()}.`
|
|
280013
280084
|
);
|
|
@@ -280036,10 +280107,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
280036
280107
|
try {
|
|
280037
280108
|
if (props.noBundle) {
|
|
280038
280109
|
const destinationDir = typeof destination === "string" ? destination : destination.path;
|
|
280039
|
-
|
|
280040
|
-
|
|
280110
|
+
fs23.mkdirSync(destinationDir, { recursive: true });
|
|
280111
|
+
fs23.writeFileSync(
|
|
280041
280112
|
path3__namespace.default.join(destinationDir, path3__namespace.default.basename(props.entry.file)),
|
|
280042
|
-
|
|
280113
|
+
fs23.readFileSync(props.entry.file, "utf-8")
|
|
280043
280114
|
);
|
|
280044
280115
|
}
|
|
280045
280116
|
const entryDirectory = path3__namespace.default.dirname(props.entry.file);
|
|
@@ -280121,7 +280192,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
280121
280192
|
const bytesInOutput = typeof module4.content === "string" ? Buffer.byteLength(module4.content) : module4.content.byteLength;
|
|
280122
280193
|
dependencies[modulePath] = { bytesInOutput };
|
|
280123
280194
|
}
|
|
280124
|
-
const content =
|
|
280195
|
+
const content = fs23.readFileSync(resolvedEntryPointPath, {
|
|
280125
280196
|
encoding: "utf-8"
|
|
280126
280197
|
});
|
|
280127
280198
|
const migrations = !props.dryRun ? await getMigrationsToUpload(scriptName, {
|
|
@@ -280174,8 +280245,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
280174
280245
|
run_worker_first: props.assetsOptions.run_worker_first
|
|
280175
280246
|
} : void 0,
|
|
280176
280247
|
logpush: void 0,
|
|
280177
|
-
//
|
|
280178
|
-
observability: void 0
|
|
280248
|
+
// logpush and observability are non-versioned settings
|
|
280249
|
+
observability: void 0,
|
|
280250
|
+
cache: config.cache
|
|
280251
|
+
// cache is a versioned setting
|
|
280179
280252
|
};
|
|
280180
280253
|
if (config.containers && config.containers.length > 0) {
|
|
280181
280254
|
logger.warn(
|
|
@@ -280287,9 +280360,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
280287
280360
|
}
|
|
280288
280361
|
}
|
|
280289
280362
|
if (props.outFile) {
|
|
280290
|
-
|
|
280363
|
+
fs23.mkdirSync(path3__namespace.default.dirname(props.outFile), { recursive: true });
|
|
280291
280364
|
const serializedFormData = await new import_undici22.Response(workerBundle).arrayBuffer();
|
|
280292
|
-
|
|
280365
|
+
fs23.writeFileSync(props.outFile, Buffer.from(serializedFormData));
|
|
280293
280366
|
}
|
|
280294
280367
|
} finally {
|
|
280295
280368
|
if (typeof destination !== "string") {
|
|
@@ -290383,9 +290456,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
290383
290456
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
|
290384
290457
|
);
|
|
290385
290458
|
if (props.outDir) {
|
|
290386
|
-
|
|
290459
|
+
fs23.mkdirSync(props.outDir, { recursive: true });
|
|
290387
290460
|
const readmePath = path3__namespace.default.join(props.outDir, "README.md");
|
|
290388
|
-
|
|
290461
|
+
fs23.writeFileSync(
|
|
290389
290462
|
readmePath,
|
|
290390
290463
|
`This folder contains the built output assets for the worker "${scriptName}" generated at ${(/* @__PURE__ */ new Date()).toISOString()}.`
|
|
290391
290464
|
);
|
|
@@ -290442,10 +290515,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
290442
290515
|
try {
|
|
290443
290516
|
if (props.noBundle) {
|
|
290444
290517
|
const destinationDir = typeof destination === "string" ? destination : destination.path;
|
|
290445
|
-
|
|
290446
|
-
|
|
290518
|
+
fs23.mkdirSync(destinationDir, { recursive: true });
|
|
290519
|
+
fs23.writeFileSync(
|
|
290447
290520
|
path3__namespace.default.join(destinationDir, path3__namespace.default.basename(props.entry.file)),
|
|
290448
|
-
|
|
290521
|
+
fs23.readFileSync(props.entry.file, "utf-8")
|
|
290449
290522
|
);
|
|
290450
290523
|
}
|
|
290451
290524
|
const entryDirectory = path3__namespace.default.dirname(props.entry.file);
|
|
@@ -290520,7 +290593,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
290520
290593
|
const bytesInOutput = typeof module4.content === "string" ? Buffer.byteLength(module4.content) : module4.content.byteLength;
|
|
290521
290594
|
dependencies[modulePath] = { bytesInOutput };
|
|
290522
290595
|
}
|
|
290523
|
-
const content =
|
|
290596
|
+
const content = fs23.readFileSync(resolvedEntryPointPath, {
|
|
290524
290597
|
encoding: "utf-8"
|
|
290525
290598
|
});
|
|
290526
290599
|
const migrations = !props.dryRun ? await getMigrationsToUpload(scriptName, {
|
|
@@ -290603,7 +290676,8 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
290603
290676
|
_headers: props.assetsOptions._headers,
|
|
290604
290677
|
run_worker_first: props.assetsOptions.run_worker_first
|
|
290605
290678
|
} : void 0,
|
|
290606
|
-
observability: config.observability
|
|
290679
|
+
observability: config.observability,
|
|
290680
|
+
cache: config.cache
|
|
290607
290681
|
};
|
|
290608
290682
|
sourceMapSize = worker.sourceMaps?.reduce(
|
|
290609
290683
|
(acc, m7) => acc + m7.content.length,
|
|
@@ -290848,9 +290922,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
290848
290922
|
}
|
|
290849
290923
|
}
|
|
290850
290924
|
if (props.outFile) {
|
|
290851
|
-
|
|
290925
|
+
fs23.mkdirSync(path3__namespace.default.dirname(props.outFile), { recursive: true });
|
|
290852
290926
|
const serializedFormData = await new import_undici24.Response(workerBundle).arrayBuffer();
|
|
290853
|
-
|
|
290927
|
+
fs23.writeFileSync(props.outFile, Buffer.from(serializedFormData));
|
|
290854
290928
|
}
|
|
290855
290929
|
} finally {
|
|
290856
290930
|
if (typeof destination !== "string") {
|
|
@@ -291274,7 +291348,7 @@ function getAssetsOptions(args, config, overrides) {
|
|
|
291274
291348
|
}
|
|
291275
291349
|
const assetsBasePath = getAssetsBasePath(config, args.assets);
|
|
291276
291350
|
const directory = path3__namespace.resolve(assetsBasePath, assets.directory);
|
|
291277
|
-
if (!
|
|
291351
|
+
if (!fs23.existsSync(directory)) {
|
|
291278
291352
|
const sourceOfTruthMessage = args.assets ? '"--assets" command line argument' : '"assets.directory" field in your configuration file';
|
|
291279
291353
|
throw new NonExistentAssetsDirError(
|
|
291280
291354
|
`The directory specified by the ${sourceOfTruthMessage} does not exist:
|
|
@@ -291457,7 +291531,7 @@ var init_assets5 = __esm({
|
|
|
291457
291531
|
payload.append(
|
|
291458
291532
|
manifestEntry[1].hash,
|
|
291459
291533
|
new File(
|
|
291460
|
-
[(await
|
|
291534
|
+
[(await fs12.readFile(absFilePath)).toString("base64")],
|
|
291461
291535
|
manifestEntry[1].hash,
|
|
291462
291536
|
{
|
|
291463
291537
|
// Most formdata body encoders (incl. undici's) will override with "application/octet-stream" if you use a falsy value here
|
|
@@ -291552,7 +291626,7 @@ Assets already uploaded have been saved, so the next attempt will automatically
|
|
|
291552
291626
|
return completionJwt;
|
|
291553
291627
|
}, "syncAssets");
|
|
291554
291628
|
buildAssetManifest = /* @__PURE__ */ __name(async (dir2) => {
|
|
291555
|
-
const files = await
|
|
291629
|
+
const files = await fs12.readdir(dir2, { recursive: true });
|
|
291556
291630
|
logReadFilesFromDirectory(dir2, files);
|
|
291557
291631
|
const manifest = {};
|
|
291558
291632
|
const { assetsIgnoreFunction, assetsIgnoreFilePresent } = await createAssetsIgnoreFunction(dir2);
|
|
@@ -291563,7 +291637,7 @@ Assets already uploaded have been saved, so the next attempt will automatically
|
|
|
291563
291637
|
return;
|
|
291564
291638
|
}
|
|
291565
291639
|
const filepath = path3__namespace.join(dir2, relativeFilepath);
|
|
291566
|
-
const filestat = await
|
|
291640
|
+
const filestat = await fs12.stat(filepath);
|
|
291567
291641
|
if (filestat.isSymbolicLink() || filestat.isDirectory()) {
|
|
291568
291642
|
return;
|
|
291569
291643
|
} else {
|
|
@@ -292076,7 +292150,7 @@ function runBuild({
|
|
|
292076
292150
|
]);
|
|
292077
292151
|
return {
|
|
292078
292152
|
...previousBundle,
|
|
292079
|
-
entrypointSource:
|
|
292153
|
+
entrypointSource: fs23.readFileSync(previousBundle.path, "utf8"),
|
|
292080
292154
|
id: previousBundle.id + 1
|
|
292081
292155
|
};
|
|
292082
292156
|
});
|
|
@@ -292135,7 +292209,7 @@ function runBuild({
|
|
|
292135
292209
|
});
|
|
292136
292210
|
stopWatching = /* @__PURE__ */ __name(() => watcher.close(), "stopWatching");
|
|
292137
292211
|
}
|
|
292138
|
-
const entrypointPath =
|
|
292212
|
+
const entrypointPath = fs23.realpathSync(
|
|
292139
292213
|
bundleResult?.resolvedEntryPointPath ?? entry.file
|
|
292140
292214
|
);
|
|
292141
292215
|
setBundle(() => ({
|
|
@@ -292147,7 +292221,7 @@ function runBuild({
|
|
|
292147
292221
|
dependencies: bundleResult?.dependencies ?? {},
|
|
292148
292222
|
sourceMapPath: bundleResult?.sourceMapPath,
|
|
292149
292223
|
sourceMapMetadata: bundleResult?.sourceMapMetadata,
|
|
292150
|
-
entrypointSource:
|
|
292224
|
+
entrypointSource: fs23.readFileSync(entrypointPath, "utf8")
|
|
292151
292225
|
}));
|
|
292152
292226
|
}
|
|
292153
292227
|
__name(build5, "build");
|
|
@@ -292220,9 +292294,9 @@ var init_BundlerController = __esm({
|
|
|
292220
292294
|
assert50__default.default(this.#tmpDir);
|
|
292221
292295
|
if (!config.build?.bundle) {
|
|
292222
292296
|
const destinationDir = this.#tmpDir.path;
|
|
292223
|
-
|
|
292297
|
+
fs23.writeFileSync(
|
|
292224
292298
|
path3__namespace.default.join(destinationDir, path3__namespace.default.basename(config.entrypoint)),
|
|
292225
|
-
|
|
292299
|
+
fs23.readFileSync(config.entrypoint, "utf-8")
|
|
292226
292300
|
);
|
|
292227
292301
|
}
|
|
292228
292302
|
const entry = {
|
|
@@ -292303,7 +292377,7 @@ var init_BundlerController = __esm({
|
|
|
292303
292377
|
if (buildAborter.signal.aborted) {
|
|
292304
292378
|
return;
|
|
292305
292379
|
}
|
|
292306
|
-
const entrypointPath =
|
|
292380
|
+
const entrypointPath = fs23.realpathSync(
|
|
292307
292381
|
bundleResult?.resolvedEntryPointPath ?? config.entrypoint
|
|
292308
292382
|
);
|
|
292309
292383
|
this.emitBundleCompleteEvent(config, {
|
|
@@ -292315,7 +292389,7 @@ var init_BundlerController = __esm({
|
|
|
292315
292389
|
dependencies: bundleResult?.dependencies ?? {},
|
|
292316
292390
|
sourceMapPath: bundleResult?.sourceMapPath,
|
|
292317
292391
|
sourceMapMetadata: bundleResult?.sourceMapMetadata,
|
|
292318
|
-
entrypointSource:
|
|
292392
|
+
entrypointSource: fs23.readFileSync(entrypointPath, "utf8")
|
|
292319
292393
|
});
|
|
292320
292394
|
} catch (err) {
|
|
292321
292395
|
logger.error("Custom build failed:", err);
|
|
@@ -292699,14 +292773,14 @@ configure it to allow binding to loopback addresses.`
|
|
|
292699
292773
|
}
|
|
292700
292774
|
};
|
|
292701
292775
|
}
|
|
292702
|
-
var
|
|
292776
|
+
var import_ci_info5, NUM_CONSECUTIVE_PORTS_TO_PROBE;
|
|
292703
292777
|
var init_memoizeGetPort = __esm({
|
|
292704
292778
|
"src/utils/memoizeGetPort.ts"() {
|
|
292705
292779
|
init_import_meta_url();
|
|
292706
292780
|
init_dist();
|
|
292707
|
-
|
|
292781
|
+
import_ci_info5 = __toESM(require_ci_info());
|
|
292708
292782
|
init_get_port();
|
|
292709
|
-
NUM_CONSECUTIVE_PORTS_TO_PROBE =
|
|
292783
|
+
NUM_CONSECUTIVE_PORTS_TO_PROBE = import_ci_info5.default.isCI ? 0 : 10;
|
|
292710
292784
|
__name(isNetworkBindPermissionError, "isNetworkBindPermissionError");
|
|
292711
292785
|
__name(memoizeGetPort, "memoizeGetPort");
|
|
292712
292786
|
}
|
|
@@ -293230,7 +293304,7 @@ function getBundleReferencedPaths(bundle) {
|
|
|
293230
293304
|
}
|
|
293231
293305
|
const sourceMappingPath = Url.fileURLToPath(sourceMappingURL);
|
|
293232
293306
|
allowed.sourceMapPaths.add(sourceMappingPath);
|
|
293233
|
-
const sourceMapData =
|
|
293307
|
+
const sourceMapData = fs23__namespace.default.readFileSync(sourceMappingPath, "utf8");
|
|
293234
293308
|
const sourceMap = JSON.parse(sourceMapData);
|
|
293235
293309
|
const sourceRoot = sourceMap.sourceRoot ?? "";
|
|
293236
293310
|
for (const source of sourceMap.sources) {
|
|
@@ -293256,7 +293330,7 @@ function* getBundleSourcePaths(bundle) {
|
|
|
293256
293330
|
}
|
|
293257
293331
|
}
|
|
293258
293332
|
function maybeGetSourceMappingURL(sourcePath) {
|
|
293259
|
-
const source =
|
|
293333
|
+
const source = fs23__namespace.default.readFileSync(sourcePath, "utf8");
|
|
293260
293334
|
const sourceMappingURLIndex = source.lastIndexOf("//# sourceMappingURL=");
|
|
293261
293335
|
if (sourceMappingURLIndex === -1) {
|
|
293262
293336
|
return;
|
|
@@ -293413,7 +293487,7 @@ function maybeHandleNetworkLoadResource(url4, bundle, tmpDir) {
|
|
|
293413
293487
|
}
|
|
293414
293488
|
const filePath = Url.fileURLToPath(url4);
|
|
293415
293489
|
if (isAllowedSourceMapPath(bundle, filePath)) {
|
|
293416
|
-
const sourceMap = JSON.parse(
|
|
293490
|
+
const sourceMap = JSON.parse(fs23.readFileSync(filePath, "utf-8"));
|
|
293417
293491
|
sourceMap.x_google_ignoreList = sourceMap.sources.map((source, i7) => {
|
|
293418
293492
|
if (source.includes("wrangler/templates")) {
|
|
293419
293493
|
return i7;
|
|
@@ -293425,7 +293499,7 @@ function maybeHandleNetworkLoadResource(url4, bundle, tmpDir) {
|
|
|
293425
293499
|
return JSON.stringify(sourceMap);
|
|
293426
293500
|
}
|
|
293427
293501
|
if (isAllowedSourcePath(bundle, filePath)) {
|
|
293428
|
-
return
|
|
293502
|
+
return fs23.readFileSync(filePath, "utf-8");
|
|
293429
293503
|
}
|
|
293430
293504
|
}
|
|
293431
293505
|
var import_open2, mapConsoleAPIMessageTypeToConsoleMethod, openInspector;
|
|
@@ -293506,20 +293580,20 @@ function validateHttpsOptions(customHttpsKeyPath = getHttpsKeyPathFromEnv(), cus
|
|
|
293506
293580
|
"Must specify both certificate path and key path to use a Custom Certificate."
|
|
293507
293581
|
);
|
|
293508
293582
|
}
|
|
293509
|
-
if (!
|
|
293583
|
+
if (!fs23__namespace.existsSync(customHttpsKeyPath)) {
|
|
293510
293584
|
throw new UserError(
|
|
293511
293585
|
"Missing Custom Certificate Key at " + customHttpsKeyPath
|
|
293512
293586
|
);
|
|
293513
293587
|
}
|
|
293514
|
-
if (!
|
|
293588
|
+
if (!fs23__namespace.existsSync(customHttpsCertPath)) {
|
|
293515
293589
|
throw new UserError(
|
|
293516
293590
|
"Missing Custom Certificate File at " + customHttpsCertPath
|
|
293517
293591
|
);
|
|
293518
293592
|
}
|
|
293519
293593
|
logger.log("Using custom certificate at ", customHttpsKeyPath);
|
|
293520
293594
|
return {
|
|
293521
|
-
key:
|
|
293522
|
-
cert:
|
|
293595
|
+
key: fs23__namespace.readFileSync(customHttpsKeyPath, "utf8"),
|
|
293596
|
+
cert: fs23__namespace.readFileSync(customHttpsCertPath, "utf8")
|
|
293523
293597
|
};
|
|
293524
293598
|
}
|
|
293525
293599
|
}
|
|
@@ -294316,8 +294390,10 @@ async function createRemoteWorkerInit(props) {
|
|
|
294316
294390
|
streaming_tail_consumers: void 0,
|
|
294317
294391
|
limits: void 0,
|
|
294318
294392
|
// no limits in preview - not supported yet but can be added
|
|
294319
|
-
observability: void 0
|
|
294393
|
+
observability: void 0,
|
|
294320
294394
|
// no observability in dev,
|
|
294395
|
+
cache: void 0
|
|
294396
|
+
// no cache in dev
|
|
294321
294397
|
};
|
|
294322
294398
|
return init4;
|
|
294323
294399
|
}
|
|
@@ -295195,7 +295271,7 @@ async function getTextFileContents(file3) {
|
|
|
295195
295271
|
}
|
|
295196
295272
|
return Buffer.from(file3.contents).toString();
|
|
295197
295273
|
}
|
|
295198
|
-
return
|
|
295274
|
+
return fs12.readFile(file3.path, "utf8");
|
|
295199
295275
|
}
|
|
295200
295276
|
function getName3(config) {
|
|
295201
295277
|
return config.name;
|
|
@@ -298175,16 +298251,16 @@ async function generateAssetsFetch(directory, log2) {
|
|
|
298175
298251
|
const workerFile = path3.join(directory, "_worker.js");
|
|
298176
298252
|
const ignoredFiles = [headersFile, redirectsFile, workerFile];
|
|
298177
298253
|
let redirects;
|
|
298178
|
-
if (
|
|
298179
|
-
const contents =
|
|
298254
|
+
if (fs23.existsSync(redirectsFile)) {
|
|
298255
|
+
const contents = fs23.readFileSync(redirectsFile, "utf-8");
|
|
298180
298256
|
redirects = parseRedirects(contents, {
|
|
298181
298257
|
htmlHandling: void 0
|
|
298182
298258
|
// Pages dev server doesn't expose html_handling configuration in this context.
|
|
298183
298259
|
});
|
|
298184
298260
|
}
|
|
298185
298261
|
let headers;
|
|
298186
|
-
if (
|
|
298187
|
-
const contents =
|
|
298262
|
+
if (fs23.existsSync(headersFile)) {
|
|
298263
|
+
const contents = fs23.readFileSync(headersFile, "utf-8");
|
|
298188
298264
|
headers = parseHeaders(contents);
|
|
298189
298265
|
}
|
|
298190
298266
|
let metadata = createMetadataObject({
|
|
@@ -298200,13 +298276,13 @@ async function generateAssetsFetch(directory, log2) {
|
|
|
298200
298276
|
switch (path82) {
|
|
298201
298277
|
case headersFile: {
|
|
298202
298278
|
log2.log("_headers modified. Re-evaluating...");
|
|
298203
|
-
const contents =
|
|
298279
|
+
const contents = fs23.readFileSync(headersFile).toString();
|
|
298204
298280
|
headers = parseHeaders(contents);
|
|
298205
298281
|
break;
|
|
298206
298282
|
}
|
|
298207
298283
|
case redirectsFile: {
|
|
298208
298284
|
log2.log("_redirects modified. Re-evaluating...");
|
|
298209
|
-
const contents =
|
|
298285
|
+
const contents = fs23.readFileSync(redirectsFile).toString();
|
|
298210
298286
|
redirects = parseRedirects(contents, {
|
|
298211
298287
|
htmlHandling: void 0
|
|
298212
298288
|
// Pages dev server doesn't expose html_handling configuration in this context.
|
|
@@ -298236,7 +298312,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
|
298236
298312
|
if (!filepath.startsWith(directory)) {
|
|
298237
298313
|
return null;
|
|
298238
298314
|
}
|
|
298239
|
-
if (
|
|
298315
|
+
if (fs23.lstatSync(filepath, { throwIfNoEntry: false })?.isFile() && !ignoredFiles.includes(filepath)) {
|
|
298240
298316
|
const hash = hashFile(filepath);
|
|
298241
298317
|
assetKeyEntryMap.set(hash, filepath);
|
|
298242
298318
|
return hash;
|
|
@@ -298266,7 +298342,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
|
298266
298342
|
"Could not fetch asset. Please file an issue on GitHub (https://github.com/cloudflare/workers-sdk/issues/new/choose) with reproduction steps."
|
|
298267
298343
|
);
|
|
298268
298344
|
}
|
|
298269
|
-
const body =
|
|
298345
|
+
const body = fs23.readFileSync(filepath);
|
|
298270
298346
|
let contentType = (0, import_mime3.getType)(filepath) || "application/octet-stream";
|
|
298271
298347
|
if (contentType.startsWith("text/") && !contentType.includes("charset")) {
|
|
298272
298348
|
contentType = `${contentType}; charset=utf-8`;
|