wrangler 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/d1/execute.tsx +16 -8
- package/wrangler-dist/cli.js +90 -83
package/package.json
CHANGED
package/src/d1/execute.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { mkdir } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import chalk from "chalk";
|
|
4
5
|
import { render, Static, Text } from "ink";
|
|
5
6
|
import Table from "ink-table";
|
|
6
7
|
import { npxImport } from "npx-import";
|
|
@@ -141,7 +142,7 @@ export const Handler = withConfig<ExecuteArgs>(
|
|
|
141
142
|
}): Promise<void> => {
|
|
142
143
|
logger.log(d1BetaWarning);
|
|
143
144
|
if (file && command)
|
|
144
|
-
return
|
|
145
|
+
return logger.error(`Error: can't provide both --command and --file.`);
|
|
145
146
|
|
|
146
147
|
const isInteractive = process.stdout.isTTY;
|
|
147
148
|
const response: QueryResult[] | null = await executeSql(
|
|
@@ -180,7 +181,7 @@ export const Handler = withConfig<ExecuteArgs>(
|
|
|
180
181
|
</Static>
|
|
181
182
|
);
|
|
182
183
|
} else {
|
|
183
|
-
|
|
184
|
+
logger.log(JSON.stringify(response, null, 2));
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
);
|
|
@@ -250,7 +251,7 @@ async function executeRemotely(
|
|
|
250
251
|
if (!ok) return null;
|
|
251
252
|
logger.log(`🌀 Let's go`);
|
|
252
253
|
} else {
|
|
253
|
-
|
|
254
|
+
logger.error(warning);
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
257
|
|
|
@@ -267,11 +268,16 @@ async function executeRemotely(
|
|
|
267
268
|
// Don't output if shouldPrompt is undefined
|
|
268
269
|
} else if (shouldPrompt !== undefined) {
|
|
269
270
|
// Pipe to error so we don't break jq
|
|
270
|
-
|
|
271
|
+
logger.error(`Executing on ${name} (${db.uuid}):`);
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
const results: QueryResult[] = [];
|
|
274
275
|
for (const sql of batches) {
|
|
276
|
+
if (multiple_batches)
|
|
277
|
+
logger.log(
|
|
278
|
+
chalk.gray(` ${sql.slice(0, 70)}${sql.length > 70 ? "..." : ""}`)
|
|
279
|
+
);
|
|
280
|
+
|
|
275
281
|
const result = await fetchResult<QueryResult[]>(
|
|
276
282
|
`/accounts/${accountId}/d1/database/${db.uuid}/query`,
|
|
277
283
|
{
|
|
@@ -317,16 +323,18 @@ function splitSql(splitter: (query: SQLQuery) => SQLQuery[], sql: SQLQuery) {
|
|
|
317
323
|
|
|
318
324
|
function batchSplit(queries: string[]) {
|
|
319
325
|
logger.log(`🌀 Parsing ${queries.length} statements`);
|
|
320
|
-
const batches: string[] = [];
|
|
321
326
|
const num_batches = Math.ceil(queries.length / QUERY_LIMIT);
|
|
327
|
+
const batches: string[] = [];
|
|
322
328
|
for (let i = 0; i < num_batches; i++) {
|
|
323
329
|
batches.push(
|
|
324
330
|
queries.slice(i * QUERY_LIMIT, (i + 1) * QUERY_LIMIT).join("; ")
|
|
325
331
|
);
|
|
326
332
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
333
|
+
if (num_batches > 1) {
|
|
334
|
+
logger.log(
|
|
335
|
+
`🌀 We are sending ${num_batches} batch(es) to D1 (limited to ${QUERY_LIMIT} statements per batch)`
|
|
336
|
+
);
|
|
337
|
+
}
|
|
330
338
|
return batches;
|
|
331
339
|
}
|
|
332
340
|
|
package/wrangler-dist/cli.js
CHANGED
|
@@ -73766,14 +73766,14 @@ var require_templates = __commonJS({
|
|
|
73766
73766
|
}
|
|
73767
73767
|
return results;
|
|
73768
73768
|
}
|
|
73769
|
-
function buildStyle(
|
|
73769
|
+
function buildStyle(chalk8, styles) {
|
|
73770
73770
|
const enabled = {};
|
|
73771
73771
|
for (const layer of styles) {
|
|
73772
73772
|
for (const style of layer.styles) {
|
|
73773
73773
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
73774
73774
|
}
|
|
73775
73775
|
}
|
|
73776
|
-
let current =
|
|
73776
|
+
let current = chalk8;
|
|
73777
73777
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
73778
73778
|
if (!Array.isArray(styles2)) {
|
|
73779
73779
|
continue;
|
|
@@ -73785,7 +73785,7 @@ var require_templates = __commonJS({
|
|
|
73785
73785
|
}
|
|
73786
73786
|
return current;
|
|
73787
73787
|
}
|
|
73788
|
-
module2.exports = (
|
|
73788
|
+
module2.exports = (chalk8, temporary) => {
|
|
73789
73789
|
const styles = [];
|
|
73790
73790
|
const chunks = [];
|
|
73791
73791
|
let chunk = [];
|
|
@@ -73795,13 +73795,13 @@ var require_templates = __commonJS({
|
|
|
73795
73795
|
} else if (style) {
|
|
73796
73796
|
const string = chunk.join("");
|
|
73797
73797
|
chunk = [];
|
|
73798
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
73798
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk8, styles)(string));
|
|
73799
73799
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
73800
73800
|
} else if (close) {
|
|
73801
73801
|
if (styles.length === 0) {
|
|
73802
73802
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
73803
73803
|
}
|
|
73804
|
-
chunks.push(buildStyle(
|
|
73804
|
+
chunks.push(buildStyle(chalk8, styles)(chunk.join("")));
|
|
73805
73805
|
chunk = [];
|
|
73806
73806
|
styles.pop();
|
|
73807
73807
|
} else {
|
|
@@ -73850,16 +73850,16 @@ var require_source = __commonJS({
|
|
|
73850
73850
|
}
|
|
73851
73851
|
};
|
|
73852
73852
|
var chalkFactory = (options6) => {
|
|
73853
|
-
const
|
|
73854
|
-
applyOptions(
|
|
73855
|
-
|
|
73856
|
-
Object.setPrototypeOf(
|
|
73857
|
-
Object.setPrototypeOf(
|
|
73858
|
-
|
|
73853
|
+
const chalk9 = {};
|
|
73854
|
+
applyOptions(chalk9, options6);
|
|
73855
|
+
chalk9.template = (...arguments_) => chalkTag(chalk9.template, ...arguments_);
|
|
73856
|
+
Object.setPrototypeOf(chalk9, Chalk.prototype);
|
|
73857
|
+
Object.setPrototypeOf(chalk9.template, chalk9);
|
|
73858
|
+
chalk9.template.constructor = () => {
|
|
73859
73859
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
73860
73860
|
};
|
|
73861
|
-
|
|
73862
|
-
return
|
|
73861
|
+
chalk9.template.Instance = ChalkClass;
|
|
73862
|
+
return chalk9.template;
|
|
73863
73863
|
};
|
|
73864
73864
|
function Chalk(options6) {
|
|
73865
73865
|
return chalkFactory(options6);
|
|
@@ -73970,7 +73970,7 @@ var require_source = __commonJS({
|
|
|
73970
73970
|
return openAll + string + closeAll;
|
|
73971
73971
|
};
|
|
73972
73972
|
var template;
|
|
73973
|
-
var chalkTag = (
|
|
73973
|
+
var chalkTag = (chalk9, ...strings) => {
|
|
73974
73974
|
const [firstString] = strings;
|
|
73975
73975
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
73976
73976
|
return strings.join(" ");
|
|
@@ -73986,14 +73986,14 @@ var require_source = __commonJS({
|
|
|
73986
73986
|
if (template === void 0) {
|
|
73987
73987
|
template = require_templates();
|
|
73988
73988
|
}
|
|
73989
|
-
return template(
|
|
73989
|
+
return template(chalk9, parts.join(""));
|
|
73990
73990
|
};
|
|
73991
73991
|
Object.defineProperties(Chalk.prototype, styles);
|
|
73992
|
-
var
|
|
73993
|
-
|
|
73994
|
-
|
|
73995
|
-
|
|
73996
|
-
module2.exports =
|
|
73992
|
+
var chalk8 = Chalk();
|
|
73993
|
+
chalk8.supportsColor = stdoutColor;
|
|
73994
|
+
chalk8.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
73995
|
+
chalk8.stderr.supportsColor = stderrColor;
|
|
73996
|
+
module2.exports = chalk8;
|
|
73997
73997
|
}
|
|
73998
73998
|
});
|
|
73999
73999
|
|
|
@@ -122907,14 +122907,14 @@ var require_templates2 = __commonJS({
|
|
|
122907
122907
|
}
|
|
122908
122908
|
return results;
|
|
122909
122909
|
}
|
|
122910
|
-
function buildStyle(
|
|
122910
|
+
function buildStyle(chalk8, styles) {
|
|
122911
122911
|
const enabled = {};
|
|
122912
122912
|
for (const layer of styles) {
|
|
122913
122913
|
for (const style of layer.styles) {
|
|
122914
122914
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
122915
122915
|
}
|
|
122916
122916
|
}
|
|
122917
|
-
let current =
|
|
122917
|
+
let current = chalk8;
|
|
122918
122918
|
for (const styleName of Object.keys(enabled)) {
|
|
122919
122919
|
if (Array.isArray(enabled[styleName])) {
|
|
122920
122920
|
if (!(styleName in current)) {
|
|
@@ -122929,7 +122929,7 @@ var require_templates2 = __commonJS({
|
|
|
122929
122929
|
}
|
|
122930
122930
|
return current;
|
|
122931
122931
|
}
|
|
122932
|
-
module2.exports = (
|
|
122932
|
+
module2.exports = (chalk8, tmp5) => {
|
|
122933
122933
|
const styles = [];
|
|
122934
122934
|
const chunks = [];
|
|
122935
122935
|
let chunk = [];
|
|
@@ -122939,13 +122939,13 @@ var require_templates2 = __commonJS({
|
|
|
122939
122939
|
} else if (style) {
|
|
122940
122940
|
const str = chunk.join("");
|
|
122941
122941
|
chunk = [];
|
|
122942
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
|
122942
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk8, styles)(str));
|
|
122943
122943
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
122944
122944
|
} else if (close) {
|
|
122945
122945
|
if (styles.length === 0) {
|
|
122946
122946
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
122947
122947
|
}
|
|
122948
|
-
chunks.push(buildStyle(
|
|
122948
|
+
chunks.push(buildStyle(chalk8, styles)(chunk.join("")));
|
|
122949
122949
|
chunk = [];
|
|
122950
122950
|
styles.pop();
|
|
122951
122951
|
} else {
|
|
@@ -122983,16 +122983,16 @@ var require_chalk = __commonJS({
|
|
|
122983
122983
|
}
|
|
122984
122984
|
function Chalk(options6) {
|
|
122985
122985
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
122986
|
-
const
|
|
122987
|
-
applyOptions(
|
|
122988
|
-
|
|
122986
|
+
const chalk8 = {};
|
|
122987
|
+
applyOptions(chalk8, options6);
|
|
122988
|
+
chalk8.template = function() {
|
|
122989
122989
|
const args = [].slice.call(arguments);
|
|
122990
|
-
return chalkTag.apply(null, [
|
|
122990
|
+
return chalkTag.apply(null, [chalk8.template].concat(args));
|
|
122991
122991
|
};
|
|
122992
|
-
Object.setPrototypeOf(
|
|
122993
|
-
Object.setPrototypeOf(
|
|
122994
|
-
|
|
122995
|
-
return
|
|
122992
|
+
Object.setPrototypeOf(chalk8, Chalk.prototype);
|
|
122993
|
+
Object.setPrototypeOf(chalk8.template, chalk8);
|
|
122994
|
+
chalk8.template.constructor = Chalk;
|
|
122995
|
+
return chalk8.template;
|
|
122996
122996
|
}
|
|
122997
122997
|
applyOptions(this, options6);
|
|
122998
122998
|
}
|
|
@@ -123111,7 +123111,7 @@ var require_chalk = __commonJS({
|
|
|
123111
123111
|
ansiStyles.dim.open = originalDim;
|
|
123112
123112
|
return str;
|
|
123113
123113
|
}
|
|
123114
|
-
function chalkTag(
|
|
123114
|
+
function chalkTag(chalk8, strings) {
|
|
123115
123115
|
if (!Array.isArray(strings)) {
|
|
123116
123116
|
return [].slice.call(arguments, 1).join(" ");
|
|
123117
123117
|
}
|
|
@@ -123121,7 +123121,7 @@ var require_chalk = __commonJS({
|
|
|
123121
123121
|
parts.push(String(args[i2 - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
123122
123122
|
parts.push(String(strings.raw[i2]));
|
|
123123
123123
|
}
|
|
123124
|
-
return template(
|
|
123124
|
+
return template(chalk8, parts.join(""));
|
|
123125
123125
|
}
|
|
123126
123126
|
Object.defineProperties(Chalk.prototype, styles);
|
|
123127
123127
|
module2.exports = Chalk();
|
|
@@ -131039,14 +131039,14 @@ var require_templates3 = __commonJS({
|
|
|
131039
131039
|
}
|
|
131040
131040
|
return results;
|
|
131041
131041
|
}
|
|
131042
|
-
function buildStyle(
|
|
131042
|
+
function buildStyle(chalk8, styles) {
|
|
131043
131043
|
const enabled = {};
|
|
131044
131044
|
for (const layer of styles) {
|
|
131045
131045
|
for (const style of layer.styles) {
|
|
131046
131046
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
131047
131047
|
}
|
|
131048
131048
|
}
|
|
131049
|
-
let current =
|
|
131049
|
+
let current = chalk8;
|
|
131050
131050
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
131051
131051
|
if (!Array.isArray(styles2)) {
|
|
131052
131052
|
continue;
|
|
@@ -131058,7 +131058,7 @@ var require_templates3 = __commonJS({
|
|
|
131058
131058
|
}
|
|
131059
131059
|
return current;
|
|
131060
131060
|
}
|
|
131061
|
-
module2.exports = (
|
|
131061
|
+
module2.exports = (chalk8, temporary) => {
|
|
131062
131062
|
const styles = [];
|
|
131063
131063
|
const chunks = [];
|
|
131064
131064
|
let chunk = [];
|
|
@@ -131068,13 +131068,13 @@ var require_templates3 = __commonJS({
|
|
|
131068
131068
|
} else if (style) {
|
|
131069
131069
|
const string = chunk.join("");
|
|
131070
131070
|
chunk = [];
|
|
131071
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
131071
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk8, styles)(string));
|
|
131072
131072
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
131073
131073
|
} else if (close) {
|
|
131074
131074
|
if (styles.length === 0) {
|
|
131075
131075
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
131076
131076
|
}
|
|
131077
|
-
chunks.push(buildStyle(
|
|
131077
|
+
chunks.push(buildStyle(chalk8, styles)(chunk.join("")));
|
|
131078
131078
|
chunk = [];
|
|
131079
131079
|
styles.pop();
|
|
131080
131080
|
} else {
|
|
@@ -131123,16 +131123,16 @@ var require_source2 = __commonJS({
|
|
|
131123
131123
|
}
|
|
131124
131124
|
};
|
|
131125
131125
|
var chalkFactory = (options6) => {
|
|
131126
|
-
const
|
|
131127
|
-
applyOptions(
|
|
131128
|
-
|
|
131129
|
-
Object.setPrototypeOf(
|
|
131130
|
-
Object.setPrototypeOf(
|
|
131131
|
-
|
|
131126
|
+
const chalk9 = {};
|
|
131127
|
+
applyOptions(chalk9, options6);
|
|
131128
|
+
chalk9.template = (...arguments_) => chalkTag(chalk9.template, ...arguments_);
|
|
131129
|
+
Object.setPrototypeOf(chalk9, Chalk.prototype);
|
|
131130
|
+
Object.setPrototypeOf(chalk9.template, chalk9);
|
|
131131
|
+
chalk9.template.constructor = () => {
|
|
131132
131132
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
131133
131133
|
};
|
|
131134
|
-
|
|
131135
|
-
return
|
|
131134
|
+
chalk9.template.Instance = ChalkClass;
|
|
131135
|
+
return chalk9.template;
|
|
131136
131136
|
};
|
|
131137
131137
|
function Chalk(options6) {
|
|
131138
131138
|
return chalkFactory(options6);
|
|
@@ -131243,7 +131243,7 @@ var require_source2 = __commonJS({
|
|
|
131243
131243
|
return openAll + string + closeAll;
|
|
131244
131244
|
};
|
|
131245
131245
|
var template;
|
|
131246
|
-
var chalkTag = (
|
|
131246
|
+
var chalkTag = (chalk9, ...strings) => {
|
|
131247
131247
|
const [firstString] = strings;
|
|
131248
131248
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
131249
131249
|
return strings.join(" ");
|
|
@@ -131259,14 +131259,14 @@ var require_source2 = __commonJS({
|
|
|
131259
131259
|
if (template === void 0) {
|
|
131260
131260
|
template = require_templates3();
|
|
131261
131261
|
}
|
|
131262
|
-
return template(
|
|
131262
|
+
return template(chalk9, parts.join(""));
|
|
131263
131263
|
};
|
|
131264
131264
|
Object.defineProperties(Chalk.prototype, styles);
|
|
131265
|
-
var
|
|
131266
|
-
|
|
131267
|
-
|
|
131268
|
-
|
|
131269
|
-
module2.exports =
|
|
131265
|
+
var chalk8 = Chalk();
|
|
131266
|
+
chalk8.supportsColor = stdoutColor;
|
|
131267
|
+
chalk8.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
131268
|
+
chalk8.stderr.supportsColor = stderrColor;
|
|
131269
|
+
module2.exports = chalk8;
|
|
131270
131270
|
}
|
|
131271
131271
|
});
|
|
131272
131272
|
|
|
@@ -131280,7 +131280,7 @@ var require_build4 = __commonJS({
|
|
|
131280
131280
|
var React18 = require_react();
|
|
131281
131281
|
var react_1 = require_react();
|
|
131282
131282
|
var ink_1 = require_build2();
|
|
131283
|
-
var
|
|
131283
|
+
var chalk8 = require_source2();
|
|
131284
131284
|
var TextInput2 = ({ value: originalValue, placeholder = "", focus = true, mask: mask2, highlightPastedText = false, showCursor = true, onChange, onSubmit }) => {
|
|
131285
131285
|
const [{ cursorOffset, cursorWidth }, setState] = react_1.useState({
|
|
131286
131286
|
cursorOffset: (originalValue || "").length,
|
|
@@ -131304,21 +131304,21 @@ var require_build4 = __commonJS({
|
|
|
131304
131304
|
const cursorActualWidth = highlightPastedText ? cursorWidth : 0;
|
|
131305
131305
|
const value = mask2 ? mask2.repeat(originalValue.length) : originalValue;
|
|
131306
131306
|
let renderedValue = value;
|
|
131307
|
-
let renderedPlaceholder = placeholder ?
|
|
131307
|
+
let renderedPlaceholder = placeholder ? chalk8.grey(placeholder) : void 0;
|
|
131308
131308
|
if (showCursor && focus) {
|
|
131309
|
-
renderedPlaceholder = placeholder.length > 0 ?
|
|
131310
|
-
renderedValue = value.length > 0 ? "" :
|
|
131309
|
+
renderedPlaceholder = placeholder.length > 0 ? chalk8.inverse(placeholder[0]) + chalk8.grey(placeholder.slice(1)) : chalk8.inverse(" ");
|
|
131310
|
+
renderedValue = value.length > 0 ? "" : chalk8.inverse(" ");
|
|
131311
131311
|
let i2 = 0;
|
|
131312
131312
|
for (const char of value) {
|
|
131313
131313
|
if (i2 >= cursorOffset - cursorActualWidth && i2 <= cursorOffset) {
|
|
131314
|
-
renderedValue +=
|
|
131314
|
+
renderedValue += chalk8.inverse(char);
|
|
131315
131315
|
} else {
|
|
131316
131316
|
renderedValue += char;
|
|
131317
131317
|
}
|
|
131318
131318
|
i2++;
|
|
131319
131319
|
}
|
|
131320
131320
|
if (value.length > 0 && cursorOffset === value.length) {
|
|
131321
|
-
renderedValue +=
|
|
131321
|
+
renderedValue += chalk8.inverse(" ");
|
|
131322
131322
|
}
|
|
131323
131323
|
}
|
|
131324
131324
|
ink_1.useInput((input, key2) => {
|
|
@@ -141159,7 +141159,7 @@ var import_websocket_server = __toESM(require_websocket_server2(), 1);
|
|
|
141159
141159
|
var wrapper_default = import_websocket.default;
|
|
141160
141160
|
|
|
141161
141161
|
// package.json
|
|
141162
|
-
var version = "2.3.
|
|
141162
|
+
var version = "2.3.2";
|
|
141163
141163
|
var package_default = {
|
|
141164
141164
|
name: "wrangler",
|
|
141165
141165
|
version,
|
|
@@ -147622,7 +147622,7 @@ async function getWorkerForZone(worker) {
|
|
|
147622
147622
|
init_import_meta_url();
|
|
147623
147623
|
var import_node_os14 = __toESM(require("node:os"));
|
|
147624
147624
|
var import_toml5 = __toESM(require_toml());
|
|
147625
|
-
var
|
|
147625
|
+
var import_chalk7 = __toESM(require_chalk());
|
|
147626
147626
|
|
|
147627
147627
|
// node_modules/supports-color/index.js
|
|
147628
147628
|
init_import_meta_url();
|
|
@@ -153887,6 +153887,7 @@ init_import_meta_url();
|
|
|
153887
153887
|
var import_node_fs10 = require("node:fs");
|
|
153888
153888
|
var import_promises8 = require("node:fs/promises");
|
|
153889
153889
|
var import_node_path19 = __toESM(require("node:path"));
|
|
153890
|
+
var import_chalk3 = __toESM(require_chalk());
|
|
153890
153891
|
var import_ink9 = __toESM(require_build2());
|
|
153891
153892
|
var import_ink_table4 = __toESM(require_dist2());
|
|
153892
153893
|
var import_react13 = __toESM(require_react());
|
|
@@ -153943,7 +153944,7 @@ var Handler4 = withConfig(
|
|
|
153943
153944
|
}) => {
|
|
153944
153945
|
logger.log(d1BetaWarning);
|
|
153945
153946
|
if (file && command2)
|
|
153946
|
-
return
|
|
153947
|
+
return logger.error(`Error: can't provide both --command and --file.`);
|
|
153947
153948
|
const isInteractive2 = process.stdout.isTTY;
|
|
153948
153949
|
const response = await executeSql(
|
|
153949
153950
|
local,
|
|
@@ -153975,7 +153976,7 @@ var Handler4 = withConfig(
|
|
|
153975
153976
|
})
|
|
153976
153977
|
);
|
|
153977
153978
|
} else {
|
|
153978
|
-
|
|
153979
|
+
logger.log(JSON.stringify(response, null, 2));
|
|
153979
153980
|
}
|
|
153980
153981
|
}
|
|
153981
153982
|
);
|
|
@@ -154028,7 +154029,7 @@ async function executeRemotely(config, name, shouldPrompt, batches) {
|
|
|
154028
154029
|
return null;
|
|
154029
154030
|
logger.log(`\u{1F300} Let's go`);
|
|
154030
154031
|
} else {
|
|
154031
|
-
|
|
154032
|
+
logger.error(warning);
|
|
154032
154033
|
}
|
|
154033
154034
|
}
|
|
154034
154035
|
const accountId = await requireAuth({});
|
|
@@ -154040,10 +154041,14 @@ async function executeRemotely(config, name, shouldPrompt, batches) {
|
|
|
154040
154041
|
if (shouldPrompt) {
|
|
154041
154042
|
logger.log(`\u{1F300} Executing on ${name} (${db.uuid}):`);
|
|
154042
154043
|
} else if (shouldPrompt !== void 0) {
|
|
154043
|
-
|
|
154044
|
+
logger.error(`Executing on ${name} (${db.uuid}):`);
|
|
154044
154045
|
}
|
|
154045
154046
|
const results = [];
|
|
154046
154047
|
for (const sql of batches) {
|
|
154048
|
+
if (multiple_batches)
|
|
154049
|
+
logger.log(
|
|
154050
|
+
import_chalk3.default.gray(` ${sql.slice(0, 70)}${sql.length > 70 ? "..." : ""}`)
|
|
154051
|
+
);
|
|
154047
154052
|
const result = await fetchResult(
|
|
154048
154053
|
`/accounts/${accountId}/d1/database/${db.uuid}/query`,
|
|
154049
154054
|
{
|
|
@@ -154076,16 +154081,18 @@ function splitSql(splitter, sql) {
|
|
|
154076
154081
|
}
|
|
154077
154082
|
function batchSplit(queries) {
|
|
154078
154083
|
logger.log(`\u{1F300} Parsing ${queries.length} statements`);
|
|
154079
|
-
const batches = [];
|
|
154080
154084
|
const num_batches = Math.ceil(queries.length / QUERY_LIMIT);
|
|
154085
|
+
const batches = [];
|
|
154081
154086
|
for (let i2 = 0; i2 < num_batches; i2++) {
|
|
154082
154087
|
batches.push(
|
|
154083
154088
|
queries.slice(i2 * QUERY_LIMIT, (i2 + 1) * QUERY_LIMIT).join("; ")
|
|
154084
154089
|
);
|
|
154085
154090
|
}
|
|
154086
|
-
|
|
154087
|
-
|
|
154088
|
-
|
|
154091
|
+
if (num_batches > 1) {
|
|
154092
|
+
logger.log(
|
|
154093
|
+
`\u{1F300} We are sending ${num_batches} batch(es) to D1 (limited to ${QUERY_LIMIT} statements per batch)`
|
|
154094
|
+
);
|
|
154095
|
+
}
|
|
154089
154096
|
return batches;
|
|
154090
154097
|
}
|
|
154091
154098
|
async function loadSqlUtils() {
|
|
@@ -159862,7 +159869,7 @@ var import_node_assert10 = __toESM(require("node:assert"));
|
|
|
159862
159869
|
var import_node_fs20 = require("node:fs");
|
|
159863
159870
|
var import_node_path35 = __toESM(require("node:path"));
|
|
159864
159871
|
var import_node_url12 = require("node:url");
|
|
159865
|
-
var
|
|
159872
|
+
var import_chalk5 = __toESM(require_chalk());
|
|
159866
159873
|
var import_tmp_promise4 = __toESM(require_tmp_promise());
|
|
159867
159874
|
|
|
159868
159875
|
// src/durable.ts
|
|
@@ -160000,7 +160007,7 @@ async function putConsumer(config, queueName, scriptName, envName, body) {
|
|
|
160000
160007
|
|
|
160001
160008
|
// src/routes.ts
|
|
160002
160009
|
init_import_meta_url();
|
|
160003
|
-
var
|
|
160010
|
+
var import_chalk4 = __toESM(require_chalk());
|
|
160004
160011
|
async function getWorkersDevSubdomain(accountId) {
|
|
160005
160012
|
try {
|
|
160006
160013
|
const { subdomain } = await fetchResult(
|
|
@@ -160060,8 +160067,8 @@ async function registerSubdomain(accountId) {
|
|
|
160060
160067
|
}
|
|
160061
160068
|
}
|
|
160062
160069
|
const ok = await confirm(
|
|
160063
|
-
`Creating a workers.dev subdomain for your account at ${
|
|
160064
|
-
|
|
160070
|
+
`Creating a workers.dev subdomain for your account at ${import_chalk4.default.blue(
|
|
160071
|
+
import_chalk4.default.underline(`https://${potentialName}.workers.dev`)
|
|
160065
160072
|
)}. Ok to proceed?`
|
|
160066
160073
|
);
|
|
160067
160074
|
if (!ok) {
|
|
@@ -160097,8 +160104,8 @@ ${onboardingLink}`);
|
|
|
160097
160104
|
}
|
|
160098
160105
|
logger.log("Success! It may take a few minutes for DNS records to update.");
|
|
160099
160106
|
logger.log(
|
|
160100
|
-
`Visit ${
|
|
160101
|
-
|
|
160107
|
+
`Visit ${import_chalk4.default.blue(
|
|
160108
|
+
import_chalk4.default.underline(
|
|
160102
160109
|
`https://dash.cloudflare.com/${accountId}/workers/subdomain`
|
|
160103
160110
|
)
|
|
160104
160111
|
)} to edit your workers.dev subdomain`
|
|
@@ -160565,13 +160572,13 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
160565
160572
|
const assignedRoutes = routesWithOtherBindings[worker];
|
|
160566
160573
|
errorMessage += `"${worker}" is already assigned to routes:
|
|
160567
160574
|
${assignedRoutes.map(
|
|
160568
|
-
(r) => ` - ${
|
|
160575
|
+
(r) => ` - ${import_chalk5.default.underline(r)}
|
|
160569
160576
|
`
|
|
160570
160577
|
)}`;
|
|
160571
160578
|
}
|
|
160572
160579
|
const resolution = "Unassign other workers from the routes you want to publish to, and then try again.";
|
|
160573
|
-
const dashLink = `Visit ${
|
|
160574
|
-
|
|
160580
|
+
const dashLink = `Visit ${import_chalk5.default.blue(
|
|
160581
|
+
import_chalk5.default.underline(
|
|
160575
160582
|
`https://dash.cloudflare.com/${accountId}/workers/overview`
|
|
160576
160583
|
)
|
|
160577
160584
|
)} to unassign a worker from a route.`;
|
|
@@ -162609,7 +162616,7 @@ ${modulesTypeStructure.join("\n")}`;
|
|
|
162609
162616
|
|
|
162610
162617
|
// src/update-check.ts
|
|
162611
162618
|
init_import_meta_url();
|
|
162612
|
-
var
|
|
162619
|
+
var import_chalk6 = __toESM(require_chalk());
|
|
162613
162620
|
var import_update_check = __toESM(require_update_check());
|
|
162614
162621
|
async function updateCheck() {
|
|
162615
162622
|
let update = null;
|
|
@@ -162620,7 +162627,7 @@ async function updateCheck() {
|
|
|
162620
162627
|
} catch (err2) {
|
|
162621
162628
|
}
|
|
162622
162629
|
if (update)
|
|
162623
|
-
return `(update available ${
|
|
162630
|
+
return `(update available ${import_chalk6.default.green(update.latest)})`;
|
|
162624
162631
|
return "";
|
|
162625
162632
|
}
|
|
162626
162633
|
|
|
@@ -162734,7 +162741,7 @@ async function printWranglerBanner() {
|
|
|
162734
162741
|
}
|
|
162735
162742
|
const text = ` \u26C5\uFE0F wrangler ${version} ${await updateCheck()}`;
|
|
162736
162743
|
logger.log(
|
|
162737
|
-
text + "\n" + (supports_color_default.stdout ?
|
|
162744
|
+
text + "\n" + (supports_color_default.stdout ? import_chalk7.default.hex("#FF8800")("-".repeat(text.length)) : "-".repeat(text.length))
|
|
162738
162745
|
);
|
|
162739
162746
|
}
|
|
162740
162747
|
function isLegacyEnv(config) {
|