rafters 0.0.67 → 0.0.68

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30971,7 +30971,7 @@ function studioApiPlugin() {
30971
30971
  client.send("rafters:token-updated", { ok: false, error: String(error47) });
30972
30972
  }
30973
30973
  });
30974
- server.middlewares.use((req, res, next) => {
30974
+ server.middlewares.use(async (req, res, next) => {
30975
30975
  let pathname;
30976
30976
  try {
30977
30977
  pathname = new URL(req.url ?? "", "http://localhost").pathname;
@@ -31047,13 +31047,16 @@ function studioApiPlugin() {
31047
31047
  return;
31048
31048
  }
31049
31049
  if (req.method === "POST") {
31050
- handlePostToken(req, res, name, registry2).catch((error47) => {
31050
+ try {
31051
+ await handlePostToken(req, res, name, registry2);
31052
+ if (res.statusCode < 400) await persistAndNotify();
31053
+ } catch (error47) {
31051
31054
  console.log(`[rafters] Unhandled error in POST /api/tokens/${name}: ${error47}`);
31052
31055
  if (!res.headersSent) {
31053
31056
  res.statusCode = 500;
31054
31057
  res.end(JSON.stringify({ ok: false, error: "Internal server error" }));
31055
31058
  }
31056
- });
31059
+ }
31057
31060
  return;
31058
31061
  }
31059
31062
  const token = registry2.get(name);
@@ -31092,13 +31095,16 @@ function studioApiPlugin() {
31092
31095
  return;
31093
31096
  }
31094
31097
  if (req.method === "POST") {
31095
- handlePostTokens(req, res, registry2).catch((error47) => {
31098
+ try {
31099
+ await handlePostTokens(req, res, registry2);
31100
+ if (res.statusCode < 400) await persistAndNotify();
31101
+ } catch (error47) {
31096
31102
  console.log(`[rafters] Unhandled error in POST /api/tokens: ${error47}`);
31097
31103
  if (!res.headersSent) {
31098
31104
  res.statusCode = 500;
31099
31105
  res.end(JSON.stringify({ ok: false, error: "Internal server error" }));
31100
31106
  }
31101
- });
31107
+ }
31102
31108
  return;
31103
31109
  }
31104
31110
  handleGetTokens(req.url ?? "", res, registry2, initialized);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rafters",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "description": "Design Intelligence CLI. Scaffold tokens, import existing shadcn/Tailwind v4 sources, add components, and serve an MCP server so AI agents read decisions instead of guessing.",
5
5
  "homepage": "https://rafters.studio",
6
6
  "license": "MIT",