@superblocksteam/sdk 2.0.41-next.53 → 2.0.41-next.7

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.
@@ -10,7 +10,6 @@ import { ddRumPlugin } from "./dev-utils/vite-plugin-dd-rum.mjs";
10
10
  import { getLogger } from "./telemetry/logging.js";
11
11
  import { generateBuildManifestPlugin } from "./vite-plugin-generate-build-manifest.mjs";
12
12
  import { injectSuperblocksIdsPlugin } from "./vite-plugin-inject-sb-ids-transform.mjs";
13
- import createLucideReactImportOptimizer from "./vite-plugin-optimize-lucide-imports.js";
14
13
 
15
14
  export async function buildApplication({
16
15
  root,
@@ -113,8 +112,8 @@ async function buildWithVite({
113
112
  customComponentsPlugin(),
114
113
  injectSuperblocksIdsPlugin(root),
115
114
  react(),
116
- createLucideReactImportOptimizer(),
117
115
  generateBuildManifestPlugin(root),
116
+
118
117
  ddRumPlugin({
119
118
  clientToken: ddClientToken ?? "",
120
119
  applicationId: ddApplicationId ?? "",
package/src/client.ts CHANGED
@@ -28,7 +28,6 @@ import { AgentType } from "./types/index.js";
28
28
  import { getAgentUrl } from "./utils.js";
29
29
  import {
30
30
  DEFAULT_BRANCH,
31
- findGitRepositoryRoot,
32
31
  getCurrentGitBranchIfGit,
33
32
  } from "./version-control.mjs";
34
33
  import type { StdISocketRPCClient } from "./socket/index.js";
@@ -328,24 +327,9 @@ export async function fetchApplication({
328
327
  return data;
329
328
  } catch (e) {
330
329
  if (axios.isAxiosError(e) && e.response?.status === 404) {
331
- let errorMessage = `Application ${applicationId} was not found on branch '${branch}'. `;
332
-
333
- // Try to get the actual current branch to provide more helpful context
334
- try {
335
- const [actualBranch, gitRoot] = await Promise.all([
336
- getCurrentGitBranchIfGit(),
337
- findGitRepositoryRoot(),
338
- ]);
339
- if (actualBranch && gitRoot) {
340
- errorMessage += `You are currently on branch '${actualBranch}' in a git repository at '${gitRoot}'. `;
341
- }
342
- } catch {
343
- // Ignore errors getting current branch
344
- }
345
-
346
- errorMessage +=
347
- "Are you sure you are on the correct application and branch?";
348
- throw new NotFoundError(errorMessage);
330
+ throw new NotFoundError(
331
+ `Application ${applicationId} was not found with branch ${branch}, are you sure you are on the correct application and branch?`,
332
+ );
349
333
  }
350
334
  throw new Error(
351
335
  `Could not fetch application: ${
@@ -13,7 +13,6 @@ import pkg from "../../package.json" with { type: "json" };
13
13
  import { getTracer } from "../telemetry/index.js";
14
14
  import { getErrorMeta, getLogger } from "../telemetry/logging.js";
15
15
  import { getCurrentGitBranchIfGit } from "../version-control.mjs";
16
- import createLucideReactImportOptimizer from "../vite-plugin-optimize-lucide-imports.js";
17
16
  import {
18
17
  customComponentsPlugin,
19
18
  isCustomComponentsEnabled,
@@ -212,11 +211,11 @@ export async function createDevServer({
212
211
  req.headers["x-superblocks-branch"] !== currentBranch
213
212
  ) {
214
213
  logger.error(
215
- `Dev server expects branch ${currentBranch}, but received ${req.headers["x-superblocks-branch"]}. Check your current branch with 'git branch' and try again.`,
214
+ `Branch header mismatch, expected ${currentBranch}, received ${req.headers["x-superblocks-branch"]}`,
216
215
  );
217
216
  res.status(401).send(
218
217
  JSON.stringify({
219
- error: `Dev server expects branch ${currentBranch}, but received ${req.headers["x-superblocks-branch"]}. Check your current branch with 'git branch' and try again.`,
218
+ error: `Branch header mismatch. Expected ${currentBranch}, received ${req.headers["x-superblocks-branch"]}`,
220
219
  }),
221
220
  );
222
221
  return;
@@ -482,6 +481,7 @@ async function startVite({
482
481
  fileSyncPluginCreator.plugin,
483
482
  // Add a virtual "stub" module for the build manifest
484
483
  buildManifestStubPlugin(),
484
+
485
485
  react({
486
486
  babel: {
487
487
  plugins: [
@@ -494,7 +494,6 @@ async function startVite({
494
494
  ],
495
495
  },
496
496
  }),
497
- createLucideReactImportOptimizer(),
498
497
  ddRumPlugin({
499
498
  clientToken: env.SUPERBLOCKS_LIBRARY_DD_CLIENT_TOKEN ?? "",
500
499
  applicationId: env.SUPERBLOCKS_LIBRARY_DD_APPLICATION_ID ?? "",
@@ -1033,19 +1033,6 @@ export async function getLocalGitRepoState(
1033
1033
  };
1034
1034
  }
1035
1035
 
1036
- /**
1037
- * Returns the root directory of the git repository, or null if not in a git repo
1038
- */
1039
- export async function findGitRepositoryRoot(): Promise<string | null> {
1040
- const git: SimpleGit = simpleGit();
1041
- try {
1042
- const rootDir = await git.revparse(["--show-toplevel"]);
1043
- return rootDir.trim();
1044
- } catch {
1045
- return null;
1046
- }
1047
- }
1048
-
1049
1036
  /**
1050
1037
  * Returns the current git branch, or undefined if not in a git repo
1051
1038
  */