wrangler 0.0.0-e33bea9b → 0.0.0-e351afcf
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/miniflare-dist/index.mjs +167 -93
- package/package.json +14 -9
- package/src/__tests__/api-devregistry.test.ts +121 -0
- package/src/__tests__/api.test.ts +27 -5
- package/src/__tests__/configuration.test.ts +59 -12
- package/src/__tests__/constellation.test.ts +371 -0
- package/src/__tests__/d1/execute.test.ts +2 -0
- package/src/__tests__/d1/migrate.test.ts +102 -0
- package/src/__tests__/delete.test.ts +6 -0
- package/src/__tests__/deployments.test.ts +335 -95
- package/src/__tests__/dev.test.tsx +71 -56
- package/src/__tests__/generate.test.ts +3 -4
- package/src/__tests__/helpers/mock-console.ts +6 -0
- package/src/__tests__/helpers/msw/handlers/deployments.ts +70 -3
- package/src/__tests__/helpers/msw/index.ts +4 -2
- package/src/__tests__/helpers/worker-scripts/parent-worker.js +4 -1
- package/src/__tests__/index.test.ts +14 -6
- package/src/__tests__/init.test.ts +127 -96
- package/src/__tests__/jest.setup.ts +4 -0
- package/src/__tests__/kv.test.ts +9 -9
- package/src/__tests__/logger.test.ts +68 -2
- package/src/__tests__/middleware.scheduled.test.ts +2 -2
- package/src/__tests__/middleware.test.ts +2 -2
- package/src/__tests__/mtls-certificates.test.ts +7 -3
- package/src/__tests__/pages/deployment-list.test.ts +2 -0
- package/src/__tests__/pages/functions-build.test.ts +70 -0
- package/src/__tests__/pages/project-list.test.ts +2 -0
- package/src/__tests__/pages/project-upload.test.ts +43 -24
- package/src/__tests__/pages/publish.test.ts +136 -92
- package/src/__tests__/publish.test.ts +878 -332
- package/src/__tests__/pubsub.test.ts +3 -0
- package/src/__tests__/queues.test.ts +5 -2
- package/src/__tests__/traverse-module-graph.test.ts +220 -0
- package/src/__tests__/tsconfig.tsbuildinfo +1 -1
- package/src/__tests__/user.test.ts +1 -1
- package/src/__tests__/worker-namespace.test.ts +1 -0
- package/src/api/dev.ts +12 -18
- package/src/api/pages/create-worker-bundle-contents.ts +1 -0
- package/src/api/pages/publish.tsx +28 -12
- package/src/bundle.ts +26 -9
- package/src/config/environment.ts +27 -0
- package/src/config/index.ts +18 -0
- package/src/config/validation.ts +91 -1
- package/src/constellation/createProject.tsx +51 -0
- package/src/constellation/deleteProject.ts +51 -0
- package/src/constellation/deleteProjectModel.ts +68 -0
- package/src/constellation/index.ts +75 -0
- package/src/constellation/listCatalog.tsx +35 -0
- package/src/constellation/listModel.tsx +41 -0
- package/src/constellation/listProject.tsx +28 -0
- package/src/constellation/listRuntime.tsx +28 -0
- package/src/constellation/options.ts +17 -0
- package/src/constellation/types.ts +17 -0
- package/src/constellation/uploadModel.tsx +64 -0
- package/src/constellation/utils.ts +90 -0
- package/src/create-worker-upload-form.ts +18 -1
- package/src/d1/backups.tsx +19 -15
- package/src/d1/create.tsx +45 -39
- package/src/d1/delete.ts +1 -1
- package/src/d1/execute.tsx +23 -20
- package/src/d1/list.tsx +14 -12
- package/src/d1/migrations/apply.tsx +36 -30
- package/src/d1/migrations/create.tsx +15 -12
- package/src/d1/migrations/helpers.ts +5 -8
- package/src/d1/migrations/list.tsx +10 -7
- package/src/deployments.ts +260 -8
- package/src/dev/dev.tsx +2 -0
- package/src/dev/local.tsx +48 -20
- package/src/dev/start-server.ts +49 -46
- package/src/dev/use-esbuild.ts +52 -49
- package/src/dev-registry.ts +2 -1
- package/src/dev.tsx +11 -5
- package/src/docs/helpers.ts +50 -0
- package/src/docs/index.ts +25 -68
- package/src/entry.ts +19 -8
- package/src/environment-variables/factory.ts +2 -1
- package/src/generate/index.ts +2 -2
- package/src/index.ts +86 -23
- package/src/init.ts +144 -135
- package/src/kv/helpers.ts +7 -4
- package/src/logger.ts +23 -4
- package/src/metrics/send-event.ts +2 -1
- package/src/miniflare-cli/index.ts +2 -2
- package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -1
- package/src/module-collection.ts +92 -26
- package/src/pages/build.ts +29 -17
- package/src/pages/deployments.tsx +3 -5
- package/src/pages/dev.ts +24 -6
- package/src/pages/functions/buildPlugin.ts +1 -0
- package/src/pages/functions/buildWorker.ts +59 -8
- package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
- package/src/pages/projects.tsx +2 -5
- package/src/pages/upload.tsx +24 -4
- package/src/publish/publish.ts +10 -26
- package/src/queues/cli/commands/consumer/add.ts +6 -0
- package/src/queues/client.ts +1 -0
- package/src/secret/index.ts +1 -0
- package/src/sites.ts +164 -52
- package/src/traverse-module-graph.ts +53 -0
- package/src/user/user.ts +1 -0
- package/src/utils/render.ts +93 -0
- package/src/worker.ts +10 -0
- package/wrangler-dist/cli.d.ts +29 -2
- package/wrangler-dist/cli.js +23270 -22110
- package/src/__tests__/api-devregistry.test.js +0 -64
package/src/d1/create.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Text, Box } from "ink";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { fetchResult } from "../cfetch";
|
|
4
|
+
import { withConfig } from "../config";
|
|
4
5
|
import { logger } from "../logger";
|
|
5
6
|
import { requireAuth } from "../user";
|
|
7
|
+
import { renderToString } from "../utils/render";
|
|
6
8
|
import { d1BetaWarning } from "./utils";
|
|
7
9
|
import type {
|
|
8
10
|
CommonYargsArgv,
|
|
@@ -20,45 +22,49 @@ export function Options(yargs: CommonYargsArgv) {
|
|
|
20
22
|
.epilogue(d1BetaWarning);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
type HandlerOptions = StrictYargsOptionsToInterface<typeof Options>;
|
|
26
|
+
export const Handler = withConfig<HandlerOptions>(
|
|
27
|
+
async ({ name, config }): Promise<void> => {
|
|
28
|
+
const accountId = await requireAuth(config);
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
logger.log(d1BetaWarning);
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
let db: Database;
|
|
33
|
+
try {
|
|
34
|
+
db = await fetchResult(`/accounts/${accountId}/d1/database`, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
headers: {
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
},
|
|
39
|
+
body: JSON.stringify({
|
|
40
|
+
name,
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
} catch (e) {
|
|
44
|
+
if ((e as { code: number }).code === 7502) {
|
|
45
|
+
throw new Error("A database with that name already exists");
|
|
46
|
+
}
|
|
47
|
+
throw e;
|
|
44
48
|
}
|
|
45
|
-
throw e;
|
|
46
|
-
}
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
logger.log(
|
|
51
|
+
renderToString(
|
|
52
|
+
<Box flexDirection="column">
|
|
53
|
+
<Text>✅ Successfully created DB '{db.name}'!</Text>
|
|
54
|
+
<Text> </Text>
|
|
55
|
+
<Text>
|
|
56
|
+
Add the following to your wrangler.toml to connect to it from a
|
|
57
|
+
Worker:
|
|
58
|
+
</Text>
|
|
59
|
+
<Text> </Text>
|
|
60
|
+
<Text>[[ d1_databases ]]</Text>
|
|
61
|
+
<Text>
|
|
62
|
+
binding = "DB" # i.e. available in your Worker on env.DB
|
|
63
|
+
</Text>
|
|
64
|
+
<Text>database_name = "{db.name}"</Text>
|
|
65
|
+
<Text>database_id = "{db.uuid}"</Text>
|
|
66
|
+
</Box>
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
package/src/d1/delete.ts
CHANGED
|
@@ -24,7 +24,7 @@ export function Options(d1ListYargs: CommonYargsArgv) {
|
|
|
24
24
|
type HandlerOptions = StrictYargsOptionsToInterface<typeof Options>;
|
|
25
25
|
export const Handler = withConfig<HandlerOptions>(
|
|
26
26
|
async ({ name, skipConfirmation, config }): Promise<void> => {
|
|
27
|
-
const accountId = await requireAuth(
|
|
27
|
+
const accountId = await requireAuth(config);
|
|
28
28
|
logger.log(d1BetaWarning);
|
|
29
29
|
|
|
30
30
|
const db: Database = await getDatabaseByNameOrBinding(
|
package/src/d1/execute.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { mkdir } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
-
import {
|
|
5
|
+
import { Static, Text } from "ink";
|
|
6
6
|
import Table from "ink-table";
|
|
7
7
|
import { npxImport } from "npx-import";
|
|
8
8
|
import React from "react";
|
|
@@ -14,6 +14,7 @@ import { logger } from "../logger";
|
|
|
14
14
|
import { readFileSync } from "../parse";
|
|
15
15
|
import { readableRelative } from "../paths";
|
|
16
16
|
import { requireAuth } from "../user";
|
|
17
|
+
import { renderToString } from "../utils/render";
|
|
17
18
|
import * as options from "./options";
|
|
18
19
|
import splitSqlQuery from "./splitter";
|
|
19
20
|
import {
|
|
@@ -36,7 +37,7 @@ export type QueryResult = {
|
|
|
36
37
|
};
|
|
37
38
|
query?: string;
|
|
38
39
|
};
|
|
39
|
-
// Max number of
|
|
40
|
+
// Max number of statements to send in a single /execute call
|
|
40
41
|
const QUERY_LIMIT = 10_000;
|
|
41
42
|
|
|
42
43
|
export function Options(yargs: CommonYargsArgv) {
|
|
@@ -110,25 +111,27 @@ export const Handler = async (args: HandlerOptions): Promise<void> => {
|
|
|
110
111
|
|
|
111
112
|
if (isInteractive && !json) {
|
|
112
113
|
// Render table if single result
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
logger.log(
|
|
115
|
+
renderToString(
|
|
116
|
+
<Static items={response}>
|
|
117
|
+
{(result) => {
|
|
118
|
+
// batch results
|
|
119
|
+
if (!Array.isArray(result)) {
|
|
120
|
+
const { results, query } = result;
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
if (Array.isArray(results) && results.length > 0) {
|
|
123
|
+
const shortQuery = shorten(query, 48);
|
|
124
|
+
return (
|
|
125
|
+
<>
|
|
126
|
+
{shortQuery ? <Text dimColor>{shortQuery}</Text> : null}
|
|
127
|
+
<Table data={results}></Table>
|
|
128
|
+
</>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
128
131
|
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
}}
|
|
133
|
+
</Static>
|
|
134
|
+
)
|
|
132
135
|
);
|
|
133
136
|
} else {
|
|
134
137
|
// set loggerLevel back to what it was before to actually output the JSON in stdout
|
|
@@ -278,7 +281,7 @@ async function executeRemotely({
|
|
|
278
281
|
}
|
|
279
282
|
}
|
|
280
283
|
|
|
281
|
-
const accountId = await requireAuth(
|
|
284
|
+
const accountId = await requireAuth(config);
|
|
282
285
|
const db: Database = await getDatabaseByNameOrBinding(
|
|
283
286
|
config,
|
|
284
287
|
accountId,
|
package/src/d1/list.tsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { render } from "ink";
|
|
2
1
|
import Table from "ink-table";
|
|
3
2
|
import React from "react";
|
|
4
3
|
import { fetchResult } from "../cfetch";
|
|
4
|
+
import { withConfig } from "../config";
|
|
5
5
|
import { logger } from "../logger";
|
|
6
6
|
import { requireAuth } from "../user";
|
|
7
|
+
import { renderToString } from "../utils/render";
|
|
7
8
|
import { d1BetaWarning } from "./utils";
|
|
8
9
|
import type {
|
|
9
10
|
CommonYargsArgv,
|
|
@@ -21,19 +22,20 @@ export function Options(d1ListYargs: CommonYargsArgv) {
|
|
|
21
22
|
.epilogue(d1BetaWarning);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
type HandlerOptions = StrictYargsOptionsToInterface<typeof Options>;
|
|
26
|
+
export const Handler = withConfig<HandlerOptions>(
|
|
27
|
+
async ({ json, config }): Promise<void> => {
|
|
28
|
+
const accountId = await requireAuth(config);
|
|
29
|
+
const dbs: Array<Database> = await listDatabases(accountId);
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if (json) {
|
|
32
|
+
logger.log(JSON.stringify(dbs, null, 2));
|
|
33
|
+
} else {
|
|
34
|
+
logger.log(d1BetaWarning);
|
|
35
|
+
logger.log(renderToString(<Table data={dbs}></Table>));
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
|
-
|
|
38
|
+
);
|
|
37
39
|
|
|
38
40
|
export const listDatabases = async (
|
|
39
41
|
accountId: string
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "node:assert";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import { Box,
|
|
4
|
+
import { Box, Text } from "ink";
|
|
5
5
|
import Table from "ink-table";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { withConfig } from "../../config";
|
|
@@ -10,6 +10,7 @@ import { CI } from "../../is-ci";
|
|
|
10
10
|
import isInteractive from "../../is-interactive";
|
|
11
11
|
import { logger } from "../../logger";
|
|
12
12
|
import { requireAuth } from "../../user";
|
|
13
|
+
import { renderToString } from "../../utils/render";
|
|
13
14
|
import { createBackup } from "../backups";
|
|
14
15
|
import { DEFAULT_MIGRATION_PATH, DEFAULT_MIGRATION_TABLE } from "../constants";
|
|
15
16
|
import { executeSql } from "../execute";
|
|
@@ -97,14 +98,16 @@ export const ApplyHandler = withConfig<ApplyHandlerOptions>(
|
|
|
97
98
|
});
|
|
98
99
|
|
|
99
100
|
if (unappliedMigrations.length === 0) {
|
|
100
|
-
|
|
101
|
+
logger.log(renderToString(<Text>✅ No migrations to apply!</Text>));
|
|
101
102
|
return;
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
logger.log(
|
|
105
|
+
renderToString(
|
|
106
|
+
<Box flexDirection="column">
|
|
107
|
+
<Text>Migrations to be applied:</Text>
|
|
108
|
+
<Table data={unappliedMigrations} columns={["Name"]}></Table>
|
|
109
|
+
</Box>
|
|
110
|
+
)
|
|
108
111
|
);
|
|
109
112
|
const ok = await confirm(
|
|
110
113
|
`About to apply ${unappliedMigrations.length} migration(s)
|
|
@@ -118,8 +121,8 @@ Your database may not be available to serve requests during the migration, conti
|
|
|
118
121
|
databaseInfo,
|
|
119
122
|
"In non-local mode `databaseInfo` should be defined."
|
|
120
123
|
);
|
|
121
|
-
|
|
122
|
-
const accountId = await requireAuth(
|
|
124
|
+
logger.log(renderToString(<Text>🕒 Creating backup...</Text>));
|
|
125
|
+
const accountId = await requireAuth(config);
|
|
123
126
|
await createBackup(accountId, databaseInfo.uuid);
|
|
124
127
|
}
|
|
125
128
|
|
|
@@ -169,35 +172,38 @@ Your database may not be available to serve requests during the migration, conti
|
|
|
169
172
|
}
|
|
170
173
|
} catch (e) {
|
|
171
174
|
const err = e as ParseError;
|
|
175
|
+
const maybeCause = (err.cause ?? err) as Error;
|
|
172
176
|
|
|
173
177
|
success = false;
|
|
174
178
|
errorNotes = err.notes?.map((msg) => msg.text) ?? [
|
|
175
|
-
|
|
179
|
+
maybeCause?.message ?? maybeCause.toString(),
|
|
176
180
|
];
|
|
177
181
|
}
|
|
178
182
|
|
|
179
183
|
migration.Status = success ? "✅" : "❌";
|
|
180
184
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
<
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
185
|
+
logger.log(
|
|
186
|
+
renderToString(
|
|
187
|
+
<Box flexDirection="column">
|
|
188
|
+
<Table
|
|
189
|
+
data={unappliedMigrations}
|
|
190
|
+
columns={["Name", "Status"]}
|
|
191
|
+
></Table>
|
|
192
|
+
{errorNotes.length > 0 && (
|
|
193
|
+
<Box flexDirection="column">
|
|
194
|
+
<Text> </Text>
|
|
195
|
+
<Text>
|
|
196
|
+
❌ Migration {migration.Name} failed with following Errors
|
|
197
|
+
</Text>
|
|
198
|
+
<Table
|
|
199
|
+
data={errorNotes.map((err) => {
|
|
200
|
+
return { Error: err };
|
|
201
|
+
})}
|
|
202
|
+
></Table>
|
|
203
|
+
</Box>
|
|
204
|
+
)}
|
|
205
|
+
</Box>
|
|
206
|
+
)
|
|
201
207
|
);
|
|
202
208
|
|
|
203
209
|
if (errorNotes.length > 0) return;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { Box,
|
|
3
|
+
import { Box, Text } from "ink";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { withConfig } from "../../config";
|
|
6
6
|
import { logger } from "../../logger";
|
|
7
|
+
import { renderToString } from "../../utils/render";
|
|
7
8
|
import { DEFAULT_MIGRATION_PATH } from "../constants";
|
|
8
9
|
import { Database } from "../options";
|
|
9
10
|
import { d1BetaWarning, getDatabaseInfoFromConfig } from "../utils";
|
|
@@ -54,17 +55,19 @@ export const CreateHandler = withConfig<CreateHandlerOptions>(
|
|
|
54
55
|
`-- Migration number: ${nextMigrationNumber} \t ${new Date().toISOString()}\n`
|
|
55
56
|
);
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
logger.log(
|
|
59
|
+
renderToString(
|
|
60
|
+
<Box flexDirection="column">
|
|
61
|
+
<Text>
|
|
62
|
+
✅ Successfully created Migration '{newMigrationName}'!
|
|
63
|
+
</Text>
|
|
64
|
+
<Text> </Text>
|
|
65
|
+
<Text>The migration is available for editing here</Text>
|
|
66
|
+
<Text>
|
|
67
|
+
{migrationsPath}/{newMigrationName}
|
|
68
|
+
</Text>
|
|
69
|
+
</Box>
|
|
70
|
+
)
|
|
68
71
|
);
|
|
69
72
|
}
|
|
70
73
|
);
|
|
@@ -157,14 +157,11 @@ export const initMigrationsTable = async ({
|
|
|
157
157
|
name,
|
|
158
158
|
shouldPrompt: isInteractive() && !CI.isCI(),
|
|
159
159
|
persistTo,
|
|
160
|
-
command: `
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
166
|
-
);
|
|
167
|
-
`,
|
|
160
|
+
command: `CREATE TABLE IF NOT EXISTS ${migrationsTableName}(
|
|
161
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
162
|
+
name TEXT UNIQUE,
|
|
163
|
+
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
164
|
+
);`,
|
|
168
165
|
file: undefined,
|
|
169
166
|
json: undefined,
|
|
170
167
|
preview,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import { Box,
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
3
|
import Table from "ink-table";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { withConfig } from "../../config";
|
|
6
6
|
import { logger } from "../../logger";
|
|
7
7
|
import { requireAuth } from "../../user";
|
|
8
|
+
import { renderToString } from "../../utils/render";
|
|
8
9
|
import { DEFAULT_MIGRATION_PATH, DEFAULT_MIGRATION_TABLE } from "../constants";
|
|
9
10
|
import { d1BetaWarning, getDatabaseInfoFromConfig } from "../utils";
|
|
10
11
|
import {
|
|
@@ -78,15 +79,17 @@ export const ListHandler = withConfig<ListHandlerOptions>(
|
|
|
78
79
|
});
|
|
79
80
|
|
|
80
81
|
if (unappliedMigrations.length === 0) {
|
|
81
|
-
|
|
82
|
+
logger.log(renderToString(<Text>✅ No migrations to apply!</Text>));
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
logger.log(
|
|
87
|
+
renderToString(
|
|
88
|
+
<Box flexDirection="column">
|
|
89
|
+
<Text>Migrations to be applied:</Text>
|
|
90
|
+
<Table data={unappliedMigrations} columns={["Name"]}></Table>
|
|
91
|
+
</Box>
|
|
92
|
+
)
|
|
90
93
|
);
|
|
91
94
|
}
|
|
92
95
|
);
|