@package-broker/cloudflare 0.10.4
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/README.md +95 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +784 -0
- package/dist/index.js.map +1 -0
- package/dist/paths.d.ts +14 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +80 -0
- package/dist/paths.js.map +1 -0
- package/dist/template.d.ts +18 -0
- package/dist/template.d.ts.map +1 -0
- package/dist/template.js +114 -0
- package/dist/template.js.map +1 -0
- package/dist/wrangler-config.d.ts +120 -0
- package/dist/wrangler-config.d.ts.map +1 -0
- package/dist/wrangler-config.js +295 -0
- package/dist/wrangler-config.js.map +1 -0
- package/dist/wrangler.d.ts +90 -0
- package/dist/wrangler.d.ts.map +1 -0
- package/dist/wrangler.js +470 -0
- package/dist/wrangler.js.map +1 -0
- package/package.json +42 -0
package/dist/wrangler.js
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* PACKAGE.broker - Cloudflare CLI - Wrangler Utilities
|
|
4
|
+
* Copyright (C) 2025 Łukasz Bajsarowicz
|
|
5
|
+
* Licensed under AGPL-3.0
|
|
6
|
+
*/
|
|
7
|
+
import { execa } from 'execa';
|
|
8
|
+
import { existsSync } from 'fs';
|
|
9
|
+
import { join, dirname } from 'path';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = dirname(__filename);
|
|
13
|
+
/**
|
|
14
|
+
* Build environment variables for wrangler execution
|
|
15
|
+
* Uses explicit options, falls back to process.env
|
|
16
|
+
*/
|
|
17
|
+
function buildWranglerEnv(options) {
|
|
18
|
+
const env = { ...process.env };
|
|
19
|
+
// Explicit options take precedence
|
|
20
|
+
if (options?.apiToken) {
|
|
21
|
+
env.CLOUDFLARE_API_TOKEN = options.apiToken;
|
|
22
|
+
}
|
|
23
|
+
if (options?.accountId) {
|
|
24
|
+
env.CLOUDFLARE_ACCOUNT_ID = options.accountId;
|
|
25
|
+
}
|
|
26
|
+
return env;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the wrangler binary path
|
|
30
|
+
* Priority:
|
|
31
|
+
* 1. Local node_modules/.bin/wrangler in the target directory
|
|
32
|
+
* 2. CLI package's own node_modules/.bin/wrangler
|
|
33
|
+
* 3. null (will use npx --no-install)
|
|
34
|
+
*/
|
|
35
|
+
function resolveWranglerBinary(cwd) {
|
|
36
|
+
const binName = process.platform === 'win32' ? 'wrangler.cmd' : 'wrangler';
|
|
37
|
+
// Try target directory's node_modules
|
|
38
|
+
if (cwd) {
|
|
39
|
+
const localBin = join(cwd, 'node_modules', '.bin', binName);
|
|
40
|
+
if (existsSync(localBin)) {
|
|
41
|
+
return localBin;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Try CLI package's own node_modules
|
|
45
|
+
const cliPackageBin = join(__dirname, '..', 'node_modules', '.bin', binName);
|
|
46
|
+
if (existsSync(cliPackageBin)) {
|
|
47
|
+
return cliPackageBin;
|
|
48
|
+
}
|
|
49
|
+
// Try monorepo structure (development)
|
|
50
|
+
const monorepoRoot = join(__dirname, '..', '..', '..', 'node_modules', '.bin', binName);
|
|
51
|
+
if (existsSync(monorepoRoot)) {
|
|
52
|
+
return monorepoRoot;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Execute a wrangler command and return the output
|
|
58
|
+
* Prefers local wrangler binary, falls back to npx --no-install
|
|
59
|
+
*/
|
|
60
|
+
async function execWrangler(args, options) {
|
|
61
|
+
const env = buildWranglerEnv(options);
|
|
62
|
+
const cwd = options?.cwd || process.cwd();
|
|
63
|
+
// Add config path if provided
|
|
64
|
+
const fullArgs = [...args];
|
|
65
|
+
if (options?.configPath) {
|
|
66
|
+
fullArgs.push('--config', options.configPath);
|
|
67
|
+
}
|
|
68
|
+
// Try to find local wrangler binary
|
|
69
|
+
const wranglerBin = resolveWranglerBinary(cwd);
|
|
70
|
+
try {
|
|
71
|
+
let result;
|
|
72
|
+
if (wranglerBin) {
|
|
73
|
+
// Use local wrangler binary
|
|
74
|
+
result = await execa(wranglerBin, fullArgs, {
|
|
75
|
+
cwd,
|
|
76
|
+
env,
|
|
77
|
+
stdio: 'pipe',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Fall back to npx --no-install (won't auto-install)
|
|
82
|
+
result = await execa('npx', ['--no-install', 'wrangler', ...fullArgs], {
|
|
83
|
+
cwd,
|
|
84
|
+
env,
|
|
85
|
+
stdio: 'pipe',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return { stdout: result.stdout, stderr: result.stderr };
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
const execaError = error;
|
|
92
|
+
if (execaError.stdout || execaError.stderr) {
|
|
93
|
+
return { stdout: execaError.stdout || '', stderr: execaError.stderr || '' };
|
|
94
|
+
}
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Execute wrangler with stdin input
|
|
100
|
+
*/
|
|
101
|
+
async function execWranglerWithInput(args, input, options) {
|
|
102
|
+
const env = buildWranglerEnv(options);
|
|
103
|
+
const cwd = options?.cwd || process.cwd();
|
|
104
|
+
// Add config path if provided
|
|
105
|
+
const fullArgs = [...args];
|
|
106
|
+
if (options?.configPath) {
|
|
107
|
+
fullArgs.push('--config', options.configPath);
|
|
108
|
+
}
|
|
109
|
+
// Try to find local wrangler binary
|
|
110
|
+
const wranglerBin = resolveWranglerBinary(cwd);
|
|
111
|
+
try {
|
|
112
|
+
let result;
|
|
113
|
+
if (wranglerBin) {
|
|
114
|
+
result = await execa(wranglerBin, fullArgs, {
|
|
115
|
+
cwd,
|
|
116
|
+
env,
|
|
117
|
+
input,
|
|
118
|
+
stdio: 'pipe',
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
result = await execa('npx', ['--no-install', 'wrangler', ...fullArgs], {
|
|
123
|
+
cwd,
|
|
124
|
+
env,
|
|
125
|
+
input,
|
|
126
|
+
stdio: 'pipe',
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return { stdout: result.stdout, stderr: result.stderr };
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
const execaError = error;
|
|
133
|
+
if (execaError.stdout || execaError.stderr) {
|
|
134
|
+
return { stdout: execaError.stdout || '', stderr: execaError.stderr || '' };
|
|
135
|
+
}
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Check if user is authenticated with wrangler
|
|
141
|
+
* Supports both interactive (wrangler login) and CI (API token) authentication
|
|
142
|
+
*/
|
|
143
|
+
export async function checkAuth(options) {
|
|
144
|
+
try {
|
|
145
|
+
const { stdout } = await execWrangler(['whoami'], options);
|
|
146
|
+
// Check for common success patterns
|
|
147
|
+
return (stdout.includes('@') ||
|
|
148
|
+
stdout.includes('Account ID') ||
|
|
149
|
+
stdout.includes('You are logged in') ||
|
|
150
|
+
stdout.length > 0);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Verify that the API token has required permissions
|
|
158
|
+
* Checks by attempting to list resources
|
|
159
|
+
*/
|
|
160
|
+
export async function verifyTokenPermissions(options) {
|
|
161
|
+
const errors = [];
|
|
162
|
+
// Check D1 access
|
|
163
|
+
try {
|
|
164
|
+
const { stderr } = await execWrangler(['d1', 'list'], options);
|
|
165
|
+
if (stderr.includes('permission') || stderr.includes('unauthorized')) {
|
|
166
|
+
errors.push('D1 Database: Missing permission');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
errors.push('D1 Database: Unable to verify access');
|
|
171
|
+
}
|
|
172
|
+
// Check KV access
|
|
173
|
+
try {
|
|
174
|
+
const { stderr } = await execWrangler(['kv', 'namespace', 'list'], options);
|
|
175
|
+
if (stderr.includes('permission') || stderr.includes('unauthorized')) {
|
|
176
|
+
errors.push('KV Namespace: Missing permission');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
errors.push('KV Namespace: Unable to verify access');
|
|
181
|
+
}
|
|
182
|
+
// Check R2 access
|
|
183
|
+
try {
|
|
184
|
+
const { stderr } = await execWrangler(['r2', 'bucket', 'list'], options);
|
|
185
|
+
if (stderr.includes('permission') || stderr.includes('unauthorized')) {
|
|
186
|
+
errors.push('R2 Bucket: Missing permission');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
errors.push('R2 Bucket: Unable to verify access');
|
|
191
|
+
}
|
|
192
|
+
// Check Queue access (paid tier only)
|
|
193
|
+
if (options?.paidTier) {
|
|
194
|
+
try {
|
|
195
|
+
const { stderr } = await execWrangler(['queues', 'list'], options);
|
|
196
|
+
if (stderr.includes('permission') || stderr.includes('unauthorized')) {
|
|
197
|
+
errors.push('Queue: Missing permission');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
errors.push('Queue: Unable to verify access');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
valid: errors.length === 0,
|
|
206
|
+
errors,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Create a D1 database and return its ID
|
|
211
|
+
*/
|
|
212
|
+
export async function createD1Database(name, options) {
|
|
213
|
+
const { stdout, stderr } = await execWrangler(['d1', 'create', name], options);
|
|
214
|
+
// Try to parse JSON output first
|
|
215
|
+
try {
|
|
216
|
+
const json = JSON.parse(stdout);
|
|
217
|
+
if (json.database_id) {
|
|
218
|
+
return json.database_id;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
// Not JSON, parse text output
|
|
223
|
+
}
|
|
224
|
+
// Parse text output: "database_id = "abc123...""
|
|
225
|
+
const dbIdMatch = stdout.match(/database_id\s*=\s*["']?([a-f0-9-]+)["']?/i) ||
|
|
226
|
+
stdout.match(/"database_id":\s*"([a-f0-9-]+)"/i) ||
|
|
227
|
+
stderr.match(/database_id\s*=\s*["']?([a-f0-9-]+)["']?/i);
|
|
228
|
+
if (dbIdMatch && dbIdMatch[1]) {
|
|
229
|
+
return dbIdMatch[1];
|
|
230
|
+
}
|
|
231
|
+
throw new Error(`Failed to parse D1 database ID from output: ${stdout}\n${stderr}`);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* List existing D1 databases and find by name
|
|
235
|
+
*/
|
|
236
|
+
export async function findD1Database(name, options) {
|
|
237
|
+
try {
|
|
238
|
+
const { stdout } = await execWrangler(['d1', 'list'], options);
|
|
239
|
+
// Parse JSON or text output
|
|
240
|
+
let databases = [];
|
|
241
|
+
try {
|
|
242
|
+
const json = JSON.parse(stdout);
|
|
243
|
+
databases = Array.isArray(json) ? json : json.result || [];
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
// Parse text output line by line
|
|
247
|
+
const lines = stdout.split('\n');
|
|
248
|
+
for (const line of lines) {
|
|
249
|
+
if (line.includes(name)) {
|
|
250
|
+
const idMatch = line.match(/([a-f0-9-]{32,})/i);
|
|
251
|
+
if (idMatch) {
|
|
252
|
+
return idMatch[1];
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const db = databases.find((d) => d.database_name === name);
|
|
258
|
+
return db?.database_id || null;
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Create a KV namespace and return its ID
|
|
266
|
+
*/
|
|
267
|
+
export async function createKVNamespace(name, options) {
|
|
268
|
+
const { stdout, stderr } = await execWrangler(['kv', 'namespace', 'create', name], options);
|
|
269
|
+
// Parse output: "id = "abc123...""
|
|
270
|
+
const idMatch = stdout.match(/id\s*=\s*["']?([a-f0-9]{32})["']?/i) ||
|
|
271
|
+
stdout.match(/"id":\s*"([a-f0-9]{32})"/i) ||
|
|
272
|
+
stderr.match(/id\s*=\s*["']?([a-f0-9]{32})["']?/i);
|
|
273
|
+
if (idMatch && idMatch[1]) {
|
|
274
|
+
return idMatch[1];
|
|
275
|
+
}
|
|
276
|
+
throw new Error(`Failed to parse KV namespace ID from output: ${stdout}\n${stderr}`);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* List existing KV namespaces and find by title
|
|
280
|
+
*/
|
|
281
|
+
export async function findKVNamespace(title, options) {
|
|
282
|
+
try {
|
|
283
|
+
const { stdout } = await execWrangler(['kv', 'namespace', 'list'], options);
|
|
284
|
+
try {
|
|
285
|
+
const json = JSON.parse(stdout);
|
|
286
|
+
const namespaces = Array.isArray(json) ? json : json.result || [];
|
|
287
|
+
const ns = namespaces.find((n) => n.title === title);
|
|
288
|
+
return ns?.id || null;
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
// Parse text output
|
|
292
|
+
const lines = stdout.split('\n');
|
|
293
|
+
for (const line of lines) {
|
|
294
|
+
if (line.includes(title)) {
|
|
295
|
+
const idMatch = line.match(/([a-f0-9]{32})/);
|
|
296
|
+
if (idMatch) {
|
|
297
|
+
return idMatch[1];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Create an R2 bucket
|
|
310
|
+
*/
|
|
311
|
+
export async function createR2Bucket(name, options) {
|
|
312
|
+
const { stdout, stderr } = await execWrangler(['r2', 'bucket', 'create', name], options);
|
|
313
|
+
// Check for errors (bucket might already exist)
|
|
314
|
+
if (stderr && !stderr.includes('already exists') && !stdout.includes('Created')) {
|
|
315
|
+
throw new Error(`Failed to create R2 bucket: ${stderr || stdout}`);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Check if R2 bucket exists
|
|
320
|
+
*/
|
|
321
|
+
export async function findR2Bucket(name, options) {
|
|
322
|
+
try {
|
|
323
|
+
const { stdout } = await execWrangler(['r2', 'bucket', 'list'], options);
|
|
324
|
+
try {
|
|
325
|
+
const json = JSON.parse(stdout);
|
|
326
|
+
const buckets = Array.isArray(json) ? json : json.result || [];
|
|
327
|
+
return buckets.some((b) => b.name === name);
|
|
328
|
+
}
|
|
329
|
+
catch {
|
|
330
|
+
// Parse text output
|
|
331
|
+
return stdout.includes(name);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Create a Queue
|
|
340
|
+
*/
|
|
341
|
+
export async function createQueue(name, options) {
|
|
342
|
+
const { stdout, stderr } = await execWrangler(['queues', 'create', name], options);
|
|
343
|
+
if (stderr && !stderr.includes('already exists') && !stdout.includes('Created')) {
|
|
344
|
+
throw new Error(`Failed to create Queue: ${stderr || stdout}`);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Check if Queue exists
|
|
349
|
+
*/
|
|
350
|
+
export async function findQueue(name, options) {
|
|
351
|
+
try {
|
|
352
|
+
const { stdout } = await execWrangler(['queues', 'list'], options);
|
|
353
|
+
try {
|
|
354
|
+
const json = JSON.parse(stdout);
|
|
355
|
+
const queues = Array.isArray(json) ? json : json.result || [];
|
|
356
|
+
return queues.some((q) => q.name === name);
|
|
357
|
+
}
|
|
358
|
+
catch {
|
|
359
|
+
return stdout.includes(name);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
catch {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Set a Cloudflare Worker secret
|
|
368
|
+
*/
|
|
369
|
+
export async function setSecret(secretName, secretValue, options) {
|
|
370
|
+
// Build wrangler command with --name if worker name is provided
|
|
371
|
+
const args = ['secret', 'put', secretName];
|
|
372
|
+
if (options?.workerName) {
|
|
373
|
+
args.push('--name', options.workerName);
|
|
374
|
+
}
|
|
375
|
+
// wrangler secret put reads from stdin
|
|
376
|
+
const { stderr, stdout } = await execWranglerWithInput(args, secretValue + '\n', options);
|
|
377
|
+
// Check for success indicators
|
|
378
|
+
const output = (stdout + stderr).toLowerCase();
|
|
379
|
+
if (!output.includes('created') &&
|
|
380
|
+
!output.includes('updated') &&
|
|
381
|
+
!output.includes('enter the secret value') &&
|
|
382
|
+
!output.includes('successfully')) {
|
|
383
|
+
// If there's actual error content, throw
|
|
384
|
+
if (stderr && stderr.trim().length > 0 && !stderr.includes('Enter')) {
|
|
385
|
+
throw new Error(`Failed to set secret ${secretName}: ${stderr}`);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Apply D1 migrations
|
|
391
|
+
*/
|
|
392
|
+
export async function applyMigrations(databaseName, migrationsDir, options) {
|
|
393
|
+
const args = ['d1', 'migrations', 'apply', databaseName];
|
|
394
|
+
if (options?.remote !== false) {
|
|
395
|
+
args.push('--remote');
|
|
396
|
+
}
|
|
397
|
+
const { stdout, stderr } = await execWrangler(args, options);
|
|
398
|
+
if (stderr && !stderr.includes('Applied') && !stdout.includes('Applied')) {
|
|
399
|
+
// Check if migrations were already applied or if it's a duplicate column error (safe to ignore)
|
|
400
|
+
const isAlreadyApplied = stderr.includes('already applied') || stdout.includes('already applied');
|
|
401
|
+
const isDuplicateColumn = stderr.includes('duplicate column') || stdout.includes('duplicate column');
|
|
402
|
+
if (!isAlreadyApplied && !isDuplicateColumn) {
|
|
403
|
+
throw new Error(`Failed to apply migrations: ${stderr || stdout}`);
|
|
404
|
+
}
|
|
405
|
+
// Log warning for duplicate column (migration conflict, but safe)
|
|
406
|
+
if (isDuplicateColumn) {
|
|
407
|
+
console.warn('⚠️ Some migrations may have already been applied (duplicate column detected). This is safe to ignore.');
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Get account subdomain from wrangler whoami
|
|
413
|
+
*/
|
|
414
|
+
async function getAccountSubdomain(options) {
|
|
415
|
+
try {
|
|
416
|
+
const { stdout } = await execWrangler(['whoami'], options);
|
|
417
|
+
// Extract subdomain from whoami output (format: "lukasz-bajsarowicz" or similar)
|
|
418
|
+
const subdomainMatch = stdout.match(/@([\w-]+)/);
|
|
419
|
+
if (subdomainMatch) {
|
|
420
|
+
return subdomainMatch[1];
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
catch {
|
|
424
|
+
// Ignore errors, return null
|
|
425
|
+
}
|
|
426
|
+
return null;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Deploy a Worker
|
|
430
|
+
*/
|
|
431
|
+
export async function deployWorker(options) {
|
|
432
|
+
const { stdout, stderr } = await execWrangler(['deploy'], options);
|
|
433
|
+
// Check for deployment errors
|
|
434
|
+
if (stderr && !stderr.includes('Successfully') && !stderr.includes('deployed')) {
|
|
435
|
+
const errorMatch = stderr.match(/\[ERROR\][^\n]+/);
|
|
436
|
+
if (errorMatch) {
|
|
437
|
+
throw new Error(`Deployment failed: ${errorMatch[0]}`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
// Extract deployment URL from output - try multiple patterns
|
|
441
|
+
// Pattern 1: https://worker-name.subdomain.workers.dev
|
|
442
|
+
let urlMatch = stdout.match(/https:\/\/[\w-]+\.workers\.dev/i) ||
|
|
443
|
+
stdout.match(/https:\/\/[\w.-]+\.workers\.dev/i);
|
|
444
|
+
// Pattern 2: deployed to https://...
|
|
445
|
+
if (!urlMatch) {
|
|
446
|
+
urlMatch = stdout.match(/deployed to (https:\/\/[\w.-]+\.workers\.dev)/i);
|
|
447
|
+
if (urlMatch) {
|
|
448
|
+
urlMatch = [urlMatch[1]];
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
// Pattern 3: https://...workers.dev (any format)
|
|
452
|
+
if (!urlMatch) {
|
|
453
|
+
urlMatch = stdout.match(/(https:\/\/[^\s]+\.workers\.dev)/i);
|
|
454
|
+
}
|
|
455
|
+
if (urlMatch && urlMatch[0]) {
|
|
456
|
+
return urlMatch[0];
|
|
457
|
+
}
|
|
458
|
+
// Fallback: construct URL from worker name and account subdomain
|
|
459
|
+
if (options?.workerName) {
|
|
460
|
+
const subdomain = await getAccountSubdomain(options);
|
|
461
|
+
if (subdomain) {
|
|
462
|
+
return `https://${options.workerName}.${subdomain}.workers.dev`;
|
|
463
|
+
}
|
|
464
|
+
// If we can't get subdomain, try generic format
|
|
465
|
+
return `https://${options.workerName}.workers.dev`;
|
|
466
|
+
}
|
|
467
|
+
// Last resort: return placeholder
|
|
468
|
+
return 'https://your-worker.workers.dev';
|
|
469
|
+
}
|
|
470
|
+
//# sourceMappingURL=wrangler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrangler.js","sourceRoot":"","sources":["../src/wrangler.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AA8BtC;;;G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,CAAC;QAClE,CAAC;QACD,gDAAgD;QAChD,OAAO,WAAW,OAAO,CAAC,UAAU,cAAc,CAAC;IACrD,CAAC;IAED,kCAAkC;IAClC,OAAO,iCAAiC,CAAC;AAC3C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@package-broker/cloudflare",
|
|
3
|
+
"version": "0.10.4",
|
|
4
|
+
"description": "Interactive CLI tool for deploying PACKAGE.broker to Cloudflare Workers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"package-broker-cloudflare": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"package.json",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"lint": "echo 'no linting configured'",
|
|
16
|
+
"build": "tsc -p tsconfig.build.json",
|
|
17
|
+
"clean": "rm -rf dist",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@iarna/toml": "^3.0.0",
|
|
23
|
+
"@package-broker/main": "^0.10.0",
|
|
24
|
+
"execa": "^9.6.1",
|
|
25
|
+
"prompts": "^2.4.2",
|
|
26
|
+
"wrangler": "^4.14.1"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/iarna__toml": "^2.0.5",
|
|
30
|
+
"@types/node": "^20.19.27",
|
|
31
|
+
"@types/prompts": "^2.4.9",
|
|
32
|
+
"typescript": "^5.9.3"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/package-broker/server",
|
|
37
|
+
"directory": "packages/cloudflare"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
}
|
|
42
|
+
}
|