rafters 0.0.59 → 0.0.61

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 +18 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12688,8 +12688,8 @@ var RegistryClient = class {
12688
12688
  return item;
12689
12689
  }
12690
12690
  /**
12691
- * Fetch a registry item (component or primitive) by name
12692
- * Tries component first, then primitive
12691
+ * Fetch a registry item by name
12692
+ * Tries component, then primitive, then composite
12693
12693
  */
12694
12694
  async fetchItem(name) {
12695
12695
  try {
@@ -12699,7 +12699,11 @@ var RegistryClient = class {
12699
12699
  try {
12700
12700
  return await this.fetchPrimitive(name);
12701
12701
  } catch {
12702
- throw err;
12702
+ try {
12703
+ return await this.fetchComposite(name);
12704
+ } catch {
12705
+ throw err;
12706
+ }
12703
12707
  }
12704
12708
  }
12705
12709
  throw err;
@@ -13827,6 +13831,9 @@ async function add(componentArgs, options) {
13827
13831
  }
13828
13832
  components = installedNames;
13829
13833
  }
13834
+ if (folder === "composites" && components.length === 0) {
13835
+ components = ["composites"];
13836
+ }
13830
13837
  if (components.length === 0) {
13831
13838
  error46("No components specified. Usage: rafters add <component...>");
13832
13839
  process.exitCode = 1;
@@ -13844,9 +13851,15 @@ async function add(componentArgs, options) {
13844
13851
  try {
13845
13852
  if (folder === "composites") {
13846
13853
  if (!seen.has(itemName)) {
13847
- const item = await client.fetchComposite(itemName);
13854
+ const composite = await client.fetchComposite(itemName);
13848
13855
  seen.add(itemName);
13849
- allItems.push(item);
13856
+ allItems.push(composite);
13857
+ for (const dep of composite.primitives) {
13858
+ if (!seen.has(dep)) {
13859
+ const depItems = await client.resolveDependencies(dep, seen);
13860
+ allItems.push(...depItems);
13861
+ }
13862
+ }
13850
13863
  }
13851
13864
  } else {
13852
13865
  const items = await client.resolveDependencies(itemName, seen);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rafters",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
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",