rafters 0.0.25 → 0.0.26

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 +25 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -61341,6 +61341,31 @@ function studioApiPlugin() {
61341
61341
  next();
61342
61342
  return;
61343
61343
  }
61344
+ if ((pathname === "/api/" || pathname === "/api") && req.method === "GET") {
61345
+ res.setHeader("Content-Type", "application/json");
61346
+ res.end(
61347
+ JSON.stringify({
61348
+ name: "Rafters Studio API",
61349
+ initialized,
61350
+ tokenCount: registry2.list().length,
61351
+ rules: {
61352
+ whyGate: "Every POST to /api/tokens/:name requires userOverride.reason.",
61353
+ gets: "Returns full Token with all intelligence metadata.",
61354
+ sets: "Value + reason in. API fills the Token shape. CSS updates via HMR.",
61355
+ colors: "POST /api/color/build with OKLCH to get a ColorValue."
61356
+ },
61357
+ endpoints: {
61358
+ "GET /api/tokens": "All tokens (optional ?namespace= filter)",
61359
+ "GET /api/tokens/:name": "One token with full data",
61360
+ "POST /api/tokens/:name": "Update token (namespace-validated patch)",
61361
+ "POST /api/tokens": "Batch update tokens",
61362
+ "POST /api/color/build": "OKLCH -> full ColorValue",
61363
+ "POST /api/shutdown": "Gracefully stop the studio"
61364
+ }
61365
+ })
61366
+ );
61367
+ return;
61368
+ }
61344
61369
  if (pathname === "/api/shutdown" && req.method === "POST") {
61345
61370
  res.setHeader("Content-Type", "application/json");
61346
61371
  res.end(JSON.stringify({ ok: true, message: "Shutting down" }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rafters",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "CLI for Rafters design system - scaffold tokens and add components",
5
5
  "license": "MIT",
6
6
  "type": "module",