@adobe-commerce/aio-toolkit 1.0.12 → 1.0.13

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.12",
3
+ "version": "1.0.13",
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",
@@ -14,7 +14,6 @@
14
14
  },
15
15
  "files": [
16
16
  "dist/**/*",
17
- "scripts/postinstall.js",
18
17
  "README.md",
19
18
  "CHANGELOG.md",
20
19
  "LICENSE"
@@ -40,8 +39,7 @@
40
39
  "validate:push": "npm run format:check && npm run lint && npm run type-check && npm run test:ci && npm run build",
41
40
  "security:audit": "npm audit --audit-level=moderate",
42
41
  "prepublishOnly": "npm run build",
43
- "prepare": "husky",
44
- "postinstall": "node scripts/postinstall.js"
42
+ "prepare": "husky"
45
43
  },
46
44
  "keywords": [
47
45
  "adobe",
@@ -57,7 +55,7 @@
57
55
  "dependencies": {
58
56
  "@adobe-commerce/aio-services-kit": "^1.0.0",
59
57
  "@adobe/aio-lib-ims": "^7.0.2",
60
- "@adobe/aio-lib-telemetry": "^1.1.2",
58
+ "@adobe/aio-lib-telemetry": "^1.1.3",
61
59
  "@adobe/aio-sdk": "^5.0.0",
62
60
  "cloudevents": "^8.0.2",
63
61
  "got": "^11.8.6",
@@ -1,92 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Postinstall script to fix @adobe/aio-lib-telemetry package.json exports
4
- *
5
- * The telemetry package has a bug where it uses "import" instead of "default"
6
- * in its exports configuration, causing CommonJS requires to fail.
7
- *
8
- * This script patches the package.json in the client project's node_modules.
9
- */
10
-
11
- const fs = require('fs');
12
-
13
- try {
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) {
20
- console.log('ℹ️ @adobe/aio-lib-telemetry not found, skipping patch');
21
- process.exit(0);
22
- }
23
-
24
- // Read the package.json
25
- const pkgContent = fs.readFileSync(telemetryPkgPath, 'utf8');
26
- const pkg = JSON.parse(pkgContent);
27
-
28
- // Check if patch is needed by looking for the bug pattern
29
- const checkNeedsPatch = (obj) => {
30
- if (!obj || typeof obj !== 'object') return false;
31
-
32
- // Check if this object has both 'import' and 'require' keys at the same level
33
- if (obj.import && obj.require) {
34
- // Check if require has 'import' key (the bug)
35
- if (obj.require.import) {
36
- return true;
37
- }
38
- // Check if import has 'import' key (the bug)
39
- if (obj.import.import) {
40
- return true;
41
- }
42
- }
43
-
44
- // Recursively check nested objects
45
- for (const key in obj) {
46
- if (typeof obj[key] === 'object' && checkNeedsPatch(obj[key])) {
47
- return true;
48
- }
49
- }
50
- return false;
51
- };
52
-
53
- if (!checkNeedsPatch(pkg.exports)) {
54
- console.log('✅ @adobe/aio-lib-telemetry already patched or fixed');
55
- process.exit(0);
56
- }
57
-
58
- // Apply the patch: replace "import" with "default" in export conditions
59
- const fixExport = (exportObj) => {
60
- if (exportObj && typeof exportObj === 'object') {
61
- // If there's an "import" key with a string value, rename it to "default"
62
- if (exportObj.import && typeof exportObj.import === 'string') {
63
- exportObj.default = exportObj.import;
64
- delete exportObj.import;
65
- }
66
- // Recursively fix nested objects
67
- Object.keys(exportObj).forEach(key => {
68
- if (typeof exportObj[key] === 'object') {
69
- fixExport(exportObj[key]);
70
- }
71
- });
72
- }
73
- };
74
-
75
- if (pkg.exports) {
76
- Object.keys(pkg.exports).forEach(key => {
77
- if (typeof pkg.exports[key] === 'object') {
78
- fixExport(pkg.exports[key]);
79
- }
80
- });
81
- }
82
-
83
- // Write the patched package.json
84
- fs.writeFileSync(telemetryPkgPath, JSON.stringify(pkg, null, 2) + '\n', 'utf8');
85
- console.log('✅ Successfully patched @adobe/aio-lib-telemetry exports');
86
-
87
- } catch (error) {
88
- console.error('⚠️ Failed to patch @adobe/aio-lib-telemetry:', error.message);
89
- // Don't fail the installation
90
- process.exit(0);
91
- }
92
-