@adobe-commerce/aio-toolkit 1.0.11 → 1.0.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe-commerce/aio-toolkit",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "A comprehensive TypeScript toolkit for Adobe App Builder applications providing standardized Adobe Commerce integrations, I/O Events orchestration, file storage utilities, authentication helpers, and robust backend development tools with 100% test coverage.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -9,27 +9,14 @@
9
9
  */
10
10
 
11
11
  const fs = require('fs');
12
- const path = require('path');
13
12
 
14
13
  try {
15
- // Try to find the telemetry package.json in multiple locations
16
- const possiblePaths = [
17
- // When installed as a dependency in another project (most common)
18
- path.join(__dirname, '..', '..', '@adobe', 'aio-lib-telemetry', 'package.json'),
19
- // When running in the toolkit project itself during development
20
- path.join(__dirname, '..', 'node_modules', '@adobe', 'aio-lib-telemetry', 'package.json'),
21
- ];
22
-
23
- let telemetryPkgPath = null;
24
- for (const p of possiblePaths) {
25
- if (fs.existsSync(p)) {
26
- telemetryPkgPath = p;
27
- break;
28
- }
29
- }
30
-
31
- // Check if the package exists
32
- if (!telemetryPkgPath) {
14
+ // Use Node's module resolution to find the telemetry package.json
15
+ // This automatically handles all the complex path logic
16
+ let telemetryPkgPath;
17
+ try {
18
+ telemetryPkgPath = require.resolve('@adobe/aio-lib-telemetry/package.json');
19
+ } catch (error) {
33
20
  console.log('ℹ️ @adobe/aio-lib-telemetry not found, skipping patch');
34
21
  process.exit(0);
35
22
  }