signal-layers 0.1.1 → 0.1.3
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/bin/signal-layers.js +47 -3
- package/package.json +1 -1
package/bin/signal-layers.js
CHANGED
|
@@ -16,6 +16,44 @@ function ensureDir(dir) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
function copyEssentialFiles() {
|
|
20
|
+
try {
|
|
21
|
+
// Always copy index.js
|
|
22
|
+
const sourceIndex = join(componentsDir, 'index.js');
|
|
23
|
+
const targetIndex = join(targetDir, 'index.js');
|
|
24
|
+
|
|
25
|
+
if (!existsSync(targetIndex)) {
|
|
26
|
+
copyFileSync(sourceIndex, targetIndex);
|
|
27
|
+
console.log(`✓ Added index.js to components/signal-layers/index.js`);
|
|
28
|
+
} else {
|
|
29
|
+
console.log(`- Skipped index.js (already exists)`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Always copy utils folder
|
|
33
|
+
const sourceUtilsDir = join(componentsDir, 'utils');
|
|
34
|
+
const targetUtilsDir = join(targetDir, 'utils');
|
|
35
|
+
|
|
36
|
+
if (existsSync(sourceUtilsDir)) {
|
|
37
|
+
ensureDir(targetUtilsDir);
|
|
38
|
+
|
|
39
|
+
const utilsFiles = readdirSync(sourceUtilsDir);
|
|
40
|
+
utilsFiles.forEach(file => {
|
|
41
|
+
const sourceFile = join(sourceUtilsDir, file);
|
|
42
|
+
const targetFile = join(targetUtilsDir, file);
|
|
43
|
+
|
|
44
|
+
if (!existsSync(targetFile)) {
|
|
45
|
+
copyFileSync(sourceFile, targetFile);
|
|
46
|
+
console.log(`✓ Added utils/${file} to components/signal-layers/utils/${file}`);
|
|
47
|
+
} else {
|
|
48
|
+
console.log(`- Skipped utils/${file} (already exists)`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error('Could not copy essential files:', err.message);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
19
57
|
function addComponent(componentName) {
|
|
20
58
|
const sourceFile = join(componentsDir, `${componentName}.jsx`);
|
|
21
59
|
const targetFile = join(targetDir, `${componentName}.jsx`);
|
|
@@ -34,7 +72,10 @@ function addComponent(componentName) {
|
|
|
34
72
|
}
|
|
35
73
|
|
|
36
74
|
copyFileSync(sourceFile, targetFile);
|
|
37
|
-
console.log(`✓ Added ${componentName} to components/
|
|
75
|
+
console.log(`✓ Added ${componentName} to components/signal-layers/${componentName}.jsx`);
|
|
76
|
+
|
|
77
|
+
// Always copy essential files when adding a component
|
|
78
|
+
copyEssentialFiles();
|
|
38
79
|
}
|
|
39
80
|
|
|
40
81
|
function copyAll() {
|
|
@@ -51,13 +92,16 @@ function copyAll() {
|
|
|
51
92
|
|
|
52
93
|
if (!existsSync(targetFile)) {
|
|
53
94
|
copyFileSync(sourceFile, targetFile);
|
|
54
|
-
console.log(`✓ Added ${componentName} to components/
|
|
95
|
+
console.log(`✓ Added ${componentName} to components/signal-layers/${componentName}.jsx`);
|
|
55
96
|
} else {
|
|
56
97
|
console.log(`- Skipped ${componentName} (already exists)`);
|
|
57
98
|
}
|
|
58
99
|
});
|
|
59
100
|
|
|
60
|
-
|
|
101
|
+
// Always copy essential files when copying all components
|
|
102
|
+
copyEssentialFiles();
|
|
103
|
+
|
|
104
|
+
console.log(`\nInstalled ${components.length} components to components/signal-layers/`);
|
|
61
105
|
} catch (err) {
|
|
62
106
|
console.error('Could not install components:', err.message);
|
|
63
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signal-layers",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A minimalist, framework-agnostic component library where components respond to signals of intention, not rigid variants or configuration APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|