@sociallane/elements 1.0.5 → 1.0.6
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/package.json +1 -1
- package/scripts/install.js +9 -12
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -95,7 +95,11 @@ function copyPackage(toDir, filter) {
|
|
|
95
95
|
if (!existsSync(toDir)) {
|
|
96
96
|
mkdirSync(toDir, { recursive: true });
|
|
97
97
|
}
|
|
98
|
-
const defaultFilter = (src) =>
|
|
98
|
+
const defaultFilter = (src) => {
|
|
99
|
+
// Exclude node_modules within the package (check relative path, not absolute)
|
|
100
|
+
const rel = path.relative(packageRoot, src).split(path.sep).join('/');
|
|
101
|
+
return !rel.includes('node_modules');
|
|
102
|
+
};
|
|
99
103
|
cpSync(packageRoot, toDir, {
|
|
100
104
|
recursive: true,
|
|
101
105
|
filter: filter || defaultFilter,
|
|
@@ -112,8 +116,6 @@ function install(targetPath, minimal) {
|
|
|
112
116
|
|
|
113
117
|
console.log('SocialLane Elements installer' + (minimal ? ' (minimal – add widgets with: npx @sociallane/elements add <slug> ...)' : ''));
|
|
114
118
|
console.log('Target:', target);
|
|
115
|
-
console.log('Package root:', packageRoot);
|
|
116
|
-
console.log('Package root files:', readdirSync(packageRoot).slice(0, 10).join(', ') + '...');
|
|
117
119
|
|
|
118
120
|
if (isSelf) {
|
|
119
121
|
console.log('Target is the current package. Running npm install here...');
|
|
@@ -123,16 +125,11 @@ function install(targetPath, minimal) {
|
|
|
123
125
|
console.log('Copying package...');
|
|
124
126
|
if (minimal) {
|
|
125
127
|
copyPackage(target, (src) => {
|
|
126
|
-
if (src.includes('node_modules')) {
|
|
127
|
-
console.log('EXCLUDE node_modules:', src);
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
128
|
const rel = path.relative(packageRoot, src).split(path.sep).join('/');
|
|
131
|
-
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
129
|
+
// Exclude node_modules within the package (not in parent path)
|
|
130
|
+
if (rel.includes('node_modules')) return false;
|
|
131
|
+
// Exclude packages/widgets for minimal install
|
|
132
|
+
if (rel === 'packages/widgets' || rel.startsWith('packages/widgets/')) return false;
|
|
136
133
|
return true;
|
|
137
134
|
});
|
|
138
135
|
const widgetsDest = path.join(target, 'packages', 'widgets');
|