@adobedjangir/commerce-admin-management 0.0.10 → 0.0.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/setup.js +28 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobedjangir/commerce-admin-management",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Schema-driven system configuration for Adobe Commerce App Builder sync apps. Magento-style scoped config in Adobe App Builder Database (ABDB) with encryption, Commerce REST helpers, and React Admin UI.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe Inc.",
package/scripts/setup.js CHANGED
@@ -441,6 +441,27 @@ function setupWebSrc (projectRoot) {
441
441
  return { changed, results }
442
442
  }
443
443
 
444
+ /**
445
+ * Remove the aio `app init` boilerplate source directory for the
446
+ * dx/excshell/1 extension. We stripped its entry from app.config.yaml in
447
+ * patchAppConfig, but the matching scaffolded source tree at
448
+ * `src/dx-excshell-1/` is left behind. Delete it so its stale React-16
449
+ * code (with `react-error-boundary` default-import) doesn't get picked up
450
+ * by `aio app dev` or `npm install` peer-resolution.
451
+ */
452
+ function stripExcshellSourceDir (projectRoot) {
453
+ const dir = path.join(projectRoot, 'src', 'dx-excshell-1')
454
+ if (!fs.existsSync(dir)) {
455
+ return { changed: false, reason: 'absent' }
456
+ }
457
+ try {
458
+ fs.rmSync(dir, { recursive: true, force: true })
459
+ return { changed: true, reason: 'removed' }
460
+ } catch (err) {
461
+ return { changed: false, reason: `rm-failed: ${err.message}` }
462
+ }
463
+ }
464
+
444
465
  function setupAppConfig (projectRoot) {
445
466
  const appConfigPath = path.join(projectRoot, 'app.config.yaml')
446
467
  if (!fs.existsSync(appConfigPath)) {
@@ -477,6 +498,13 @@ function main () {
477
498
  return
478
499
  }
479
500
 
501
+ // Strip the leftover aio dx/excshell/1 source scaffold before anything
502
+ // else — its stale React-16 code conflicts with our React-18 bundle.
503
+ const excshell = stripExcshellSourceDir(projectRoot)
504
+ if (excshell.changed) {
505
+ console.log('[@adobedjangir/commerce-admin-management] removed src/dx-excshell-1/ (replaced by commerce/backend-ui/1)')
506
+ }
507
+
480
508
  const app = setupAppConfig(projectRoot)
481
509
  if (app.changed) {
482
510
  console.log(