wrangler 0.0.0-e6733a3 → 0.0.0-e88a54e

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.
Files changed (99) hide show
  1. package/bin/wrangler.js +2 -2
  2. package/miniflare-dist/index.mjs +79 -0
  3. package/miniflare-dist/index.mjs.map +7 -0
  4. package/package.json +35 -16
  5. package/pages/functions/buildWorker.ts +1 -1
  6. package/pages/functions/filepath-routing.test.ts +212 -28
  7. package/pages/functions/filepath-routing.ts +91 -131
  8. package/pages/functions/routes.ts +11 -18
  9. package/pages/functions/template-worker.ts +19 -33
  10. package/src/__tests__/configuration.test.ts +2796 -0
  11. package/src/__tests__/dev.test.tsx +488 -58
  12. package/src/__tests__/dev2.test.tsx +154 -0
  13. package/src/__tests__/guess-worker-format.test.ts +58 -0
  14. package/src/__tests__/{clipboardy-mock.js → helpers/clipboardy-mock.js} +0 -0
  15. package/src/__tests__/helpers/cmd-shim.d.ts +11 -0
  16. package/src/__tests__/helpers/faye-websocket.d.ts +6 -0
  17. package/src/__tests__/helpers/mock-account-id.ts +48 -0
  18. package/src/__tests__/helpers/mock-bin.ts +36 -0
  19. package/src/__tests__/{mock-cfetch.ts → helpers/mock-cfetch.ts} +55 -19
  20. package/src/__tests__/helpers/mock-console.ts +70 -0
  21. package/src/__tests__/{mock-dialogs.ts → helpers/mock-dialogs.ts} +1 -1
  22. package/src/__tests__/helpers/mock-kv.ts +33 -0
  23. package/src/__tests__/helpers/mock-stdin.ts +103 -0
  24. package/src/__tests__/helpers/mock-web-socket.ts +29 -0
  25. package/src/__tests__/helpers/run-in-tmp.ts +32 -0
  26. package/src/__tests__/helpers/run-wrangler.ts +16 -0
  27. package/src/__tests__/helpers/write-wrangler-toml.ts +17 -0
  28. package/src/__tests__/https-options.test.ts +127 -0
  29. package/src/__tests__/index.test.ts +779 -75
  30. package/src/__tests__/jest.setup.ts +53 -6
  31. package/src/__tests__/kv.test.ts +738 -454
  32. package/src/__tests__/logout.test.ts +52 -0
  33. package/src/__tests__/package-manager.test.ts +206 -0
  34. package/src/__tests__/pages.test.ts +44 -0
  35. package/src/__tests__/parse.test.ts +322 -0
  36. package/src/__tests__/publish.test.ts +2704 -0
  37. package/src/__tests__/r2.test.ts +198 -0
  38. package/src/__tests__/route.test.ts +45 -0
  39. package/src/__tests__/secret.test.ts +425 -0
  40. package/src/__tests__/sentry.test.ts +146 -0
  41. package/src/__tests__/tail.test.ts +564 -0
  42. package/src/__tests__/whoami.test.tsx +100 -0
  43. package/src/bundle.ts +142 -0
  44. package/src/cfetch/index.ts +21 -19
  45. package/src/cfetch/internal.ts +94 -24
  46. package/src/cli.ts +10 -0
  47. package/src/config/README.md +107 -0
  48. package/src/config/config.ts +218 -0
  49. package/src/config/diagnostics.ts +80 -0
  50. package/src/config/environment.ts +366 -0
  51. package/src/config/index.ts +62 -0
  52. package/src/config/validation-helpers.ts +486 -0
  53. package/src/config/validation.ts +1090 -0
  54. package/src/{api/preview.ts → create-worker-preview.ts} +61 -23
  55. package/src/create-worker-upload-form.ts +217 -0
  56. package/src/dev/dev.tsx +364 -0
  57. package/src/dev/local.tsx +232 -0
  58. package/src/dev/remote.tsx +203 -0
  59. package/src/dev/use-esbuild.ts +100 -0
  60. package/src/dialogs.tsx +2 -2
  61. package/src/entry.ts +208 -0
  62. package/src/environment-variables.ts +33 -0
  63. package/src/https-options.ts +122 -0
  64. package/src/index.tsx +1198 -799
  65. package/src/inspect.ts +159 -66
  66. package/src/{kv.tsx → kv.ts} +117 -65
  67. package/src/miniflare-cli/README.md +30 -0
  68. package/src/miniflare-cli/enum-keys.ts +17 -0
  69. package/src/miniflare-cli/index.ts +37 -0
  70. package/src/module-collection.ts +229 -35
  71. package/src/open-in-browser.ts +25 -0
  72. package/src/package-manager.ts +126 -0
  73. package/src/pages.tsx +58 -42
  74. package/src/parse.ts +183 -0
  75. package/src/paths.ts +26 -0
  76. package/src/proxy.ts +224 -78
  77. package/src/publish.ts +281 -292
  78. package/src/r2.ts +50 -0
  79. package/src/reporting.ts +131 -0
  80. package/src/selfsigned.d.ts +29 -0
  81. package/src/sites.tsx +224 -58
  82. package/src/tail/filters.ts +279 -0
  83. package/src/tail/index.ts +299 -0
  84. package/src/tail/printing.ts +62 -0
  85. package/src/user.tsx +273 -180
  86. package/src/whoami.tsx +69 -0
  87. package/src/{api/worker.ts → worker.ts} +45 -37
  88. package/templates/new-worker.js +15 -0
  89. package/templates/new-worker.ts +15 -0
  90. package/{static-asset-facade.js → templates/static-asset-facade.js} +0 -0
  91. package/templates/tsconfig.json +105 -0
  92. package/wrangler-dist/cli.js +130612 -112486
  93. package/wrangler-dist/cli.js.map +3 -3
  94. package/src/__tests__/run-in-tmp.ts +0 -19
  95. package/src/__tests__/run-wrangler.ts +0 -32
  96. package/src/api/form_data.ts +0 -131
  97. package/src/config.ts +0 -487
  98. package/src/dev.tsx +0 -771
  99. package/src/tail.tsx +0 -73
@@ -0,0 +1,232 @@
1
+ import { spawn } from "node:child_process";
2
+ import { realpathSync } from "node:fs";
3
+ import { writeFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { useState, useEffect, useRef } from "react";
6
+ import onExit from "signal-exit";
7
+ import useInspector from "../inspect";
8
+ import { DEFAULT_MODULE_RULES } from "../module-collection";
9
+ import { waitForPortToBeAvailable } from "../proxy";
10
+ import type { Config } from "../config";
11
+ import type { AssetPaths } from "../sites";
12
+ import type { CfWorkerInit, CfScriptFormat } from "../worker";
13
+ import type { EsbuildBundle } from "./use-esbuild";
14
+ import type { MiniflareOptions } from "miniflare";
15
+
16
+ interface LocalProps {
17
+ name: undefined | string;
18
+ bundle: EsbuildBundle | undefined;
19
+ format: CfScriptFormat | undefined;
20
+ compatibilityDate: string | undefined;
21
+ compatibilityFlags: undefined | string[];
22
+ bindings: CfWorkerInit["bindings"];
23
+ assetPaths: undefined | AssetPaths;
24
+ public: undefined | string;
25
+ port: number;
26
+ ip: string;
27
+ rules: Config["rules"];
28
+ inspectorPort: number;
29
+ enableLocalPersistence: boolean;
30
+ }
31
+
32
+ export function Local(props: LocalProps) {
33
+ const { inspectorUrl } = useLocalWorker(props);
34
+ useInspector({
35
+ inspectorUrl,
36
+ port: props.inspectorPort,
37
+ logToTerminal: false,
38
+ });
39
+ return null;
40
+ }
41
+
42
+ function useLocalWorker({
43
+ name: workerName,
44
+ bundle,
45
+ format,
46
+ compatibilityDate,
47
+ compatibilityFlags,
48
+ bindings,
49
+ assetPaths,
50
+ public: publicDirectory,
51
+ port,
52
+ rules,
53
+ enableLocalPersistence,
54
+ ip,
55
+ }: LocalProps) {
56
+ // TODO: pass vars via command line
57
+ const local = useRef<ReturnType<typeof spawn>>();
58
+ const removeSignalExitListener = useRef<() => void>();
59
+ const [inspectorUrl, setInspectorUrl] = useState<string | undefined>();
60
+ useEffect(() => {
61
+ async function startLocalWorker() {
62
+ if (!bundle || !format) return;
63
+
64
+ // port for the worker
65
+ await waitForPortToBeAvailable(port, { retryPeriod: 200, timeout: 2000 });
66
+
67
+ if (publicDirectory) {
68
+ throw new Error(
69
+ '⎔ A "public" folder is not yet supported in local mode.'
70
+ );
71
+ }
72
+
73
+ // In local mode, we want to copy all referenced modules into
74
+ // the output bundle directory before starting up
75
+ for (const module of bundle.modules) {
76
+ await writeFile(
77
+ path.join(path.dirname(bundle.path), module.name),
78
+ module.content
79
+ );
80
+ }
81
+
82
+ const scriptPath = realpathSync(bundle.path);
83
+
84
+ const wasmBindings = { ...bindings.wasm_modules };
85
+ if (format === "service-worker") {
86
+ for (const { type, name } of bundle.modules) {
87
+ if (type === "compiled-wasm") {
88
+ // In service-worker format, .wasm modules are referenced by global identifiers,
89
+ // so we convert it here.
90
+ // This identifier has to be a valid JS identifier, so we replace all non alphanumeric
91
+ // characters with an underscore.
92
+ const identifier = name.replace(/[^a-zA-Z0-9_$]/g, "_");
93
+ wasmBindings[identifier] = name;
94
+ }
95
+ }
96
+ }
97
+
98
+ const options: MiniflareOptions = {
99
+ name: workerName,
100
+ port,
101
+ scriptPath,
102
+ host: ip,
103
+ modules: format === "modules",
104
+ modulesRules: (rules || [])
105
+ .concat(DEFAULT_MODULE_RULES)
106
+ .map(({ type, globs: include, fallthrough }) => ({
107
+ type,
108
+ include,
109
+ fallthrough,
110
+ })),
111
+ compatibilityDate,
112
+ compatibilityFlags,
113
+ kvNamespaces: bindings.kv_namespaces?.map((kv) => kv.binding),
114
+ kvPersist: enableLocalPersistence,
115
+ durableObjects: Object.fromEntries(
116
+ (bindings.durable_objects?.bindings ?? []).map<[string, string]>(
117
+ (value) => [value.name, value.class_name]
118
+ )
119
+ ),
120
+ durableObjectsPersist: enableLocalPersistence,
121
+ cachePersist: enableLocalPersistence,
122
+ sitePath: assetPaths?.assetDirectory
123
+ ? path.join(assetPaths.baseDirectory, assetPaths.assetDirectory)
124
+ : undefined,
125
+ siteInclude: assetPaths?.includePatterns.length
126
+ ? assetPaths?.includePatterns
127
+ : undefined,
128
+ siteExclude: assetPaths?.excludePatterns.length
129
+ ? assetPaths.excludePatterns
130
+ : undefined,
131
+ bindings: bindings.vars,
132
+ wasmBindings,
133
+ sourceMap: true,
134
+ logUnhandledRejections: true,
135
+ };
136
+
137
+ // The path to the Miniflare CLI assumes that this file is being run from
138
+ // `wrangler-dist` and that the CLI is found in `miniflare-dist`.
139
+ // If either of those paths change this line needs updating.
140
+ const miniflareCLIPath = path.resolve(
141
+ __dirname,
142
+ "../miniflare-dist/index.mjs"
143
+ );
144
+ const optionsArg = JSON.stringify(options, null);
145
+
146
+ console.log("⎔ Starting a local server...");
147
+ local.current = spawn(
148
+ "node",
149
+ [
150
+ "--experimental-vm-modules", // ensures that Miniflare can run ESM Workers
151
+ "--no-warnings", // hide annoying Node warnings
152
+ "--inspect", // start Miniflare listening for a debugger to attach
153
+ miniflareCLIPath,
154
+ optionsArg,
155
+ // "--log=VERBOSE", // uncomment this to Miniflare to log "everything"!
156
+ ],
157
+ {
158
+ cwd: path.dirname(scriptPath),
159
+ }
160
+ );
161
+
162
+ local.current.on("close", (code) => {
163
+ if (code) {
164
+ console.log(`Miniflare process exited with code ${code}`);
165
+ }
166
+ });
167
+
168
+ local.current.stdout?.on("data", (data: Buffer) => {
169
+ console.log(`${data.toString()}`);
170
+ });
171
+
172
+ local.current.stderr?.on("data", (data: Buffer) => {
173
+ console.error(`${data.toString()}`);
174
+ const matches =
175
+ /Debugger listening on (ws:\/\/127\.0\.0\.1:\d+\/[A-Za-z0-9-]+)/.exec(
176
+ data.toString()
177
+ );
178
+ if (matches) {
179
+ setInspectorUrl(matches[1]);
180
+ }
181
+ });
182
+
183
+ local.current.on("exit", (code) => {
184
+ if (code) {
185
+ console.error(`Miniflare process exited with code ${code}`);
186
+ }
187
+ });
188
+
189
+ local.current.on("error", (error: Error) => {
190
+ console.error(`Miniflare process failed to spawn`);
191
+ console.error(error);
192
+ });
193
+
194
+ removeSignalExitListener.current = onExit((_code, _signal) => {
195
+ console.log("⎔ Shutting down local server.");
196
+ local.current?.kill();
197
+ local.current = undefined;
198
+ });
199
+ }
200
+
201
+ startLocalWorker().catch((err) => {
202
+ console.error("local worker:", err);
203
+ });
204
+
205
+ return () => {
206
+ if (local.current) {
207
+ console.log("⎔ Shutting down local server.");
208
+ local.current?.kill();
209
+ local.current = undefined;
210
+ removeSignalExitListener.current && removeSignalExitListener.current();
211
+ removeSignalExitListener.current = undefined;
212
+ }
213
+ };
214
+ }, [
215
+ bundle,
216
+ workerName,
217
+ format,
218
+ port,
219
+ ip,
220
+ bindings.durable_objects?.bindings,
221
+ bindings.kv_namespaces,
222
+ bindings.vars,
223
+ compatibilityDate,
224
+ compatibilityFlags,
225
+ enableLocalPersistence,
226
+ assetPaths,
227
+ publicDirectory,
228
+ rules,
229
+ bindings.wasm_modules,
230
+ ]);
231
+ return { inspectorUrl };
232
+ }
@@ -0,0 +1,203 @@
1
+ import assert from "node:assert";
2
+ import { readFile } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { useState, useEffect, useRef } from "react";
5
+ import { createWorkerPreview } from "../create-worker-preview";
6
+ import useInspector from "../inspect";
7
+ import { usePreviewServer } from "../proxy";
8
+ import { syncAssets } from "../sites";
9
+ import type { CfPreviewToken } from "../create-worker-preview";
10
+ import type { AssetPaths } from "../sites";
11
+ import type { CfModule, CfWorkerInit, CfScriptFormat } from "../worker";
12
+ import type { EsbuildBundle } from "./use-esbuild";
13
+
14
+ export function Remote(props: {
15
+ name: string | undefined;
16
+ bundle: EsbuildBundle | undefined;
17
+ format: CfScriptFormat | undefined;
18
+ public: undefined | string;
19
+ assetPaths: undefined | AssetPaths;
20
+ port: number;
21
+ ip: string;
22
+ localProtocol: "https" | "http";
23
+ inspectorPort: number;
24
+ accountId: undefined | string;
25
+ apiToken: undefined | string;
26
+ bindings: CfWorkerInit["bindings"];
27
+ compatibilityDate: string | undefined;
28
+ compatibilityFlags: undefined | string[];
29
+ usageModel: undefined | "bundled" | "unbound";
30
+ env: string | undefined;
31
+ legacyEnv: boolean | undefined;
32
+ zone: { id: string; host: string } | undefined;
33
+ }) {
34
+ assert(props.accountId, "accountId is required");
35
+ assert(props.apiToken, "apiToken is required");
36
+ const previewToken = useWorker({
37
+ name: props.name,
38
+ bundle: props.bundle,
39
+ format: props.format,
40
+ modules: props.bundle ? props.bundle.modules : [],
41
+ accountId: props.accountId,
42
+ apiToken: props.apiToken,
43
+ bindings: props.bindings,
44
+ assetPaths: props.assetPaths,
45
+ port: props.port,
46
+ compatibilityDate: props.compatibilityDate,
47
+ compatibilityFlags: props.compatibilityFlags,
48
+ usageModel: props.usageModel,
49
+ env: props.env,
50
+ legacyEnv: props.legacyEnv,
51
+ zone: props.zone,
52
+ });
53
+
54
+ usePreviewServer({
55
+ previewToken,
56
+ publicRoot: props.public,
57
+ localProtocol: props.localProtocol,
58
+ localPort: props.port,
59
+ ip: props.ip,
60
+ });
61
+
62
+ useInspector({
63
+ inspectorUrl: previewToken ? previewToken.inspectorUrl.href : undefined,
64
+ port: props.inspectorPort,
65
+ logToTerminal: true,
66
+ });
67
+ return null;
68
+ }
69
+
70
+ export function useWorker(props: {
71
+ name: string | undefined;
72
+ bundle: EsbuildBundle | undefined;
73
+ format: CfScriptFormat | undefined;
74
+ modules: CfModule[];
75
+ accountId: string;
76
+ apiToken: string;
77
+ bindings: CfWorkerInit["bindings"];
78
+ assetPaths: undefined | AssetPaths;
79
+ port: number;
80
+ compatibilityDate: string | undefined;
81
+ compatibilityFlags: string[] | undefined;
82
+ usageModel: undefined | "bundled" | "unbound";
83
+ env: string | undefined;
84
+ legacyEnv: boolean | undefined;
85
+ zone: { id: string; host: string } | undefined;
86
+ }): CfPreviewToken | undefined {
87
+ const {
88
+ name,
89
+ bundle,
90
+ format,
91
+ modules,
92
+ accountId,
93
+ apiToken,
94
+ bindings,
95
+ assetPaths,
96
+ compatibilityDate,
97
+ compatibilityFlags,
98
+ usageModel,
99
+ port,
100
+ } = props;
101
+ const [token, setToken] = useState<CfPreviewToken | undefined>();
102
+
103
+ // This is the most reliable way to detect whether
104
+ // something's "happened" in our system; We make a ref and
105
+ // mark it once we log our initial message. Refs are vars!
106
+ const startedRef = useRef(false);
107
+
108
+ useEffect(() => {
109
+ async function start() {
110
+ setToken(undefined); // reset token in case we're re-running
111
+
112
+ if (!bundle || !format) return;
113
+
114
+ if (!startedRef.current) {
115
+ startedRef.current = true;
116
+ } else {
117
+ console.log("⎔ Detected changes, restarted server.");
118
+ }
119
+
120
+ const assets = await syncAssets(
121
+ accountId,
122
+ // When we're using the newer service environments, we wouldn't
123
+ // have added the env name on to the script name. However, we must
124
+ // include it in the kv namespace name regardless (since there's no
125
+ // concept of service environments for kv namespaces yet).
126
+ name + (!props.legacyEnv && props.env ? `-${props.env}` : ""),
127
+ assetPaths,
128
+ true
129
+ ); // TODO: cancellable?
130
+
131
+ const content = await readFile(bundle.path, "utf-8");
132
+
133
+ const init: CfWorkerInit = {
134
+ name,
135
+ main: {
136
+ name: path.basename(bundle.path),
137
+ type: format === "modules" ? "esm" : "commonjs",
138
+ content,
139
+ },
140
+ modules: modules.concat(
141
+ assets.manifest
142
+ ? {
143
+ name: "__STATIC_CONTENT_MANIFEST",
144
+ content: JSON.stringify(assets.manifest),
145
+ type: "text",
146
+ }
147
+ : []
148
+ ),
149
+ bindings: {
150
+ ...bindings,
151
+ kv_namespaces: (bindings.kv_namespaces || []).concat(
152
+ assets.namespace
153
+ ? { binding: "__STATIC_CONTENT", id: assets.namespace }
154
+ : []
155
+ ),
156
+ text_blobs: {
157
+ ...bindings.text_blobs,
158
+ ...(assets.manifest &&
159
+ format === "service-worker" && {
160
+ __STATIC_CONTENT_MANIFEST: "__STATIC_CONTENT_MANIFEST",
161
+ }),
162
+ },
163
+ },
164
+ migrations: undefined, // no migrations in dev
165
+ compatibility_date: compatibilityDate,
166
+ compatibility_flags: compatibilityFlags,
167
+ usage_model: usageModel,
168
+ };
169
+ setToken(
170
+ await createWorkerPreview(
171
+ init,
172
+ {
173
+ accountId,
174
+ apiToken,
175
+ },
176
+ { env: props.env, legacyEnv: props.legacyEnv, zone: props.zone }
177
+ )
178
+ );
179
+ }
180
+ start().catch((err) => {
181
+ // we want to log the error, but not end the process
182
+ // since it could recover after the developer fixes whatever's wrong
183
+ console.error("remote worker:", err);
184
+ });
185
+ }, [
186
+ name,
187
+ bundle,
188
+ format,
189
+ accountId,
190
+ apiToken,
191
+ port,
192
+ assetPaths,
193
+ compatibilityDate,
194
+ compatibilityFlags,
195
+ usageModel,
196
+ bindings,
197
+ modules,
198
+ props.env,
199
+ props.legacyEnv,
200
+ props.zone,
201
+ ]);
202
+ return token;
203
+ }
@@ -0,0 +1,100 @@
1
+ import assert from "node:assert";
2
+ import { useState, useEffect } from "react";
3
+ import { bundleWorker } from "../bundle";
4
+ import type { Config } from "../config";
5
+ import type { Entry } from "../entry";
6
+ import type { CfModule } from "../worker";
7
+ import type { WatchMode } from "esbuild";
8
+
9
+ export type EsbuildBundle = {
10
+ id: number;
11
+ path: string;
12
+ entry: Entry;
13
+ type: "esm" | "commonjs";
14
+ modules: CfModule[];
15
+ serveAssetsFromWorker: boolean;
16
+ };
17
+
18
+ export function useEsbuild({
19
+ entry,
20
+ destination,
21
+ staticRoot,
22
+ jsxFactory,
23
+ jsxFragment,
24
+ rules,
25
+ serveAssetsFromWorker,
26
+ }: {
27
+ entry: Entry;
28
+ destination: string | undefined;
29
+ staticRoot: undefined | string;
30
+ jsxFactory: string | undefined;
31
+ jsxFragment: string | undefined;
32
+ rules: Config["rules"];
33
+ serveAssetsFromWorker: boolean;
34
+ }): EsbuildBundle | undefined {
35
+ const [bundle, setBundle] = useState<EsbuildBundle>();
36
+ useEffect(() => {
37
+ let stopWatching: (() => void) | undefined = undefined;
38
+
39
+ const watchMode: WatchMode = {
40
+ async onRebuild(error) {
41
+ if (error) console.error("watch build failed:", error);
42
+ else {
43
+ // nothing really changes here, so let's increment the id
44
+ // to change the return object's identity
45
+ setBundle((previousBundle) => {
46
+ assert(
47
+ previousBundle,
48
+ "Rebuild triggered with no previous build available"
49
+ );
50
+ return { ...previousBundle, id: previousBundle.id + 1 };
51
+ });
52
+ }
53
+ },
54
+ };
55
+
56
+ async function build() {
57
+ if (!destination) return;
58
+
59
+ const { resolvedEntryPointPath, bundleType, modules, stop } =
60
+ await bundleWorker(entry, destination, {
61
+ // In dev, we serve assets from the local proxy before we send the request to the worker.
62
+ serveAssetsFromWorker: false,
63
+ jsxFactory,
64
+ jsxFragment,
65
+ rules,
66
+ watch: watchMode,
67
+ });
68
+
69
+ // Capture the `stop()` method to use as the `useEffect()` destructor.
70
+ stopWatching = stop;
71
+
72
+ setBundle({
73
+ id: 0,
74
+ entry,
75
+ path: resolvedEntryPointPath,
76
+ type: bundleType,
77
+ modules,
78
+ serveAssetsFromWorker,
79
+ });
80
+ }
81
+
82
+ build().catch(() => {
83
+ // esbuild already logs errors to stderr and we don't want to end the process
84
+ // on build errors anyway so this is a no-op error handler
85
+ });
86
+
87
+ return () => {
88
+ stopWatching?.();
89
+ };
90
+ }, [
91
+ entry,
92
+ destination,
93
+ staticRoot,
94
+ jsxFactory,
95
+ jsxFragment,
96
+ serveAssetsFromWorker,
97
+ rules,
98
+ ]);
99
+ return bundle;
100
+ }
package/src/dialogs.tsx CHANGED
@@ -1,7 +1,7 @@
1
- import * as React from "react";
2
- import { useState } from "react";
3
1
  import { Box, Text, useInput, render } from "ink";
4
2
  import TextInput from "ink-text-input";
3
+ import * as React from "react";
4
+ import { useState } from "react";
5
5
  type ConfirmProps = {
6
6
  text: string;
7
7
  onConfirm: (answer: boolean) => void;