rwsdk 0.1.18 → 0.1.19

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.
@@ -285,23 +285,52 @@ export async function runRelease(cwd, projectDir, resourceUniqueKey) {
285
285
  console.error(`Warning: Could not update wrangler.jsonc: ${error}`);
286
286
  }
287
287
  }
288
- // Run release command with our interactive $expect utility
289
- log("Running release command with interactive prompts");
290
- const result = await $expect("npm run release", [
291
- {
292
- // Make the pattern more flexible to account for potential whitespace differences
293
- expect: /Do you want to proceed with deployment\?\s*\(y\/N\)/i,
294
- send: "y\r",
295
- },
296
- ], {
297
- reject: false, // Add reject: false to prevent uncaught promise rejections
298
- env: {
299
- RWSDK_RENAME_WORKER: "1",
300
- RWSDK_RENAME_DB: "1",
301
- ...process.env,
302
- },
303
- cwd,
304
- });
288
+ // Run release command with our interactive $expect utility and retry logic
289
+ log("Running release command with interactive prompts and retries");
290
+ const MAX_RETRIES = 3;
291
+ let lastError = null;
292
+ let result = null;
293
+ for (let i = 0; i < MAX_RETRIES; i++) {
294
+ try {
295
+ console.log(`\nšŸš€ Deploying worker to Cloudflare (Attempt ${i + 1}/${MAX_RETRIES})...`);
296
+ result = await $expect("npm run release", [
297
+ {
298
+ // Make the pattern more flexible to account for potential whitespace differences
299
+ expect: /Do you want to proceed with deployment\?\s*\(y\/N\)/i,
300
+ send: "y\r",
301
+ },
302
+ ], {
303
+ reject: false, // Add reject: false to prevent uncaught promise rejections
304
+ env: {
305
+ RWSDK_RENAME_WORKER: "1",
306
+ RWSDK_RENAME_DB: "1",
307
+ ...process.env,
308
+ },
309
+ cwd,
310
+ });
311
+ // Check exit code to ensure command succeeded
312
+ if (result.code === 0) {
313
+ log(`Release command succeeded on attempt ${i + 1}`);
314
+ lastError = null; // Clear last error on success
315
+ break; // Exit the loop on success
316
+ }
317
+ else {
318
+ throw new Error(`Release command failed with exit code ${result.code}`);
319
+ }
320
+ }
321
+ catch (error) {
322
+ lastError = error;
323
+ log(`Attempt ${i + 1} failed: ${lastError.message}`);
324
+ if (i < MAX_RETRIES - 1) {
325
+ console.log(` Waiting 5 seconds before retrying...`);
326
+ await setTimeout(5000);
327
+ }
328
+ }
329
+ }
330
+ if (lastError || !result) {
331
+ log("ERROR: Release command failed after all retries.");
332
+ throw lastError || new Error("Release command failed after all retries.");
333
+ }
305
334
  // Check exit code to ensure command succeeded
306
335
  if (result.code !== 0) {
307
336
  // Add more contextual information about the error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,6 +12,13 @@
12
12
  "./dist",
13
13
  "./bin"
14
14
  ],
15
+ "scripts": {
16
+ "build": "tsc --build --clean && tsc",
17
+ "release": "./scripts/release.sh",
18
+ "test": "vitest --run",
19
+ "debug:sync": "tsx ./src/scripts/debug-sync.mts",
20
+ "smoke-test": "tsx ./src/scripts/smoke-test.mts"
21
+ },
15
22
  "exports": {
16
23
  "./vite": {
17
24
  "default": "./dist/vite/index.mjs",
@@ -152,6 +159,7 @@
152
159
  "peerDependencies": {
153
160
  "vite": "^6.2.6"
154
161
  },
162
+ "packageManager": "pnpm@9.14.4+sha512.c8180b3fbe4e4bca02c94234717896b5529740a6cbadf19fa78254270403ea2f27d4e1d46a08a0f56c89b63dc8ebfd3ee53326da720273794e6200fcf0d184ab",
155
163
  "devDependencies": {
156
164
  "@types/debug": "^4.1.12",
157
165
  "@types/lodash": "^4.17.16",
@@ -161,12 +169,5 @@
161
169
  "tsx": "^4.19.4",
162
170
  "typescript": "^5.8.3",
163
171
  "vitest": "^3.1.1"
164
- },
165
- "scripts": {
166
- "build": "tsc --build --clean && tsc",
167
- "release": "./scripts/release.sh",
168
- "test": "vitest --run",
169
- "debug:sync": "tsx ./src/scripts/debug-sync.mts",
170
- "smoke-test": "tsx ./src/scripts/smoke-test.mts"
171
172
  }
172
- }
173
+ }
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 RedwoodJS Inc
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.