rwsdk 1.0.0-beta.0 → 1.0.0-beta.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.
@@ -11,6 +11,19 @@ import { ROOT_DIR } from "../constants.mjs";
11
11
  import { retry } from "./retry.mjs";
12
12
  const log = debug("rwsdk:e2e:environment");
13
13
  const createSdkTarball = async () => {
14
+ const existingTarballPath = process.env.RWSKD_SMOKE_TEST_TARBALL_PATH;
15
+ if (existingTarballPath) {
16
+ if (!fs.existsSync(existingTarballPath)) {
17
+ throw new Error(`Provided tarball path does not exist: ${existingTarballPath}`);
18
+ }
19
+ log(`📦 Using existing tarball: ${existingTarballPath}`);
20
+ return {
21
+ tarballPath: existingTarballPath,
22
+ cleanupTarball: async () => {
23
+ /* no-op */
24
+ }, // No-op cleanup
25
+ };
26
+ }
14
27
  const packResult = await $({ cwd: ROOT_DIR, stdio: "pipe" }) `npm pack`;
15
28
  const tarballName = packResult.stdout?.trim();
16
29
  const tarballPath = path.join(ROOT_DIR, tarballName);
@@ -6,6 +6,30 @@ import { adjectives, animals, uniqueNamesGenerator, } from "unique-names-generat
6
6
  import { ROOT_DIR } from "../constants.mjs";
7
7
  import { copyProjectToTempDir } from "./environment.mjs";
8
8
  const log = (message) => console.log(message);
9
+ async function verifyPackedContents(targetDir) {
10
+ log(" - Verifying installed package contents...");
11
+ const packageName = "rwsdk";
12
+ const installedDistPath = path.join(targetDir, "node_modules", packageName, "dist");
13
+ if (!fs.existsSync(installedDistPath)) {
14
+ throw new Error(`dist/ directory not found in installed package at ${installedDistPath}.`);
15
+ }
16
+ const { stdout: originalDistChecksumOut } = await $("find . -type f | sort | md5sum", {
17
+ shell: true,
18
+ cwd: path.join(ROOT_DIR, "dist"),
19
+ });
20
+ const originalDistChecksum = originalDistChecksumOut.split(" ")[0];
21
+ const { stdout: installedDistChecksumOut } = await $("find . -type f | sort | md5sum", {
22
+ shell: true,
23
+ cwd: installedDistPath,
24
+ });
25
+ const installedDistChecksum = installedDistChecksumOut.split(" ")[0];
26
+ log(` - Original dist checksum: ${originalDistChecksum}`);
27
+ log(` - Installed dist checksum: ${installedDistChecksum}`);
28
+ if (originalDistChecksum !== installedDistChecksum) {
29
+ throw new Error("File list in installed dist/ does not match original dist/.");
30
+ }
31
+ log(" ✅ Installed package contents match the local build.");
32
+ }
9
33
  /**
10
34
  * Copies wrangler cache from monorepo to temp directory for deployment tests
11
35
  */
@@ -80,6 +104,7 @@ export async function setupTarballEnvironment({ projectDir, monorepoRoot, packag
80
104
  const resourceUniqueKey = `${uniqueNameSuffix}-${hash}`;
81
105
  try {
82
106
  const { tempDir, targetDir } = await copyProjectToTempDir(projectDir, resourceUniqueKey, packageManager, monorepoRoot);
107
+ await verifyPackedContents(targetDir);
83
108
  // Copy wrangler cache to improve deployment performance
84
109
  const sdkRoot = ROOT_DIR;
85
110
  await copyWranglerCache(targetDir, sdkRoot);
@@ -35,6 +35,9 @@ export const addon = async () => {
35
35
  console.error('Could not find "rwsdk" in your dependencies or devDependencies.');
36
36
  process.exit(1);
37
37
  }
38
+ if (/^\d/.test(rwsdkVersion)) {
39
+ rwsdkVersion = `v${rwsdkVersion}`;
40
+ }
38
41
  const tmpDirPrefix = path.join(os.tmpdir(), `rwsdk-addon-${addonName}-`);
39
42
  const tmpDir = await fs.mkdtemp(tmpDirPrefix);
40
43
  const downloadUrl = `https://github.com/redwoodjs/sdk/releases/download/${rwsdkVersion}/${addonName}-${rwsdkVersion}.tar.gz`;
@@ -66,12 +66,6 @@ if (fileURLToPath(import.meta.url) === process.argv[1]) {
66
66
  else if (arg === "--copy-project") {
67
67
  options.copyProject = true;
68
68
  }
69
- else if (arg === "--no-sync") {
70
- syncExplicit = false;
71
- }
72
- else if (arg === "--sync") {
73
- syncExplicit = true;
74
- }
75
69
  else if (arg === "--ci") {
76
70
  // Already handled above, just skip
77
71
  }
@@ -99,7 +93,6 @@ Options:
99
93
  --keep Keep temporary test directory after tests complete
100
94
  --no-headless Run browser tests with GUI (not headless)
101
95
  --sync Force syncing SDK code to test project
102
- --no-sync Disable syncing SDK code to test project
103
96
  --ci Run in CI mode (keeps temp dirs, sets headless)
104
97
  --bail Stop on first test failure
105
98
  --copy-project Copy the project to the artifacts directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {