rafters 0.0.58 → 0.0.59
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.
- package/dist/index.js +26 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13389,6 +13389,7 @@ async function installWithPackageManager(packageManager, dependencies, options)
|
|
|
13389
13389
|
}
|
|
13390
13390
|
|
|
13391
13391
|
// src/utils/install-registry-deps.ts
|
|
13392
|
+
var REACT_RUNTIME_PACKAGES = /* @__PURE__ */ new Set(["react", "react-dom", "@types/react", "@types/react-dom"]);
|
|
13392
13393
|
function parseDependency(dep) {
|
|
13393
13394
|
const trimmed = dep.trim();
|
|
13394
13395
|
if (!trimmed) {
|
|
@@ -13439,8 +13440,12 @@ async function installRegistryDependencies(items, targetDir, options = {}) {
|
|
|
13439
13440
|
return result;
|
|
13440
13441
|
}
|
|
13441
13442
|
const externalDeps = [];
|
|
13443
|
+
const dropForTarget = options.target && options.target !== "react";
|
|
13442
13444
|
for (const dep of allDeps) {
|
|
13443
|
-
|
|
13445
|
+
const { name } = parseDependency(dep);
|
|
13446
|
+
if (name.startsWith("@rafters/")) {
|
|
13447
|
+
result.skipped.push(dep);
|
|
13448
|
+
} else if (dropForTarget && REACT_RUNTIME_PACKAGES.has(name)) {
|
|
13444
13449
|
result.skipped.push(dep);
|
|
13445
13450
|
} else {
|
|
13446
13451
|
externalDeps.push(dep);
|
|
@@ -13640,6 +13645,14 @@ function isAlreadyInstalled(config2, item) {
|
|
|
13640
13645
|
}
|
|
13641
13646
|
return config2.installed.primitives.includes(item.name);
|
|
13642
13647
|
}
|
|
13648
|
+
function isInstalledOnDisk(config2, item, cwd) {
|
|
13649
|
+
if (!isAlreadyInstalled(config2, item)) return false;
|
|
13650
|
+
const filesToCheck = item.type === "ui" ? selectFilesForFramework(item.files, getComponentTarget(config2)).files : item.files;
|
|
13651
|
+
for (const file2 of filesToCheck) {
|
|
13652
|
+
if (fileExists(cwd, transformPath(file2.path, config2, cwd))) return true;
|
|
13653
|
+
}
|
|
13654
|
+
return false;
|
|
13655
|
+
}
|
|
13643
13656
|
function trackInstalled(config2, items) {
|
|
13644
13657
|
if (!config2.installed) {
|
|
13645
13658
|
config2.installed = { components: [], primitives: [], composites: [], rules: [] };
|
|
@@ -13856,13 +13869,20 @@ async function add(componentArgs, options) {
|
|
|
13856
13869
|
const target = getComponentTarget(config2);
|
|
13857
13870
|
for (const item of allItems) {
|
|
13858
13871
|
if (!options.overwrite && isAlreadyInstalled(config2, item)) {
|
|
13872
|
+
if (isInstalledOnDisk(config2, item, cwd)) {
|
|
13873
|
+
log({
|
|
13874
|
+
event: "add:skip",
|
|
13875
|
+
component: item.name,
|
|
13876
|
+
reason: "already installed"
|
|
13877
|
+
});
|
|
13878
|
+
skipped.push(item.name);
|
|
13879
|
+
continue;
|
|
13880
|
+
}
|
|
13859
13881
|
log({
|
|
13860
|
-
event: "add:
|
|
13882
|
+
event: "add:warning",
|
|
13861
13883
|
component: item.name,
|
|
13862
|
-
|
|
13884
|
+
message: "Config tracks this as installed but no files found on disk -- reinstalling."
|
|
13863
13885
|
});
|
|
13864
|
-
skipped.push(item.name);
|
|
13865
|
-
continue;
|
|
13866
13886
|
}
|
|
13867
13887
|
try {
|
|
13868
13888
|
const result = await installItem(cwd, item, options, config2);
|
|
@@ -13903,7 +13923,7 @@ async function add(componentArgs, options) {
|
|
|
13903
13923
|
};
|
|
13904
13924
|
let depsResult = emptyDeps;
|
|
13905
13925
|
try {
|
|
13906
|
-
depsResult = await installRegistryDependencies(filteredItems, cwd);
|
|
13926
|
+
depsResult = await installRegistryDependencies(filteredItems, cwd, { target });
|
|
13907
13927
|
} catch (err) {
|
|
13908
13928
|
const message = err instanceof Error ? err.message : String(err);
|
|
13909
13929
|
log({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rafters",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
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",
|