@schandlergarcia/sf-web-components 2.2.0 → 2.2.1
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/scripts/postinstall.mjs +18 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.2.1] - 2026-04-10
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Postinstall `.a4drules` path** — no longer hardcodes 5-level deep path; now walks up to find `sfdx-project.json` for SFDX projects, or falls back to cwd for standalone projects.
|
|
12
|
+
- **`setup` script collision** — renamed from `setup` to `sfwc:setup` to avoid conflicts with existing project scripts (e.g., SFDX org-setup).
|
|
13
|
+
|
|
8
14
|
## [2.2.0] - 2026-04-04
|
|
9
15
|
|
|
10
16
|
### Added
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -336,9 +336,9 @@ if (fs.existsSync(packageJsonPath)) {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
// Add manual setup script (re-runs postinstall if it was missed)
|
|
339
|
-
if (!packageJson.scripts['setup']) {
|
|
340
|
-
packageJson.scripts['setup'] = 'node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs';
|
|
341
|
-
scriptsAdded.push('setup');
|
|
339
|
+
if (!packageJson.scripts['sfwc:setup']) {
|
|
340
|
+
packageJson.scripts['sfwc:setup'] = 'node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs';
|
|
341
|
+
scriptsAdded.push('sfwc:setup');
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
// Add brand scripts
|
|
@@ -374,7 +374,20 @@ const packageA4dRules = path.join(packageRoot, '.a4drules');
|
|
|
374
374
|
if (fs.existsSync(packageA4dRules)) {
|
|
375
375
|
console.log('\n📋 Copying AI assistant rules to project root...\n');
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
// Walk up from cwd to find the project root (directory with package.json)
|
|
378
|
+
// For SFDX projects, the webapp may be nested (force-app/main/default/uiBundles/app/)
|
|
379
|
+
// and the SFDX root is higher up. We look for sfdx-project.json first, then fall back to cwd.
|
|
380
|
+
let projectRootPath = cwd;
|
|
381
|
+
let checkDir = cwd;
|
|
382
|
+
for (let i = 0; i < 10; i++) {
|
|
383
|
+
const parent = path.dirname(checkDir);
|
|
384
|
+
if (parent === checkDir) break;
|
|
385
|
+
if (fs.existsSync(path.join(parent, 'sfdx-project.json'))) {
|
|
386
|
+
projectRootPath = parent;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
checkDir = parent;
|
|
390
|
+
}
|
|
378
391
|
const targetA4dRules = path.join(projectRootPath, '.a4drules');
|
|
379
392
|
|
|
380
393
|
if (!fs.existsSync(targetA4dRules)) {
|
|
@@ -462,7 +475,7 @@ console.log(` - Installed ${templatesInstalled} page templates`);
|
|
|
462
475
|
console.log(` - Installed ${scriptsInstalled} utility scripts`);
|
|
463
476
|
console.log(` - Installed CommandCenter.tsx for dashboard management`);
|
|
464
477
|
console.log(` - Added "npm run reset:command-center" script`);
|
|
465
|
-
console.log(` - Added "npm run setup" script (re-run this setup anytime)`);
|
|
478
|
+
console.log(` - Added "npm run sfwc:setup" script (re-run this setup anytime)`);
|
|
466
479
|
console.log(` - Installed AI assistant rules (.a4drules)`);
|
|
467
480
|
if (migratedFiles > 0) {
|
|
468
481
|
console.log(` - Migrated ${migratedFiles} dashboard files to correct location`);
|