rwsdk 1.0.0-alpha.20-test.20250929174617 → 1.0.0-alpha.20-test.20250929182842

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.
@@ -7,26 +7,20 @@ import path from "node:path";
7
7
  import { Readable } from "node:stream";
8
8
  import { pipeline } from "node:stream/promises";
9
9
  async function getRwSdkProjectRootDir(cwd) {
10
- const pnpmWorkspaceYamlPath = await findUp("pnpm-workspace.yaml", { cwd });
11
- if (pnpmWorkspaceYamlPath) {
12
- return path.dirname(pnpmWorkspaceYamlPath);
13
- }
14
10
  const packageJsonPath = await findUp("package.json", { cwd });
15
11
  if (packageJsonPath) {
16
- const packageJsonContent = await fs.readFile(packageJsonPath, "utf-8");
17
- const packageJson = JSON.parse(packageJsonContent);
18
- if (packageJson.workspaces) {
19
- return path.dirname(packageJsonPath);
20
- }
12
+ return path.dirname(packageJsonPath);
21
13
  }
22
- // If not in a monorepo, assume the current directory is the project root
23
14
  return cwd;
24
15
  }
25
16
  export const addon = async () => {
26
- const addonName = process.argv[3];
27
- if (!addonName) {
17
+ const addonName = process.argv[2];
18
+ console.log(process.argv);
19
+ if (!addonName ||
20
+ process.argv.find((arg) => arg === "-h") ||
21
+ process.argv.find((arg) => arg === "--help")) {
28
22
  console.error("Please specify the addon name.");
29
- console.error("Usage: rw-scripts addon <addon-name>");
23
+ console.error(`Usage: npx rwsdk addon <addon-name>`);
30
24
  process.exit(1);
31
25
  }
32
26
  try {
@@ -34,7 +28,10 @@ export const addon = async () => {
34
28
  const packageJsonPath = path.resolve(projectRootDir, "package.json");
35
29
  const packageJsonContent = await fs.readFile(packageJsonPath, "utf-8");
36
30
  const { dependencies, devDependencies } = JSON.parse(packageJsonContent);
37
- const rwsdkVersion = dependencies?.rwsdk || devDependencies?.rwsdk;
31
+ let rwsdkVersion = dependencies?.rwsdk || devDependencies?.rwsdk;
32
+ if (rwsdkVersion === "workspace:*") {
33
+ throw new Error('The "rwsdk" dependency is set to "workspace:*". Please use a specific version of the SDK.');
34
+ }
38
35
  if (!rwsdkVersion) {
39
36
  console.error('Could not find "rwsdk" in your dependencies or devDependencies.');
40
37
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "1.0.0-alpha.20-test.20250929174617",
3
+ "version": "1.0.0-alpha.20-test.20250929182842",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {
@@ -166,7 +166,8 @@
166
166
  "ts-morph": "~27.0.0",
167
167
  "unique-names-generator": "~4.7.1",
168
168
  "vibe-rules": "~0.3.0",
169
- "vite-tsconfig-paths": "~5.1.4"
169
+ "vite-tsconfig-paths": "~5.1.4",
170
+ "decompress": "~4.2.1"
170
171
  },
171
172
  "peerDependencies": {
172
173
  "@cloudflare/vite-plugin": "^1.12.4",
@@ -184,7 +185,6 @@
184
185
  "@types/lodash": "~4.17.16",
185
186
  "@types/node": "~24.5.2",
186
187
  "@types/proper-lockfile": "~4.1.4",
187
- "decompress": "~4.2.1",
188
188
  "js-beautify": "~1.15.4",
189
189
  "semver": "~7.7.1",
190
190
  "tsx": "~4.20.0",