@schandlergarcia/sf-web-components 1.9.21 ā 1.9.23
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/postinstall.mjs +35 -1
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -60,7 +60,7 @@ function copyDirectoryRecursive(source, target) {
|
|
|
60
60
|
|
|
61
61
|
if (stat.isDirectory()) {
|
|
62
62
|
count += copyDirectoryRecursive(sourcePath, targetPath);
|
|
63
|
-
} else if (item.match(/\.(jsx|tsx|js|ts|css)$/)) {
|
|
63
|
+
} else if (item.match(/\.(jsx|tsx|js|ts|css|md)$/)) {
|
|
64
64
|
try {
|
|
65
65
|
fs.copyFileSync(sourcePath, targetPath);
|
|
66
66
|
count++;
|
|
@@ -268,6 +268,39 @@ if (fs.existsSync(packageJsonPath)) {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
// Copy .a4drules from package to project root (so AI assistants can discover them)
|
|
272
|
+
const packageA4dRules = path.join(packageRoot, '.a4drules');
|
|
273
|
+
const projectRootA4dRules = path.join(cwd, '../../../../../.a4drules'); // Go up from webapp to project root
|
|
274
|
+
|
|
275
|
+
if (fs.existsSync(packageA4dRules)) {
|
|
276
|
+
console.log('\nš Copying AI assistant rules to project root...\n');
|
|
277
|
+
|
|
278
|
+
// Resolve to absolute path
|
|
279
|
+
const projectRootPath = path.resolve(cwd, '../../../../../');
|
|
280
|
+
const targetA4dRules = path.join(projectRootPath, '.a4drules');
|
|
281
|
+
|
|
282
|
+
// Create .a4drules if it doesn't exist
|
|
283
|
+
if (!fs.existsSync(targetA4dRules)) {
|
|
284
|
+
fs.mkdirSync(targetA4dRules, { recursive: true });
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Copy skills directory
|
|
288
|
+
const skillsSource = path.join(packageA4dRules, 'skills');
|
|
289
|
+
const skillsTarget = path.join(targetA4dRules, 'skills');
|
|
290
|
+
if (fs.existsSync(skillsSource)) {
|
|
291
|
+
const skillsCopied = copyDirectoryRecursive(skillsSource, skillsTarget);
|
|
292
|
+
console.log(` ā Copied ${skillsCopied} skill files`);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Copy features directory
|
|
296
|
+
const featuresSource = path.join(packageA4dRules, 'features');
|
|
297
|
+
const featuresTarget = path.join(targetA4dRules, 'features');
|
|
298
|
+
if (fs.existsSync(featuresSource)) {
|
|
299
|
+
const featuresCopied = copyDirectoryRecursive(featuresSource, featuresTarget);
|
|
300
|
+
console.log(` ā Copied ${featuresCopied} feature rule files`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
271
304
|
// Migrate any dashboards from old location (src/components/pages/) to new location (src/pages/)
|
|
272
305
|
const oldPagesDir = path.join(cwd, 'src/components/pages');
|
|
273
306
|
const newPagesDir = path.join(cwd, 'src/pages');
|
|
@@ -315,6 +348,7 @@ console.log(` - Updated ${filesUpdated} files`);
|
|
|
315
348
|
console.log(` - Installed ${templatesInstalled} page templates`);
|
|
316
349
|
console.log(` - Installed CommandCenter.tsx for dashboard management`);
|
|
317
350
|
console.log(` - Added "npm run reset:command-center" script`);
|
|
351
|
+
console.log(` - Installed AI assistant rules for command center building`);
|
|
318
352
|
if (migratedFiles > 0) {
|
|
319
353
|
console.log(` - Migrated ${migratedFiles} dashboard files to correct location`);
|
|
320
354
|
}
|